RTEMS 4.11Annotated Report
Mon Jan 13 19:34:03 2014
4000a5a0 <_CORE_RWLock_Release>:
CORE_RWLock_Status _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock,
Thread_Control *executing
)
{
4000a5a0: 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 );
4000a5a4: 7f ff e5 6b call 40003b50 <sparc_disable_interrupts>
4000a5a8: 01 00 00 00 nop
if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){
4000a5ac: c2 06 20 44 ld [ %i0 + 0x44 ], %g1
4000a5b0: 80 a0 60 00 cmp %g1, 0
4000a5b4: 12 80 00 08 bne 4000a5d4 <_CORE_RWLock_Release+0x34>
4000a5b8: 80 a0 60 01 cmp %g1, 1
_ISR_Enable( level );
4000a5bc: 7f ff e5 69 call 40003b60 <sparc_enable_interrupts>
4000a5c0: b0 10 20 00 clr %i0
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
4000a5c4: 82 10 20 02 mov 2, %g1
4000a5c8: c2 26 60 34 st %g1, [ %i1 + 0x34 ]
4000a5cc: 81 c7 e0 08 ret
4000a5d0: 81 e8 00 00 restore
return CORE_RWLOCK_SUCCESSFUL;
}
if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) {
4000a5d4: 32 80 00 0b bne,a 4000a600 <_CORE_RWLock_Release+0x60>
4000a5d8: c0 26 60 34 clr [ %i1 + 0x34 ]
the_rwlock->number_of_readers -= 1;
4000a5dc: c2 06 20 48 ld [ %i0 + 0x48 ], %g1
4000a5e0: 82 00 7f ff add %g1, -1, %g1
if ( the_rwlock->number_of_readers != 0 ) {
4000a5e4: 80 a0 60 00 cmp %g1, 0
4000a5e8: 02 80 00 05 be 4000a5fc <_CORE_RWLock_Release+0x5c>
4000a5ec: c2 26 20 48 st %g1, [ %i0 + 0x48 ]
/* must be unlocked again */
_ISR_Enable( level );
4000a5f0: 7f ff e5 5c call 40003b60 <sparc_enable_interrupts>
4000a5f4: b0 10 20 00 clr %i0
return CORE_RWLOCK_SUCCESSFUL;
4000a5f8: 30 80 00 24 b,a 4000a688 <_CORE_RWLock_Release+0xe8>
}
}
/* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
4000a5fc: 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;
4000a600: c0 26 20 44 clr [ %i0 + 0x44 ]
_ISR_Enable( level );
4000a604: 7f ff e5 57 call 40003b60 <sparc_enable_interrupts>
4000a608: 01 00 00 00 nop
next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue );
4000a60c: 40 00 07 6a call 4000c3b4 <_Thread_queue_Dequeue>
4000a610: 90 10 00 18 mov %i0, %o0
if ( next ) {
4000a614: 80 a2 20 00 cmp %o0, 0
4000a618: 22 80 00 1c be,a 4000a688 <_CORE_RWLock_Release+0xe8>
4000a61c: b0 10 20 00 clr %i0
if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
4000a620: c2 02 20 30 ld [ %o0 + 0x30 ], %g1
4000a624: 80 a0 60 01 cmp %g1, 1
4000a628: 32 80 00 05 bne,a 4000a63c <_CORE_RWLock_Release+0x9c>
4000a62c: c2 06 20 48 ld [ %i0 + 0x48 ], %g1
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
4000a630: 82 10 20 02 mov 2, %g1
return CORE_RWLOCK_SUCCESSFUL;
4000a634: 10 80 00 14 b 4000a684 <_CORE_RWLock_Release+0xe4>
4000a638: c2 26 20 44 st %g1, [ %i0 + 0x44 ]
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
4000a63c: 82 00 60 01 inc %g1
4000a640: c2 26 20 48 st %g1, [ %i0 + 0x48 ]
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
4000a644: 82 10 20 01 mov 1, %g1
4000a648: 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 );
4000a64c: 40 00 08 96 call 4000c8a4 <_Thread_queue_First>
4000a650: 90 10 00 18 mov %i0, %o0
if ( !next ||
4000a654: 92 92 20 00 orcc %o0, 0, %o1
4000a658: 22 80 00 0c be,a 4000a688 <_CORE_RWLock_Release+0xe8>
4000a65c: b0 10 20 00 clr %i0
4000a660: c2 02 60 30 ld [ %o1 + 0x30 ], %g1
4000a664: 80 a0 60 01 cmp %g1, 1
4000a668: 02 80 00 07 be 4000a684 <_CORE_RWLock_Release+0xe4> <== NEVER TAKEN
4000a66c: 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;
4000a670: c2 06 20 48 ld [ %i0 + 0x48 ], %g1
4000a674: 82 00 60 01 inc %g1
_Thread_queue_Extract( &the_rwlock->Wait_queue, next );
4000a678: 40 00 08 30 call 4000c738 <_Thread_queue_Extract>
4000a67c: c2 26 20 48 st %g1, [ %i0 + 0x48 ]
}
4000a680: 30 bf ff f3 b,a 4000a64c <_CORE_RWLock_Release+0xac>
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
4000a684: b0 10 20 00 clr %i0
4000a688: 81 c7 e0 08 ret
4000a68c: 81 e8 00 00 restore
4000a690 <_CORE_RWLock_Timeout>:
void _CORE_RWLock_Timeout(
Objects_Id id,
void *ignored
)
{
4000a690: 9d e3 bf 98 save %sp, -104, %sp
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
4000a694: 90 10 00 18 mov %i0, %o0
4000a698: 40 00 06 82 call 4000c0a0 <_Thread_Get>
4000a69c: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
4000a6a0: c2 07 bf fc ld [ %fp + -4 ], %g1
4000a6a4: 80 a0 60 00 cmp %g1, 0
4000a6a8: 12 80 00 09 bne 4000a6cc <_CORE_RWLock_Timeout+0x3c> <== NEVER TAKEN
4000a6ac: 01 00 00 00 nop
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
4000a6b0: 40 00 08 b9 call 4000c994 <_Thread_queue_Process_timeout>
4000a6b4: 01 00 00 00 nop
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4000a6b8: 03 10 00 6b sethi %hi(0x4001ac00), %g1
4000a6bc: 82 10 63 00 or %g1, 0x300, %g1 ! 4001af00 <_Per_CPU_Information>
4000a6c0: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
--level;
4000a6c4: 84 00 bf ff add %g2, -1, %g2
_Thread_Dispatch_disable_level = level;
4000a6c8: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
4000a6cc: 81 c7 e0 08 ret
4000a6d0: 81 e8 00 00 restore
40007ff0 <_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
)
{
40007ff0: 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)) ) {
40007ff4: 90 10 00 18 mov %i0, %o0
40007ff8: 40 00 07 34 call 40009cc8 <_Thread_queue_Dequeue>
40007ffc: ba 10 00 18 mov %i0, %i5
40008000: 80 a2 20 00 cmp %o0, 0
40008004: 12 80 00 0e bne 4000803c <_CORE_semaphore_Surrender+0x4c>
40008008: 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 );
4000800c: 7f ff e8 75 call 400021e0 <sparc_disable_interrupts>
40008010: 01 00 00 00 nop
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
40008014: c2 07 60 48 ld [ %i5 + 0x48 ], %g1
40008018: c4 07 60 40 ld [ %i5 + 0x40 ], %g2
4000801c: 80 a0 40 02 cmp %g1, %g2
40008020: 1a 80 00 05 bcc 40008034 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN
40008024: b0 10 20 04 mov 4, %i0
the_semaphore->count += 1;
40008028: 82 00 60 01 inc %g1
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
4000802c: b0 10 20 00 clr %i0
#endif
} else {
_ISR_Disable( level );
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
the_semaphore->count += 1;
40008030: c2 27 60 48 st %g1, [ %i5 + 0x48 ]
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
_ISR_Enable( level );
40008034: 7f ff e8 6f call 400021f0 <sparc_enable_interrupts>
40008038: 01 00 00 00 nop
}
return status;
}
4000803c: 81 c7 e0 08 ret
40008040: 81 e8 00 00 restore
40006d34 <_Event_Surrender>:
rtems_event_set event_in,
Event_Control *event,
Thread_blocking_operation_States *sync_state,
States_Control wait_state
)
{
40006d34: 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 );
40006d38: 7f ff ed 2a call 400021e0 <sparc_disable_interrupts>
40006d3c: 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;
40006d40: c2 06 80 00 ld [ %i2 ], %g1
40006d44: b2 16 40 01 or %i1, %g1, %i1
40006d48: 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;
40006d4c: c4 06 20 24 ld [ %i0 + 0x24 ], %g2
seized_events = _Event_sets_Get( pending_events, event_condition );
if (
40006d50: 82 8e 40 02 andcc %i1, %g2, %g1
40006d54: 02 80 00 32 be 40006e1c <_Event_Surrender+0xe8>
40006d58: 80 a0 40 02 cmp %g1, %g2
!_Event_sets_Is_empty( seized_events )
&& ( seized_events == event_condition || _Options_Is_any( option_set ) )
40006d5c: 02 80 00 04 be 40006d6c <_Event_Surrender+0x38>
40006d60: 80 8f 60 02 btst 2, %i5
40006d64: 02 80 00 2e be 40006e1c <_Event_Surrender+0xe8>
40006d68: 01 00 00 00 nop
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
40006d6c: 05 10 00 5c sethi %hi(0x40017000), %g2
* 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 ) &&
40006d70: c4 00 a2 28 ld [ %g2 + 0x228 ], %g2 ! 40017228 <_Per_CPU_Information+0x18>
40006d74: 80 a6 00 02 cmp %i0, %g2
40006d78: 32 80 00 0e bne,a 40006db0 <_Event_Surrender+0x7c>
40006d7c: c4 06 20 10 ld [ %i0 + 0x10 ], %g2
40006d80: c4 06 c0 00 ld [ %i3 ], %g2
40006d84: 80 a0 a0 01 cmp %g2, 1
40006d88: 32 80 00 0a bne,a 40006db0 <_Event_Surrender+0x7c>
40006d8c: 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) );
40006d90: 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;
40006d94: 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(
40006d98: f2 26 80 00 st %i1, [ %i2 ]
pending_events,
seized_events
);
the_thread->Wait.count = 0;
40006d9c: c0 26 20 24 clr [ %i0 + 0x24 ]
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
40006da0: c2 20 80 00 st %g1, [ %g2 ]
*sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
40006da4: 82 10 20 03 mov 3, %g1
40006da8: 10 80 00 1d b 40006e1c <_Event_Surrender+0xe8>
40006dac: c2 26 c0 00 st %g1, [ %i3 ]
} else if ( _States_Are_set( the_thread->current_state, wait_state ) ) {
40006db0: 80 8f 00 02 btst %i4, %g2
40006db4: 02 80 00 1a be 40006e1c <_Event_Surrender+0xe8> <== NEVER TAKEN
40006db8: 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;
40006dbc: 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(
40006dc0: f2 26 80 00 st %i1, [ %i2 ]
pending_events,
seized_events
);
the_thread->Wait.count = 0;
40006dc4: c0 26 20 24 clr [ %i0 + 0x24 ]
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
40006dc8: c2 20 80 00 st %g1, [ %g2 ]
_ISR_Flash( level );
40006dcc: 7f ff ed 09 call 400021f0 <sparc_enable_interrupts>
40006dd0: 01 00 00 00 nop
40006dd4: 7f ff ed 03 call 400021e0 <sparc_disable_interrupts>
40006dd8: 01 00 00 00 nop
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
40006ddc: c2 06 20 50 ld [ %i0 + 0x50 ], %g1
40006de0: 80 a0 60 02 cmp %g1, 2
40006de4: 02 80 00 06 be 40006dfc <_Event_Surrender+0xc8>
40006de8: 82 10 20 03 mov 3, %g1
_ISR_Enable( level );
40006dec: 7f ff ed 01 call 400021f0 <sparc_enable_interrupts>
40006df0: 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 );
40006df4: 10 80 00 08 b 40006e14 <_Event_Surrender+0xe0>
40006df8: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 100ffff8 <RAM_SIZE+0xfcffff8>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
40006dfc: c2 26 20 50 st %g1, [ %i0 + 0x50 ]
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
40006e00: 7f ff ec fc call 400021f0 <sparc_enable_interrupts>
40006e04: 33 04 03 ff sethi %hi(0x100ffc00), %i1
(void) _Watchdog_Remove( &the_thread->Timer );
40006e08: 40 00 0e 2f call 4000a6c4 <_Watchdog_Remove>
40006e0c: 90 06 20 48 add %i0, 0x48, %o0
40006e10: b2 16 63 f8 or %i1, 0x3f8, %i1
40006e14: 40 00 0a 15 call 40009668 <_Thread_Clear_state>
40006e18: 81 e8 00 00 restore
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
40006e1c: 7f ff ec f5 call 400021f0 <sparc_enable_interrupts>
40006e20: 91 e8 00 08 restore %g0, %o0, %o0
40006e24 <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *arg
)
{
40006e24: 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 );
40006e28: 90 10 00 18 mov %i0, %o0
40006e2c: 40 00 0a e2 call 400099b4 <_Thread_Get>
40006e30: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
40006e34: c2 07 bf fc ld [ %fp + -4 ], %g1
40006e38: 80 a0 60 00 cmp %g1, 0
40006e3c: 12 80 00 21 bne 40006ec0 <_Event_Timeout+0x9c> <== NEVER TAKEN
40006e40: b8 10 00 08 mov %o0, %i4
*
* 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 );
40006e44: 7f ff ec e7 call 400021e0 <sparc_disable_interrupts>
40006e48: 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 ) {
40006e4c: c2 07 20 24 ld [ %i4 + 0x24 ], %g1
40006e50: 3b 10 00 5c sethi %hi(0x40017000), %i5
40006e54: 80 a0 60 00 cmp %g1, 0
40006e58: 12 80 00 05 bne 40006e6c <_Event_Timeout+0x48>
40006e5c: ba 17 62 10 or %i5, 0x210, %i5
_ISR_Enable( level );
40006e60: 7f ff ec e4 call 400021f0 <sparc_enable_interrupts>
40006e64: 01 00 00 00 nop
40006e68: 30 80 00 13 b,a 40006eb4 <_Event_Timeout+0x90>
_Objects_Put_without_thread_dispatch( &the_thread->Object );
return;
}
the_thread->Wait.count = 0;
if ( _Thread_Is_executing( the_thread ) ) {
40006e6c: c2 07 60 18 ld [ %i5 + 0x18 ], %g1
40006e70: 80 a7 00 01 cmp %i4, %g1
40006e74: 12 80 00 08 bne 40006e94 <_Event_Timeout+0x70>
40006e78: c0 27 20 24 clr [ %i4 + 0x24 ]
if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
40006e7c: c2 06 40 00 ld [ %i1 ], %g1
40006e80: 80 a0 60 01 cmp %g1, 1
40006e84: 12 80 00 05 bne 40006e98 <_Event_Timeout+0x74> <== NEVER TAKEN
40006e88: 82 10 20 06 mov 6, %g1
*sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
40006e8c: 82 10 20 02 mov 2, %g1
40006e90: c2 26 40 00 st %g1, [ %i1 ]
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
40006e94: 82 10 20 06 mov 6, %g1
40006e98: c2 27 20 34 st %g1, [ %i4 + 0x34 ]
_ISR_Enable( level );
40006e9c: 7f ff ec d5 call 400021f0 <sparc_enable_interrupts>
40006ea0: 01 00 00 00 nop
40006ea4: 13 04 03 ff sethi %hi(0x100ffc00), %o1
40006ea8: 90 10 00 1c mov %i4, %o0
40006eac: 40 00 09 ef call 40009668 <_Thread_Clear_state>
40006eb0: 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 level = _Thread_Dispatch_disable_level;
40006eb4: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
--level;
40006eb8: 82 00 7f ff add %g1, -1, %g1
_Thread_Dispatch_disable_level = level;
40006ebc: c2 27 60 10 st %g1, [ %i5 + 0x10 ]
40006ec0: 81 c7 e0 08 ret
40006ec4: 81 e8 00 00 restore
40008fcc <_Freechain_Get>:
}
void *_Freechain_Get(Freechain_Control *freechain)
{
40008fcc: 9d e3 bf a0 save %sp, -96, %sp
if ( _Chain_Is_empty( &freechain->Freechain ) ) {
40008fd0: 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 );
40008fd4: 82 06 20 04 add %i0, 4, %g1
40008fd8: 80 a0 80 01 cmp %g2, %g1
40008fdc: 22 80 00 08 be,a 40008ffc <_Freechain_Get+0x30>
40008fe0: 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;
40008fe4: c2 06 00 00 ld [ %i0 ], %g1
Chain_Node *new_first = old_first->next;
40008fe8: c4 00 40 00 ld [ %g1 ], %g2
head->next = new_first;
40008fec: c4 26 00 00 st %g2, [ %i0 ]
new_first->previous = head;
40008ff0: f0 20 a0 04 st %i0, [ %g2 + 4 ]
if ( !( *freechain->extend )( freechain ) ) {
return NULL;
}
}
return _Chain_Get_first_unprotected( &freechain->Freechain );
40008ff4: 81 c7 e0 08 ret
40008ff8: 91 e8 00 01 restore %g0, %g1, %o0
}
void *_Freechain_Get(Freechain_Control *freechain)
{
if ( _Chain_Is_empty( &freechain->Freechain ) ) {
if ( !( *freechain->extend )( freechain ) ) {
40008ffc: 9f c0 40 00 call %g1
40009000: 90 10 00 18 mov %i0, %o0
40009004: 80 a2 20 00 cmp %o0, 0
40009008: 32 bf ff f8 bne,a 40008fe8 <_Freechain_Get+0x1c> <== ALWAYS TAKEN
4000900c: c2 06 00 00 ld [ %i0 ], %g1
return NULL;
}
}
return _Chain_Get_first_unprotected( &freechain->Freechain );
}
40009010: 81 c7 e0 08 ret <== NOT EXECUTED
40009014: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED
4000cd3c <_Heap_Extend>:
Heap_Control *heap,
void *extend_area_begin_ptr,
uintptr_t extend_area_size,
uintptr_t unused __attribute__((unused))
)
{
4000cd3c: 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;
4000cd40: c0 27 bf f8 clr [ %fp + -8 ]
Heap_Block *extend_last_block = NULL;
4000cd44: 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;
4000cd48: 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;
4000cd4c: 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;
4000cd50: ec 06 20 10 ld [ %i0 + 0x10 ], %l6
uintptr_t const min_block_size = heap->min_block_size;
4000cd54: 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 ) {
4000cd58: 80 a7 40 19 cmp %i5, %i1
4000cd5c: 1a 80 00 04 bcc 4000cd6c <_Heap_Extend+0x30>
4000cd60: e6 06 20 30 ld [ %i0 + 0x30 ], %l3
return 0;
4000cd64: 81 c7 e0 08 ret
4000cd68: 91 e8 20 00 restore %g0, 0, %o0
}
extend_area_ok = _Heap_Get_first_and_last_block(
4000cd6c: 90 10 00 19 mov %i1, %o0
4000cd70: 92 10 00 1a mov %i2, %o1
4000cd74: 94 10 00 16 mov %l6, %o2
4000cd78: 98 07 bf f8 add %fp, -8, %o4
4000cd7c: 7f ff ed d3 call 400084c8 <_Heap_Get_first_and_last_block>
4000cd80: 9a 07 bf fc add %fp, -4, %o5
page_size,
min_block_size,
&extend_first_block,
&extend_last_block
);
if (!extend_area_ok ) {
4000cd84: 80 a2 20 00 cmp %o0, 0
4000cd88: 02 bf ff f7 be 4000cd64 <_Heap_Extend+0x28>
4000cd8c: b6 10 00 12 mov %l2, %i3
4000cd90: a2 10 20 00 clr %l1
4000cd94: a8 10 20 00 clr %l4
4000cd98: b8 10 20 00 clr %i4
4000cd9c: 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;
4000cda0: 80 a6 c0 12 cmp %i3, %l2
4000cda4: 12 80 00 03 bne 4000cdb0 <_Heap_Extend+0x74> <== NEVER TAKEN
4000cda8: aa 10 00 1b mov %i3, %l5
4000cdac: ea 06 20 18 ld [ %i0 + 0x18 ], %l5
uintptr_t const sub_area_end = start_block->prev_size;
4000cdb0: 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);
4000cdb4: 92 10 00 16 mov %l6, %o1
4000cdb8: 40 00 18 ba call 400130a0 <.urem>
4000cdbc: 90 10 00 1a mov %i2, %o0
4000cdc0: ae 06 bf f8 add %i2, -8, %l7
Heap_Block *const end_block =
_Heap_Block_of_alloc_area( sub_area_end, page_size );
if (
4000cdc4: 80 a5 40 1d cmp %l5, %i5
4000cdc8: 1a 80 00 05 bcc 4000cddc <_Heap_Extend+0xa0>
4000cdcc: 90 25 c0 08 sub %l7, %o0, %o0
4000cdd0: 80 a6 40 1a cmp %i1, %i2
4000cdd4: 0a bf ff e4 bcs 4000cd64 <_Heap_Extend+0x28>
4000cdd8: 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 ) {
4000cddc: 80 a7 40 15 cmp %i5, %l5
4000cde0: 02 80 00 06 be 4000cdf8 <_Heap_Extend+0xbc>
4000cde4: 80 a7 40 1a cmp %i5, %i2
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
4000cde8: 2a 80 00 05 bcs,a 4000cdfc <_Heap_Extend+0xc0>
4000cdec: a8 10 00 1b mov %i3, %l4
link_below_block = start_block;
}
if ( sub_area_end == extend_area_begin ) {
4000cdf0: 10 80 00 04 b 4000ce00 <_Heap_Extend+0xc4>
4000cdf4: 80 a6 80 19 cmp %i2, %i1
4000cdf8: a0 10 00 1b mov %i3, %l0
4000cdfc: 80 a6 80 19 cmp %i2, %i1
4000ce00: 12 80 00 05 bne 4000ce14 <_Heap_Extend+0xd8>
4000ce04: 80 a6 80 19 cmp %i2, %i1
start_block->prev_size = extend_area_end;
4000ce08: fa 26 c0 00 st %i5, [ %i3 ]
4000ce0c: 10 80 00 04 b 4000ce1c <_Heap_Extend+0xe0>
4000ce10: b8 10 00 08 mov %o0, %i4
merge_above_block = end_block;
} else if ( sub_area_end < extend_area_begin ) {
4000ce14: 2a 80 00 02 bcs,a 4000ce1c <_Heap_Extend+0xe0>
4000ce18: 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;
4000ce1c: f6 02 20 04 ld [ %o0 + 4 ], %i3
4000ce20: 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);
4000ce24: 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 );
4000ce28: 80 a6 c0 12 cmp %i3, %l2
4000ce2c: 12 bf ff e1 bne 4000cdb0 <_Heap_Extend+0x74>
4000ce30: aa 10 00 1b mov %i3, %l5
if ( extend_area_begin < heap->area_begin ) {
4000ce34: c2 06 20 18 ld [ %i0 + 0x18 ], %g1
4000ce38: 80 a6 40 01 cmp %i1, %g1
4000ce3c: 3a 80 00 04 bcc,a 4000ce4c <_Heap_Extend+0x110>
4000ce40: c2 06 20 1c ld [ %i0 + 0x1c ], %g1
4000ce44: 10 80 00 05 b 4000ce58 <_Heap_Extend+0x11c>
4000ce48: f2 26 20 18 st %i1, [ %i0 + 0x18 ]
heap->area_begin = extend_area_begin;
} else if ( heap->area_end < extend_area_end ) {
4000ce4c: 80 a0 40 1d cmp %g1, %i5
4000ce50: 2a 80 00 02 bcs,a 4000ce58 <_Heap_Extend+0x11c>
4000ce54: 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;
4000ce58: c4 07 bf f8 ld [ %fp + -8 ], %g2
4000ce5c: c2 07 bf fc ld [ %fp + -4 ], %g1
extend_first_block->prev_size = extend_area_end;
4000ce60: 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 =
4000ce64: 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;
4000ce68: 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 =
4000ce6c: 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;
4000ce70: 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 ) {
4000ce74: c6 06 20 20 ld [ %i0 + 0x20 ], %g3
4000ce78: 80 a0 c0 02 cmp %g3, %g2
4000ce7c: 08 80 00 04 bleu 4000ce8c <_Heap_Extend+0x150>
4000ce80: c0 20 60 04 clr [ %g1 + 4 ]
4000ce84: 10 80 00 06 b 4000ce9c <_Heap_Extend+0x160>
4000ce88: 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 ) {
4000ce8c: c4 06 20 24 ld [ %i0 + 0x24 ], %g2
4000ce90: 80 a0 80 01 cmp %g2, %g1
4000ce94: 2a 80 00 02 bcs,a 4000ce9c <_Heap_Extend+0x160>
4000ce98: c2 26 20 24 st %g1, [ %i0 + 0x24 ]
heap->last_block = extend_last_block;
}
if ( merge_below_block != NULL ) {
4000ce9c: 80 a4 20 00 cmp %l0, 0
4000cea0: 02 80 00 14 be 4000cef0 <_Heap_Extend+0x1b4>
4000cea4: 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;
4000cea8: 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;
4000ceac: 92 10 00 1b mov %i3, %o1
4000ceb0: 40 00 18 7c call 400130a0 <.urem>
4000ceb4: 90 10 00 19 mov %i1, %o0
if ( remainder != 0 ) {
4000ceb8: 80 a2 20 00 cmp %o0, 0
4000cebc: 02 80 00 04 be 4000cecc <_Heap_Extend+0x190>
4000cec0: c2 04 00 00 ld [ %l0 ], %g1
return value - remainder + alignment;
4000cec4: b2 06 40 1b add %i1, %i3, %i1
4000cec8: 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 =
4000cecc: 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;
4000ced0: 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 =
4000ced4: 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;
4000ced8: 82 10 60 01 or %g1, 1, %g1
_Heap_Free_block( heap, new_first_block );
4000cedc: 90 10 00 18 mov %i0, %o0
4000cee0: 7f ff ff 81 call 4000cce4 <_Heap_Free_block>
4000cee4: c2 22 60 04 st %g1, [ %o1 + 4 ]
link_below_block,
extend_last_block
);
}
if ( merge_above_block != NULL ) {
4000cee8: 10 80 00 08 b 4000cf08 <_Heap_Extend+0x1cc>
4000ceec: 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 ) {
4000cef0: 80 a5 20 00 cmp %l4, 0
4000cef4: 02 80 00 04 be 4000cf04 <_Heap_Extend+0x1c8>
4000cef8: 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;
4000cefc: 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 =
4000cf00: e8 20 60 04 st %l4, [ %g1 + 4 ]
link_below_block,
extend_last_block
);
}
if ( merge_above_block != NULL ) {
4000cf04: 80 a7 20 00 cmp %i4, 0
4000cf08: 02 80 00 15 be 4000cf5c <_Heap_Extend+0x220>
4000cf0c: 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);
4000cf10: 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(
4000cf14: ba 27 40 1c sub %i5, %i4, %i5
4000cf18: 40 00 18 62 call 400130a0 <.urem>
4000cf1c: 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)
4000cf20: c4 07 20 04 ld [ %i4 + 4 ], %g2
4000cf24: 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 =
4000cf28: 82 02 00 1c add %o0, %i4, %g1
(last_block->size_and_flag - last_block_new_size)
4000cf2c: 84 20 80 08 sub %g2, %o0, %g2
| HEAP_PREV_BLOCK_USED;
4000cf30: 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 =
4000cf34: 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;
4000cf38: 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 );
4000cf3c: 92 10 00 1c mov %i4, %o1
4000cf40: 82 08 60 01 and %g1, 1, %g1
block->size_and_flag = size | flag;
4000cf44: 90 12 00 01 or %o0, %g1, %o0
4000cf48: d0 27 20 04 st %o0, [ %i4 + 4 ]
4000cf4c: 7f ff ff 66 call 4000cce4 <_Heap_Free_block>
4000cf50: 90 10 00 18 mov %i0, %o0
extend_first_block,
extend_last_block
);
}
if ( merge_below_block == NULL && merge_above_block == NULL ) {
4000cf54: 10 80 00 0f b 4000cf90 <_Heap_Extend+0x254>
4000cf58: 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 ) {
4000cf5c: 80 a4 60 00 cmp %l1, 0
4000cf60: 02 80 00 0b be 4000cf8c <_Heap_Extend+0x250>
4000cf64: 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;
4000cf68: c6 04 60 04 ld [ %l1 + 4 ], %g3
_Heap_Link_above(
4000cf6c: c2 07 bf fc ld [ %fp + -4 ], %g1
4000cf70: 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 );
4000cf74: 84 20 80 11 sub %g2, %l1, %g2
block->size_and_flag = size | flag;
4000cf78: 84 10 c0 02 or %g3, %g2, %g2
4000cf7c: c4 24 60 04 st %g2, [ %l1 + 4 ]
last_block->size_and_flag |= HEAP_PREV_BLOCK_USED;
4000cf80: c4 00 60 04 ld [ %g1 + 4 ], %g2
4000cf84: 84 10 a0 01 or %g2, 1, %g2
4000cf88: c4 20 60 04 st %g2, [ %g1 + 4 ]
extend_first_block,
extend_last_block
);
}
if ( merge_below_block == NULL && merge_above_block == NULL ) {
4000cf8c: 80 a7 20 00 cmp %i4, 0
4000cf90: 32 80 00 09 bne,a 4000cfb4 <_Heap_Extend+0x278>
4000cf94: c2 06 20 24 ld [ %i0 + 0x24 ], %g1
4000cf98: 80 a4 20 00 cmp %l0, 0
4000cf9c: 32 80 00 06 bne,a 4000cfb4 <_Heap_Extend+0x278>
4000cfa0: c2 06 20 24 ld [ %i0 + 0x24 ], %g1
_Heap_Free_block( heap, extend_first_block );
4000cfa4: d2 07 bf f8 ld [ %fp + -8 ], %o1
4000cfa8: 7f ff ff 4f call 4000cce4 <_Heap_Free_block>
4000cfac: 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
4000cfb0: 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(
4000cfb4: 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;
4000cfb8: 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(
4000cfbc: 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;
4000cfc0: 86 08 e0 01 and %g3, 1, %g3
block->size_and_flag = size | flag;
4000cfc4: 84 10 c0 02 or %g3, %g2, %g2
4000cfc8: c4 20 60 04 st %g2, [ %g1 + 4 ]
}
_Heap_Set_last_block_size( heap );
extended_size = stats->free_size - free_size;
4000cfcc: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
4000cfd0: a6 20 40 13 sub %g1, %l3, %l3
/* Statistics */
stats->size += extended_size;
4000cfd4: c2 06 20 2c ld [ %i0 + 0x2c ], %g1
4000cfd8: 82 00 40 13 add %g1, %l3, %g1
4000cfdc: c2 26 20 2c st %g1, [ %i0 + 0x2c ]
return extended_size;
}
4000cfe0: 81 c7 e0 08 ret
4000cfe4: 91 e8 00 13 restore %g0, %l3, %o0
4000cbb4 <_Heap_Free>:
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
4000cbb4: 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 ) {
4000cbb8: 80 a6 60 00 cmp %i1, 0
4000cbbc: 02 80 00 7d be 4000cdb0 <_Heap_Free+0x1fc>
4000cbc0: 86 10 20 01 mov 1, %g3
4000cbc4: d2 06 20 10 ld [ %i0 + 0x10 ], %o1
4000cbc8: 40 00 18 1b call 40012c34 <.urem>
4000cbcc: 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
4000cbd0: 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);
4000cbd4: 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);
4000cbd8: 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;
4000cbdc: 80 a2 00 1a cmp %o0, %i2
4000cbe0: 0a 80 00 05 bcs 4000cbf4 <_Heap_Free+0x40>
4000cbe4: 82 10 20 00 clr %g1
4000cbe8: c2 06 20 24 ld [ %i0 + 0x24 ], %g1
4000cbec: 80 a0 40 08 cmp %g1, %o0
4000cbf0: 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
4000cbf4: 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 ) ) {
4000cbf8: 80 a0 60 00 cmp %g1, 0
4000cbfc: 02 80 00 6d be 4000cdb0 <_Heap_Free+0x1fc>
4000cc00: 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;
4000cc04: 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;
4000cc08: 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);
4000cc0c: 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;
4000cc10: 80 a0 40 1a cmp %g1, %i2
4000cc14: 0a 80 00 05 bcs 4000cc28 <_Heap_Free+0x74> <== NEVER TAKEN
4000cc18: 88 10 20 00 clr %g4
4000cc1c: c6 06 20 24 ld [ %i0 + 0x24 ], %g3
4000cc20: 80 a0 c0 01 cmp %g3, %g1
4000cc24: 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
4000cc28: 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 ) ) {
4000cc2c: 80 a1 20 00 cmp %g4, 0
4000cc30: 02 80 00 60 be 4000cdb0 <_Heap_Free+0x1fc>
4000cc34: 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;
4000cc38: fa 00 60 04 ld [ %g1 + 4 ], %i5
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
4000cc3c: 80 8f 60 01 btst 1, %i5
4000cc40: 22 80 00 5c be,a 4000cdb0 <_Heap_Free+0x1fc> <== NEVER TAKEN
4000cc44: 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
4000cc48: de 06 20 24 ld [ %i0 + 0x24 ], %o7
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
4000cc4c: 80 a0 40 0f cmp %g1, %o7
4000cc50: 02 80 00 07 be 4000cc6c <_Heap_Free+0xb8>
4000cc54: ba 0f 7f fe and %i5, -2, %i5
4000cc58: 88 00 40 1d add %g1, %i5, %g4
4000cc5c: f2 01 20 04 ld [ %g4 + 4 ], %i1
4000cc60: b2 1e 60 01 xor %i1, 1, %i1
4000cc64: 10 80 00 03 b 4000cc70 <_Heap_Free+0xbc>
4000cc68: b2 0e 60 01 and %i1, 1, %i1
4000cc6c: b2 10 20 00 clr %i1
if ( !_Heap_Is_prev_used( block ) ) {
4000cc70: 80 8f 20 01 btst 1, %i4
4000cc74: 12 80 00 25 bne 4000cd08 <_Heap_Free+0x154>
4000cc78: b2 0e 60 01 and %i1, 1, %i1
uintptr_t const prev_size = block->prev_size;
4000cc7c: 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);
4000cc80: 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;
4000cc84: 80 a1 00 1a cmp %g4, %i2
4000cc88: 0a 80 00 04 bcs 4000cc98 <_Heap_Free+0xe4> <== NEVER TAKEN
4000cc8c: b6 10 20 00 clr %i3
4000cc90: 80 a3 c0 04 cmp %o7, %g4
4000cc94: 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 ) ) {
4000cc98: b6 8e e0 01 andcc %i3, 1, %i3
4000cc9c: 22 80 00 45 be,a 4000cdb0 <_Heap_Free+0x1fc> <== NEVER TAKEN
4000cca0: 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;
4000cca4: 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) ) {
4000cca8: 80 8e e0 01 btst 1, %i3
4000ccac: 02 80 00 40 be 4000cdac <_Heap_Free+0x1f8> <== NEVER TAKEN
4000ccb0: 80 a6 60 00 cmp %i1, 0
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
4000ccb4: 02 80 00 0e be 4000ccec <_Heap_Free+0x138>
4000ccb8: b8 00 80 1c add %g2, %i4, %i4
uintptr_t const size = block_size + prev_size + next_block_size;
4000ccbc: 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;
4000ccc0: f8 00 60 08 ld [ %g1 + 8 ], %i4
Heap_Block *prev = block->prev;
4000ccc4: c2 00 60 0c ld [ %g1 + 0xc ], %g1
prev->next = next;
4000ccc8: f8 20 60 08 st %i4, [ %g1 + 8 ]
next->prev = prev;
4000cccc: c2 27 20 0c st %g1, [ %i4 + 0xc ]
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
4000ccd0: c2 06 20 38 ld [ %i0 + 0x38 ], %g1
4000ccd4: 82 00 7f ff add %g1, -1, %g1
4000ccd8: c2 26 20 38 st %g1, [ %i0 + 0x38 ]
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4000ccdc: 82 17 60 01 or %i5, 1, %g1
4000cce0: c2 21 20 04 st %g1, [ %g4 + 4 ]
4000cce4: 10 80 00 28 b 4000cd84 <_Heap_Free+0x1d0>
4000cce8: 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;
4000ccec: ba 17 20 01 or %i4, 1, %i5
4000ccf0: fa 21 20 04 st %i5, [ %g4 + 4 ]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4000ccf4: c8 00 60 04 ld [ %g1 + 4 ], %g4
4000ccf8: 88 09 3f fe and %g4, -2, %g4
4000ccfc: c8 20 60 04 st %g4, [ %g1 + 4 ]
next_block->prev_size = size;
4000cd00: 10 80 00 21 b 4000cd84 <_Heap_Free+0x1d0>
4000cd04: f8 20 80 08 st %i4, [ %g2 + %o0 ]
}
} else if ( next_is_free ) { /* coalesce next */
4000cd08: 80 a6 60 00 cmp %i1, 0
4000cd0c: 22 80 00 0d be,a 4000cd40 <_Heap_Free+0x18c>
4000cd10: c8 06 20 08 ld [ %i0 + 8 ], %g4
uintptr_t const size = block_size + next_block_size;
4000cd14: 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;
4000cd18: fa 00 60 08 ld [ %g1 + 8 ], %i5
Heap_Block *prev = old_block->prev;
4000cd1c: c2 00 60 0c ld [ %g1 + 0xc ], %g1
new_block->next = next;
4000cd20: fa 22 20 08 st %i5, [ %o0 + 8 ]
new_block->prev = prev;
4000cd24: c2 22 20 0c st %g1, [ %o0 + 0xc ]
next->prev = new_block;
4000cd28: d0 27 60 0c st %o0, [ %i5 + 0xc ]
prev->next = new_block;
4000cd2c: d0 20 60 08 st %o0, [ %g1 + 8 ]
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4000cd30: 82 11 20 01 or %g4, 1, %g1
4000cd34: c2 22 20 04 st %g1, [ %o0 + 4 ]
4000cd38: 10 80 00 13 b 4000cd84 <_Heap_Free+0x1d0>
4000cd3c: c8 21 00 08 st %g4, [ %g4 + %o0 ]
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
4000cd40: f0 22 20 0c st %i0, [ %o0 + 0xc ]
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
4000cd44: c8 22 20 08 st %g4, [ %o0 + 8 ]
new_block->prev = block_before;
block_before->next = new_block;
4000cd48: d0 26 20 08 st %o0, [ %i0 + 8 ]
next->prev = new_block;
4000cd4c: 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;
4000cd50: 88 10 a0 01 or %g2, 1, %g4
4000cd54: c8 22 20 04 st %g4, [ %o0 + 4 ]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4000cd58: c8 00 60 04 ld [ %g1 + 4 ], %g4
4000cd5c: 88 09 3f fe and %g4, -2, %g4
4000cd60: c8 20 60 04 st %g4, [ %g1 + 4 ]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
4000cd64: 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;
4000cd68: c4 20 80 08 st %g2, [ %g2 + %o0 ]
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
4000cd6c: 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;
4000cd70: 82 00 60 01 inc %g1
if ( stats->max_free_blocks < stats->free_blocks ) {
4000cd74: 80 a1 00 01 cmp %g4, %g1
4000cd78: 1a 80 00 03 bcc 4000cd84 <_Heap_Free+0x1d0>
4000cd7c: c2 26 20 38 st %g1, [ %i0 + 0x38 ]
stats->max_free_blocks = stats->free_blocks;
4000cd80: c2 26 20 3c st %g1, [ %i0 + 0x3c ]
}
}
/* Statistics */
--stats->used_blocks;
4000cd84: c2 06 20 40 ld [ %i0 + 0x40 ], %g1
4000cd88: 82 00 7f ff add %g1, -1, %g1
4000cd8c: c2 26 20 40 st %g1, [ %i0 + 0x40 ]
++stats->frees;
4000cd90: c2 06 20 50 ld [ %i0 + 0x50 ], %g1
4000cd94: 82 00 60 01 inc %g1
4000cd98: c2 26 20 50 st %g1, [ %i0 + 0x50 ]
stats->free_size += block_size;
4000cd9c: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
4000cda0: 84 00 40 02 add %g1, %g2, %g2
return( true );
4000cda4: 10 80 00 03 b 4000cdb0 <_Heap_Free+0x1fc>
4000cda8: 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;
4000cdac: 86 10 20 00 clr %g3 <== NOT EXECUTED
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4000cdb0: b0 08 e0 01 and %g3, 1, %i0
4000cdb4: 81 c7 e0 08 ret
4000cdb8: 81 e8 00 00 restore
4000b38c <_Heap_Iterate>:
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
4000b38c: 9d e3 bf a0 save %sp, -96, %sp
Heap_Block *current = heap->first_block;
4000b390: c2 06 20 20 ld [ %i0 + 0x20 ], %g1
Heap_Block *end = heap->last_block;
4000b394: f8 06 20 24 ld [ %i0 + 0x24 ], %i4
bool stop = false;
4000b398: 90 10 20 00 clr %o0
while ( !stop && current != end ) {
4000b39c: 80 a0 40 1c cmp %g1, %i4
4000b3a0: 02 80 00 0e be 4000b3d8 <_Heap_Iterate+0x4c>
4000b3a4: 90 1a 20 01 xor %o0, 1, %o0
4000b3a8: 80 8a 20 ff btst 0xff, %o0
4000b3ac: 02 80 00 0b be 4000b3d8 <_Heap_Iterate+0x4c> <== NEVER TAKEN
4000b3b0: 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;
4000b3b4: d2 00 60 04 ld [ %g1 + 4 ], %o1
4000b3b8: 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);
4000b3bc: 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;
4000b3c0: 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 );
4000b3c4: 96 10 00 1a mov %i2, %o3
4000b3c8: 9f c6 40 00 call %i1
4000b3cc: 94 0a a0 01 and %o2, 1, %o2
current = next;
4000b3d0: 10 bf ff f3 b 4000b39c <_Heap_Iterate+0x10>
4000b3d4: 82 10 00 1d mov %i5, %g1
4000b3d8: 81 c7 e0 08 ret
4000b3dc: 81 e8 00 00 restore
40014724 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
40014724: 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);
40014728: d2 06 20 10 ld [ %i0 + 0x10 ], %o1
4001472c: 7f ff f9 42 call 40012c34 <.urem>
40014730: 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
40014734: 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);
40014738: 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);
4001473c: 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;
40014740: 80 a2 00 04 cmp %o0, %g4
40014744: 0a 80 00 05 bcs 40014758 <_Heap_Size_of_alloc_area+0x34>
40014748: 82 10 20 00 clr %g1
4001474c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1
40014750: 80 a0 40 08 cmp %g1, %o0
40014754: 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
40014758: 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 ) ) {
4001475c: 80 a0 60 00 cmp %g1, 0
40014760: 02 80 00 17 be 400147bc <_Heap_Size_of_alloc_area+0x98>
40014764: 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;
40014768: c2 02 20 04 ld [ %o0 + 4 ], %g1
4001476c: 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);
40014770: 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;
40014774: 80 a0 40 04 cmp %g1, %g4
40014778: 0a 80 00 05 bcs 4001478c <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN
4001477c: 84 10 20 00 clr %g2
40014780: c4 06 20 24 ld [ %i0 + 0x24 ], %g2
40014784: 80 a0 80 01 cmp %g2, %g1
40014788: 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
4001478c: 84 08 a0 01 and %g2, 1, %g2
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
40014790: 80 a0 a0 00 cmp %g2, 0
40014794: 02 80 00 0a be 400147bc <_Heap_Size_of_alloc_area+0x98> <== NEVER TAKEN
40014798: 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;
4001479c: c4 00 60 04 ld [ %g1 + 4 ], %g2
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
400147a0: 80 88 a0 01 btst 1, %g2
400147a4: 02 80 00 05 be 400147b8 <_Heap_Size_of_alloc_area+0x94> <== NEVER TAKEN
400147a8: 82 20 40 19 sub %g1, %i1, %g1
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
400147ac: 82 00 60 04 add %g1, 4, %g1
return true;
400147b0: 10 80 00 03 b 400147bc <_Heap_Size_of_alloc_area+0x98>
400147b4: 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;
400147b8: 86 10 20 00 clr %g3 <== NOT EXECUTED
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
return true;
}
400147bc: b0 08 e0 01 and %g3, 1, %i0
400147c0: 81 c7 e0 08 ret
400147c4: 81 e8 00 00 restore
4000915c <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
4000915c: 9d e3 bf 80 save %sp, -128, %sp
40009160: ac 10 00 19 mov %i1, %l6
uintptr_t const page_size = heap->page_size;
40009164: f8 06 20 10 ld [ %i0 + 0x10 ], %i4
uintptr_t const min_block_size = heap->min_block_size;
40009168: f6 06 20 14 ld [ %i0 + 0x14 ], %i3
Heap_Block *const first_block = heap->first_block;
4000916c: 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;
40009170: 80 a6 a0 00 cmp %i2, 0
40009174: 02 80 00 05 be 40009188 <_Heap_Walk+0x2c>
40009178: e0 06 20 24 ld [ %i0 + 0x24 ], %l0
4000917c: 3b 10 00 24 sethi %hi(0x40009000), %i5
40009180: 10 80 00 04 b 40009190 <_Heap_Walk+0x34>
40009184: ba 17 61 0c or %i5, 0x10c, %i5 ! 4000910c <_Heap_Walk_print>
40009188: 3b 10 00 24 sethi %hi(0x40009000), %i5
4000918c: ba 17 61 04 or %i5, 0x104, %i5 ! 40009104 <_Heap_Walk_print_nothing>
40009190: 05 10 00 64 sethi %hi(0x40019000), %g2
if ( !_System_state_Is_up( _System_state_Get() ) ) {
40009194: c4 00 a0 a8 ld [ %g2 + 0xa8 ], %g2 ! 400190a8 <_System_state_Current>
40009198: 80 a0 a0 02 cmp %g2, 2
4000919c: 22 80 00 04 be,a 400091ac <_Heap_Walk+0x50>
400091a0: c4 06 20 1c ld [ %i0 + 0x1c ], %g2
return true;
400091a4: 10 80 01 30 b 40009664 <_Heap_Walk+0x508>
400091a8: 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)(
400091ac: da 06 20 18 ld [ %i0 + 0x18 ], %o5
400091b0: c4 23 a0 5c st %g2, [ %sp + 0x5c ]
400091b4: f2 23 a0 60 st %i1, [ %sp + 0x60 ]
400091b8: e0 23 a0 64 st %l0, [ %sp + 0x64 ]
400091bc: c4 06 20 08 ld [ %i0 + 8 ], %g2
400091c0: 90 10 00 16 mov %l6, %o0
400091c4: c4 23 a0 68 st %g2, [ %sp + 0x68 ]
400091c8: c4 06 20 0c ld [ %i0 + 0xc ], %g2
400091cc: 92 10 20 00 clr %o1
400091d0: c4 23 a0 6c st %g2, [ %sp + 0x6c ]
400091d4: 15 10 00 57 sethi %hi(0x40015c00), %o2
400091d8: 96 10 00 1c mov %i4, %o3
400091dc: 94 12 a3 40 or %o2, 0x340, %o2
400091e0: 9f c7 40 00 call %i5
400091e4: 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 ) {
400091e8: 80 a7 20 00 cmp %i4, 0
400091ec: 12 80 00 07 bne 40009208 <_Heap_Walk+0xac>
400091f0: 80 8f 20 07 btst 7, %i4
(*printer)( source, true, "page size is zero\n" );
400091f4: 15 10 00 57 sethi %hi(0x40015c00), %o2
400091f8: 90 10 00 16 mov %l6, %o0
400091fc: 92 10 20 01 mov 1, %o1
40009200: 10 80 00 37 b 400092dc <_Heap_Walk+0x180>
40009204: 94 12 a3 d8 or %o2, 0x3d8, %o2
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
40009208: 22 80 00 08 be,a 40009228 <_Heap_Walk+0xcc>
4000920c: 90 10 00 1b mov %i3, %o0
(*printer)(
40009210: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009214: 90 10 00 16 mov %l6, %o0
40009218: 92 10 20 01 mov 1, %o1
4000921c: 94 12 a3 f0 or %o2, 0x3f0, %o2
40009220: 10 80 00 4a b 40009348 <_Heap_Walk+0x1ec>
40009224: 96 10 00 1c mov %i4, %o3
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
40009228: 7f ff e2 7a call 40001c10 <.urem>
4000922c: 92 10 00 1c mov %i4, %o1
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
40009230: 80 a2 20 00 cmp %o0, 0
40009234: 22 80 00 08 be,a 40009254 <_Heap_Walk+0xf8>
40009238: 90 06 60 08 add %i1, 8, %o0
(*printer)(
4000923c: 15 10 00 58 sethi %hi(0x40016000), %o2
40009240: 90 10 00 16 mov %l6, %o0
40009244: 92 10 20 01 mov 1, %o1
40009248: 94 12 a0 10 or %o2, 0x10, %o2
4000924c: 10 80 00 3f b 40009348 <_Heap_Walk+0x1ec>
40009250: 96 10 00 1b mov %i3, %o3
40009254: 7f ff e2 6f call 40001c10 <.urem>
40009258: 92 10 00 1c mov %i4, %o1
);
return false;
}
if (
4000925c: 80 a2 20 00 cmp %o0, 0
40009260: 22 80 00 07 be,a 4000927c <_Heap_Walk+0x120>
40009264: c4 06 60 04 ld [ %i1 + 4 ], %g2
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
40009268: 15 10 00 58 sethi %hi(0x40016000), %o2
4000926c: 90 10 00 16 mov %l6, %o0
40009270: 92 10 20 01 mov 1, %o1
40009274: 10 80 01 03 b 40009680 <_Heap_Walk+0x524>
40009278: 94 12 a0 38 or %o2, 0x38, %o2
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
4000927c: 80 88 a0 01 btst 1, %g2
40009280: 32 80 00 07 bne,a 4000929c <_Heap_Walk+0x140>
40009284: f4 04 20 04 ld [ %l0 + 4 ], %i2
(*printer)(
40009288: 15 10 00 58 sethi %hi(0x40016000), %o2
4000928c: 90 10 00 16 mov %l6, %o0
40009290: 92 10 20 01 mov 1, %o1
40009294: 10 80 00 12 b 400092dc <_Heap_Walk+0x180>
40009298: 94 12 a0 70 or %o2, 0x70, %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;
4000929c: 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);
400092a0: 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;
400092a4: c4 06 a0 04 ld [ %i2 + 4 ], %g2
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
400092a8: 80 88 a0 01 btst 1, %g2
400092ac: 12 80 00 07 bne 400092c8 <_Heap_Walk+0x16c>
400092b0: 80 a6 80 19 cmp %i2, %i1
(*printer)(
400092b4: 15 10 00 58 sethi %hi(0x40016000), %o2
400092b8: 90 10 00 16 mov %l6, %o0
400092bc: 92 10 20 01 mov 1, %o1
400092c0: 10 80 00 07 b 400092dc <_Heap_Walk+0x180>
400092c4: 94 12 a0 a0 or %o2, 0xa0, %o2
);
return false;
}
if (
400092c8: 02 80 00 0a be 400092f0 <_Heap_Walk+0x194>
400092cc: 15 10 00 58 sethi %hi(0x40016000), %o2
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
400092d0: 90 10 00 16 mov %l6, %o0
400092d4: 92 10 20 01 mov 1, %o1
400092d8: 94 12 a0 b8 or %o2, 0xb8, %o2
400092dc: 9f c7 40 00 call %i5
400092e0: a6 10 20 00 clr %l3
400092e4: b0 0c e0 ff and %l3, 0xff, %i0
400092e8: 81 c7 e0 08 ret
400092ec: 81 e8 00 00 restore
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
400092f0: 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;
400092f4: d6 06 20 08 ld [ %i0 + 8 ], %o3
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
400092f8: 10 80 00 03 b 40009304 <_Heap_Walk+0x1a8>
400092fc: b2 10 00 18 mov %i0, %i1
return false;
}
prev_block = free_block;
free_block = free_block->next;
40009300: 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 ) {
40009304: 80 a2 c0 18 cmp %o3, %i0
40009308: 22 80 00 34 be,a 400093d8 <_Heap_Walk+0x27c>
4000930c: 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;
40009310: c6 06 20 20 ld [ %i0 + 0x20 ], %g3
40009314: 80 a0 c0 0b cmp %g3, %o3
40009318: 18 80 00 05 bgu 4000932c <_Heap_Walk+0x1d0>
4000931c: 84 10 20 00 clr %g2
40009320: c4 06 20 24 ld [ %i0 + 0x24 ], %g2
40009324: 80 a0 80 0b cmp %g2, %o3
40009328: 84 60 3f ff subx %g0, -1, %g2
if ( !_Heap_Is_block_in_heap( heap, free_block ) ) {
4000932c: 80 a0 a0 00 cmp %g2, 0
40009330: 12 80 00 0b bne 4000935c <_Heap_Walk+0x200>
40009334: 90 02 e0 08 add %o3, 8, %o0
(*printer)(
40009338: 15 10 00 58 sethi %hi(0x40016000), %o2
4000933c: 90 10 00 16 mov %l6, %o0
40009340: 92 10 20 01 mov 1, %o1
40009344: 94 12 a0 e8 or %o2, 0xe8, %o2
return false;
}
if ( _Heap_Is_used( free_block ) ) {
(*printer)(
40009348: 9f c7 40 00 call %i5
4000934c: a6 10 20 00 clr %l3
40009350: b0 0c e0 ff and %l3, 0xff, %i0
40009354: 81 c7 e0 08 ret
40009358: 81 e8 00 00 restore
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
4000935c: d6 27 bf fc st %o3, [ %fp + -4 ]
40009360: 7f ff e2 2c call 40001c10 <.urem>
40009364: 92 10 00 11 mov %l1, %o1
);
return false;
}
if (
40009368: 80 a2 20 00 cmp %o0, 0
4000936c: 02 80 00 07 be 40009388 <_Heap_Walk+0x22c>
40009370: d6 07 bf fc ld [ %fp + -4 ], %o3
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
40009374: 15 10 00 58 sethi %hi(0x40016000), %o2
40009378: 90 10 00 16 mov %l6, %o0
4000937c: 92 10 20 01 mov 1, %o1
40009380: 10 bf ff f2 b 40009348 <_Heap_Walk+0x1ec>
40009384: 94 12 a1 08 or %o2, 0x108, %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;
40009388: c4 02 e0 04 ld [ %o3 + 4 ], %g2
4000938c: 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 =
40009390: 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;
40009394: c4 00 a0 04 ld [ %g2 + 4 ], %g2
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
40009398: 80 88 a0 01 btst 1, %g2
4000939c: 22 80 00 07 be,a 400093b8 <_Heap_Walk+0x25c>
400093a0: d8 02 e0 0c ld [ %o3 + 0xc ], %o4
(*printer)(
400093a4: 15 10 00 58 sethi %hi(0x40016000), %o2
400093a8: 90 10 00 16 mov %l6, %o0
400093ac: 92 10 20 01 mov 1, %o1
400093b0: 10 bf ff e6 b 40009348 <_Heap_Walk+0x1ec>
400093b4: 94 12 a1 38 or %o2, 0x138, %o2
);
return false;
}
if ( free_block->prev != prev_block ) {
400093b8: 80 a3 00 19 cmp %o4, %i1
400093bc: 02 bf ff d1 be 40009300 <_Heap_Walk+0x1a4>
400093c0: b2 10 00 0b mov %o3, %i1
(*printer)(
400093c4: 15 10 00 58 sethi %hi(0x40016000), %o2
400093c8: 90 10 00 16 mov %l6, %o0
400093cc: 92 10 20 01 mov 1, %o1
400093d0: 10 80 00 2b b 4000947c <_Heap_Walk+0x320>
400093d4: 94 12 a1 58 or %o2, 0x158, %o2
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
400093d8: 23 10 00 58 sethi %hi(0x40016000), %l1
400093dc: 2f 10 00 57 sethi %hi(0x40015c00), %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;
400093e0: 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;
400093e4: 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;
400093e8: 9e 1e 40 10 xor %i1, %l0, %o7
400093ec: 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;
400093f0: aa 0c bf fe and %l2, -2, %l5
400093f4: 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);
400093f8: 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;
400093fc: 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;
40009400: 80 a3 40 14 cmp %o5, %l4
40009404: 18 80 00 05 bgu 40009418 <_Heap_Walk+0x2bc> <== NEVER TAKEN
40009408: 9e 10 20 00 clr %o7
4000940c: de 06 20 24 ld [ %i0 + 0x24 ], %o7
40009410: 80 a3 c0 14 cmp %o7, %l4
40009414: 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
40009418: 9e 0b e0 01 and %o7, 1, %o7
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
4000941c: 80 a3 e0 00 cmp %o7, 0
40009420: 12 80 00 07 bne 4000943c <_Heap_Walk+0x2e0>
40009424: a6 10 00 0f mov %o7, %l3
(*printer)(
40009428: 15 10 00 58 sethi %hi(0x40016000), %o2
4000942c: 90 10 00 16 mov %l6, %o0
40009430: 92 10 20 01 mov 1, %o1
40009434: 10 80 00 31 b 400094f8 <_Heap_Walk+0x39c>
40009438: 94 12 a1 90 or %o2, 0x190, %o2
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
4000943c: d8 27 bf f8 st %o4, [ %fp + -8 ]
40009440: 90 10 00 15 mov %l5, %o0
40009444: 7f ff e1 f3 call 40001c10 <.urem>
40009448: 92 10 00 1c mov %i4, %o1
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
4000944c: 80 a2 20 00 cmp %o0, 0
40009450: 02 80 00 10 be 40009490 <_Heap_Walk+0x334>
40009454: d8 07 bf f8 ld [ %fp + -8 ], %o4
40009458: 80 a3 20 00 cmp %o4, 0
4000945c: 02 80 00 0e be 40009494 <_Heap_Walk+0x338>
40009460: 80 a5 40 1b cmp %l5, %i3
(*printer)(
40009464: 15 10 00 58 sethi %hi(0x40016000), %o2
40009468: 90 10 00 16 mov %l6, %o0
4000946c: 92 10 20 01 mov 1, %o1
40009470: 94 12 a1 c0 or %o2, 0x1c0, %o2
40009474: 96 10 00 19 mov %i1, %o3
40009478: 98 10 00 15 mov %l5, %o4
4000947c: 9f c7 40 00 call %i5
40009480: a6 10 20 00 clr %l3
40009484: b0 0c e0 ff and %l3, 0xff, %i0
40009488: 81 c7 e0 08 ret
4000948c: 81 e8 00 00 restore
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
40009490: 80 a5 40 1b cmp %l5, %i3
40009494: 9e 40 20 00 addx %g0, 0, %o7
40009498: 9e 0b 00 0f and %o4, %o7, %o7
4000949c: 80 a3 e0 00 cmp %o7, 0
400094a0: 02 80 00 0c be 400094d0 <_Heap_Walk+0x374>
400094a4: a6 10 00 0f mov %o7, %l3
(*printer)(
400094a8: 90 10 00 16 mov %l6, %o0
400094ac: 92 10 20 01 mov 1, %o1
400094b0: 15 10 00 58 sethi %hi(0x40016000), %o2
400094b4: 96 10 00 19 mov %i1, %o3
400094b8: 94 12 a1 f0 or %o2, 0x1f0, %o2
400094bc: 98 10 00 15 mov %l5, %o4
400094c0: 9f c7 40 00 call %i5
400094c4: 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;
400094c8: 10 80 00 67 b 40009664 <_Heap_Walk+0x508>
400094cc: a6 10 20 00 clr %l3
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
400094d0: 80 a6 40 14 cmp %i1, %l4
400094d4: 2a 80 00 0f bcs,a 40009510 <_Heap_Walk+0x3b4>
400094d8: de 05 20 04 ld [ %l4 + 4 ], %o7
400094dc: 80 a3 20 00 cmp %o4, 0
400094e0: 22 80 00 0c be,a 40009510 <_Heap_Walk+0x3b4>
400094e4: de 05 20 04 ld [ %l4 + 4 ], %o7
(*printer)(
400094e8: 15 10 00 58 sethi %hi(0x40016000), %o2
400094ec: 90 10 00 16 mov %l6, %o0
400094f0: 92 10 20 01 mov 1, %o1
400094f4: 94 12 a2 20 or %o2, 0x220, %o2
400094f8: 96 10 00 19 mov %i1, %o3
400094fc: 9f c7 40 00 call %i5
40009500: 98 10 00 14 mov %l4, %o4
40009504: b0 0c e0 ff and %l3, 0xff, %i0
40009508: 81 c7 e0 08 ret
4000950c: 81 e8 00 00 restore
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
40009510: 80 8b e0 01 btst 1, %o7
40009514: 12 80 00 3f bne 40009610 <_Heap_Walk+0x4b4>
40009518: 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 ?
4000951c: 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)(
40009520: d8 06 20 08 ld [ %i0 + 8 ], %o4
40009524: 80 a3 40 0c cmp %o5, %o4
40009528: 02 80 00 08 be 40009548 <_Heap_Walk+0x3ec>
4000952c: 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)" : ""),
40009530: 80 a3 40 18 cmp %o5, %i0
40009534: 12 80 00 07 bne 40009550 <_Heap_Walk+0x3f4>
40009538: 96 14 62 c8 or %l1, 0x2c8, %o3
4000953c: 17 10 00 57 sethi %hi(0x40015c00), %o3
40009540: 10 80 00 04 b 40009550 <_Heap_Walk+0x3f4>
40009544: 96 12 e3 10 or %o3, 0x310, %o3 ! 40015f10 <_Semaphore_Translate_core_mutex_return_code_+0x50>
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)(
40009548: 03 10 00 57 sethi %hi(0x40015c00), %g1
4000954c: 96 10 63 00 or %g1, 0x300, %o3 ! 40015f00 <_Semaphore_Translate_core_mutex_return_code_+0x40>
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
40009550: 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)(
40009554: 80 a3 00 0f cmp %o4, %o7
40009558: 02 80 00 06 be 40009570 <_Heap_Walk+0x414>
4000955c: 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)" : "")
40009560: 12 80 00 06 bne 40009578 <_Heap_Walk+0x41c>
40009564: 9e 14 62 c8 or %l1, 0x2c8, %o7
40009568: 10 80 00 04 b 40009578 <_Heap_Walk+0x41c>
4000956c: 9e 15 e3 30 or %l7, 0x330, %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)(
40009570: 03 10 00 57 sethi %hi(0x40015c00), %g1
40009574: 9e 10 63 20 or %g1, 0x320, %o7 ! 40015f20 <_Semaphore_Translate_core_mutex_return_code_+0x60>
40009578: d6 23 a0 5c st %o3, [ %sp + 0x5c ]
4000957c: d8 23 a0 60 st %o4, [ %sp + 0x60 ]
40009580: de 23 a0 64 st %o7, [ %sp + 0x64 ]
40009584: 90 10 00 16 mov %l6, %o0
40009588: 92 10 20 00 clr %o1
4000958c: 15 10 00 58 sethi %hi(0x40016000), %o2
40009590: 96 10 00 19 mov %i1, %o3
40009594: 94 12 a2 58 or %o2, 0x258, %o2
40009598: 9f c7 40 00 call %i5
4000959c: 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 ) {
400095a0: da 05 00 00 ld [ %l4 ], %o5
400095a4: 80 a5 40 0d cmp %l5, %o5
400095a8: 02 80 00 0c be 400095d8 <_Heap_Walk+0x47c>
400095ac: 80 a4 a0 00 cmp %l2, 0
(*printer)(
400095b0: e8 23 a0 5c st %l4, [ %sp + 0x5c ]
400095b4: 90 10 00 16 mov %l6, %o0
400095b8: 92 10 20 01 mov 1, %o1
400095bc: 15 10 00 58 sethi %hi(0x40016000), %o2
400095c0: 96 10 00 19 mov %i1, %o3
400095c4: 94 12 a2 90 or %o2, 0x290, %o2
400095c8: 9f c7 40 00 call %i5
400095cc: 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;
400095d0: 10 80 00 25 b 40009664 <_Heap_Walk+0x508>
400095d4: a6 10 20 00 clr %l3
);
return false;
}
if ( !prev_used ) {
400095d8: 32 80 00 07 bne,a 400095f4 <_Heap_Walk+0x498>
400095dc: c8 06 20 08 ld [ %i0 + 8 ], %g4
(*printer)(
400095e0: 15 10 00 58 sethi %hi(0x40016000), %o2
400095e4: 90 10 00 16 mov %l6, %o0
400095e8: 92 10 20 01 mov 1, %o1
400095ec: 10 80 00 25 b 40009680 <_Heap_Walk+0x524>
400095f0: 94 12 a2 d0 or %o2, 0x2d0, %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 ) {
400095f4: 80 a1 00 18 cmp %g4, %i0
400095f8: 02 80 00 1e be 40009670 <_Heap_Walk+0x514>
400095fc: 80 a1 00 19 cmp %g4, %i1
if ( free_block == block ) {
40009600: 02 80 00 15 be 40009654 <_Heap_Walk+0x4f8>
40009604: 80 a5 00 1a cmp %l4, %i2
return true;
}
free_block = free_block->next;
40009608: 10 bf ff fb b 400095f4 <_Heap_Walk+0x498>
4000960c: 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) {
40009610: 80 a4 a0 00 cmp %l2, 0
40009614: 02 80 00 09 be 40009638 <_Heap_Walk+0x4dc>
40009618: 92 10 20 00 clr %o1
(*printer)(
4000961c: 15 10 00 58 sethi %hi(0x40016000), %o2
40009620: 96 10 00 19 mov %i1, %o3
40009624: 94 12 a3 00 or %o2, 0x300, %o2
40009628: 9f c7 40 00 call %i5
4000962c: 98 10 00 15 mov %l5, %o4
40009630: 10 80 00 09 b 40009654 <_Heap_Walk+0x4f8>
40009634: 80 a5 00 1a cmp %l4, %i2
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
40009638: da 06 40 00 ld [ %i1 ], %o5
4000963c: 15 10 00 58 sethi %hi(0x40016000), %o2
40009640: 96 10 00 19 mov %i1, %o3
40009644: 94 12 a3 18 or %o2, 0x318, %o2
40009648: 9f c7 40 00 call %i5
4000964c: 98 10 00 15 mov %l5, %o4
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
40009650: 80 a5 00 1a cmp %l4, %i2
40009654: 02 80 00 04 be 40009664 <_Heap_Walk+0x508>
40009658: a6 10 20 01 mov 1, %l3
4000965c: 10 bf ff 61 b 400093e0 <_Heap_Walk+0x284>
40009660: b2 10 00 14 mov %l4, %i1
40009664: b0 0c e0 ff and %l3, 0xff, %i0
40009668: 81 c7 e0 08 ret
4000966c: 81 e8 00 00 restore
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
40009670: 15 10 00 58 sethi %hi(0x40016000), %o2
40009674: 90 10 00 16 mov %l6, %o0
40009678: 92 10 20 01 mov 1, %o1
4000967c: 94 12 a3 40 or %o2, 0x340, %o2
40009680: 10 bf ff 32 b 40009348 <_Heap_Walk+0x1ec>
40009684: 96 10 00 19 mov %i1, %o3
4000855c <_Internal_error_Occurred>:
void _Internal_error_Occurred(
Internal_errors_Source the_source,
bool is_internal,
Internal_errors_t the_error
)
{
4000855c: 9d e3 bf 90 save %sp, -112, %sp
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
40008560: 13 10 00 29 sethi %hi(0x4000a400), %o1
40008564: 90 07 bf f4 add %fp, -12, %o0
40008568: 92 12 60 3c or %o1, 0x3c, %o1
Internal_errors_Source source,
bool is_internal,
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
4000856c: f0 27 bf f4 st %i0, [ %fp + -12 ]
40008570: f2 2f bf f8 stb %i1, [ %fp + -8 ]
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
40008574: 40 00 07 bd call 4000a468 <_User_extensions_Iterate>
40008578: f4 27 bf fc st %i2, [ %fp + -4 ]
_User_extensions_Fatal( the_source, is_internal, the_error );
_Internal_errors_What_happened.the_source = the_source;
4000857c: 05 10 00 5c sethi %hi(0x40017000), %g2 <== NOT EXECUTED
40008580: 82 10 a1 fc or %g2, 0x1fc, %g1 ! 400171fc <_Internal_errors_What_happened><== NOT EXECUTED
40008584: f0 20 a1 fc st %i0, [ %g2 + 0x1fc ] <== NOT EXECUTED
_Internal_errors_What_happened.is_internal = is_internal;
40008588: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED
_Internal_errors_What_happened.the_error = the_error;
4000858c: 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;
40008590: 84 10 20 04 mov 4, %g2 <== NOT EXECUTED
40008594: 03 10 00 5c sethi %hi(0x40017000), %g1 <== NOT EXECUTED
_System_state_Set( SYSTEM_STATE_FAILED );
_CPU_Fatal_halt( the_error );
40008598: 7f ff e7 12 call 400021e0 <sparc_disable_interrupts> <== NOT EXECUTED
4000859c: c4 20 62 08 st %g2, [ %g1 + 0x208 ] ! 40017208 <_System_state_Current><== NOT EXECUTED
400085a0: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED
400085a4: 30 80 00 00 b,a 400085a4 <_Internal_error_Occurred+0x48> <== NOT EXECUTED
40008610 <_Objects_Allocate>:
#endif
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
40008610: 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 )
40008614: c2 06 20 18 ld [ %i0 + 0x18 ], %g1
40008618: 80 a0 60 00 cmp %g1, 0
4000861c: 12 80 00 04 bne 4000862c <_Objects_Allocate+0x1c> <== ALWAYS TAKEN
40008620: ba 10 00 18 mov %i0, %i5
return NULL;
40008624: 81 c7 e0 08 ret
40008628: 91 e8 20 00 restore %g0, 0, %o0
/*
* OK. The manager should be initialized and configured to have objects.
* With any luck, it is safe to attempt to allocate an object.
*/
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
4000862c: b6 06 20 20 add %i0, 0x20, %i3
40008630: 7f ff fd 82 call 40007c38 <_Chain_Get>
40008634: 90 10 00 1b mov %i3, %o0
if ( information->auto_extend ) {
40008638: c2 0e 20 12 ldub [ %i0 + 0x12 ], %g1
/*
* OK. The manager should be initialized and configured to have objects.
* With any luck, it is safe to attempt to allocate an object.
*/
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
4000863c: b8 10 00 08 mov %o0, %i4
if ( information->auto_extend ) {
40008640: 80 a0 60 00 cmp %g1, 0
40008644: 02 80 00 1e be 400086bc <_Objects_Allocate+0xac>
40008648: b0 10 00 08 mov %o0, %i0
/*
* If the list is empty then we are out of objects and need to
* extend information base.
*/
if ( !the_object ) {
4000864c: 80 a2 20 00 cmp %o0, 0
40008650: 32 80 00 0a bne,a 40008678 <_Objects_Allocate+0x68>
40008654: c4 07 60 08 ld [ %i5 + 8 ], %g2
_Objects_Extend_information( information );
40008658: 40 00 00 22 call 400086e0 <_Objects_Extend_information>
4000865c: 90 10 00 1d mov %i5, %o0
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
40008660: 7f ff fd 76 call 40007c38 <_Chain_Get>
40008664: 90 10 00 1b mov %i3, %o0
}
if ( the_object ) {
40008668: b8 92 20 00 orcc %o0, 0, %i4
4000866c: 02 bf ff ee be 40008624 <_Objects_Allocate+0x14>
40008670: 01 00 00 00 nop
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
40008674: c4 07 60 08 ld [ %i5 + 8 ], %g2
40008678: d0 07 20 08 ld [ %i4 + 8 ], %o0
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
4000867c: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1
}
if ( the_object ) {
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
40008680: 03 00 00 3f sethi %hi(0xfc00), %g1
40008684: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff <PROM_START+0xffff>
40008688: 90 0a 00 01 and %o0, %g1, %o0
4000868c: 82 08 80 01 and %g2, %g1, %g1
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
40008690: 40 00 28 bd call 40012984 <.udiv>
40008694: 90 22 00 01 sub %o0, %g1, %o0
information->inactive_per_block[ block ]--;
40008698: c2 07 60 30 ld [ %i5 + 0x30 ], %g1
4000869c: 91 2a 20 02 sll %o0, 2, %o0
400086a0: c4 00 40 08 ld [ %g1 + %o0 ], %g2
information->inactive--;
400086a4: 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 ]--;
400086a8: 84 00 bf ff add %g2, -1, %g2
400086ac: c4 20 40 08 st %g2, [ %g1 + %o0 ]
information->inactive--;
400086b0: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1
400086b4: 82 00 7f ff add %g1, -1, %g1
400086b8: c2 37 60 2c sth %g1, [ %i5 + 0x2c ]
);
}
#endif
return the_object;
}
400086bc: 81 c7 e0 08 ret
400086c0: 81 e8 00 00 restore
400086e0 <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
400086e0: 9d e3 bf 90 save %sp, -112, %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 )
400086e4: f4 06 20 34 ld [ %i0 + 0x34 ], %i2
/*
* 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 );
400086e8: f6 16 20 0a lduh [ %i0 + 0xa ], %i3
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
400086ec: 80 a6 a0 00 cmp %i2, 0
400086f0: f2 16 20 14 lduh [ %i0 + 0x14 ], %i1
400086f4: 02 80 00 18 be 40008754 <_Objects_Extend_information+0x74>
400086f8: e0 16 20 10 lduh [ %i0 + 0x10 ], %l0
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
400086fc: 91 2c 20 10 sll %l0, 0x10, %o0
40008700: a3 2e 60 10 sll %i1, 0x10, %l1
40008704: 91 32 20 10 srl %o0, 0x10, %o0
40008708: a3 34 60 10 srl %l1, 0x10, %l1
/*
* 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 );
4000870c: ba 10 00 1b mov %i3, %i5
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
40008710: 92 10 00 11 mov %l1, %o1
40008714: 40 00 28 9c call 40012984 <.udiv>
40008718: b8 10 20 00 clr %i4
4000871c: 91 2a 20 10 sll %o0, 0x10, %o0
40008720: a7 32 20 10 srl %o0, 0x10, %l3
for ( ; block < block_count; block++ ) {
40008724: 80 a7 00 13 cmp %i4, %l3
40008728: 1a 80 00 09 bcc 4000874c <_Objects_Extend_information+0x6c>
4000872c: 83 2f 20 02 sll %i4, 2, %g1
if ( information->object_blocks[ block ] == NULL ) {
40008730: c2 06 80 01 ld [ %i2 + %g1 ], %g1
40008734: 80 a0 60 00 cmp %g1, 0
40008738: 22 80 00 0b be,a 40008764 <_Objects_Extend_information+0x84>
4000873c: b4 10 20 00 clr %i2
do_extend = false;
break;
} else
index_base += information->allocation_size;
40008740: ba 07 40 11 add %i5, %l1, %i5
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
40008744: 10 bf ff f8 b 40008724 <_Objects_Extend_information+0x44>
40008748: b8 07 20 01 inc %i4
4000874c: 10 80 00 06 b 40008764 <_Objects_Extend_information+0x84>
40008750: b4 10 20 01 mov 1, %i2
/*
* 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 );
40008754: ba 10 00 1b mov %i3, %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;
40008758: b4 10 20 01 mov 1, %i2
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
4000875c: b8 10 20 00 clr %i4
40008760: a6 10 20 00 clr %l3
} else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
40008764: b3 2e 60 10 sll %i1, 0x10, %i1
40008768: a1 2c 20 10 sll %l0, 0x10, %l0
4000876c: 91 36 60 10 srl %i1, 0x10, %o0
40008770: 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 ) {
40008774: 03 00 00 3f sethi %hi(0xfc00), %g1
} else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
40008778: a0 02 00 10 add %o0, %l0, %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 ) {
4000877c: 82 10 63 ff or %g1, 0x3ff, %g1
40008780: 80 a4 00 01 cmp %l0, %g1
40008784: 18 80 00 8b bgu 400089b0 <_Objects_Extend_information+0x2d0>
40008788: 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;
4000878c: 40 00 28 44 call 4001289c <.umul>
40008790: d2 06 20 18 ld [ %i0 + 0x18 ], %o1
if ( information->auto_extend ) {
40008794: c2 0e 20 12 ldub [ %i0 + 0x12 ], %g1
40008798: 80 a0 60 00 cmp %g1, 0
4000879c: 02 80 00 09 be 400087c0 <_Objects_Extend_information+0xe0>
400087a0: 01 00 00 00 nop
new_object_block = _Workspace_Allocate( block_size );
400087a4: 40 00 08 60 call 4000a924 <_Workspace_Allocate>
400087a8: 01 00 00 00 nop
if ( !new_object_block )
400087ac: b2 92 20 00 orcc %o0, 0, %i1
400087b0: 12 80 00 08 bne 400087d0 <_Objects_Extend_information+0xf0><== ALWAYS TAKEN
400087b4: 80 8e a0 ff btst 0xff, %i2
400087b8: 81 c7 e0 08 ret <== NOT EXECUTED
400087bc: 81 e8 00 00 restore <== NOT EXECUTED
return;
} else {
new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
400087c0: 40 00 08 67 call 4000a95c <_Workspace_Allocate_or_fatal_error>
400087c4: 01 00 00 00 nop
400087c8: b2 10 00 08 mov %o0, %i1
}
/*
* Do we need to grow the tables?
*/
if ( do_extend ) {
400087cc: 80 8e a0 ff btst 0xff, %i2
400087d0: 02 80 00 57 be 4000892c <_Objects_Extend_information+0x24c>
400087d4: 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*)),
400087d8: 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);
400087dc: a2 04 e0 07 add %l3, 7, %l1
400087e0: 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 +
400087e4: 83 2c 60 01 sll %l1, 1, %g1
((maximum + minimum_index) * sizeof(Objects_Control *));
400087e8: 90 04 00 1b add %l0, %i3, %o0
400087ec: 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 +
400087f0: 90 00 40 08 add %g1, %o0, %o0
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
400087f4: c2 0e 20 12 ldub [ %i0 + 0x12 ], %g1
400087f8: 80 a0 60 00 cmp %g1, 0
400087fc: 02 80 00 0b be 40008828 <_Objects_Extend_information+0x148>
40008800: 01 00 00 00 nop
object_blocks = _Workspace_Allocate( block_size );
40008804: 40 00 08 48 call 4000a924 <_Workspace_Allocate>
40008808: 01 00 00 00 nop
if ( !object_blocks ) {
4000880c: b4 92 20 00 orcc %o0, 0, %i2
40008810: 32 80 00 0a bne,a 40008838 <_Objects_Extend_information+0x158><== ALWAYS TAKEN
40008814: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1
_Workspace_Free( new_object_block );
40008818: 40 00 08 4b call 4000a944 <_Workspace_Free> <== NOT EXECUTED
4000881c: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED
return;
40008820: 81 c7 e0 08 ret <== NOT EXECUTED
40008824: 81 e8 00 00 restore <== NOT EXECUTED
}
} else {
object_blocks = _Workspace_Allocate_or_fatal_error( block_size );
40008828: 40 00 08 4d call 4000a95c <_Workspace_Allocate_or_fatal_error>
4000882c: 01 00 00 00 nop
40008830: b4 10 00 08 mov %o0, %i2
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
40008834: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
40008838: a4 06 80 11 add %i2, %l1, %l2
4000883c: 80 a0 40 1b cmp %g1, %i3
40008840: 18 80 00 04 bgu 40008850 <_Objects_Extend_information+0x170>
40008844: a2 04 80 11 add %l2, %l1, %l1
40008848: 10 80 00 13 b 40008894 <_Objects_Extend_information+0x1b4>
4000884c: 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,
40008850: d2 06 20 34 ld [ %i0 + 0x34 ], %o1
information->object_blocks,
block_count * sizeof(void*) );
40008854: a8 04 ff fc add %l3, -4, %l4
/*
* 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,
40008858: 90 10 00 1a mov %i2, %o0
4000885c: 40 00 1b 82 call 4000f664 <memcpy>
40008860: 94 10 00 14 mov %l4, %o2
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
40008864: d2 06 20 30 ld [ %i0 + 0x30 ], %o1
40008868: 94 10 00 14 mov %l4, %o2
4000886c: 40 00 1b 7e call 4000f664 <memcpy>
40008870: 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 *) );
40008874: c2 16 20 10 lduh [ %i0 + 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,
40008878: d2 06 20 1c ld [ %i0 + 0x1c ], %o1
information->local_table,
(information->maximum + minimum_index) * sizeof(Objects_Control *) );
4000887c: 94 00 40 1b add %g1, %i3, %o2
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
40008880: 90 10 00 11 mov %l1, %o0
40008884: 40 00 1b 78 call 4000f664 <memcpy>
40008888: 95 2a a0 02 sll %o2, 2, %o2
4000888c: 10 80 00 09 b 400088b0 <_Objects_Extend_information+0x1d0>
40008890: c4 16 20 14 lduh [ %i0 + 0x14 ], %g2
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
40008894: 80 a0 40 1b cmp %g1, %i3
40008898: 02 80 00 05 be 400088ac <_Objects_Extend_information+0x1cc>
4000889c: 85 28 60 02 sll %g1, 2, %g2
400088a0: 82 00 60 01 inc %g1
local_table[ index ] = NULL;
400088a4: 10 bf ff fc b 40008894 <_Objects_Extend_information+0x1b4>
400088a8: c0 20 80 11 clr [ %g2 + %l1 ]
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
400088ac: c4 16 20 14 lduh [ %i0 + 0x14 ], %g2
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
400088b0: a6 04 ff fc add %l3, -4, %l3
400088b4: c0 26 80 13 clr [ %i2 + %l3 ]
inactive_per_block[block_count] = 0;
400088b8: c0 24 80 13 clr [ %l2 + %l3 ]
for ( index=index_base ;
index < ( information->allocation_size + index_base );
400088bc: 84 07 40 02 add %i5, %g2, %g2
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
400088c0: 82 10 00 1d mov %i5, %g1
400088c4: 80 a0 40 02 cmp %g1, %g2
400088c8: 1a 80 00 05 bcc 400088dc <_Objects_Extend_information+0x1fc>
400088cc: 87 28 60 02 sll %g1, 2, %g3
index < ( information->allocation_size + index_base );
index++ ) {
400088d0: 82 00 60 01 inc %g1
local_table[ index ] = NULL;
400088d4: 10 bf ff fc b 400088c4 <_Objects_Extend_information+0x1e4>
400088d8: c0 20 c0 11 clr [ %g3 + %l1 ]
}
_ISR_Disable( level );
400088dc: 7f ff e6 41 call 400021e0 <sparc_disable_interrupts>
400088e0: 01 00 00 00 nop
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
400088e4: c2 06 00 00 ld [ %i0 ], %g1
400088e8: 05 00 00 40 sethi %hi(0x10000), %g2
400088ec: 83 28 60 18 sll %g1, 0x18, %g1
400088f0: 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;
400088f4: e0 36 20 10 sth %l0, [ %i0 + 0x10 ]
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
400088f8: a0 10 40 10 or %g1, %l0, %l0
information->maximum_id = _Objects_Build_id(
400088fc: c2 16 20 04 lduh [ %i0 + 4 ], %g1
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
40008900: f6 06 20 34 ld [ %i0 + 0x34 ], %i3
40008904: 83 28 60 1b sll %g1, 0x1b, %g1
information->object_blocks = object_blocks;
40008908: f4 26 20 34 st %i2, [ %i0 + 0x34 ]
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
4000890c: a0 14 00 01 or %l0, %g1, %l0
information->inactive_per_block = inactive_per_block;
40008910: e4 26 20 30 st %l2, [ %i0 + 0x30 ]
information->local_table = local_table;
40008914: e2 26 20 1c st %l1, [ %i0 + 0x1c ]
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
40008918: e0 26 20 0c st %l0, [ %i0 + 0xc ]
information->the_class,
_Objects_Local_node,
information->maximum
);
_ISR_Enable( level );
4000891c: 7f ff e6 35 call 400021f0 <sparc_enable_interrupts>
40008920: 01 00 00 00 nop
_Workspace_Free( old_tables );
40008924: 40 00 08 08 call 4000a944 <_Workspace_Free>
40008928: 90 10 00 1b mov %i3, %o0
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
4000892c: c2 06 20 34 ld [ %i0 + 0x34 ], %g1
40008930: b9 2f 20 02 sll %i4, 2, %i4
40008934: f2 20 40 1c st %i1, [ %g1 + %i4 ]
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
40008938: c2 06 20 34 ld [ %i0 + 0x34 ], %g1
4000893c: d4 16 20 14 lduh [ %i0 + 0x14 ], %o2
40008940: d2 00 40 1c ld [ %g1 + %i4 ], %o1
40008944: d6 06 20 18 ld [ %i0 + 0x18 ], %o3
40008948: 90 07 bf f4 add %fp, -12, %o0
4000894c: 7f ff fc ca call 40007c74 <_Chain_Initialize>
40008950: 37 00 00 40 sethi %hi(0x10000), %i3
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
40008954: b4 06 20 20 add %i0, 0x20, %i2
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
40008958: 7f ff fc b8 call 40007c38 <_Chain_Get>
4000895c: 90 07 bf f4 add %fp, -12, %o0
40008960: 92 92 20 00 orcc %o0, 0, %o1
40008964: 02 80 00 0d be 40008998 <_Objects_Extend_information+0x2b8>
40008968: 90 10 00 1a mov %i2, %o0
4000896c: c4 06 00 00 ld [ %i0 ], %g2
the_object->id = _Objects_Build_id(
40008970: c2 16 20 04 lduh [ %i0 + 4 ], %g1
40008974: 85 28 a0 18 sll %g2, 0x18, %g2
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
40008978: 83 28 60 1b sll %g1, 0x1b, %g1
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
4000897c: 84 10 80 1b or %g2, %i3, %g2
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
40008980: 82 10 80 01 or %g2, %g1, %g1
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
40008984: 82 10 40 1d or %g1, %i5, %g1
40008988: c2 22 60 08 st %g1, [ %o1 + 8 ]
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
4000898c: 7f ff fc 9f call 40007c08 <_Chain_Append>
40008990: ba 07 60 01 inc %i5
40008994: 30 bf ff f1 b,a 40008958 <_Objects_Extend_information+0x278>
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
40008998: c4 06 20 30 ld [ %i0 + 0x30 ], %g2
4000899c: c2 16 20 14 lduh [ %i0 + 0x14 ], %g1
400089a0: c2 20 80 1c st %g1, [ %g2 + %i4 ]
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
400089a4: c4 16 20 2c lduh [ %i0 + 0x2c ], %g2
400089a8: 82 00 80 01 add %g2, %g1, %g1
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
information->inactive =
400089ac: c2 36 20 2c sth %g1, [ %i0 + 0x2c ]
400089b0: 81 c7 e0 08 ret
400089b4: 81 e8 00 00 restore
40008a6c <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint16_t the_class
)
{
40008a6c: 9d e3 bf a0 save %sp, -96, %sp
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
40008a70: 80 a6 60 00 cmp %i1, 0
40008a74: 12 80 00 04 bne 40008a84 <_Objects_Get_information+0x18>
40008a78: 01 00 00 00 nop
return NULL;
40008a7c: 81 c7 e0 08 ret
40008a80: 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 );
40008a84: 40 00 10 ce call 4000cdbc <_Objects_API_maximum_class>
40008a88: 90 10 00 18 mov %i0, %o0
if ( the_class_api_maximum == 0 )
40008a8c: 80 a2 20 00 cmp %o0, 0
40008a90: 02 bf ff fb be 40008a7c <_Objects_Get_information+0x10>
40008a94: 80 a6 40 08 cmp %i1, %o0
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
40008a98: 18 bf ff f9 bgu 40008a7c <_Objects_Get_information+0x10>
40008a9c: 03 10 00 5b sethi %hi(0x40016c00), %g1
return NULL;
if ( !_Objects_Information_table[ the_api ] )
40008aa0: b1 2e 20 02 sll %i0, 2, %i0
40008aa4: 82 10 60 a4 or %g1, 0xa4, %g1
40008aa8: c2 00 40 18 ld [ %g1 + %i0 ], %g1
40008aac: 80 a0 60 00 cmp %g1, 0
40008ab0: 02 bf ff f3 be 40008a7c <_Objects_Get_information+0x10> <== NEVER TAKEN
40008ab4: b3 2e 60 02 sll %i1, 2, %i1
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
40008ab8: f0 00 40 19 ld [ %g1 + %i1 ], %i0
if ( !info )
40008abc: 80 a6 20 00 cmp %i0, 0
40008ac0: 02 bf ff ef be 40008a7c <_Objects_Get_information+0x10> <== NEVER TAKEN
40008ac4: 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 )
40008ac8: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1
40008acc: 80 a0 60 00 cmp %g1, 0
40008ad0: 02 bf ff eb be 40008a7c <_Objects_Get_information+0x10>
40008ad4: 01 00 00 00 nop
return NULL;
#endif
return info;
}
40008ad8: 81 c7 e0 08 ret
40008adc: 81 e8 00 00 restore
4000c678 <_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;
4000c678: c2 02 20 08 ld [ %o0 + 8 ], %g1
4000c67c: 92 22 40 01 sub %o1, %g1, %o1
if ( information->maximum >= index ) {
4000c680: 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;
4000c684: 92 02 60 01 inc %o1
if ( information->maximum >= index ) {
4000c688: 80 a0 40 09 cmp %g1, %o1
4000c68c: 0a 80 00 09 bcs 4000c6b0 <_Objects_Get_no_protection+0x38>
4000c690: 93 2a 60 02 sll %o1, 2, %o1
if ( (the_object = information->local_table[ index ]) != NULL ) {
4000c694: c2 02 20 1c ld [ %o0 + 0x1c ], %g1
4000c698: d0 00 40 09 ld [ %g1 + %o1 ], %o0
4000c69c: 80 a2 20 00 cmp %o0, 0
4000c6a0: 02 80 00 05 be 4000c6b4 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN
4000c6a4: 82 10 20 01 mov 1, %g1
*location = OBJECTS_LOCAL;
return the_object;
4000c6a8: 81 c3 e0 08 retl
4000c6ac: 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;
4000c6b0: 82 10 20 01 mov 1, %g1
return NULL;
4000c6b4: 90 10 20 00 clr %o0
}
4000c6b8: 81 c3 e0 08 retl
4000c6bc: c2 22 80 00 st %g1, [ %o2 ]
4000d074 <_Objects_Id_to_name>:
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
4000d074: 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;
4000d078: 80 a6 20 00 cmp %i0, 0
4000d07c: 12 80 00 06 bne 4000d094 <_Objects_Id_to_name+0x20>
4000d080: 83 36 20 18 srl %i0, 0x18, %g1
ISR_Level level;
_ISR_Disable_without_giant( level );
#endif
executing = _Thread_Executing;
4000d084: 03 10 00 bd sethi %hi(0x4002f400), %g1
4000d088: c2 00 60 88 ld [ %g1 + 0x88 ], %g1 ! 4002f488 <_Per_CPU_Information+0x18>
4000d08c: f0 00 60 08 ld [ %g1 + 8 ], %i0
4000d090: 83 36 20 18 srl %i0, 0x18, %g1
4000d094: 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 )
4000d098: 84 00 7f ff add %g1, -1, %g2
4000d09c: 80 a0 a0 02 cmp %g2, 2
4000d0a0: 08 80 00 04 bleu 4000d0b0 <_Objects_Id_to_name+0x3c>
4000d0a4: 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;
4000d0a8: 81 c7 e0 08 ret
4000d0ac: 91 e8 20 03 restore %g0, 3, %o0
if ( !_Objects_Information_table[ the_api ] )
4000d0b0: 05 10 00 bb sethi %hi(0x4002ec00), %g2
4000d0b4: 84 10 a2 c4 or %g2, 0x2c4, %g2 ! 4002eec4 <_Objects_Information_table>
4000d0b8: c2 00 80 01 ld [ %g2 + %g1 ], %g1
4000d0bc: 80 a0 60 00 cmp %g1, 0
4000d0c0: 02 bf ff fa be 4000d0a8 <_Objects_Id_to_name+0x34>
4000d0c4: 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 ];
4000d0c8: 85 28 a0 02 sll %g2, 2, %g2
4000d0cc: d0 00 40 02 ld [ %g1 + %g2 ], %o0
if ( !information )
4000d0d0: 80 a2 20 00 cmp %o0, 0
4000d0d4: 02 bf ff f5 be 4000d0a8 <_Objects_Id_to_name+0x34> <== NEVER TAKEN
4000d0d8: 01 00 00 00 nop
return OBJECTS_INVALID_ID;
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
4000d0dc: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1
4000d0e0: 80 a0 60 00 cmp %g1, 0
4000d0e4: 12 bf ff f1 bne 4000d0a8 <_Objects_Id_to_name+0x34> <== NEVER TAKEN
4000d0e8: 92 10 00 18 mov %i0, %o1
return OBJECTS_INVALID_ID;
#endif
the_object = _Objects_Get( information, tmpId, &ignored_location );
4000d0ec: 7f ff ff c5 call 4000d000 <_Objects_Get>
4000d0f0: 94 07 bf fc add %fp, -4, %o2
if ( !the_object )
4000d0f4: 80 a2 20 00 cmp %o0, 0
4000d0f8: 02 bf ff ec be 4000d0a8 <_Objects_Id_to_name+0x34>
4000d0fc: 01 00 00 00 nop
return OBJECTS_INVALID_ID;
*name = the_object->name;
4000d100: c2 02 20 0c ld [ %o0 + 0xc ], %g1
_Objects_Put( the_object );
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
4000d104: b0 10 20 00 clr %i0
RTEMS_INLINE_ROUTINE void _Objects_Put(
Objects_Control *the_object
)
{
(void) the_object;
_Thread_Enable_dispatch();
4000d108: 40 00 03 74 call 4000ded8 <_Thread_Enable_dispatch>
4000d10c: c2 26 40 00 st %g1, [ %i1 ]
4000d110: 81 c7 e0 08 ret
4000d114: 81 e8 00 00 restore
40007080 <_POSIX_Keys_Free_memory>:
#include <rtems/score/chainimpl.h>
void _POSIX_Keys_Free_memory(
POSIX_Keys_Control *the_key
)
{
40007080: 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;
40007084: 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 );
40007088: 39 10 00 64 sethi %hi(0x40019000), %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;
4000708c: f6 27 bf f4 st %i3, [ %fp + -12 ]
search_node.thread_id = 0;
40007090: c0 27 bf f8 clr [ %fp + -8 ]
iter = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree, &search_node.Key_value_lookup_node );
40007094: 90 17 21 8c or %i4, 0x18c, %o0
40007098: 92 07 bf e4 add %fp, -28, %o1
4000709c: 40 00 0c 12 call 4000a0e4 <_RBTree_Find>
400070a0: b2 10 00 1c mov %i4, %i1
if ( !iter )
400070a4: ba 92 20 00 orcc %o0, 0, %i5
400070a8: 02 80 00 2d be 4000715c <_POSIX_Keys_Free_memory+0xdc>
400070ac: 01 00 00 00 nop
return;
/**
* find the smallest thread_id node in the rbtree.
*/
next = _RBTree_Next( iter, RBT_LEFT );
400070b0: 40 00 0c cc call 4000a3e0 <_RBTree_Next>
400070b4: 92 10 20 00 clr %o1 ! 0 <PROM_START>
400070b8: b8 10 00 08 mov %o0, %i4
p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node );
400070bc: 82 02 3f f8 add %o0, -8, %g1
while ( next != NULL && p->key == key_id) {
400070c0: 80 a7 20 00 cmp %i4, 0
400070c4: 32 80 00 07 bne,a 400070e0 <_POSIX_Keys_Free_memory+0x60>
400070c8: 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 );
400070cc: 31 10 00 64 sethi %hi(0x40019000), %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 );
400070d0: 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 );
400070d4: b2 16 61 8c or %i1, 0x18c, %i1
400070d8: 10 80 00 1d b 4000714c <_POSIX_Keys_Free_memory+0xcc>
400070dc: b0 16 21 48 or %i0, 0x148, %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) {
400070e0: 80 a0 40 1b cmp %g1, %i3
400070e4: 12 bf ff fb bne 400070d0 <_POSIX_Keys_Free_memory+0x50> <== NEVER TAKEN
400070e8: 31 10 00 64 sethi %hi(0x40019000), %i0
iter = next;
next = _RBTree_Next( iter, RBT_LEFT );
400070ec: 90 10 00 1c mov %i4, %o0
400070f0: 92 10 20 00 clr %o1
400070f4: 40 00 0c bb call 4000a3e0 <_RBTree_Next>
400070f8: ba 10 00 1c mov %i4, %i5
p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node );
400070fc: 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 );
40007100: 10 bf ff f0 b 400070c0 <_POSIX_Keys_Free_memory+0x40>
40007104: 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 );
40007108: 40 00 0c b6 call 4000a3e0 <_RBTree_Next>
4000710c: 90 10 00 1d mov %i5, %o0
_RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter );
40007110: 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 );
40007114: b4 10 00 08 mov %o0, %i2
_RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter );
40007118: 40 00 0b 87 call 40009f34 <_RBTree_Extract>
4000711c: 90 10 00 19 mov %i1, %o0
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
40007120: c4 07 00 00 ld [ %i4 ], %g2
previous = the_node->previous;
40007124: c2 07 20 04 ld [ %i4 + 4 ], %g1
40007128: 92 10 00 1c mov %i4, %o1
next->previous = previous;
4000712c: c2 20 a0 04 st %g1, [ %g2 + 4 ]
previous->next = next;
40007130: c4 20 40 00 st %g2, [ %g1 ]
40007134: 40 00 07 b9 call 40009018 <_Freechain_Put>
40007138: 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 ) {
4000713c: 80 a6 a0 00 cmp %i2, 0
40007140: 02 80 00 07 be 4000715c <_POSIX_Keys_Free_memory+0xdc>
40007144: 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;
40007148: 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 ) {
4000714c: c2 07 20 18 ld [ %i4 + 0x18 ], %g1
40007150: 80 a0 40 1b cmp %g1, %i3
40007154: 02 bf ff ed be 40007108 <_POSIX_Keys_Free_memory+0x88>
40007158: 92 10 20 01 mov 1, %o1
4000715c: 81 c7 e0 08 ret
40007160: 81 e8 00 00 restore
4000bcc4 <_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;
4000bcc4: 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 );
4000bcc8: 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;
4000bccc: d0 02 20 10 ld [ %o0 + 0x10 ], %o0
if ( diff )
4000bcd0: 90 a2 00 02 subcc %o0, %g2, %o0
4000bcd4: 12 80 00 0c bne 4000bd04 <_POSIX_Keys_Key_value_lookup_tree_compare_function+0x40>
4000bcd8: 92 02 7f f8 add %o1, -8, %o1
return diff;
thread_id1 = n1->thread_id;
4000bcdc: d0 00 60 1c ld [ %g1 + 0x1c ], %o0
thread_id2 = n2->thread_id;
4000bce0: 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 )
4000bce4: 80 a0 60 00 cmp %g1, 0
4000bce8: 02 80 00 06 be 4000bd00 <_POSIX_Keys_Key_value_lookup_tree_compare_function+0x3c><== NEVER TAKEN
4000bcec: 80 a2 20 00 cmp %o0, 0
4000bcf0: 22 80 00 05 be,a 4000bd04 <_POSIX_Keys_Key_value_lookup_tree_compare_function+0x40>
4000bcf4: 90 10 20 00 clr %o0
return thread_id1 - thread_id2;
4000bcf8: 81 c3 e0 08 retl
4000bcfc: 90 22 00 01 sub %o0, %g1, %o0
return 0;
4000bd00: 90 10 20 00 clr %o0 <== NOT EXECUTED
}
4000bd04: 81 c3 e0 08 retl
4000bd0c <_POSIX_Keys_Keypool_extend>:
return _Objects_Maximum_per_allocation( max );
}
static bool _POSIX_Keys_Keypool_extend( Freechain_Control *keypool )
{
4000bd0c: 9d e3 bf a0 save %sp, -96, %sp
return 0;
}
static uint32_t _POSIX_Keys_Get_keypool_bump_count( void )
{
uint32_t max = Configuration_POSIX_API.maximum_key_value_pairs;
4000bd10: 03 10 00 57 sethi %hi(0x40015c00), %g1
4000bd14: c2 00 63 6c ld [ %g1 + 0x36c ], %g1 ! 40015f6c <Configuration_POSIX_API+0x10>
return _Objects_Is_unlimited( max ) ?
4000bd18: 80 a0 60 00 cmp %g1, 0
4000bd1c: 36 80 00 14 bge,a 4000bd6c <_POSIX_Keys_Keypool_extend+0x60><== NEVER TAKEN
4000bd20: b0 10 20 00 clr %i0 <== NOT EXECUTED
4000bd24: 3b 00 00 3f sethi %hi(0xfc00), %i5
4000bd28: ba 17 63 ff or %i5, 0x3ff, %i5 ! ffff <PROM_START+0xffff>
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 ) {
4000bd2c: ba 88 40 1d andcc %g1, %i5, %i5
4000bd30: 12 80 00 04 bne 4000bd40 <_POSIX_Keys_Keypool_extend+0x34><== ALWAYS TAKEN
4000bd34: 83 2f 60 05 sll %i5, 5, %g1
return _Objects_Maximum_per_allocation( max );
}
static bool _POSIX_Keys_Keypool_extend( Freechain_Control *keypool )
{
4000bd38: 10 80 00 0d b 4000bd6c <_POSIX_Keys_Keypool_extend+0x60> <== NOT EXECUTED
4000bd3c: 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 );
4000bd40: 91 2f 60 02 sll %i5, 2, %o0
POSIX_Keys_Key_value_pair *nodes = _Workspace_Allocate( size );
4000bd44: 7f ff fa f8 call 4000a924 <_Workspace_Allocate>
4000bd48: 90 02 00 01 add %o0, %g1, %o0
ok = nodes != NULL;
if ( ok ) {
4000bd4c: 92 92 20 00 orcc %o0, 0, %o1
4000bd50: 22 80 00 07 be,a 4000bd6c <_POSIX_Keys_Keypool_extend+0x60><== NEVER TAKEN
4000bd54: b0 10 20 00 clr %i0 <== NOT EXECUTED
_Chain_Initialize(
4000bd58: 90 10 00 18 mov %i0, %o0
4000bd5c: 94 10 00 1d mov %i5, %o2
4000bd60: 96 10 20 24 mov 0x24, %o3
4000bd64: 7f ff ef c4 call 40007c74 <_Chain_Initialize>
4000bd68: b0 10 20 01 mov 1, %i0
);
}
}
return ok;
}
4000bd6c: b0 0e 20 01 and %i0, 1, %i0
4000bd70: 81 c7 e0 08 ret
4000bd74: 81 e8 00 00 restore
4000c588 <_POSIX_Message_queue_Receive_support>:
size_t msg_len,
unsigned int *msg_prio,
bool wait,
Watchdog_Interval timeout
)
{
4000c588: 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(
4000c58c: 11 10 00 a3 sethi %hi(0x40028c00), %o0
4000c590: 92 10 00 18 mov %i0, %o1
4000c594: 90 12 21 d4 or %o0, 0x1d4, %o0
4000c598: 40 00 0c d0 call 4000f8d8 <_Objects_Get>
4000c59c: 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 ) {
4000c5a0: c2 07 bf f8 ld [ %fp + -8 ], %g1
4000c5a4: 80 a0 60 00 cmp %g1, 0
4000c5a8: 12 80 00 3d bne 4000c69c <_POSIX_Message_queue_Receive_support+0x114>
4000c5ac: 01 00 00 00 nop
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
4000c5b0: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
4000c5b4: 84 08 60 03 and %g1, 3, %g2
4000c5b8: 80 a0 a0 01 cmp %g2, 1
4000c5bc: 32 80 00 05 bne,a 4000c5d0 <_POSIX_Message_queue_Receive_support+0x48>
4000c5c0: d0 02 20 10 ld [ %o0 + 0x10 ], %o0
RTEMS_INLINE_ROUTINE void _Objects_Put(
Objects_Control *the_object
)
{
(void) the_object;
_Thread_Enable_dispatch();
4000c5c4: 40 00 10 52 call 4001070c <_Thread_Enable_dispatch>
4000c5c8: 01 00 00 00 nop
4000c5cc: 30 80 00 34 b,a 4000c69c <_POSIX_Message_queue_Receive_support+0x114>
rtems_set_errno_and_return_minus_one( EBADF );
}
the_mq = the_mq_fd->Queue;
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
4000c5d0: c4 02 20 68 ld [ %o0 + 0x68 ], %g2
4000c5d4: 80 a6 80 02 cmp %i2, %g2
4000c5d8: 1a 80 00 08 bcc 4000c5f8 <_POSIX_Message_queue_Receive_support+0x70>
4000c5dc: 84 10 3f ff mov -1, %g2
4000c5e0: 40 00 10 4b call 4001070c <_Thread_Enable_dispatch>
4000c5e4: 01 00 00 00 nop
_Objects_Put( &the_mq_fd->Object );
rtems_set_errno_and_return_minus_one( EMSGSIZE );
4000c5e8: 40 00 28 23 call 40016674 <__errno>
4000c5ec: 01 00 00 00 nop
4000c5f0: 10 80 00 2e b 4000c6a8 <_POSIX_Message_queue_Receive_support+0x120>
4000c5f4: 82 10 20 7a mov 0x7a, %g1 ! 7a <PROM_START+0x7a>
length_out = -1;
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
4000c5f8: 80 a7 20 00 cmp %i4, 0
4000c5fc: 02 80 00 05 be 4000c610 <_POSIX_Message_queue_Receive_support+0x88>
4000c600: c4 27 bf fc st %g2, [ %fp + -4 ]
do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true;
4000c604: b9 30 60 0e srl %g1, 0xe, %i4
4000c608: b8 1f 20 01 xor %i4, 1, %i4
4000c60c: b8 0f 20 01 and %i4, 1, %i4
do_wait = wait;
/*
* Now perform the actual message receive
*/
executing = _Thread_Executing;
4000c610: 03 10 00 a3 sethi %hi(0x40028c00), %g1
4000c614: f4 00 62 68 ld [ %g1 + 0x268 ], %i2 ! 40028e68 <_Per_CPU_Information+0x18>
_CORE_message_queue_Seize(
4000c618: 90 02 20 1c add %o0, 0x1c, %o0
4000c61c: 92 10 00 1a mov %i2, %o1
4000c620: 94 10 00 18 mov %i0, %o2
4000c624: 96 10 00 19 mov %i1, %o3
4000c628: 98 07 bf fc add %fp, -4, %o4
4000c62c: 9a 10 00 1c mov %i4, %o5
4000c630: 40 00 08 6c call 4000e7e0 <_CORE_message_queue_Seize>
4000c634: fa 23 a0 5c st %i5, [ %sp + 0x5c ]
4000c638: 40 00 10 35 call 4001070c <_Thread_Enable_dispatch>
4000c63c: 01 00 00 00 nop
do_wait,
timeout
);
_Objects_Put( &the_mq_fd->Object );
if (msg_prio) {
4000c640: 80 a6 e0 00 cmp %i3, 0
4000c644: 22 80 00 08 be,a 4000c664 <_POSIX_Message_queue_Receive_support+0xdc><== NEVER TAKEN
4000c648: 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);
4000c64c: c4 06 a0 24 ld [ %i2 + 0x24 ], %g2
4000c650: 83 38 a0 1f sra %g2, 0x1f, %g1
4000c654: 84 18 40 02 xor %g1, %g2, %g2
4000c658: 82 20 80 01 sub %g2, %g1, %g1
*msg_prio = _POSIX_Message_queue_Priority_from_core(
4000c65c: c2 26 c0 00 st %g1, [ %i3 ]
executing->Wait.count
);
}
if ( !executing->Wait.return_code )
4000c660: c2 06 a0 34 ld [ %i2 + 0x34 ], %g1
4000c664: 80 a0 60 00 cmp %g1, 0
4000c668: 12 80 00 05 bne 4000c67c <_POSIX_Message_queue_Receive_support+0xf4>
4000c66c: 01 00 00 00 nop
return length_out;
4000c670: f0 07 bf fc ld [ %fp + -4 ], %i0
4000c674: 81 c7 e0 08 ret
4000c678: 81 e8 00 00 restore
rtems_set_errno_and_return_minus_one(
4000c67c: 40 00 27 fe call 40016674 <__errno>
4000c680: b0 10 3f ff mov -1, %i0
4000c684: ba 10 00 08 mov %o0, %i5
4000c688: 40 00 00 95 call 4000c8dc <_POSIX_Message_queue_Translate_core_message_queue_return_code>
4000c68c: d0 06 a0 34 ld [ %i2 + 0x34 ], %o0
4000c690: d0 27 40 00 st %o0, [ %i5 ]
4000c694: 81 c7 e0 08 ret
4000c698: 81 e8 00 00 restore
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
4000c69c: 40 00 27 f6 call 40016674 <__errno>
4000c6a0: 01 00 00 00 nop
4000c6a4: 82 10 20 09 mov 9, %g1 ! 9 <PROM_START+0x9>
4000c6a8: c2 22 00 00 st %g1, [ %o0 ]
4000c6ac: b0 10 3f ff mov -1, %i0
}
4000c6b0: 81 c7 e0 08 ret
4000c6b4: 81 e8 00 00 restore
4000bedc <_POSIX_Once_Manager_initialization>:
#include <rtems.h>
#include <rtems/posix/posixapi.h>
#include <rtems/posix/onceimpl.h>
void _POSIX_Once_Manager_initialization(void)
{
4000bedc: 9d e3 bf 88 save %sp, -120, %sp
pthread_mutexattr_t mattr;
int eno;
_POSIX_Once_Lock = PTHREAD_MUTEX_INITIALIZER;
4000bee0: 03 10 00 5c sethi %hi(0x40017000), %g1
4000bee4: 84 10 3f ff mov -1, %g2
4000bee8: ba 10 60 a4 or %g1, 0xa4, %i5
4000beec: c4 20 60 a4 st %g2, [ %g1 + 0xa4 ]
eno = pthread_mutexattr_init( &mattr );
4000bef0: 40 00 09 30 call 4000e3b0 <pthread_mutexattr_init>
4000bef4: 90 07 bf e8 add %fp, -24, %o0
_Assert( eno == 0 );
eno = pthread_mutexattr_settype( &mattr, PTHREAD_MUTEX_RECURSIVE );
4000bef8: 92 10 20 01 mov 1, %o1
4000befc: 40 00 09 39 call 4000e3e0 <pthread_mutexattr_settype>
4000bf00: 90 07 bf e8 add %fp, -24, %o0
_Assert( eno == 0 );
eno = pthread_mutex_init( &_POSIX_Once_Lock, &mattr );
4000bf04: 92 07 bf e8 add %fp, -24, %o1
4000bf08: 40 00 09 44 call 4000e418 <pthread_mutex_init>
4000bf0c: 90 10 00 1d mov %i5, %o0
if ( eno != 0 )
4000bf10: 92 92 20 00 orcc %o0, 0, %o1
4000bf14: 02 80 00 04 be 4000bf24 <_POSIX_Once_Manager_initialization+0x48><== ALWAYS TAKEN
4000bf18: 01 00 00 00 nop
_POSIX_Fatal_error( POSIX_FD_PTHREAD_ONCE, eno );
4000bf1c: 7f ff ee 9f call 40007998 <_POSIX_Fatal_error> <== NOT EXECUTED
4000bf20: 90 10 20 01 mov 1, %o0 ! 1 <PROM_START+0x1> <== NOT EXECUTED
eno = pthread_mutexattr_destroy( &mattr );
4000bf24: 40 00 09 17 call 4000e380 <pthread_mutexattr_destroy>
4000bf28: 90 07 bf e8 add %fp, -24, %o0
4000bf2c: 81 c7 e0 08 ret
4000bf30: 81 e8 00 00 restore
4000ee54 <_POSIX_Semaphore_Create_support>:
size_t name_len,
int pshared,
unsigned int value,
POSIX_Semaphore_Control **the_sem
)
{
4000ee54: 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)
4000ee58: 80 a6 a0 00 cmp %i2, 0
4000ee5c: 22 80 00 06 be,a 4000ee74 <_POSIX_Semaphore_Create_support+0x20>
4000ee60: 03 10 00 73 sethi %hi(0x4001cc00), %g1
rtems_set_errno_and_return_minus_one( ENOSYS );
4000ee64: 40 00 0a 13 call 400116b0 <__errno>
4000ee68: 01 00 00 00 nop
4000ee6c: 10 80 00 12 b 4000eeb4 <_POSIX_Semaphore_Create_support+0x60>
4000ee70: 82 10 20 58 mov 0x58, %g1 ! 58 <PROM_START+0x58>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4000ee74: 82 10 62 d0 or %g1, 0x2d0, %g1
4000ee78: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
4000ee7c: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
4000ee80: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
* the inactive chain of free semaphore control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
4000ee84: 21 10 00 73 sethi %hi(0x4001cc00), %l0
4000ee88: 90 14 20 34 or %l0, 0x34, %o0 ! 4001cc34 <_POSIX_Semaphore_Information>
4000ee8c: 7f ff ef cd call 4000adc0 <_Objects_Allocate>
4000ee90: a2 10 00 10 mov %l0, %l1
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
4000ee94: ba 92 20 00 orcc %o0, 0, %i5
4000ee98: 12 80 00 0a bne 4000eec0 <_POSIX_Semaphore_Create_support+0x6c>
4000ee9c: 80 a6 20 00 cmp %i0, 0
_Thread_Enable_dispatch();
4000eea0: 7f ff f4 b7 call 4000c17c <_Thread_Enable_dispatch>
4000eea4: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( ENOSPC );
4000eea8: 40 00 0a 02 call 400116b0 <__errno>
4000eeac: 01 00 00 00 nop
4000eeb0: 82 10 20 1c mov 0x1c, %g1 ! 1c <PROM_START+0x1c>
4000eeb4: c2 22 00 00 st %g1, [ %o0 ]
4000eeb8: 81 c7 e0 08 ret
4000eebc: 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 ) {
4000eec0: 02 80 00 10 be 4000ef00 <_POSIX_Semaphore_Create_support+0xac>
4000eec4: 90 10 00 18 mov %i0, %o0
name = _Workspace_String_duplicate( name_arg, name_len );
4000eec8: 40 00 04 c8 call 400101e8 <_Workspace_String_duplicate>
4000eecc: 92 10 00 19 mov %i1, %o1
if ( !name ) {
4000eed0: b4 92 20 00 orcc %o0, 0, %i2
4000eed4: 12 80 00 0d bne 4000ef08 <_POSIX_Semaphore_Create_support+0xb4><== ALWAYS TAKEN
4000eed8: 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 );
4000eedc: 90 14 20 34 or %l0, 0x34, %o0 <== NOT EXECUTED
4000eee0: 7f ff f0 a2 call 4000b168 <_Objects_Free> <== NOT EXECUTED
4000eee4: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
4000eee8: 7f ff f4 a5 call 4000c17c <_Thread_Enable_dispatch> <== NOT EXECUTED
4000eeec: 01 00 00 00 nop <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4000eef0: 40 00 09 f0 call 400116b0 <__errno> <== NOT EXECUTED
4000eef4: 01 00 00 00 nop <== NOT EXECUTED
4000eef8: 10 bf ff ef b 4000eeb4 <_POSIX_Semaphore_Create_support+0x60><== NOT EXECUTED
4000eefc: 82 10 20 0c mov 0xc, %g1 ! c <PROM_START+0xc> <== NOT EXECUTED
}
} else {
name = NULL;
4000ef00: b4 10 20 00 clr %i2
}
the_semaphore->process_shared = pshared;
if ( name ) {
4000ef04: 80 a6 a0 00 cmp %i2, 0
4000ef08: 02 80 00 08 be 4000ef28 <_POSIX_Semaphore_Create_support+0xd4>
4000ef0c: c0 27 60 10 clr [ %i5 + 0x10 ]
the_semaphore->named = true;
4000ef10: 82 10 20 01 mov 1, %g1
4000ef14: c2 2f 60 14 stb %g1, [ %i5 + 0x14 ]
the_semaphore->open_count = 1;
4000ef18: 82 10 20 01 mov 1, %g1
4000ef1c: c2 27 60 18 st %g1, [ %i5 + 0x18 ]
4000ef20: 10 80 00 05 b 4000ef34 <_POSIX_Semaphore_Create_support+0xe0>
4000ef24: c2 2f 60 15 stb %g1, [ %i5 + 0x15 ]
the_semaphore->linked = true;
} else {
the_semaphore->named = false;
4000ef28: c0 2f 60 14 clrb [ %i5 + 0x14 ]
the_semaphore->open_count = 0;
4000ef2c: c0 27 60 18 clr [ %i5 + 0x18 ]
the_semaphore->linked = false;
4000ef30: 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;
4000ef34: 82 10 3f ff mov -1, %g1
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
4000ef38: 90 07 60 1c add %i5, 0x1c, %o0
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
4000ef3c: c2 27 60 5c st %g1, [ %i5 + 0x5c ]
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
4000ef40: 92 07 60 5c add %i5, 0x5c, %o1
4000ef44: 94 10 00 1b mov %i3, %o2
4000ef48: 7f ff ed cb call 4000a674 <_CORE_semaphore_Initialize>
4000ef4c: c0 27 60 60 clr [ %i5 + 0x60 ]
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
_Objects_Set_local_object(
4000ef50: c2 17 60 0a lduh [ %i5 + 0xa ], %g1
* @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,
4000ef54: a2 14 60 34 or %l1, 0x34, %l1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4000ef58: c4 04 60 1c ld [ %l1 + 0x1c ], %g2
4000ef5c: 83 28 60 02 sll %g1, 2, %g1
4000ef60: fa 20 80 01 st %i5, [ %g2 + %g1 ]
the_object
);
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
/* ASSERT: information->is_string */
the_object->name.name_p = name;
4000ef64: f4 27 60 0c st %i2, [ %i5 + 0xc ]
&_POSIX_Semaphore_Information,
&the_semaphore->Object,
name
);
*the_sem = the_semaphore;
4000ef68: fa 27 00 00 st %i5, [ %i4 ]
_Thread_Enable_dispatch();
4000ef6c: 7f ff f4 84 call 4000c17c <_Thread_Enable_dispatch>
4000ef70: b0 10 20 00 clr %i0
return 0;
}
4000ef74: 81 c7 e0 08 ret
4000ef78: 81 e8 00 00 restore
4000bc40 <_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 ];
4000bc40: c2 02 21 50 ld [ %o0 + 0x150 ], %g1
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
4000bc44: c4 00 60 e4 ld [ %g1 + 0xe4 ], %g2
4000bc48: 80 a0 a0 00 cmp %g2, 0
4000bc4c: 12 80 00 13 bne 4000bc98 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x58><== NEVER TAKEN
4000bc50: 01 00 00 00 nop
4000bc54: c4 00 60 e8 ld [ %g1 + 0xe8 ], %g2
4000bc58: 80 a0 a0 01 cmp %g2, 1
4000bc5c: 12 80 00 0f bne 4000bc98 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x58>
4000bc60: 01 00 00 00 nop
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
4000bc64: c2 00 60 ec ld [ %g1 + 0xec ], %g1
4000bc68: 80 a0 60 00 cmp %g1, 0
4000bc6c: 02 80 00 0b be 4000bc98 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x58>
4000bc70: 01 00 00 00 nop
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4000bc74: 03 10 00 5f sethi %hi(0x40017c00), %g1
4000bc78: 82 10 62 10 or %g1, 0x210, %g1 ! 40017e10 <_Per_CPU_Information>
4000bc7c: c4 00 60 10 ld [ %g1 + 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 );
4000bc80: 92 10 3f ff mov -1, %o1
--level;
4000bc84: 84 00 bf ff add %g2, -1, %g2
_Thread_Dispatch_disable_level = level;
4000bc88: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
4000bc8c: 82 13 c0 00 mov %o7, %g1
4000bc90: 40 00 01 d4 call 4000c3e0 <_POSIX_Thread_Exit>
4000bc94: 9e 10 40 00 mov %g1, %o7
RTEMS_INLINE_ROUTINE void _Objects_Put(
Objects_Control *the_object
)
{
(void) the_object;
_Thread_Enable_dispatch();
4000bc98: 82 13 c0 00 mov %o7, %g1
4000bc9c: 7f ff f7 4b call 400099c8 <_Thread_Enable_dispatch>
4000bca0: 9e 10 40 00 mov %g1, %o7
4000d1c8 <_POSIX_Thread_Translate_sched_param>:
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
4000d1c8: 9d e3 bf a0 save %sp, -96, %sp
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
4000d1cc: 7f ff ff f4 call 4000d19c <_POSIX_Priority_Is_valid>
4000d1d0: d0 06 40 00 ld [ %i1 ], %o0
4000d1d4: 80 a2 20 00 cmp %o0, 0
4000d1d8: 32 80 00 04 bne,a 4000d1e8 <_POSIX_Thread_Translate_sched_param+0x20><== ALWAYS TAKEN
4000d1dc: c0 26 80 00 clr [ %i2 ]
return EINVAL;
4000d1e0: 81 c7 e0 08 ret
4000d1e4: 91 e8 20 16 restore %g0, 0x16, %o0
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
*budget_callout = NULL;
if ( policy == SCHED_OTHER ) {
4000d1e8: 80 a6 20 00 cmp %i0, 0
4000d1ec: 12 80 00 06 bne 4000d204 <_POSIX_Thread_Translate_sched_param+0x3c>
4000d1f0: c0 26 c0 00 clr [ %i3 ]
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
4000d1f4: 82 10 20 01 mov 1, %g1
4000d1f8: c2 26 80 00 st %g1, [ %i2 ]
return 0;
4000d1fc: 81 c7 e0 08 ret
4000d200: 81 e8 00 00 restore
}
if ( policy == SCHED_FIFO ) {
4000d204: 80 a6 20 01 cmp %i0, 1
4000d208: 02 80 00 29 be 4000d2ac <_POSIX_Thread_Translate_sched_param+0xe4>
4000d20c: 80 a6 20 02 cmp %i0, 2
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
}
if ( policy == SCHED_RR ) {
4000d210: 12 80 00 04 bne 4000d220 <_POSIX_Thread_Translate_sched_param+0x58>
4000d214: 80 a6 20 04 cmp %i0, 4
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
4000d218: 10 80 00 25 b 4000d2ac <_POSIX_Thread_Translate_sched_param+0xe4>
4000d21c: f0 26 80 00 st %i0, [ %i2 ]
return 0;
}
if ( policy == SCHED_SPORADIC ) {
4000d220: 12 bf ff f0 bne 4000d1e0 <_POSIX_Thread_Translate_sched_param+0x18>
4000d224: 01 00 00 00 nop
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
4000d228: c2 06 60 08 ld [ %i1 + 8 ], %g1
4000d22c: 80 a0 60 00 cmp %g1, 0
4000d230: 32 80 00 07 bne,a 4000d24c <_POSIX_Thread_Translate_sched_param+0x84>
4000d234: c2 06 60 10 ld [ %i1 + 0x10 ], %g1
4000d238: c2 06 60 0c ld [ %i1 + 0xc ], %g1
4000d23c: 80 a0 60 00 cmp %g1, 0
4000d240: 02 bf ff e8 be 4000d1e0 <_POSIX_Thread_Translate_sched_param+0x18>
4000d244: 01 00 00 00 nop
(param->sched_ss_repl_period.tv_nsec == 0) )
return EINVAL;
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
4000d248: c2 06 60 10 ld [ %i1 + 0x10 ], %g1
4000d24c: 80 a0 60 00 cmp %g1, 0
4000d250: 12 80 00 06 bne 4000d268 <_POSIX_Thread_Translate_sched_param+0xa0>
4000d254: 01 00 00 00 nop
4000d258: c2 06 60 14 ld [ %i1 + 0x14 ], %g1
4000d25c: 80 a0 60 00 cmp %g1, 0
4000d260: 02 bf ff e0 be 4000d1e0 <_POSIX_Thread_Translate_sched_param+0x18>
4000d264: 01 00 00 00 nop
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
4000d268: 7f ff f7 eb call 4000b214 <_Timespec_To_ticks>
4000d26c: 90 06 60 08 add %i1, 8, %o0
4000d270: ba 10 00 08 mov %o0, %i5
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
4000d274: 7f ff f7 e8 call 4000b214 <_Timespec_To_ticks>
4000d278: 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 ) <
4000d27c: 80 a7 40 08 cmp %i5, %o0
4000d280: 0a bf ff d8 bcs 4000d1e0 <_POSIX_Thread_Translate_sched_param+0x18>
4000d284: 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 ) )
4000d288: 7f ff ff c5 call 4000d19c <_POSIX_Priority_Is_valid>
4000d28c: d0 06 60 04 ld [ %i1 + 4 ], %o0
4000d290: 80 a2 20 00 cmp %o0, 0
4000d294: 02 bf ff d3 be 4000d1e0 <_POSIX_Thread_Translate_sched_param+0x18>
4000d298: 82 10 20 03 mov 3, %g1
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
4000d29c: c2 26 80 00 st %g1, [ %i2 ]
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
4000d2a0: 03 10 00 1e sethi %hi(0x40007800), %g1
4000d2a4: 82 10 60 58 or %g1, 0x58, %g1 ! 40007858 <_POSIX_Threads_Sporadic_budget_callout>
4000d2a8: c2 26 c0 00 st %g1, [ %i3 ]
return 0;
}
return EINVAL;
}
4000d2ac: 81 c7 e0 08 ret
4000d2b0: 91 e8 20 00 restore %g0, 0, %o0
4000c178 <_POSIX_Threads_Delete_extension>:
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
4000c178: 9d e3 bf a0 save %sp, -96, %sp
Thread_Control *the_thread;
POSIX_API_Control *api;
void **value_ptr;
api = deleted->API_Extensions[ THREAD_API_POSIX ];
4000c17c: f0 06 61 50 ld [ %i1 + 0x150 ], %i0
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
4000c180: 40 00 08 37 call 4000e25c <_POSIX_Threads_cancel_run>
4000c184: 90 10 00 19 mov %i1, %o0
/*
* Run all the key destructors
*/
_POSIX_Keys_Run_destructors( deleted );
4000c188: 40 00 08 4b call 4000e2b4 <_POSIX_Keys_Run_destructors>
4000c18c: 90 10 00 19 mov %i1, %o0
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
4000c190: f8 06 60 28 ld [ %i1 + 0x28 ], %i4
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
4000c194: ba 06 20 50 add %i0, 0x50, %i5
4000c198: 7f ff f6 cc call 40009cc8 <_Thread_queue_Dequeue>
4000c19c: 90 10 00 1d mov %i5, %o0
4000c1a0: 80 a2 20 00 cmp %o0, 0
4000c1a4: 22 80 00 05 be,a 4000c1b8 <_POSIX_Threads_Delete_extension+0x40><== ALWAYS TAKEN
4000c1a8: c2 06 20 90 ld [ %i0 + 0x90 ], %g1
*(void **)the_thread->Wait.return_argument = value_ptr;
4000c1ac: c2 02 20 28 ld [ %o0 + 0x28 ], %g1 <== NOT EXECUTED
4000c1b0: 10 bf ff fa b 4000c198 <_POSIX_Threads_Delete_extension+0x20><== NOT EXECUTED
4000c1b4: f8 20 40 00 st %i4, [ %g1 ] <== NOT EXECUTED
if ( api->schedpolicy == SCHED_SPORADIC )
4000c1b8: 80 a0 60 04 cmp %g1, 4
4000c1bc: 32 80 00 05 bne,a 4000c1d0 <_POSIX_Threads_Delete_extension+0x58>
4000c1c0: c0 26 61 50 clr [ %i1 + 0x150 ]
(void) _Watchdog_Remove( &api->Sporadic_timer );
4000c1c4: 7f ff f9 40 call 4000a6c4 <_Watchdog_Remove>
4000c1c8: 90 06 20 b4 add %i0, 0xb4, %o0
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
4000c1cc: c0 26 61 50 clr [ %i1 + 0x150 ]
_Workspace_Free( api );
4000c1d0: 7f ff f9 dd call 4000a944 <_Workspace_Free>
4000c1d4: 81 e8 00 00 restore
4000759c <_POSIX_Threads_Initialize_user_threads_body>:
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/config.h>
#include <rtems/posix/time.h>
void _POSIX_Threads_Initialize_user_threads_body(void)
{
4000759c: 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;
400075a0: 03 10 00 7a sethi %hi(0x4001e800), %g1
400075a4: 82 10 60 e4 or %g1, 0xe4, %g1 ! 4001e8e4 <Configuration_POSIX_API>
maximum = Configuration_POSIX_API.number_of_initialization_threads;
400075a8: f6 00 60 34 ld [ %g1 + 0x34 ], %i3
if ( !user_threads || maximum == 0 )
400075ac: 80 a6 e0 00 cmp %i3, 0
400075b0: 02 80 00 1b be 4000761c <_POSIX_Threads_Initialize_user_threads_body+0x80><== NEVER TAKEN
400075b4: fa 00 60 38 ld [ %g1 + 0x38 ], %i5
400075b8: 80 a7 60 00 cmp %i5, 0
400075bc: 02 80 00 18 be 4000761c <_POSIX_Threads_Initialize_user_threads_body+0x80><== NEVER TAKEN
400075c0: 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 );
400075c4: 40 00 17 3c call 4000d2b4 <pthread_attr_init>
400075c8: 90 07 bf b4 add %fp, -76, %o0
_Assert( eno == 0 );
eno = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
400075cc: 92 10 20 02 mov 2, %o1
400075d0: 40 00 17 45 call 4000d2e4 <pthread_attr_setinheritsched>
400075d4: 90 07 bf b4 add %fp, -76, %o0
_Assert( eno == 0 );
eno = pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
400075d8: d2 07 60 04 ld [ %i5 + 4 ], %o1
400075dc: 40 00 17 51 call 4000d320 <pthread_attr_setstacksize>
400075e0: 90 07 bf b4 add %fp, -76, %o0
_Assert( eno == 0 );
eno = pthread_create(
400075e4: d4 07 40 00 ld [ %i5 ], %o2
400075e8: 92 07 bf b4 add %fp, -76, %o1
400075ec: 90 07 bf b0 add %fp, -80, %o0
400075f0: 7f ff ff 0f call 4000722c <pthread_create>
400075f4: 96 10 20 00 clr %o3
&thread_id,
&attr,
user_threads[ index ].thread_entry,
NULL
);
if ( eno )
400075f8: 92 92 20 00 orcc %o0, 0, %o1
400075fc: 22 80 00 05 be,a 40007610 <_POSIX_Threads_Initialize_user_threads_body+0x74>
40007600: b8 07 20 01 inc %i4
_POSIX_Fatal_error( POSIX_FD_PTHREAD, eno );
40007604: 40 00 04 9f call 40008880 <_POSIX_Fatal_error>
40007608: 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++ ) {
4000760c: b8 07 20 01 inc %i4 <== NOT EXECUTED
40007610: 80 a7 00 1b cmp %i4, %i3
40007614: 12 bf ff ec bne 400075c4 <_POSIX_Threads_Initialize_user_threads_body+0x28><== NEVER TAKEN
40007618: ba 07 60 08 add %i5, 8, %i5
4000761c: 81 c7 e0 08 ret
40007620: 81 e8 00 00 restore
4000c0e0 <_POSIX_Threads_Sporadic_budget_TSR>:
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
4000c0e0: 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 ];
4000c0e4: fa 06 61 50 ld [ %i1 + 0x150 ], %i5
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
4000c0e8: 40 00 04 07 call 4000d104 <_Timespec_To_ticks>
4000c0ec: 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);
4000c0f0: 03 10 00 57 sethi %hi(0x40015c00), %g1
4000c0f4: d2 08 63 54 ldub [ %g1 + 0x354 ], %o1 ! 40015f54 <rtems_maximum_priority>
4000c0f8: c2 07 60 94 ld [ %i5 + 0x94 ], %g1
the_thread->cpu_time_budget = ticks;
4000c0fc: d0 26 60 74 st %o0, [ %i1 + 0x74 ]
4000c100: 92 22 40 01 sub %o1, %g1, %o1
*/
#if 0
printk( "TSR %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
4000c104: c2 06 60 1c ld [ %i1 + 0x1c ], %g1
4000c108: 80 a0 60 00 cmp %g1, 0
4000c10c: 12 80 00 09 bne 4000c130 <_POSIX_Threads_Sporadic_budget_TSR+0x50><== NEVER TAKEN
4000c110: 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 ) {
4000c114: c2 06 60 14 ld [ %i1 + 0x14 ], %g1
4000c118: 80 a0 40 09 cmp %g1, %o1
4000c11c: 08 80 00 06 bleu 4000c134 <_POSIX_Threads_Sporadic_budget_TSR+0x54>
4000c120: 90 07 60 9c add %i5, 0x9c, %o0
_Thread_Change_priority( the_thread, new_priority, true );
4000c124: 90 10 00 19 mov %i1, %o0
4000c128: 7f ff f5 14 call 40009578 <_Thread_Change_priority>
4000c12c: 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 );
4000c130: 90 07 60 9c add %i5, 0x9c, %o0
4000c134: 40 00 03 f4 call 4000d104 <_Timespec_To_ticks>
4000c138: 31 10 00 5b sethi %hi(0x40016c00), %i0
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4000c13c: b0 16 21 d0 or %i0, 0x1d0, %i0 ! 40016dd0 <_Watchdog_Ticks_chain>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
4000c140: d0 27 60 c0 st %o0, [ %i5 + 0xc0 ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4000c144: 7f ff f9 0a call 4000a56c <_Watchdog_Insert>
4000c148: 93 ef 60 b4 restore %i5, 0xb4, %o1
40007858 <_POSIX_Threads_Sporadic_budget_callout>:
)
{
POSIX_API_Control *api;
uint32_t new_priority;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
40007858: c4 02 21 50 ld [ %o0 + 0x150 ], %g2
/*
* This will prevent the thread from consuming its entire "budget"
* while at low priority.
*/
the_thread->cpu_time_budget = UINT32_MAX;
4000785c: 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);
40007860: c4 00 a0 98 ld [ %g2 + 0x98 ], %g2
40007864: c6 22 20 74 st %g3, [ %o0 + 0x74 ]
40007868: 07 10 00 7a sethi %hi(0x4001e800), %g3
4000786c: d2 08 e0 dc ldub [ %g3 + 0xdc ], %o1 ! 4001e8dc <rtems_maximum_priority>
40007870: 92 22 40 02 sub %o1, %g2, %o1
*/
#if 0
printk( "callout %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
40007874: c4 02 20 1c ld [ %o0 + 0x1c ], %g2
40007878: 80 a0 a0 00 cmp %g2, 0
4000787c: 12 80 00 09 bne 400078a0 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN
40007880: 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 ) {
40007884: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
40007888: 80 a0 40 09 cmp %g1, %o1
4000788c: 1a 80 00 05 bcc 400078a0 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN
40007890: 94 10 20 01 mov 1, %o2
_Thread_Change_priority( the_thread, new_priority, true );
40007894: 82 13 c0 00 mov %o7, %g1
40007898: 40 00 0a cd call 4000a3cc <_Thread_Change_priority>
4000789c: 9e 10 40 00 mov %g1, %o7
400078a0: 81 c3 e0 08 retl <== NOT EXECUTED
40006ef4 <_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)
{
40006ef4: 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;
40006ef8: c2 06 60 68 ld [ %i1 + 0x68 ], %g1
40006efc: 82 00 60 01 inc %g1
40006f00: c2 26 60 68 st %g1, [ %i1 + 0x68 ]
/* The timer must be reprogrammed */
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
40006f04: c2 06 60 54 ld [ %i1 + 0x54 ], %g1
40006f08: 80 a0 60 00 cmp %g1, 0
40006f0c: 32 80 00 07 bne,a 40006f28 <_POSIX_Timer_TSR+0x34>
40006f10: d2 06 60 64 ld [ %i1 + 0x64 ], %o1
40006f14: c2 06 60 58 ld [ %i1 + 0x58 ], %g1
40006f18: 80 a0 60 00 cmp %g1, 0
40006f1c: 02 80 00 1f be 40006f98 <_POSIX_Timer_TSR+0xa4> <== NEVER TAKEN
40006f20: 82 10 20 04 mov 4, %g1
( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) {
activated = _POSIX_Timer_Insert_helper(
40006f24: d2 06 60 64 ld [ %i1 + 0x64 ], %o1
40006f28: d4 06 60 08 ld [ %i1 + 8 ], %o2
40006f2c: 90 06 60 10 add %i1, 0x10, %o0
40006f30: 17 10 00 1b sethi %hi(0x40006c00), %o3
40006f34: 98 10 00 19 mov %i1, %o4
40006f38: 40 00 17 4c call 4000cc68 <_POSIX_Timer_Insert_helper>
40006f3c: 96 12 e2 f4 or %o3, 0x2f4, %o3
ptimer->ticks,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated )
40006f40: 80 a2 20 00 cmp %o0, 0
40006f44: 02 80 00 1a be 40006fac <_POSIX_Timer_TSR+0xb8> <== NEVER TAKEN
40006f48: 90 07 bf f8 add %fp, -8, %o0
tod_as_timestamp_ptr =
40006f4c: 13 10 00 62 sethi %hi(0x40018800), %o1
40006f50: 40 00 05 d3 call 4000869c <_TOD_Get_with_nanoseconds>
40006f54: 92 12 61 80 or %o1, 0x180, %o1 ! 40018980 <_TOD>
static inline void _TOD_Get(
struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
40006f58: 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);
40006f5c: 94 10 20 00 clr %o2
40006f60: 90 10 00 1c mov %i4, %o0
40006f64: 92 10 00 1d mov %i5, %o1
40006f68: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
40006f6c: 40 00 35 3c call 4001445c <__divdi3>
40006f70: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
40006f74: 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);
40006f78: d2 26 60 6c st %o1, [ %i1 + 0x6c ]
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
40006f7c: 94 10 20 00 clr %o2
40006f80: 92 10 00 1d mov %i5, %o1
40006f84: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
40006f88: 40 00 36 27 call 40014824 <__moddi3>
40006f8c: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
/* 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;
40006f90: 82 10 20 03 mov 3, %g1
40006f94: 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 ) ) {
40006f98: d0 06 60 38 ld [ %i1 + 0x38 ], %o0
40006f9c: d2 06 60 44 ld [ %i1 + 0x44 ], %o1
40006fa0: 40 00 16 38 call 4000c880 <pthread_kill>
40006fa4: 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;
40006fa8: c0 26 60 68 clr [ %i1 + 0x68 ]
40006fac: 81 c7 e0 08 ret
40006fb0: 81 e8 00 00 restore
4001649c <_POSIX_signals_Check_signal>:
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
4001649c: 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,
400164a0: 98 10 20 01 mov 1, %o4
400164a4: 90 10 00 18 mov %i0, %o0
400164a8: 92 10 00 19 mov %i1, %o1
400164ac: 94 07 bf cc add %fp, -52, %o2
400164b0: 96 10 00 1a mov %i2, %o3
400164b4: 40 00 00 2e call 4001656c <_POSIX_signals_Clear_signals>
400164b8: 9a 10 20 01 mov 1, %o5
400164bc: 80 a2 20 00 cmp %o0, 0
400164c0: 02 80 00 28 be 40016560 <_POSIX_signals_Check_signal+0xc4>
400164c4: 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 )
400164c8: 83 2e 60 04 sll %i1, 4, %g1
400164cc: 23 10 00 bd sethi %hi(0x4002f400), %l1
400164d0: a1 2e 60 02 sll %i1, 2, %l0
400164d4: a2 14 60 b8 or %l1, 0xb8, %l1
400164d8: a0 20 40 10 sub %g1, %l0, %l0
400164dc: 82 04 40 10 add %l1, %l0, %g1
400164e0: fa 00 60 08 ld [ %g1 + 8 ], %i5
400164e4: 80 a7 60 01 cmp %i5, 1
400164e8: 02 80 00 1d be 4001655c <_POSIX_signals_Check_signal+0xc0><== NEVER TAKEN
400164ec: 90 07 bf d8 add %fp, -40, %o0
return false;
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
400164f0: f6 06 20 dc ld [ %i0 + 0xdc ], %i3
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
400164f4: c2 00 60 04 ld [ %g1 + 4 ], %g1
400164f8: 82 10 40 1b or %g1, %i3, %g1
400164fc: c2 26 20 dc st %g1, [ %i0 + 0xdc ]
40016500: 03 10 00 bd sethi %hi(0x4002f400), %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,
40016504: f4 00 60 88 ld [ %g1 + 0x88 ], %i2 ! 4002f488 <_Per_CPU_Information+0x18>
40016508: 94 10 20 28 mov 0x28, %o2
4001650c: b4 06 a0 20 add %i2, 0x20, %i2
40016510: 40 00 0a 40 call 40018e10 <memcpy>
40016514: 92 10 00 1a mov %i2, %o1
sizeof( stored_thread_wait_information ));
/*
* Here, the signal handler function executes
*/
switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
40016518: c2 04 40 10 ld [ %l1 + %l0 ], %g1
4001651c: 80 a0 60 02 cmp %g1, 2
40016520: 12 80 00 07 bne 4001653c <_POSIX_signals_Check_signal+0xa0>
40016524: 90 10 00 19 mov %i1, %o0
case SA_SIGINFO:
(*_POSIX_signals_Vectors[ signo ].sa_sigaction)(
40016528: 92 07 bf cc add %fp, -52, %o1
4001652c: 9f c7 40 00 call %i5
40016530: 94 10 20 00 clr %o2
signo,
&siginfo_struct,
NULL /* context is undefined per 1003.1b-1993, p. 66 */
);
break;
40016534: 10 80 00 05 b 40016548 <_POSIX_signals_Check_signal+0xac>
40016538: 90 10 00 1a mov %i2, %o0
default:
(*_POSIX_signals_Vectors[ signo ].sa_handler)( signo );
4001653c: 9f c7 40 00 call %i5
40016540: 01 00 00 00 nop
}
/*
* Restore the blocking information
*/
memcpy( &executing->Wait, &stored_thread_wait_information,
40016544: 90 10 00 1a mov %i2, %o0
40016548: 92 07 bf d8 add %fp, -40, %o1
4001654c: 40 00 0a 31 call 40018e10 <memcpy>
40016550: 94 10 20 28 mov 0x28, %o2
/*
* Restore the previous set of blocked signals
*/
api->signals_blocked = saved_signals_blocked;
return true;
40016554: 10 80 00 03 b 40016560 <_POSIX_signals_Check_signal+0xc4>
40016558: 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;
4001655c: b8 10 20 00 clr %i4 <== NOT EXECUTED
* Restore the previous set of blocked signals
*/
api->signals_blocked = saved_signals_blocked;
return true;
}
40016560: b0 0f 20 ff and %i4, 0xff, %i0
40016564: 81 c7 e0 08 ret
40016568: 81 e8 00 00 restore
40017220 <_POSIX_signals_Clear_process_signals>:
40017220: 82 02 3f ff add %o0, -1, %g1
40017224: 84 10 20 01 mov 1, %g2
40017228: 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 ) {
4001722c: 83 2a 20 02 sll %o0, 2, %g1
40017230: 91 2a 20 04 sll %o0, 4, %o0
40017234: 90 22 00 01 sub %o0, %g1, %o0
40017238: 03 10 00 bd sethi %hi(0x4002f400), %g1
4001723c: 82 10 60 b8 or %g1, 0xb8, %g1 ! 4002f4b8 <_POSIX_signals_Vectors>
40017240: c2 00 40 08 ld [ %g1 + %o0 ], %g1
40017244: 80 a0 60 02 cmp %g1, 2
40017248: 12 80 00 0a bne 40017270 <_POSIX_signals_Clear_process_signals+0x50>
4001724c: 03 10 00 bd sethi %hi(0x4002f400), %g1
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
40017250: 03 10 00 bd sethi %hi(0x4002f400), %g1
40017254: 82 10 62 88 or %g1, 0x288, %g1 ! 4002f688 <_POSIX_signals_Siginfo>
40017258: 86 02 00 01 add %o0, %g1, %g3
4001725c: 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 );
40017260: 86 00 e0 04 add %g3, 4, %g3
40017264: 80 a0 40 03 cmp %g1, %g3
40017268: 12 80 00 05 bne 4001727c <_POSIX_signals_Clear_process_signals+0x5c><== NEVER TAKEN
4001726c: 03 10 00 bd sethi %hi(0x4002f400), %g1
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
40017270: c6 00 62 84 ld [ %g1 + 0x284 ], %g3 ! 4002f684 <_POSIX_signals_Pending>
40017274: 84 28 c0 02 andn %g3, %g2, %g2
40017278: c4 20 62 84 st %g2, [ %g1 + 0x284 ]
4001727c: 81 c3 e0 08 retl
40007d2c <_POSIX_signals_Get_lowest>:
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
40007d2c: 82 10 20 1b mov 0x1b, %g1
40007d30: 84 10 20 01 mov 1, %g2
40007d34: 86 00 7f ff add %g1, -1, %g3
40007d38: 87 28 80 03 sll %g2, %g3, %g3
if ( set & signo_to_mask( signo ) ) {
40007d3c: 80 88 c0 08 btst %g3, %o0
40007d40: 12 80 00 11 bne 40007d84 <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN
40007d44: 01 00 00 00 nop
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
40007d48: 82 00 60 01 inc %g1
40007d4c: 80 a0 60 20 cmp %g1, 0x20
40007d50: 12 bf ff fa bne 40007d38 <_POSIX_signals_Get_lowest+0xc>
40007d54: 86 00 7f ff add %g1, -1, %g3
40007d58: 82 10 20 01 mov 1, %g1
40007d5c: 84 10 20 01 mov 1, %g2
40007d60: 86 00 7f ff add %g1, -1, %g3
40007d64: 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 ) ) {
40007d68: 80 88 c0 08 btst %g3, %o0
40007d6c: 12 80 00 06 bne 40007d84 <_POSIX_signals_Get_lowest+0x58>
40007d70: 01 00 00 00 nop
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
40007d74: 82 00 60 01 inc %g1
40007d78: 80 a0 60 1b cmp %g1, 0x1b
40007d7c: 12 bf ff fa bne 40007d64 <_POSIX_signals_Get_lowest+0x38> <== ALWAYS TAKEN
40007d80: 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;
}
40007d84: 81 c3 e0 08 retl
40007d88: 90 10 00 01 mov %g1, %o0
40012e94 <_POSIX_signals_Post_switch_hook>:
*/
static void _POSIX_signals_Post_switch_hook(
Thread_Control *the_thread
)
{
40012e94: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
_ISR_Disable_without_giant( level );
#endif
executing = _Thread_Executing;
40012e98: 03 10 00 bd sethi %hi(0x4002f400), %g1
ISR_Level level;
int hold_errno;
Thread_Control *executing;
executing = _Thread_Get_executing();
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
40012e9c: fa 06 21 50 ld [ %i0 + 0x150 ], %i5
40012ea0: f6 00 60 88 ld [ %g1 + 0x88 ], %i3
hold_errno = executing->Wait.return_code;
/*
* api may be NULL in case of a thread close in progress
*/
if ( !api )
40012ea4: 80 a7 60 00 cmp %i5, 0
40012ea8: 02 80 00 0f be 40012ee4 <_POSIX_signals_Post_switch_hook+0x50><== NEVER TAKEN
40012eac: f4 06 e0 34 ld [ %i3 + 0x34 ], %i2
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_POSIX_signals_Acquire( level );
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
40012eb0: 33 10 00 bd sethi %hi(0x4002f400), %i1
*
* 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( level );
40012eb4: 7f ff be 1a call 4000271c <sparc_disable_interrupts>
40012eb8: 01 00 00 00 nop
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
40012ebc: c4 06 62 84 ld [ %i1 + 0x284 ], %g2
40012ec0: c2 07 60 e0 ld [ %i5 + 0xe0 ], %g1
40012ec4: 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( level );
if ( !(~api->signals_blocked &
40012ec8: c4 07 60 dc ld [ %i5 + 0xdc ], %g2
40012ecc: 80 a8 40 02 andncc %g1, %g2, %g0
40012ed0: 12 80 00 07 bne 40012eec <_POSIX_signals_Post_switch_hook+0x58>
40012ed4: 01 00 00 00 nop
(api->signals_pending | _POSIX_signals_Pending)) ) {
_POSIX_signals_Release( level );
40012ed8: 7f ff be 15 call 4000272c <sparc_enable_interrupts>
40012edc: 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;
40012ee0: f4 26 e0 34 st %i2, [ %i3 + 0x34 ]
40012ee4: 81 c7 e0 08 ret
40012ee8: 81 e8 00 00 restore
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
_POSIX_signals_Release( level );
break;
}
_POSIX_signals_Release( level );
40012eec: 7f ff be 10 call 4000272c <sparc_enable_interrupts>
40012ef0: b8 10 20 1b mov 0x1b, %i4
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
_POSIX_signals_Check_signal( api, signo, false );
40012ef4: 92 10 00 1c mov %i4, %o1
40012ef8: 94 10 20 00 clr %o2
40012efc: 40 00 0d 68 call 4001649c <_POSIX_signals_Check_signal>
40012f00: 90 10 00 1d mov %i5, %o0
_POSIX_signals_Check_signal( api, signo, true );
40012f04: 92 10 00 1c mov %i4, %o1
40012f08: 90 10 00 1d mov %i5, %o0
40012f0c: 40 00 0d 64 call 4001649c <_POSIX_signals_Check_signal>
40012f10: 94 10 20 01 mov 1, %o2
_POSIX_signals_Release( level );
break;
}
_POSIX_signals_Release( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
40012f14: b8 07 20 01 inc %i4
40012f18: 80 a7 20 20 cmp %i4, 0x20
40012f1c: 12 bf ff f7 bne 40012ef8 <_POSIX_signals_Post_switch_hook+0x64>
40012f20: 92 10 00 1c mov %i4, %o1
40012f24: 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 );
40012f28: 92 10 00 1c mov %i4, %o1
40012f2c: 94 10 20 00 clr %o2
40012f30: 40 00 0d 5b call 4001649c <_POSIX_signals_Check_signal>
40012f34: 90 10 00 1d mov %i5, %o0
_POSIX_signals_Check_signal( api, signo, true );
40012f38: 92 10 00 1c mov %i4, %o1
40012f3c: 90 10 00 1d mov %i5, %o0
40012f40: 40 00 0d 57 call 4001649c <_POSIX_signals_Check_signal>
40012f44: 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++ ) {
40012f48: b8 07 20 01 inc %i4
40012f4c: 80 a7 20 1b cmp %i4, 0x1b
40012f50: 12 bf ff f7 bne 40012f2c <_POSIX_signals_Post_switch_hook+0x98>
40012f54: 92 10 00 1c mov %i4, %o1
40012f58: 30 bf ff d7 b,a 40012eb4 <_POSIX_signals_Post_switch_hook+0x20>
400290d0 <_POSIX_signals_Unblock_thread>:
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
400290d0: 9d e3 bf a0 save %sp, -96, %sp
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
400290d4: c2 06 20 10 ld [ %i0 + 0x10 ], %g1
400290d8: 3b 04 00 20 sethi %hi(0x10008000), %i5
400290dc: 84 06 7f ff add %i1, -1, %g2
400290e0: 86 10 20 01 mov 1, %g3
400290e4: b8 08 40 1d and %g1, %i5, %i4
{
POSIX_API_Control *api;
sigset_t mask;
siginfo_t *the_info = NULL;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
400290e8: c8 06 21 50 ld [ %i0 + 0x150 ], %g4
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
400290ec: 80 a7 00 1d cmp %i4, %i5
400290f0: 12 80 00 1d bne 40029164 <_POSIX_signals_Unblock_thread+0x94>
400290f4: 85 28 c0 02 sll %g3, %g2, %g2
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
400290f8: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
400290fc: 80 88 80 01 btst %g2, %g1
40029100: 12 80 00 07 bne 4002911c <_POSIX_signals_Unblock_thread+0x4c>
40029104: 82 10 20 04 mov 4, %g1
40029108: c2 01 20 dc ld [ %g4 + 0xdc ], %g1
4002910c: 80 a8 80 01 andncc %g2, %g1, %g0
40029110: 22 80 00 3e be,a 40029208 <_POSIX_signals_Unblock_thread+0x138>
40029114: b0 10 20 00 clr %i0
the_thread->Wait.return_code = EINTR;
40029118: 82 10 20 04 mov 4, %g1
4002911c: c2 26 20 34 st %g1, [ %i0 + 0x34 ]
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
40029120: 80 a6 a0 00 cmp %i2, 0
40029124: 12 80 00 07 bne 40029140 <_POSIX_signals_Unblock_thread+0x70>
40029128: d0 06 20 28 ld [ %i0 + 0x28 ], %o0
the_info->si_signo = signo;
the_info->si_code = SI_USER;
4002912c: 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;
40029130: f2 22 00 00 st %i1, [ %o0 ]
the_info->si_code = SI_USER;
40029134: c2 22 20 04 st %g1, [ %o0 + 4 ]
40029138: 10 80 00 05 b 4002914c <_POSIX_signals_Unblock_thread+0x7c>
4002913c: c0 22 20 08 clr [ %o0 + 8 ]
the_info->si_value.sival_int = 0;
} else {
*the_info = *info;
40029140: 92 10 00 1a mov %i2, %o1
40029144: 7f ff bf 33 call 40018e10 <memcpy>
40029148: 94 10 20 0c mov 0xc, %o2
}
_Thread_queue_Extract_with_proxy( the_thread );
4002914c: 90 10 00 18 mov %i0, %o0
40029150: 7f ff 95 15 call 4000e5a4 <_Thread_queue_Extract_with_proxy>
40029154: b0 10 20 01 mov 1, %i0
40029158: b0 0e 20 01 and %i0, 1, %i0
4002915c: 81 c7 e0 08 ret
40029160: 81 e8 00 00 restore
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
40029164: c8 01 20 dc ld [ %g4 + 0xdc ], %g4
40029168: 80 a8 80 04 andncc %g2, %g4, %g0
4002916c: 02 80 00 26 be 40029204 <_POSIX_signals_Unblock_thread+0x134>
40029170: 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 ) ) {
40029174: 80 88 40 02 btst %g1, %g2
40029178: 02 80 00 17 be 400291d4 <_POSIX_signals_Unblock_thread+0x104>
4002917c: 80 a0 60 00 cmp %g1, 0
the_thread->Wait.return_code = EINTR;
40029180: 84 10 20 04 mov 4, %g2
40029184: 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) )
40029188: 05 00 02 ef sethi %hi(0xbbc00), %g2
4002918c: 84 10 a2 e0 or %g2, 0x2e0, %g2 ! bbee0 <PROM_START+0xbbee0>
40029190: 80 88 40 02 btst %g1, %g2
40029194: 02 80 00 06 be 400291ac <_POSIX_signals_Unblock_thread+0xdc>
40029198: 80 88 60 08 btst 8, %g1
_Thread_queue_Extract_with_proxy( the_thread );
4002919c: 7f ff 95 02 call 4000e5a4 <_Thread_queue_Extract_with_proxy>
400291a0: 90 10 00 18 mov %i0, %o0
} else if ( the_thread->current_state == STATES_READY ) {
_Thread_Signal_notification( the_thread );
}
}
return false;
400291a4: 10 80 00 19 b 40029208 <_POSIX_signals_Unblock_thread+0x138>
400291a8: 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) ) {
400291ac: 22 80 00 17 be,a 40029208 <_POSIX_signals_Unblock_thread+0x138><== NEVER TAKEN
400291b0: b0 10 20 00 clr %i0 <== NOT EXECUTED
(void) _Watchdog_Remove( &the_thread->Timer );
400291b4: 7f ff 96 c5 call 4000ecc8 <_Watchdog_Remove>
400291b8: 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 );
400291bc: 90 10 00 18 mov %i0, %o0
400291c0: 13 04 03 ff sethi %hi(0x100ffc00), %o1
400291c4: 7f ff 92 7f call 4000dbc0 <_Thread_Clear_state>
400291c8: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 100ffff8 <RAM_SIZE+0xfcffff8>
} else if ( the_thread->current_state == STATES_READY ) {
_Thread_Signal_notification( the_thread );
}
}
return false;
400291cc: 10 80 00 0f b 40029208 <_POSIX_signals_Unblock_thread+0x138>
400291d0: 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 ) {
400291d4: 32 80 00 0d bne,a 40029208 <_POSIX_signals_Unblock_thread+0x138><== NEVER TAKEN
400291d8: b0 10 20 00 clr %i0 <== NOT EXECUTED
ISR_Level level;
_ISR_Disable_without_giant( level );
#endif
isr_nest_level = _ISR_Nest_level;
400291dc: 03 10 00 bd sethi %hi(0x4002f400), %g1
400291e0: 82 10 60 70 or %g1, 0x70, %g1 ! 4002f470 <_Per_CPU_Information>
return idle->Wait.return_code;
}
RTEMS_INLINE_ROUTINE void _Thread_Signal_notification( Thread_Control *thread )
{
if ( _ISR_Is_in_progress() && _Thread_Is_executing( thread ) ) {
400291e4: c4 00 60 0c ld [ %g1 + 0xc ], %g2
400291e8: 80 a0 a0 00 cmp %g2, 0
400291ec: 22 80 00 07 be,a 40029208 <_POSIX_signals_Unblock_thread+0x138>
400291f0: b0 10 20 00 clr %i0
400291f4: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
400291f8: 80 a6 00 02 cmp %i0, %g2
400291fc: 22 80 00 02 be,a 40029204 <_POSIX_signals_Unblock_thread+0x134><== ALWAYS TAKEN
40029200: c6 28 60 14 stb %g3, [ %g1 + 0x14 ]
_Thread_Signal_notification( the_thread );
}
}
return false;
40029204: b0 10 20 00 clr %i0
}
40029208: b0 0e 20 01 and %i0, 1, %i0
4002920c: 81 c7 e0 08 ret
40029210: 81 e8 00 00 restore
4000ab0c <_RBTree_Initialize>:
void *starting_address,
size_t number_nodes,
size_t node_size,
bool is_unique
)
{
4000ab0c: 9d e3 bf a0 save %sp, -96, %sp
size_t count;
RBTree_Node *next;
/* TODO: Error message? */
if (!the_rbtree) return;
4000ab10: 80 a6 20 00 cmp %i0, 0
4000ab14: 02 80 00 10 be 4000ab54 <_RBTree_Initialize+0x48> <== NEVER TAKEN
4000ab18: 01 00 00 00 nop
RBTree_Control *the_rbtree,
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
4000ab1c: c0 26 00 00 clr [ %i0 ]
the_rbtree->root = NULL;
4000ab20: c0 26 20 04 clr [ %i0 + 4 ]
the_rbtree->first[0] = NULL;
4000ab24: c0 26 20 08 clr [ %i0 + 8 ]
the_rbtree->first[1] = NULL;
4000ab28: c0 26 20 0c clr [ %i0 + 0xc ]
the_rbtree->compare_function = compare_function;
4000ab2c: f2 26 20 10 st %i1, [ %i0 + 0x10 ]
the_rbtree->is_unique = is_unique;
4000ab30: 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-- ) {
4000ab34: 80 a6 e0 00 cmp %i3, 0
4000ab38: 02 80 00 07 be 4000ab54 <_RBTree_Initialize+0x48>
4000ab3c: 92 10 00 1a mov %i2, %o1
_RBTree_Insert(the_rbtree, next);
4000ab40: 90 10 00 18 mov %i0, %o0
4000ab44: 7f ff ff 44 call 4000a854 <_RBTree_Insert>
4000ab48: b4 06 80 1c add %i2, %i4, %i2
4000ab4c: 10 bf ff fa b 4000ab34 <_RBTree_Initialize+0x28>
4000ab50: b6 06 ff ff add %i3, -1, %i3
4000ab54: 81 c7 e0 08 ret
4000ab58: 81 e8 00 00 restore
4000a1c4 <_RBTree_Insert>:
*/
RBTree_Node *_RBTree_Insert(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
4000a1c4: 9d e3 bf a0 save %sp, -96, %sp
if(!the_node) return (RBTree_Node*)-1;
4000a1c8: 80 a6 60 00 cmp %i1, 0
4000a1cc: 02 80 00 80 be 4000a3cc <_RBTree_Insert+0x208>
4000a1d0: 01 00 00 00 nop
RBTree_Node *iter_node = the_rbtree->root;
4000a1d4: fa 06 20 04 ld [ %i0 + 4 ], %i5
int compare_result;
if (!iter_node) { /* special case: first node inserted */
4000a1d8: 80 a7 60 00 cmp %i5, 0
4000a1dc: 32 80 00 16 bne,a 4000a234 <_RBTree_Insert+0x70>
4000a1e0: c2 06 20 10 ld [ %i0 + 0x10 ], %g1
the_node->color = RBT_BLACK;
4000a1e4: c0 26 60 0c clr [ %i1 + 0xc ]
the_rbtree->root = the_node;
4000a1e8: f2 26 20 04 st %i1, [ %i0 + 4 ]
the_rbtree->first[0] = the_rbtree->first[1] = the_node;
4000a1ec: f2 26 20 0c st %i1, [ %i0 + 0xc ]
4000a1f0: f2 26 20 08 st %i1, [ %i0 + 8 ]
the_node->parent = (RBTree_Node *) the_rbtree;
4000a1f4: f0 26 40 00 st %i0, [ %i1 ]
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
4000a1f8: c0 26 60 08 clr [ %i1 + 8 ]
4000a1fc: c0 26 60 04 clr [ %i1 + 4 ]
4000a200: 81 c7 e0 08 ret
4000a204: 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 ) )
4000a208: 02 80 00 73 be 4000a3d4 <_RBTree_Insert+0x210>
4000a20c: b8 38 00 08 xnor %g0, %o0, %i4
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
4000a210: b9 37 20 1f srl %i4, 0x1f, %i4
if (!iter_node->child[dir]) {
4000a214: 83 2f 20 02 sll %i4, 2, %g1
4000a218: 84 07 40 01 add %i5, %g1, %g2
4000a21c: c6 00 a0 04 ld [ %g2 + 4 ], %g3
4000a220: 80 a0 e0 00 cmp %g3, 0
4000a224: 22 80 00 0d be,a 4000a258 <_RBTree_Insert+0x94>
4000a228: 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];
4000a22c: 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);
4000a230: c2 06 20 10 ld [ %i0 + 0x10 ], %g1
4000a234: 90 10 00 19 mov %i1, %o0
4000a238: 9f c0 40 00 call %g1
4000a23c: 92 10 00 1d mov %i5, %o1
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
4000a240: c2 0e 20 14 ldub [ %i0 + 0x14 ], %g1
4000a244: 80 a0 60 00 cmp %g1, 0
4000a248: 22 bf ff f2 be,a 4000a210 <_RBTree_Insert+0x4c>
4000a24c: b8 38 00 08 xnor %g0, %o0, %i4
4000a250: 10 bf ff ee b 4000a208 <_RBTree_Insert+0x44>
4000a254: 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;
4000a258: c0 26 60 04 clr [ %i1 + 4 ]
the_node->color = RBT_RED;
4000a25c: 86 10 20 01 mov 1, %g3
4000a260: c6 26 60 0c st %g3, [ %i1 + 0xc ]
iter_node->child[dir] = the_node;
4000a264: f2 20 a0 04 st %i1, [ %g2 + 4 ]
the_node->parent = iter_node;
4000a268: fa 26 40 00 st %i5, [ %i1 ]
4000a26c: ba 06 00 01 add %i0, %g1, %i5
/* update min/max */
compare_result = the_rbtree->compare_function(
4000a270: c2 06 20 10 ld [ %i0 + 0x10 ], %g1
4000a274: d2 07 60 08 ld [ %i5 + 8 ], %o1
4000a278: 9f c0 40 00 call %g1
4000a27c: 90 10 00 19 mov %i1, %o0
the_node,
_RBTree_First(the_rbtree, dir)
);
if ( (!dir && _RBTree_Is_lesser(compare_result)) ||
4000a280: 80 a7 20 00 cmp %i4, 0
4000a284: 12 80 00 06 bne 4000a29c <_RBTree_Insert+0xd8>
4000a288: 80 a2 20 00 cmp %o0, 0
4000a28c: 36 80 00 1e bge,a 4000a304 <_RBTree_Insert+0x140>
4000a290: d0 06 40 00 ld [ %i1 ], %o0
(dir && _RBTree_Is_greater(compare_result)) ) {
the_rbtree->first[dir] = the_node;
4000a294: 10 80 00 1b b 4000a300 <_RBTree_Insert+0x13c>
4000a298: 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)) ) {
4000a29c: 34 80 00 19 bg,a 4000a300 <_RBTree_Insert+0x13c>
4000a2a0: 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
4000a2a4: 10 80 00 18 b 4000a304 <_RBTree_Insert+0x140>
4000a2a8: 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);
4000a2ac: 82 18 60 01 xor %g1, 1, %g1
4000a2b0: 80 a0 00 01 cmp %g0, %g1
4000a2b4: 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))) {
4000a2b8: 80 a0 60 00 cmp %g1, 0
4000a2bc: 02 80 00 3f be 4000a3b8 <_RBTree_Insert+0x1f4>
4000a2c0: 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;
4000a2c4: 02 80 00 06 be 4000a2dc <_RBTree_Insert+0x118> <== NEVER TAKEN
4000a2c8: 82 10 20 00 clr %g1
if(!(the_node->parent->parent->parent)) return NULL;
4000a2cc: c2 07 40 00 ld [ %i5 ], %g1
4000a2d0: 80 a0 60 00 cmp %g1, 0
4000a2d4: 32 80 00 12 bne,a 4000a31c <_RBTree_Insert+0x158> <== ALWAYS TAKEN
4000a2d8: 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);
4000a2dc: 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)) {
4000a2e0: 80 a0 a0 00 cmp %g2, 0
4000a2e4: 22 80 00 1c be,a 4000a354 <_RBTree_Insert+0x190>
4000a2e8: c2 07 60 04 ld [ %i5 + 4 ], %g1
the_node->parent->color = RBT_BLACK;
4000a2ec: c0 22 20 0c clr [ %o0 + 0xc ]
u->color = RBT_BLACK;
4000a2f0: c0 20 60 0c clr [ %g1 + 0xc ]
g->color = RBT_RED;
4000a2f4: 82 10 20 01 mov 1, %g1
4000a2f8: 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));
4000a2fc: 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
4000a300: 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;
4000a304: fa 02 00 00 ld [ %o0 ], %i5
4000a308: 80 a7 60 00 cmp %i5, 0
4000a30c: 32 bf ff e8 bne,a 4000a2ac <_RBTree_Insert+0xe8>
4000a310: c2 02 20 0c ld [ %o0 + 0xc ], %g1
4000a314: 10 bf ff e9 b 4000a2b8 <_RBTree_Insert+0xf4>
4000a318: 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])
4000a31c: 80 a2 00 01 cmp %o0, %g1
4000a320: 22 80 00 02 be,a 4000a328 <_RBTree_Insert+0x164>
4000a324: 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);
4000a328: 80 a0 60 00 cmp %g1, 0
4000a32c: 02 bf ff ed be 4000a2e0 <_RBTree_Insert+0x11c>
4000a330: 84 10 20 00 clr %g2
4000a334: c4 00 60 0c ld [ %g1 + 0xc ], %g2
4000a338: 80 a0 a0 01 cmp %g2, 1
4000a33c: 32 bf ff e9 bne,a 4000a2e0 <_RBTree_Insert+0x11c>
4000a340: 84 10 20 00 clr %g2
4000a344: 10 80 00 02 b 4000a34c <_RBTree_Insert+0x188>
4000a348: 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)) {
4000a34c: 10 bf ff e6 b 4000a2e4 <_RBTree_Insert+0x120>
4000a350: 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];
4000a354: 82 1a 00 01 xor %o0, %g1, %g1
4000a358: 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];
4000a35c: c2 02 20 04 ld [ %o0 + 4 ], %g1
RBTree_Direction pdir = the_node->parent != g->child[0];
4000a360: 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];
4000a364: 82 1e 40 01 xor %i1, %g1, %g1
4000a368: 80 a0 00 01 cmp %g0, %g1
4000a36c: 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) {
4000a370: 80 a0 40 1c cmp %g1, %i4
4000a374: 22 80 00 08 be,a 4000a394 <_RBTree_Insert+0x1d0>
4000a378: c2 06 40 00 ld [ %i1 ], %g1
_RBTree_Rotate(the_node->parent, pdir);
4000a37c: 7f ff ff 74 call 4000a14c <_RBTree_Rotate>
4000a380: 92 10 00 1c mov %i4, %o1
the_node = the_node->child[pdir];
4000a384: 83 2f 20 02 sll %i4, 2, %g1
4000a388: b2 06 40 01 add %i1, %g1, %i1
4000a38c: f2 06 60 04 ld [ %i1 + 4 ], %i1
}
the_node->parent->color = RBT_BLACK;
4000a390: c2 06 40 00 ld [ %i1 ], %g1
g->color = RBT_RED;
4000a394: 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;
4000a398: c0 20 60 0c clr [ %g1 + 0xc ]
g->color = RBT_RED;
4000a39c: d2 27 60 0c st %o1, [ %i5 + 0xc ]
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
4000a3a0: 90 10 00 1d mov %i5, %o0
4000a3a4: 92 22 40 1c sub %o1, %i4, %o1
4000a3a8: 7f ff ff 69 call 4000a14c <_RBTree_Rotate>
4000a3ac: ba 10 00 19 mov %i1, %i5
4000a3b0: 10 bf ff d4 b 4000a300 <_RBTree_Insert+0x13c>
4000a3b4: b2 10 00 1d mov %i5, %i1
}
}
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
4000a3b8: 12 80 00 03 bne 4000a3c4 <_RBTree_Insert+0x200>
4000a3bc: b0 10 20 00 clr %i0
4000a3c0: c0 26 60 0c clr [ %i1 + 0xc ]
4000a3c4: 81 c7 e0 08 ret
4000a3c8: 81 e8 00 00 restore
RBTree_Node *_RBTree_Insert(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
if(!the_node) return (RBTree_Node*)-1;
4000a3cc: 81 c7 e0 08 ret
4000a3d0: 91 e8 3f ff restore %g0, -1, %o0
4000a3d4: b0 10 00 1d mov %i5, %i0
/* verify red-black properties */
_RBTree_Validate_insert(the_node);
}
return (RBTree_Node*)0;
}
4000a3d8: 81 c7 e0 08 ret
4000a3dc: 81 e8 00 00 restore
4000a250 <_RBTree_Iterate>:
const RBTree_Control *rbtree,
RBTree_Direction dir,
RBTree_Visitor visitor,
void *visitor_arg
)
{
4000a250: 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);
4000a254: 80 a0 00 19 cmp %g0, %i1
4000a258: 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];
4000a25c: 82 00 60 02 add %g1, 2, %g1
4000a260: 83 28 60 02 sll %g1, 2, %g1
4000a264: 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;
4000a268: b8 10 20 00 clr %i4
while ( !stop && current != NULL ) {
4000a26c: 80 a7 60 00 cmp %i5, 0
4000a270: 02 80 00 0e be 4000a2a8 <_RBTree_Iterate+0x58>
4000a274: b8 1f 20 01 xor %i4, 1, %i4
4000a278: 80 8f 20 ff btst 0xff, %i4
4000a27c: 02 80 00 0b be 4000a2a8 <_RBTree_Iterate+0x58> <== NEVER TAKEN
4000a280: 90 10 00 1d mov %i5, %o0
stop = (*visitor)( current, dir, visitor_arg );
4000a284: 92 10 00 19 mov %i1, %o1
4000a288: 9f c6 80 00 call %i2
4000a28c: 94 10 00 1b mov %i3, %o2
current = _RBTree_Next( current, dir );
4000a290: 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 );
4000a294: b8 10 00 08 mov %o0, %i4
current = _RBTree_Next( current, dir );
4000a298: 40 00 00 06 call 4000a2b0 <_RBTree_Next>
4000a29c: 90 10 00 1d mov %i5, %o0
4000a2a0: 10 bf ff f3 b 4000a26c <_RBTree_Iterate+0x1c>
4000a2a4: ba 10 00 08 mov %o0, %i5
4000a2a8: 81 c7 e0 08 ret
4000a2ac: 81 e8 00 00 restore
4000e910 <_RBTree_Rotate>:
RBTree_Node *the_node,
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
4000e910: 80 a2 20 00 cmp %o0, 0
4000e914: 02 80 00 1b be 4000e980 <_RBTree_Rotate+0x70> <== NEVER TAKEN
4000e918: 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);
4000e91c: 84 60 3f ff subx %g0, -1, %g2
4000e920: 85 28 a0 02 sll %g2, 2, %g2
4000e924: 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;
4000e928: c2 00 a0 04 ld [ %g2 + 4 ], %g1
4000e92c: 80 a0 60 00 cmp %g1, 0
4000e930: 02 80 00 14 be 4000e980 <_RBTree_Rotate+0x70> <== NEVER TAKEN
4000e934: 93 2a 60 02 sll %o1, 2, %o1
4000e938: 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];
4000e93c: c6 02 60 04 ld [ %o1 + 4 ], %g3
4000e940: c6 20 a0 04 st %g3, [ %g2 + 4 ]
if (c->child[dir])
4000e944: c4 02 60 04 ld [ %o1 + 4 ], %g2
4000e948: 80 a0 a0 00 cmp %g2, 0
4000e94c: 32 80 00 02 bne,a 4000e954 <_RBTree_Rotate+0x44>
4000e950: d0 20 80 00 st %o0, [ %g2 ]
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
4000e954: d0 22 60 04 st %o0, [ %o1 + 4 ]
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
4000e958: c4 02 00 00 ld [ %o0 ], %g2
4000e95c: c6 00 a0 04 ld [ %g2 + 4 ], %g3
4000e960: 86 1a 00 03 xor %o0, %g3, %g3
4000e964: 80 a0 00 03 cmp %g0, %g3
4000e968: 86 40 20 00 addx %g0, 0, %g3
4000e96c: 87 28 e0 02 sll %g3, 2, %g3
4000e970: 86 00 80 03 add %g2, %g3, %g3
4000e974: c2 20 e0 04 st %g1, [ %g3 + 4 ]
c->parent = the_node->parent;
4000e978: c4 20 40 00 st %g2, [ %g1 ]
the_node->parent = c;
4000e97c: c2 22 00 00 st %g1, [ %o0 ]
4000e980: 81 c3 e0 08 retl
4000e8c8 <_RBTree_Sibling>:
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
4000e8c8: 80 a2 20 00 cmp %o0, 0
4000e8cc: 02 80 00 0f be 4000e908 <_RBTree_Sibling+0x40> <== NEVER TAKEN
4000e8d0: 82 10 20 00 clr %g1
if(!(the_node->parent)) return NULL;
4000e8d4: c2 02 00 00 ld [ %o0 ], %g1
4000e8d8: 80 a0 60 00 cmp %g1, 0
4000e8dc: 02 80 00 0b be 4000e908 <_RBTree_Sibling+0x40> <== NEVER TAKEN
4000e8e0: 01 00 00 00 nop
if(!(the_node->parent->parent)) return NULL;
4000e8e4: c4 00 40 00 ld [ %g1 ], %g2
4000e8e8: 80 a0 a0 00 cmp %g2, 0
4000e8ec: 22 80 00 07 be,a 4000e908 <_RBTree_Sibling+0x40>
4000e8f0: 82 10 20 00 clr %g1
if(the_node == the_node->parent->child[RBT_LEFT])
4000e8f4: c4 00 60 04 ld [ %g1 + 4 ], %g2
4000e8f8: 80 a2 00 02 cmp %o0, %g2
4000e8fc: 32 80 00 03 bne,a 4000e908 <_RBTree_Sibling+0x40>
4000e900: 82 10 00 02 mov %g2, %g1
4000e904: c2 00 60 08 ld [ %g1 + 8 ], %g1
return the_node->parent->child[RBT_RIGHT];
else
return the_node->parent->child[RBT_LEFT];
}
4000e908: 81 c3 e0 08 retl
4000e90c: 90 10 00 01 mov %g1, %o0
40007cc0 <_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
)
{
40007cc0: 9d e3 bf 98 save %sp, -104, %sp
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
40007cc4: 13 10 00 63 sethi %hi(0x40018c00), %o1
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
Timestamp_Control uptime;
#endif
Thread_Control *owning_thread = the_period->owner;
40007cc8: f6 06 20 40 ld [ %i0 + 0x40 ], %i3
40007ccc: 90 07 bf f8 add %fp, -8, %o0
40007cd0: 40 00 06 9b call 4000973c <_TOD_Get_with_nanoseconds>
40007cd4: 92 12 61 88 or %o1, 0x188, %o1
/*
* Determine elapsed wall time since period initiated.
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
40007cd8: c4 1f bf f8 ldd [ %fp + -8 ], %g2
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
40007cdc: f8 1e 20 50 ldd [ %i0 + 0x50 ], %i4
* Determine cpu usage since period initiated.
*/
used = owning_thread->cpu_time_used;
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
if (owning_thread == _Thread_Executing) {
40007ce0: 09 10 00 64 sethi %hi(0x40019000), %g4
40007ce4: ba a0 c0 1d subcc %g3, %i5, %i5
40007ce8: 88 11 23 10 or %g4, 0x310, %g4
40007cec: b8 60 80 1c subx %g2, %i4, %i4
40007cf0: f8 3e 40 00 std %i4, [ %i1 ]
40007cf4: fa 01 20 18 ld [ %g4 + 0x18 ], %i5
#endif
/*
* Determine cpu usage since period initiated.
*/
used = owning_thread->cpu_time_used;
40007cf8: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
if (owning_thread == _Thread_Executing) {
40007cfc: 80 a6 c0 1d cmp %i3, %i5
40007d00: 12 80 00 15 bne 40007d54 <_Rate_monotonic_Get_status+0x94>
40007d04: 82 10 20 01 mov 1, %g1
40007d08: f8 19 20 20 ldd [ %g4 + 0x20 ], %i4
40007d0c: 86 a0 c0 1d subcc %g3, %i5, %g3
40007d10: 84 60 80 1c subx %g2, %i4, %g2
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
40007d14: ba 83 40 03 addcc %o5, %g3, %i5
40007d18: 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))
40007d1c: c4 1e 20 48 ldd [ %i0 + 0x48 ], %g2
40007d20: 80 a0 80 1c cmp %g2, %i4
40007d24: 34 80 00 0c bg,a 40007d54 <_Rate_monotonic_Get_status+0x94><== NEVER TAKEN
40007d28: 82 10 20 00 clr %g1 <== NOT EXECUTED
40007d2c: 32 80 00 06 bne,a 40007d44 <_Rate_monotonic_Get_status+0x84>
40007d30: 86 a7 40 03 subcc %i5, %g3, %g3
40007d34: 80 a0 c0 1d cmp %g3, %i5
40007d38: 18 80 00 06 bgu 40007d50 <_Rate_monotonic_Get_status+0x90>
40007d3c: 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;
40007d40: 82 10 20 01 mov 1, %g1
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
40007d44: 84 67 00 02 subx %i4, %g2, %g2
40007d48: 10 80 00 03 b 40007d54 <_Rate_monotonic_Get_status+0x94>
40007d4c: 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;
40007d50: 82 10 20 00 clr %g1
return false;
*cpu_since_last_period = used - the_period->cpu_usage_period_initiated;
#endif
return true;
}
40007d54: b0 08 60 01 and %g1, 1, %i0
40007d58: 81 c7 e0 08 ret
40007d5c: 81 e8 00 00 restore
4000838c <_Rate_monotonic_Timeout>:
void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
)
{
4000838c: 9d e3 bf 98 save %sp, -104, %sp
40008390: 11 10 00 63 sethi %hi(0x40018c00), %o0
40008394: 92 10 00 18 mov %i0, %o1
40008398: 90 12 20 cc or %o0, 0xcc, %o0
4000839c: 40 00 07 ed call 4000a350 <_Objects_Get>
400083a0: 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 ) {
400083a4: c2 07 bf fc ld [ %fp + -4 ], %g1
400083a8: 80 a0 60 00 cmp %g1, 0
400083ac: 12 80 00 25 bne 40008440 <_Rate_monotonic_Timeout+0xb4> <== NEVER TAKEN
400083b0: ba 10 00 08 mov %o0, %i5
case OBJECTS_LOCAL:
the_thread = the_period->owner;
400083b4: d0 02 20 40 ld [ %o0 + 0x40 ], %o0
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
400083b8: 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);
400083bc: c4 02 20 10 ld [ %o0 + 0x10 ], %g2
400083c0: 80 88 80 01 btst %g2, %g1
400083c4: 22 80 00 0b be,a 400083f0 <_Rate_monotonic_Timeout+0x64>
400083c8: c2 07 60 38 ld [ %i5 + 0x38 ], %g1
400083cc: c4 02 20 20 ld [ %o0 + 0x20 ], %g2
400083d0: c2 07 60 08 ld [ %i5 + 8 ], %g1
400083d4: 80 a0 80 01 cmp %g2, %g1
400083d8: 32 80 00 06 bne,a 400083f0 <_Rate_monotonic_Timeout+0x64>
400083dc: c2 07 60 38 ld [ %i5 + 0x38 ], %g1
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
400083e0: 13 04 03 ff sethi %hi(0x100ffc00), %o1
400083e4: 40 00 0a a2 call 4000ae6c <_Thread_Clear_state>
400083e8: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 100ffff8 <RAM_SIZE+0xfcffff8>
400083ec: 30 80 00 06 b,a 40008404 <_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 ) {
400083f0: 80 a0 60 01 cmp %g1, 1
400083f4: 12 80 00 0d bne 40008428 <_Rate_monotonic_Timeout+0x9c>
400083f8: 82 10 20 04 mov 4, %g1
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
400083fc: 82 10 20 03 mov 3, %g1
40008400: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
_Rate_monotonic_Initiate_statistics( the_period );
40008404: 7f ff fe a0 call 40007e84 <_Rate_monotonic_Initiate_statistics>
40008408: 90 10 00 1d mov %i5, %o0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
4000840c: c2 07 60 3c ld [ %i5 + 0x3c ], %g1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40008410: 11 10 00 63 sethi %hi(0x40018c00), %o0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40008414: c2 27 60 1c st %g1, [ %i5 + 0x1c ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40008418: 90 12 22 d0 or %o0, 0x2d0, %o0
4000841c: 40 00 0e 9b call 4000be88 <_Watchdog_Insert>
40008420: 92 07 60 10 add %i5, 0x10, %o1
40008424: 30 80 00 02 b,a 4000842c <_Rate_monotonic_Timeout+0xa0>
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
40008428: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4000842c: 03 10 00 64 sethi %hi(0x40019000), %g1
40008430: 82 10 63 10 or %g1, 0x310, %g1 ! 40019310 <_Per_CPU_Information>
40008434: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
--level;
40008438: 84 00 bf ff add %g2, -1, %g2
_Thread_Dispatch_disable_level = level;
4000843c: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
40008440: 81 c7 e0 08 ret
40008444: 81 e8 00 00 restore
40007d60 <_Rate_monotonic_Update_statistics>:
}
static void _Rate_monotonic_Update_statistics(
Rate_monotonic_Control *the_period
)
{
40007d60: 9d e3 bf 90 save %sp, -112, %sp
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
40007d64: c2 06 20 58 ld [ %i0 + 0x58 ], %g1
40007d68: 82 00 60 01 inc %g1
40007d6c: c2 26 20 58 st %g1, [ %i0 + 0x58 ]
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
40007d70: c2 06 20 38 ld [ %i0 + 0x38 ], %g1
40007d74: 80 a0 60 04 cmp %g1, 4
40007d78: 12 80 00 05 bne 40007d8c <_Rate_monotonic_Update_statistics+0x2c>
40007d7c: 90 10 00 18 mov %i0, %o0
stats->missed_count++;
40007d80: c2 06 20 5c ld [ %i0 + 0x5c ], %g1
40007d84: 82 00 60 01 inc %g1
40007d88: c2 26 20 5c st %g1, [ %i0 + 0x5c ]
/*
* Grab status for time statistics.
*/
valid_status =
40007d8c: 92 07 bf f8 add %fp, -8, %o1
40007d90: 7f ff ff cc call 40007cc0 <_Rate_monotonic_Get_status>
40007d94: 94 07 bf f0 add %fp, -16, %o2
_Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
if (!valid_status)
40007d98: 80 a2 20 00 cmp %o0, 0
40007d9c: 02 80 00 38 be 40007e7c <_Rate_monotonic_Update_statistics+0x11c>
40007da0: c4 1f bf f0 ldd [ %fp + -16 ], %g2
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
40007da4: 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 ) )
40007da8: c2 06 20 60 ld [ %i0 + 0x60 ], %g1
40007dac: b6 87 40 03 addcc %i5, %g3, %i3
40007db0: b4 47 00 02 addx %i4, %g2, %i2
40007db4: 80 a0 40 02 cmp %g1, %g2
40007db8: 14 80 00 09 bg 40007ddc <_Rate_monotonic_Update_statistics+0x7c>
40007dbc: f4 3e 20 70 std %i2, [ %i0 + 0x70 ]
40007dc0: 80 a0 40 02 cmp %g1, %g2
40007dc4: 32 80 00 08 bne,a 40007de4 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN
40007dc8: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED
40007dcc: c2 06 20 64 ld [ %i0 + 0x64 ], %g1
40007dd0: 80 a0 40 03 cmp %g1, %g3
40007dd4: 28 80 00 04 bleu,a 40007de4 <_Rate_monotonic_Update_statistics+0x84>
40007dd8: c2 06 20 68 ld [ %i0 + 0x68 ], %g1
stats->min_cpu_time = executed;
40007ddc: c4 3e 20 60 std %g2, [ %i0 + 0x60 ]
if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
40007de0: c2 06 20 68 ld [ %i0 + 0x68 ], %g1
40007de4: 80 a0 40 02 cmp %g1, %g2
40007de8: 26 80 00 0a bl,a 40007e10 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN
40007dec: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED
40007df0: 80 a0 40 02 cmp %g1, %g2
40007df4: 32 80 00 08 bne,a 40007e14 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN
40007df8: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED
40007dfc: c2 06 20 6c ld [ %i0 + 0x6c ], %g1
40007e00: 80 a0 40 03 cmp %g1, %g3
40007e04: 3a 80 00 04 bcc,a 40007e14 <_Rate_monotonic_Update_statistics+0xb4>
40007e08: c4 1f bf f8 ldd [ %fp + -8 ], %g2
stats->max_cpu_time = executed;
40007e0c: 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 );
40007e10: c4 1f bf f8 ldd [ %fp + -8 ], %g2
40007e14: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4
if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
40007e18: c2 06 20 78 ld [ %i0 + 0x78 ], %g1
40007e1c: b6 87 40 03 addcc %i5, %g3, %i3
40007e20: b4 47 00 02 addx %i4, %g2, %i2
40007e24: 80 a0 40 02 cmp %g1, %g2
40007e28: 14 80 00 09 bg 40007e4c <_Rate_monotonic_Update_statistics+0xec>
40007e2c: f4 3e 20 88 std %i2, [ %i0 + 0x88 ]
40007e30: 80 a0 40 02 cmp %g1, %g2
40007e34: 32 80 00 08 bne,a 40007e54 <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN
40007e38: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED
40007e3c: c2 06 20 7c ld [ %i0 + 0x7c ], %g1
40007e40: 80 a0 40 03 cmp %g1, %g3
40007e44: 28 80 00 04 bleu,a 40007e54 <_Rate_monotonic_Update_statistics+0xf4>
40007e48: c2 06 20 80 ld [ %i0 + 0x80 ], %g1
stats->min_wall_time = since_last_period;
40007e4c: c4 3e 20 78 std %g2, [ %i0 + 0x78 ]
if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
40007e50: c2 06 20 80 ld [ %i0 + 0x80 ], %g1
40007e54: 80 a0 40 02 cmp %g1, %g2
40007e58: 26 80 00 09 bl,a 40007e7c <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN
40007e5c: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED
40007e60: 80 a0 40 02 cmp %g1, %g2
40007e64: 12 80 00 06 bne 40007e7c <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN
40007e68: 01 00 00 00 nop
40007e6c: c2 06 20 84 ld [ %i0 + 0x84 ], %g1
40007e70: 80 a0 40 03 cmp %g1, %g3
40007e74: 2a 80 00 02 bcs,a 40007e7c <_Rate_monotonic_Update_statistics+0x11c>
40007e78: c4 3e 20 80 std %g2, [ %i0 + 0x80 ]
40007e7c: 81 c7 e0 08 ret
40007e80: 81 e8 00 00 restore
40009c68 <_Scheduler_CBS_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_CBS_Allocate(
Thread_Control *the_thread
)
{
40009c68: 9d e3 bf a0 save %sp, -96, %sp
void *sched;
Scheduler_CBS_Per_thread *schinfo;
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
40009c6c: 40 00 06 63 call 4000b5f8 <_Workspace_Allocate>
40009c70: 90 10 20 1c mov 0x1c, %o0
if ( sched ) {
40009c74: 80 a2 20 00 cmp %o0, 0
40009c78: 02 80 00 06 be 40009c90 <_Scheduler_CBS_Allocate+0x28> <== NEVER TAKEN
40009c7c: 82 10 20 02 mov 2, %g1
the_thread->scheduler_info = sched;
40009c80: d0 26 20 88 st %o0, [ %i0 + 0x88 ]
schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info);
schinfo->edf_per_thread.thread = the_thread;
40009c84: f0 22 00 00 st %i0, [ %o0 ]
schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
40009c88: c2 22 20 14 st %g1, [ %o0 + 0x14 ]
schinfo->cbs_server = NULL;
40009c8c: c0 22 20 18 clr [ %o0 + 0x18 ]
}
return sched;
}
40009c90: 81 c7 e0 08 ret
40009c94: 91 e8 00 08 restore %g0, %o0, %o0
4000a928 <_Scheduler_CBS_Attach_thread>:
int _Scheduler_CBS_Attach_thread (
Scheduler_CBS_Server_id server_id,
rtems_id task_id
)
{
4000a928: 9d e3 bf 98 save %sp, -104, %sp
Objects_Locations location;
Thread_Control *the_thread;
if ( server_id >= _Scheduler_CBS_Maximum_servers )
4000a92c: 03 10 00 64 sethi %hi(0x40019000), %g1
4000a930: c2 00 61 98 ld [ %g1 + 0x198 ], %g1 ! 40019198 <_Scheduler_CBS_Maximum_servers>
4000a934: 80 a6 00 01 cmp %i0, %g1
4000a938: 0a 80 00 04 bcs 4000a948 <_Scheduler_CBS_Attach_thread+0x20>
4000a93c: 3b 10 00 69 sethi %hi(0x4001a400), %i5
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
4000a940: 81 c7 e0 08 ret
4000a944: 91 e8 3f ee restore %g0, -18, %o0
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
4000a948: c2 07 60 18 ld [ %i5 + 0x18 ], %g1
4000a94c: b1 2e 20 02 sll %i0, 2, %i0
4000a950: c2 00 40 18 ld [ %g1 + %i0 ], %g1
4000a954: 80 a0 60 00 cmp %g1, 0
4000a958: 02 80 00 21 be 4000a9dc <_Scheduler_CBS_Attach_thread+0xb4>
4000a95c: 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 )
4000a960: c2 00 40 00 ld [ %g1 ], %g1
4000a964: 80 a0 7f ff cmp %g1, -1
4000a968: 12 80 00 1f bne 4000a9e4 <_Scheduler_CBS_Attach_thread+0xbc>
4000a96c: 90 10 00 19 mov %i1, %o0
return SCHEDULER_CBS_ERROR_FULL;
the_thread = _Thread_Get(task_id, &location);
4000a970: 40 00 03 d5 call 4000b8c4 <_Thread_Get>
4000a974: 92 07 bf fc add %fp, -4, %o1
/* The routine _Thread_Get may disable dispatch and not enable again. */
if ( the_thread ) {
4000a978: 80 a2 20 00 cmp %o0, 0
4000a97c: 02 bf ff f1 be 4000a940 <_Scheduler_CBS_Attach_thread+0x18>
4000a980: 01 00 00 00 nop
Scheduler_CBS_Per_thread *sched_info;
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
4000a984: c2 02 20 88 ld [ %o0 + 0x88 ], %g1
/* Thread is already attached to a server. */
if ( sched_info->cbs_server ) {
4000a988: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
4000a98c: 80 a0 a0 00 cmp %g2, 0
4000a990: 02 80 00 05 be 4000a9a4 <_Scheduler_CBS_Attach_thread+0x7c><== ALWAYS TAKEN
4000a994: c4 07 60 18 ld [ %i5 + 0x18 ], %g2
RTEMS_INLINE_ROUTINE void _Objects_Put(
Objects_Control *the_object
)
{
(void) the_object;
_Thread_Enable_dispatch();
4000a998: 40 00 03 be call 4000b890 <_Thread_Enable_dispatch> <== NOT EXECUTED
4000a99c: b0 10 3f e6 mov -26, %i0 <== NOT EXECUTED
4000a9a0: 30 80 00 12 b,a 4000a9e8 <_Scheduler_CBS_Attach_thread+0xc0><== NOT EXECUTED
_Objects_Put( &the_thread->Object );
return SCHEDULER_CBS_ERROR_FULL;
}
_Scheduler_CBS_Server_list[server_id]->task_id = task_id;
4000a9a4: c4 00 80 18 ld [ %g2 + %i0 ], %g2
_Objects_Put( &the_thread->Object );
} else {
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
}
return SCHEDULER_CBS_OK;
4000a9a8: b0 10 20 00 clr %i0
if ( sched_info->cbs_server ) {
_Objects_Put( &the_thread->Object );
return SCHEDULER_CBS_ERROR_FULL;
}
_Scheduler_CBS_Server_list[server_id]->task_id = task_id;
4000a9ac: f2 20 80 00 st %i1, [ %g2 ]
sched_info->cbs_server = (void *) _Scheduler_CBS_Server_list[server_id];
4000a9b0: c4 20 60 18 st %g2, [ %g1 + 0x18 ]
the_thread->budget_callout = _Scheduler_CBS_Budget_callout;
4000a9b4: 03 10 00 2b sethi %hi(0x4000ac00), %g1
4000a9b8: 82 10 62 3c or %g1, 0x23c, %g1 ! 4000ae3c <_Scheduler_CBS_Budget_callout>
4000a9bc: c2 22 20 7c st %g1, [ %o0 + 0x7c ]
the_thread->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
4000a9c0: 82 10 20 03 mov 3, %g1
4000a9c4: c2 22 20 78 st %g1, [ %o0 + 0x78 ]
the_thread->is_preemptible = true;
4000a9c8: 82 10 20 01 mov 1, %g1
4000a9cc: 40 00 03 b1 call 4000b890 <_Thread_Enable_dispatch>
4000a9d0: c2 2a 20 70 stb %g1, [ %o0 + 0x70 ]
_Objects_Put( &the_thread->Object );
} else {
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
}
return SCHEDULER_CBS_OK;
4000a9d4: 81 c7 e0 08 ret
4000a9d8: 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] )
return SCHEDULER_CBS_ERROR_NOSERVER;
4000a9dc: 81 c7 e0 08 ret
4000a9e0: 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;
4000a9e4: b0 10 3f e6 mov -26, %i0
} else {
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
}
return SCHEDULER_CBS_OK;
}
4000a9e8: 81 c7 e0 08 ret
4000a9ec: 81 e8 00 00 restore
4000ae3c <_Scheduler_CBS_Budget_callout>:
Scheduler_CBS_Server **_Scheduler_CBS_Server_list;
void _Scheduler_CBS_Budget_callout(
Thread_Control *the_thread
)
{
4000ae3c: 9d e3 bf 98 save %sp, -104, %sp
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info;
Scheduler_CBS_Server_id server_id;
/* Put violating task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
4000ae40: d2 06 20 ac ld [ %i0 + 0xac ], %o1
if ( the_thread->real_priority != new_priority )
4000ae44: c2 06 20 18 ld [ %i0 + 0x18 ], %g1
4000ae48: 80 a0 40 09 cmp %g1, %o1
4000ae4c: 32 80 00 02 bne,a 4000ae54 <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN
4000ae50: d2 26 20 18 st %o1, [ %i0 + 0x18 ]
the_thread->real_priority = new_priority;
if ( the_thread->current_priority != new_priority )
4000ae54: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
4000ae58: 80 a0 40 09 cmp %g1, %o1
4000ae5c: 02 80 00 04 be 4000ae6c <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN
4000ae60: 90 10 00 18 mov %i0, %o0
_Thread_Change_priority(the_thread, new_priority, true);
4000ae64: 40 00 01 89 call 4000b488 <_Thread_Change_priority>
4000ae68: 94 10 20 01 mov 1, %o2
/* Invoke callback function if any. */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
4000ae6c: fa 06 20 88 ld [ %i0 + 0x88 ], %i5
if ( sched_info->cbs_server->cbs_budget_overrun ) {
4000ae70: c2 07 60 18 ld [ %i5 + 0x18 ], %g1
4000ae74: c4 00 60 0c ld [ %g1 + 0xc ], %g2
4000ae78: 80 a0 a0 00 cmp %g2, 0
4000ae7c: 02 80 00 09 be 4000aea0 <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN
4000ae80: 01 00 00 00 nop
_Scheduler_CBS_Get_server_id(
4000ae84: d0 00 40 00 ld [ %g1 ], %o0
4000ae88: 7f ff ff d8 call 4000ade8 <_Scheduler_CBS_Get_server_id>
4000ae8c: 92 07 bf fc add %fp, -4, %o1
sched_info->cbs_server->task_id,
&server_id
);
sched_info->cbs_server->cbs_budget_overrun( server_id );
4000ae90: c2 07 60 18 ld [ %i5 + 0x18 ], %g1
4000ae94: c2 00 60 0c ld [ %g1 + 0xc ], %g1
4000ae98: 9f c0 40 00 call %g1
4000ae9c: d0 07 bf fc ld [ %fp + -4 ], %o0
4000aea0: 81 c7 e0 08 ret
4000aea4: 81 e8 00 00 restore
4000aa4c <_Scheduler_CBS_Create_server>:
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
4000aa4c: 9d e3 bf a0 save %sp, -96, %sp
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
4000aa50: c2 06 20 04 ld [ %i0 + 4 ], %g1
4000aa54: 80 a0 60 00 cmp %g1, 0
4000aa58: 04 80 00 15 ble 4000aaac <_Scheduler_CBS_Create_server+0x60>
4000aa5c: 01 00 00 00 nop
4000aa60: c2 06 00 00 ld [ %i0 ], %g1
4000aa64: 80 a0 60 00 cmp %g1, 0
4000aa68: 04 80 00 11 ble 4000aaac <_Scheduler_CBS_Create_server+0x60>
4000aa6c: 3b 10 00 69 sethi %hi(0x4001a400), %i5
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
if ( !_Scheduler_CBS_Server_list[i] )
4000aa70: c6 07 60 18 ld [ %i5 + 0x18 ], %g3 ! 4001a418 <_Scheduler_CBS_Server_list>
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
4000aa74: 03 10 00 64 sethi %hi(0x40019000), %g1
4000aa78: c4 00 61 98 ld [ %g1 + 0x198 ], %g2 ! 40019198 <_Scheduler_CBS_Maximum_servers>
if ( !_Scheduler_CBS_Server_list[i] )
4000aa7c: 82 10 20 00 clr %g1
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
4000aa80: 80 a0 40 02 cmp %g1, %g2
4000aa84: 02 80 00 08 be 4000aaa4 <_Scheduler_CBS_Create_server+0x58>
4000aa88: b9 28 60 02 sll %g1, 2, %i4
if ( !_Scheduler_CBS_Server_list[i] )
4000aa8c: c8 00 c0 1c ld [ %g3 + %i4 ], %g4
4000aa90: 80 a1 20 00 cmp %g4, 0
4000aa94: 02 80 00 08 be 4000aab4 <_Scheduler_CBS_Create_server+0x68>
4000aa98: f6 07 60 18 ld [ %i5 + 0x18 ], %i3
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
4000aa9c: 10 bf ff f9 b 4000aa80 <_Scheduler_CBS_Create_server+0x34>
4000aaa0: 82 00 60 01 inc %g1
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
4000aaa4: 81 c7 e0 08 ret
4000aaa8: 91 e8 3f e6 restore %g0, -26, %o0
if ( params->budget <= 0 ||
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
4000aaac: 81 c7 e0 08 ret
4000aab0: 91 e8 3f ee restore %g0, -18, %o0
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
4000aab4: c2 26 80 00 st %g1, [ %i2 ]
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
4000aab8: 40 00 07 5f call 4000c834 <_Workspace_Allocate>
4000aabc: 90 10 20 10 mov 0x10, %o0
the_server = _Scheduler_CBS_Server_list[*server_id];
4000aac0: c2 06 80 00 ld [ %i2 ], %g1
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
4000aac4: d0 26 c0 1c st %o0, [ %i3 + %i4 ]
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
4000aac8: c4 07 60 18 ld [ %i5 + 0x18 ], %g2
4000aacc: 83 28 60 02 sll %g1, 2, %g1
4000aad0: c2 00 80 01 ld [ %g2 + %g1 ], %g1
if ( !the_server )
4000aad4: 80 a0 60 00 cmp %g1, 0
4000aad8: 02 80 00 0b be 4000ab04 <_Scheduler_CBS_Create_server+0xb8><== NEVER TAKEN
4000aadc: 01 00 00 00 nop
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
4000aae0: c4 06 00 00 ld [ %i0 ], %g2
4000aae4: c4 20 60 04 st %g2, [ %g1 + 4 ]
4000aae8: c4 06 20 04 ld [ %i0 + 4 ], %g2
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
4000aaec: f2 20 60 0c st %i1, [ %g1 + 0xc ]
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
4000aaf0: c4 20 60 08 st %g2, [ %g1 + 8 ]
the_server->task_id = -1;
4000aaf4: 84 10 3f ff mov -1, %g2
4000aaf8: c4 20 40 00 st %g2, [ %g1 ]
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
4000aafc: 81 c7 e0 08 ret
4000ab00: 91 e8 20 00 restore %g0, 0, %o0
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
4000ab04: 81 c7 e0 08 ret <== NOT EXECUTED
4000ab08: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED
4000aea8 <_Scheduler_CBS_Initialize>:
}
}
int _Scheduler_CBS_Initialize(void)
{
4000aea8: 9d e3 bf a0 save %sp, -96, %sp
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
4000aeac: 3b 10 00 64 sethi %hi(0x40019000), %i5
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
4000aeb0: d0 07 61 98 ld [ %i5 + 0x198 ], %o0 ! 40019198 <_Scheduler_CBS_Maximum_servers>
}
int _Scheduler_CBS_Initialize(void)
{
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
4000aeb4: 40 00 06 60 call 4000c834 <_Workspace_Allocate>
4000aeb8: 91 2a 20 02 sll %o0, 2, %o0
4000aebc: 03 10 00 69 sethi %hi(0x4001a400), %g1
4000aec0: d0 20 60 18 st %o0, [ %g1 + 0x18 ] ! 4001a418 <_Scheduler_CBS_Server_list>
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
4000aec4: 80 a2 20 00 cmp %o0, 0
4000aec8: 02 80 00 0d be 4000aefc <_Scheduler_CBS_Initialize+0x54> <== NEVER TAKEN
4000aecc: 86 10 00 01 mov %g1, %g3
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
4000aed0: c4 07 61 98 ld [ %i5 + 0x198 ], %g2
4000aed4: 82 10 20 00 clr %g1
4000aed8: 80 a0 40 02 cmp %g1, %g2
4000aedc: 02 80 00 06 be 4000aef4 <_Scheduler_CBS_Initialize+0x4c>
4000aee0: fa 00 e0 18 ld [ %g3 + 0x18 ], %i5
_Scheduler_CBS_Server_list[i] = NULL;
4000aee4: 89 28 60 02 sll %g1, 2, %g4
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
4000aee8: 82 00 60 01 inc %g1
_Scheduler_CBS_Server_list[i] = NULL;
4000aeec: 10 bf ff fb b 4000aed8 <_Scheduler_CBS_Initialize+0x30>
4000aef0: c0 27 40 04 clr [ %i5 + %g4 ]
4000aef4: 81 c7 e0 08 ret
4000aef8: 91 e8 20 00 restore %g0, 0, %o0
}
return SCHEDULER_CBS_OK;
}
4000aefc: 81 c7 e0 08 ret <== NOT EXECUTED
4000af00: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED
40009c98 <_Scheduler_CBS_Release_job>:
)
{
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info =
(Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
Scheduler_CBS_Server *serv_info =
40009c98: c2 02 20 88 ld [ %o0 + 0x88 ], %g1
(Scheduler_CBS_Server *) sched_info->cbs_server;
if (deadline) {
40009c9c: 80 a2 60 00 cmp %o1, 0
40009ca0: 02 80 00 10 be 40009ce0 <_Scheduler_CBS_Release_job+0x48>
40009ca4: c2 00 60 18 ld [ %g1 + 0x18 ], %g1
/* Initializing or shifting deadline. */
if (serv_info)
40009ca8: 80 a0 60 00 cmp %g1, 0
40009cac: 02 80 00 08 be 40009ccc <_Scheduler_CBS_Release_job+0x34>
40009cb0: 05 10 00 60 sethi %hi(0x40018000), %g2
new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline)
40009cb4: d2 00 a3 70 ld [ %g2 + 0x370 ], %o1 ! 40018370 <_Watchdog_Ticks_since_boot>
40009cb8: c4 00 60 04 ld [ %g1 + 4 ], %g2
40009cbc: 92 02 40 02 add %o1, %g2, %o1
40009cc0: 05 20 00 00 sethi %hi(0x80000000), %g2
40009cc4: 10 80 00 0a b 40009cec <_Scheduler_CBS_Release_job+0x54>
40009cc8: 92 2a 40 02 andn %o1, %g2, %o1
& ~SCHEDULER_EDF_PRIO_MSB;
else
new_priority = (_Watchdog_Ticks_since_boot + deadline)
40009ccc: c2 00 a3 70 ld [ %g2 + 0x370 ], %g1
40009cd0: 92 02 40 01 add %o1, %g1, %o1
40009cd4: 03 20 00 00 sethi %hi(0x80000000), %g1
40009cd8: 10 80 00 07 b 40009cf4 <_Scheduler_CBS_Release_job+0x5c>
40009cdc: 92 2a 40 01 andn %o1, %g1, %o1
/* Switch back to background priority. */
new_priority = the_thread->Start.initial_priority;
}
/* Budget replenishment for the next job. */
if (serv_info)
40009ce0: 80 a0 60 00 cmp %g1, 0
40009ce4: 02 80 00 04 be 40009cf4 <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN
40009ce8: d2 02 20 ac ld [ %o0 + 0xac ], %o1
the_thread->cpu_time_budget = serv_info->parameters.budget;
40009cec: c2 00 60 08 ld [ %g1 + 8 ], %g1
40009cf0: c2 22 20 74 st %g1, [ %o0 + 0x74 ]
the_thread->real_priority = new_priority;
40009cf4: d2 22 20 18 st %o1, [ %o0 + 0x18 ]
_Thread_Change_priority(the_thread, new_priority, true);
40009cf8: 94 10 20 01 mov 1, %o2
40009cfc: 82 13 c0 00 mov %o7, %g1
40009d00: 40 00 01 2b call 4000a1ac <_Thread_Change_priority>
40009d04: 9e 10 40 00 mov %g1, %o7
40009d08 <_Scheduler_CBS_Unblock>:
#include <rtems/score/watchdogimpl.h>
void _Scheduler_CBS_Unblock(
Thread_Control *the_thread
)
{
40009d08: 9d e3 bf a0 save %sp, -96, %sp
Scheduler_CBS_Per_thread *sched_info;
Scheduler_CBS_Server *serv_info;
Priority_Control new_priority;
_Scheduler_EDF_Enqueue(the_thread);
40009d0c: 40 00 00 90 call 40009f4c <_Scheduler_EDF_Enqueue>
40009d10: 90 10 00 18 mov %i0, %o0
/* TODO: flash critical section? */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server;
40009d14: c2 06 20 88 ld [ %i0 + 0x88 ], %g1
40009d18: fa 00 60 18 ld [ %g1 + 0x18 ], %i5
* Late unblock rule for deadline-driven tasks. The remaining time to
* deadline must be sufficient to serve the remaining computation time
* without increased utilization of this task. It might cause a deadline
* miss of another task.
*/
if (serv_info) {
40009d1c: 80 a7 60 00 cmp %i5, 0
40009d20: 22 80 00 1a be,a 40009d88 <_Scheduler_CBS_Unblock+0x80>
40009d24: 3b 10 00 61 sethi %hi(0x40018400), %i5
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 -
40009d28: 03 10 00 60 sethi %hi(0x40018000), %g1
_Watchdog_Ticks_since_boot;
if ( deadline*budget_left > budget*deadline_left ) {
40009d2c: 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 -
40009d30: d0 00 63 70 ld [ %g1 + 0x370 ], %o0
40009d34: f8 06 20 18 ld [ %i0 + 0x18 ], %i4
_Watchdog_Ticks_since_boot;
if ( deadline*budget_left > budget*deadline_left ) {
40009d38: 40 00 28 99 call 40013f9c <.umul>
40009d3c: 90 27 00 08 sub %i4, %o0, %o0
40009d40: d2 06 20 74 ld [ %i0 + 0x74 ], %o1
40009d44: b6 10 00 08 mov %o0, %i3
40009d48: 40 00 28 95 call 40013f9c <.umul>
40009d4c: d0 07 60 08 ld [ %i5 + 8 ], %o0
40009d50: 80 a6 c0 08 cmp %i3, %o0
40009d54: 24 80 00 0d ble,a 40009d88 <_Scheduler_CBS_Unblock+0x80>
40009d58: 3b 10 00 61 sethi %hi(0x40018400), %i5
/* Put late unblocked task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
40009d5c: d2 06 20 ac ld [ %i0 + 0xac ], %o1
if ( the_thread->real_priority != new_priority )
40009d60: 80 a7 00 09 cmp %i4, %o1
40009d64: 32 80 00 02 bne,a 40009d6c <_Scheduler_CBS_Unblock+0x64>
40009d68: d2 26 20 18 st %o1, [ %i0 + 0x18 ]
the_thread->real_priority = new_priority;
if ( the_thread->current_priority != new_priority )
40009d6c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
40009d70: 80 a0 40 09 cmp %g1, %o1
40009d74: 02 80 00 04 be 40009d84 <_Scheduler_CBS_Unblock+0x7c>
40009d78: 90 10 00 18 mov %i0, %o0
_Thread_Change_priority(the_thread, new_priority, true);
40009d7c: 40 00 01 0c call 4000a1ac <_Thread_Change_priority>
40009d80: 94 10 20 01 mov 1, %o2
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
40009d84: 3b 10 00 61 sethi %hi(0x40018400), %i5
40009d88: ba 17 63 a0 or %i5, 0x3a0, %i5 ! 400187a0 <_Per_CPU_Information>
40009d8c: c4 07 60 1c ld [ %i5 + 0x1c ], %g2
40009d90: 03 10 00 5d sethi %hi(0x40017400), %g1
40009d94: d0 06 20 14 ld [ %i0 + 0x14 ], %o0
40009d98: c2 00 61 78 ld [ %g1 + 0x178 ], %g1
40009d9c: 9f c0 40 00 call %g1
40009da0: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1
40009da4: 80 a2 20 00 cmp %o0, 0
40009da8: 04 80 00 0d ble 40009ddc <_Scheduler_CBS_Unblock+0xd4>
40009dac: 82 10 00 1d mov %i5, %g1
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
40009db0: c4 07 60 18 ld [ %i5 + 0x18 ], %g2
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
40009db4: f0 27 60 1c st %i0, [ %i5 + 0x1c ]
if ( _Thread_Executing->is_preemptible ||
40009db8: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2
40009dbc: 80 a0 a0 00 cmp %g2, 0
40009dc0: 12 80 00 06 bne 40009dd8 <_Scheduler_CBS_Unblock+0xd0>
40009dc4: 84 10 20 01 mov 1, %g2
40009dc8: c4 06 20 14 ld [ %i0 + 0x14 ], %g2
40009dcc: 80 a0 a0 00 cmp %g2, 0
40009dd0: 12 80 00 03 bne 40009ddc <_Scheduler_CBS_Unblock+0xd4> <== ALWAYS TAKEN
40009dd4: 84 10 20 01 mov 1, %g2
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
40009dd8: c4 28 60 14 stb %g2, [ %g1 + 0x14 ]
40009ddc: 81 c7 e0 08 ret
40009de0: 81 e8 00 00 restore
40009d34 <_Scheduler_EDF_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_EDF_Allocate(
Thread_Control *the_thread
)
{
40009d34: 9d e3 bf a0 save %sp, -96, %sp
void *sched;
Scheduler_EDF_Per_thread *schinfo;
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
40009d38: 40 00 06 04 call 4000b548 <_Workspace_Allocate>
40009d3c: 90 10 20 18 mov 0x18, %o0
if ( sched ) {
40009d40: 80 a2 20 00 cmp %o0, 0
40009d44: 02 80 00 05 be 40009d58 <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN
40009d48: 82 10 20 02 mov 2, %g1
the_thread->scheduler_info = sched;
40009d4c: d0 26 20 88 st %o0, [ %i0 + 0x88 ]
schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info);
schinfo->thread = the_thread;
40009d50: f0 22 00 00 st %i0, [ %o0 ]
schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
40009d54: c2 22 20 14 st %g1, [ %o0 + 0x14 ]
}
return sched;
}
40009d58: 81 c7 e0 08 ret
40009d5c: 91 e8 00 08 restore %g0, %o0, %o0
40009efc <_Scheduler_EDF_Block>:
#include <rtems/score/scheduleredfimpl.h>
void _Scheduler_EDF_Block(
Thread_Control *the_thread
)
{
40009efc: 9d e3 bf a0 save %sp, -96, %sp
void ( *extract )( Thread_Control *thread ),
void ( *schedule )( Thread_Control *thread, bool force_dispatch ),
Thread_Control *thread
)
{
( *extract )( thread );
40009f00: 40 00 00 1d call 40009f74 <_Scheduler_EDF_Extract>
40009f04: 90 10 00 18 mov %i0, %o0
40009f08: 03 10 00 61 sethi %hi(0x40018400), %g1
40009f0c: 82 10 63 a0 or %g1, 0x3a0, %g1 ! 400187a0 <_Per_CPU_Information>
/* TODO: flash critical section? */
if ( _Thread_Is_executing( thread ) || _Thread_Is_heir( thread ) ) {
40009f10: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
40009f14: 80 a6 00 02 cmp %i0, %g2
40009f18: 02 80 00 06 be 40009f30 <_Scheduler_EDF_Block+0x34>
40009f1c: 01 00 00 00 nop
40009f20: c2 00 60 1c ld [ %g1 + 0x1c ], %g1
40009f24: 80 a6 00 01 cmp %i0, %g1
40009f28: 12 80 00 04 bne 40009f38 <_Scheduler_EDF_Block+0x3c> <== ALWAYS TAKEN
40009f2c: 01 00 00 00 nop
( *schedule )( thread, true );
40009f30: 7f ff ff e0 call 40009eb0 <_Scheduler_EDF_Schedule_body>
40009f34: 93 e8 20 01 restore %g0, 1, %o1
40009f38: 81 c7 e0 08 ret
40009f3c: 81 e8 00 00 restore
4000a048 <_Scheduler_EDF_Schedule>:
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
4000a048: 03 10 00 61 sethi %hi(0x40018400), %g1
4000a04c: c2 00 63 d0 ld [ %g1 + 0x3d0 ], %g1 ! 400187d0 <_Scheduler_EDF_Ready_queue+0x8>
4000a050: c6 00 7f fc ld [ %g1 + -4 ], %g3
RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
Thread_Control *heir,
bool force_dispatch
)
{
Thread_Control *executing = _Thread_Executing;
4000a054: 03 10 00 61 sethi %hi(0x40018400), %g1
4000a058: 82 10 63 a0 or %g1, 0x3a0, %g1 ! 400187a0 <_Per_CPU_Information>
4000a05c: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
_Thread_Heir = heir;
if ( executing != heir && ( force_dispatch || executing->is_preemptible ) )
4000a060: 80 a0 80 03 cmp %g2, %g3
4000a064: 02 80 00 07 be 4000a080 <_Scheduler_EDF_Schedule+0x38>
4000a068: c6 20 60 1c st %g3, [ %g1 + 0x1c ]
4000a06c: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2
4000a070: 80 a0 a0 00 cmp %g2, 0
4000a074: 02 80 00 03 be 4000a080 <_Scheduler_EDF_Schedule+0x38> <== NEVER TAKEN
4000a078: 84 10 20 01 mov 1, %g2
_Thread_Dispatch_necessary = true;
4000a07c: c4 28 60 14 stb %g2, [ %g1 + 0x14 ]
4000a080: 81 c3 e0 08 retl
40009eb0 <_Scheduler_EDF_Schedule_body>:
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
40009eb0: 03 10 00 61 sethi %hi(0x40018400), %g1
)
{
RBTree_Node *first = _RBTree_First(&_Scheduler_EDF_Ready_queue, RBT_LEFT);
Scheduler_EDF_Per_thread *sched_info =
_RBTree_Container_of(first, Scheduler_EDF_Per_thread, Node);
Thread_Control *heir = (Thread_Control *) sched_info->thread;
40009eb4: c2 00 63 d0 ld [ %g1 + 0x3d0 ], %g1 ! 400187d0 <_Scheduler_EDF_Ready_queue+0x8>
40009eb8: c6 00 7f fc ld [ %g1 + -4 ], %g3
RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
Thread_Control *heir,
bool force_dispatch
)
{
Thread_Control *executing = _Thread_Executing;
40009ebc: 03 10 00 61 sethi %hi(0x40018400), %g1
40009ec0: 82 10 63 a0 or %g1, 0x3a0, %g1 ! 400187a0 <_Per_CPU_Information>
40009ec4: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
_Thread_Heir = heir;
if ( executing != heir && ( force_dispatch || executing->is_preemptible ) )
40009ec8: 80 a0 80 03 cmp %g2, %g3
40009ecc: 02 80 00 0a be 40009ef4 <_Scheduler_EDF_Schedule_body+0x44><== NEVER TAKEN
40009ed0: c6 20 60 1c st %g3, [ %g1 + 0x1c ]
40009ed4: 80 a2 60 00 cmp %o1, 0
40009ed8: 32 80 00 06 bne,a 40009ef0 <_Scheduler_EDF_Schedule_body+0x40><== ALWAYS TAKEN
40009edc: 84 10 20 01 mov 1, %g2
40009ee0: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 <== NOT EXECUTED
40009ee4: 80 a0 a0 00 cmp %g2, 0 <== NOT EXECUTED
40009ee8: 02 80 00 03 be 40009ef4 <_Scheduler_EDF_Schedule_body+0x44><== NOT EXECUTED
40009eec: 84 10 20 01 mov 1, %g2 <== NOT EXECUTED
_Thread_Dispatch_necessary = true;
40009ef0: c4 28 60 14 stb %g2, [ %g1 + 0x14 ]
40009ef4: 81 c3 e0 08 retl
40009f6c <_Scheduler_EDF_Unblock>:
#include <rtems/score/thread.h>
void _Scheduler_EDF_Unblock(
Thread_Control *the_thread
)
{
40009f6c: 9d e3 bf a0 save %sp, -96, %sp
_Scheduler_EDF_Enqueue(the_thread);
40009f70: 7f ff ff a3 call 40009dfc <_Scheduler_EDF_Enqueue>
40009f74: 90 10 00 18 mov %i0, %o0
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
40009f78: 3b 10 00 61 sethi %hi(0x40018400), %i5
40009f7c: ba 17 62 f0 or %i5, 0x2f0, %i5 ! 400186f0 <_Per_CPU_Information>
40009f80: c4 07 60 1c ld [ %i5 + 0x1c ], %g2
RTEMS_INLINE_ROUTINE int _Scheduler_Priority_compare(
Priority_Control p1,
Priority_Control p2
)
{
return _Scheduler.Operations.priority_compare(p1, p2);
40009f84: 03 10 00 5d sethi %hi(0x40017400), %g1
40009f88: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0
40009f8c: c2 00 60 c8 ld [ %g1 + 0xc8 ], %g1
40009f90: 9f c0 40 00 call %g1
40009f94: d2 06 20 14 ld [ %i0 + 0x14 ], %o1
40009f98: 80 a2 20 00 cmp %o0, 0
40009f9c: 16 80 00 0d bge 40009fd0 <_Scheduler_EDF_Unblock+0x64>
40009fa0: 82 10 00 1d mov %i5, %g1
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
40009fa4: c4 07 60 18 ld [ %i5 + 0x18 ], %g2
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
40009fa8: f0 27 60 1c st %i0, [ %i5 + 0x1c ]
if ( _Thread_Executing->is_preemptible ||
40009fac: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2
40009fb0: 80 a0 a0 00 cmp %g2, 0
40009fb4: 12 80 00 06 bne 40009fcc <_Scheduler_EDF_Unblock+0x60>
40009fb8: 84 10 20 01 mov 1, %g2
40009fbc: c4 06 20 14 ld [ %i0 + 0x14 ], %g2
40009fc0: 80 a0 a0 00 cmp %g2, 0
40009fc4: 12 80 00 03 bne 40009fd0 <_Scheduler_EDF_Unblock+0x64> <== ALWAYS TAKEN
40009fc8: 84 10 20 01 mov 1, %g2
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
40009fcc: c4 28 60 14 stb %g2, [ %g1 + 0x14 ]
40009fd0: 81 c7 e0 08 ret
40009fd4: 81 e8 00 00 restore
4000a0bc <_Scheduler_EDF_Yield>:
#endif
#include <rtems/score/scheduleredfimpl.h>
void _Scheduler_EDF_Yield( Thread_Control *thread )
{
4000a0bc: 9d e3 bf a0 save %sp, -96, %sp
Scheduler_EDF_Per_thread *thread_info =
(Scheduler_EDF_Per_thread *) thread->scheduler_info;
RBTree_Node *thread_node = &(thread_info->Node);
_ISR_Disable( level );
4000a0c0: 7f ff e2 98 call 40002b20 <sparc_disable_interrupts>
4000a0c4: fa 06 20 88 ld [ %i0 + 0x88 ], %i5
{
ISR_Level level;
Scheduler_EDF_Per_thread *thread_info =
(Scheduler_EDF_Per_thread *) thread->scheduler_info;
RBTree_Node *thread_node = &(thread_info->Node);
4000a0c8: ba 07 60 04 add %i5, 4, %i5
_ISR_Disable( level );
4000a0cc: b6 10 00 08 mov %o0, %i3
/*
* The RBTree has more than one node, enqueue behind the tasks
* with the same priority in case there are such ones.
*/
_RBTree_Extract( &_Scheduler_EDF_Ready_queue, thread_node );
4000a0d0: 39 10 00 61 sethi %hi(0x40018400), %i4
4000a0d4: 92 10 00 1d mov %i5, %o1
4000a0d8: 40 00 0f 22 call 4000dd60 <_RBTree_Extract>
4000a0dc: 90 17 23 c8 or %i4, 0x3c8, %o0
_RBTree_Insert( &_Scheduler_EDF_Ready_queue, thread_node );
4000a0e0: 90 17 23 c8 or %i4, 0x3c8, %o0
4000a0e4: 40 00 0f a9 call 4000df88 <_RBTree_Insert>
4000a0e8: 92 10 00 1d mov %i5, %o1
_ISR_Flash( level );
4000a0ec: 7f ff e2 91 call 40002b30 <sparc_enable_interrupts>
4000a0f0: 90 10 00 1b mov %i3, %o0
4000a0f4: 7f ff e2 8b call 40002b20 <sparc_disable_interrupts>
4000a0f8: 01 00 00 00 nop
4000a0fc: b0 10 00 08 mov %o0, %i0
4000a100: 03 10 00 61 sethi %hi(0x40018400), %g1
4000a104: c2 00 63 d0 ld [ %g1 + 0x3d0 ], %g1 ! 400187d0 <_Scheduler_EDF_Ready_queue+0x8>
4000a108: c6 00 7f fc ld [ %g1 + -4 ], %g3
RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
Thread_Control *heir,
bool force_dispatch
)
{
Thread_Control *executing = _Thread_Executing;
4000a10c: 03 10 00 61 sethi %hi(0x40018400), %g1
4000a110: 82 10 63 a0 or %g1, 0x3a0, %g1 ! 400187a0 <_Per_CPU_Information>
4000a114: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
_Thread_Heir = heir;
if ( executing != heir && ( force_dispatch || executing->is_preemptible ) )
4000a118: 80 a0 80 03 cmp %g2, %g3
4000a11c: 02 80 00 07 be 4000a138 <_Scheduler_EDF_Yield+0x7c> <== NEVER TAKEN
4000a120: c6 20 60 1c st %g3, [ %g1 + 0x1c ]
4000a124: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2
4000a128: 80 a0 a0 00 cmp %g2, 0
4000a12c: 02 80 00 03 be 4000a138 <_Scheduler_EDF_Yield+0x7c> <== ALWAYS TAKEN
4000a130: 84 10 20 01 mov 1, %g2
_Thread_Dispatch_necessary = true;
4000a134: c4 28 60 14 stb %g2, [ %g1 + 0x14 ] <== NOT EXECUTED
_Scheduler_EDF_Schedule_body( thread, false );
_ISR_Enable( level );
4000a138: 7f ff e2 7e call 40002b30 <sparc_enable_interrupts>
4000a13c: 81 e8 00 00 restore
40008eb0 <_Scheduler_default_Tick>:
#endif
}
}
void _Scheduler_default_Tick( void )
{
40008eb0: 9d e3 bf a0 save %sp, -96, %sp
uint32_t processor;
for ( processor = 0 ; processor < processor_count ; ++processor ) {
const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( processor );
_Scheduler_default_Tick_for_executing( per_cpu->executing );
40008eb4: 03 10 00 5c sethi %hi(0x40017000), %g1
40008eb8: fa 00 62 28 ld [ %g1 + 0x228 ], %i5 ! 40017228 <_Per_CPU_Information+0x18>
/*
* If the thread is not preemptible or is not ready, then
* just return.
*/
if ( !executing->is_preemptible )
40008ebc: c2 0f 60 70 ldub [ %i5 + 0x70 ], %g1
40008ec0: 80 a0 60 00 cmp %g1, 0
40008ec4: 02 80 00 25 be 40008f58 <_Scheduler_default_Tick+0xa8>
40008ec8: 01 00 00 00 nop
return;
if ( !_States_Is_ready( executing->current_state ) )
40008ecc: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
40008ed0: 80 a0 60 00 cmp %g1, 0
40008ed4: 12 80 00 21 bne 40008f58 <_Scheduler_default_Tick+0xa8>
40008ed8: 01 00 00 00 nop
/*
* The cpu budget algorithm determines what happens next.
*/
switch ( executing->budget_algorithm ) {
40008edc: c2 07 60 78 ld [ %i5 + 0x78 ], %g1
40008ee0: 80 a0 60 01 cmp %g1, 1
40008ee4: 0a 80 00 06 bcs 40008efc <_Scheduler_default_Tick+0x4c>
40008ee8: 80 a0 60 02 cmp %g1, 2
40008eec: 08 80 00 06 bleu 40008f04 <_Scheduler_default_Tick+0x54>
40008ef0: 80 a0 60 03 cmp %g1, 3
40008ef4: 22 80 00 12 be,a 40008f3c <_Scheduler_default_Tick+0x8c> <== ALWAYS TAKEN
40008ef8: c2 07 60 74 ld [ %i5 + 0x74 ], %g1
40008efc: 81 c7 e0 08 ret
40008f00: 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 ) {
40008f04: c2 07 60 74 ld [ %i5 + 0x74 ], %g1
40008f08: 82 00 7f ff add %g1, -1, %g1
40008f0c: 80 a0 60 00 cmp %g1, 0
40008f10: 14 bf ff fb bg 40008efc <_Scheduler_default_Tick+0x4c>
40008f14: c2 27 60 74 st %g1, [ %i5 + 0x74 ]
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Yield(
Thread_Control *thread
)
{
( *_Scheduler.Operations.yield )( thread );
40008f18: 03 10 00 58 sethi %hi(0x40016000), %g1
40008f1c: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 ! 40016024 <_Scheduler+0xc>
40008f20: 9f c0 40 00 call %g1
40008f24: 90 10 00 1d mov %i5, %o0
* executing thread's timeslice is reset. Otherwise, the
* currently executing thread is placed at the rear of the
* FIFO for this priority and a new heir is selected.
*/
_Scheduler_Yield( executing );
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
40008f28: 03 10 00 5b sethi %hi(0x40016c00), %g1
40008f2c: c2 00 60 a0 ld [ %g1 + 0xa0 ], %g1 ! 40016ca0 <_Thread_Ticks_per_timeslice>
40008f30: c2 27 60 74 st %g1, [ %i5 + 0x74 ]
40008f34: 81 c7 e0 08 ret
40008f38: 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 )
40008f3c: 82 00 7f ff add %g1, -1, %g1
40008f40: 80 a0 60 00 cmp %g1, 0
40008f44: 12 bf ff ee bne 40008efc <_Scheduler_default_Tick+0x4c>
40008f48: c2 27 60 74 st %g1, [ %i5 + 0x74 ]
(*executing->budget_callout)( executing );
40008f4c: c2 07 60 7c ld [ %i5 + 0x7c ], %g1
40008f50: 9f c0 40 00 call %g1
40008f54: 90 10 00 1d mov %i5, %o0
40008f58: 81 c7 e0 08 ret
40008f5c: 81 e8 00 00 restore
40009010 <_Scheduler_priority_Schedule_body>:
/**@{**/
RTEMS_INLINE_ROUTINE Chain_Control *
_Scheduler_priority_Get_ready_queues( void )
{
return ( Chain_Control * ) _Scheduler.information;
40009010: 03 10 00 58 sethi %hi(0x40016000), %g1
40009014: da 00 60 18 ld [ %g1 + 0x18 ], %o5 ! 40016018 <_Scheduler>
RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void )
{
Priority_bit_map_Control minor;
Priority_bit_map_Control major;
_Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
40009018: 03 10 00 5d sethi %hi(0x40017400), %g1
4000901c: c4 10 61 e0 lduh [ %g1 + 0x1e0 ], %g2 ! 400175e0 <_Priority_Major_bit_map>
40009020: 03 10 00 56 sethi %hi(0x40015800), %g1
40009024: 85 28 a0 10 sll %g2, 0x10, %g2
40009028: 87 30 a0 10 srl %g2, 0x10, %g3
4000902c: 80 a0 e0 ff cmp %g3, 0xff
40009030: 18 80 00 05 bgu 40009044 <_Scheduler_priority_Schedule_body+0x34>
40009034: 82 10 62 10 or %g1, 0x210, %g1
40009038: c4 08 40 03 ldub [ %g1 + %g3 ], %g2
4000903c: 10 80 00 04 b 4000904c <_Scheduler_priority_Schedule_body+0x3c>
40009040: 84 00 a0 08 add %g2, 8, %g2
40009044: 85 30 a0 18 srl %g2, 0x18, %g2
40009048: c4 08 40 02 ldub [ %g1 + %g2 ], %g2
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
4000904c: 85 28 a0 10 sll %g2, 0x10, %g2
40009050: 09 10 00 5d sethi %hi(0x40017400), %g4
40009054: 87 30 a0 0f srl %g2, 0xf, %g3
40009058: 88 11 21 f0 or %g4, 0x1f0, %g4
4000905c: c6 11 00 03 lduh [ %g4 + %g3 ], %g3
40009060: 87 28 e0 10 sll %g3, 0x10, %g3
40009064: 89 30 e0 10 srl %g3, 0x10, %g4
40009068: 80 a1 20 ff cmp %g4, 0xff
4000906c: 18 80 00 05 bgu 40009080 <_Scheduler_priority_Schedule_body+0x70>
40009070: 87 30 e0 18 srl %g3, 0x18, %g3
40009074: c2 08 40 04 ldub [ %g1 + %g4 ], %g1
40009078: 10 80 00 03 b 40009084 <_Scheduler_priority_Schedule_body+0x74>
4000907c: 82 00 60 08 add %g1, 8, %g1
40009080: c2 08 40 03 ldub [ %g1 + %g3 ], %g1
return (_Priority_Bits_index( major ) << 4) +
40009084: 85 30 a0 0c srl %g2, 0xc, %g2
_Priority_Bits_index( minor );
40009088: 83 28 60 10 sll %g1, 0x10, %g1
4000908c: 83 30 60 10 srl %g1, 0x10, %g1
Chain_Control *the_ready_queue
)
{
Priority_Control index = _Priority_bit_map_Get_highest();
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
40009090: 82 00 40 02 add %g1, %g2, %g1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
40009094: 85 28 60 02 sll %g1, 2, %g2
40009098: 83 28 60 04 sll %g1, 4, %g1
4000909c: 82 20 40 02 sub %g1, %g2, %g1
400090a0: c6 03 40 01 ld [ %o5 + %g1 ], %g3
RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
Thread_Control *heir,
bool force_dispatch
)
{
Thread_Control *executing = _Thread_Executing;
400090a4: 03 10 00 5c sethi %hi(0x40017000), %g1
400090a8: 82 10 62 10 or %g1, 0x210, %g1 ! 40017210 <_Per_CPU_Information>
400090ac: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
_Thread_Heir = heir;
if ( executing != heir && ( force_dispatch || executing->is_preemptible ) )
400090b0: 80 a0 80 03 cmp %g2, %g3
400090b4: 02 80 00 0a be 400090dc <_Scheduler_priority_Schedule_body+0xcc><== NEVER TAKEN
400090b8: c6 20 60 1c st %g3, [ %g1 + 0x1c ]
400090bc: 80 a2 60 00 cmp %o1, 0
400090c0: 32 80 00 06 bne,a 400090d8 <_Scheduler_priority_Schedule_body+0xc8><== ALWAYS TAKEN
400090c4: 84 10 20 01 mov 1, %g2
400090c8: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 <== NOT EXECUTED
400090cc: 80 a0 a0 00 cmp %g2, 0 <== NOT EXECUTED
400090d0: 02 80 00 03 be 400090dc <_Scheduler_priority_Schedule_body+0xcc><== NOT EXECUTED
400090d4: 84 10 20 01 mov 1, %g2 <== NOT EXECUTED
_Thread_Dispatch_necessary = true;
400090d8: c4 28 60 14 stb %g2, [ %g1 + 0x14 ]
400090dc: 81 c3 e0 08 retl
40009b50 <_Scheduler_simple_Block>:
#include <rtems/score/schedulersimpleimpl.h>
void _Scheduler_simple_Block(
Thread_Control *the_thread
)
{
40009b50: 9d e3 bf a0 save %sp, -96, %sp
void ( *extract )( Thread_Control *thread ),
void ( *schedule )( Thread_Control *thread, bool force_dispatch ),
Thread_Control *thread
)
{
( *extract )( thread );
40009b54: 40 00 00 16 call 40009bac <_Scheduler_simple_Extract>
40009b58: 90 10 00 18 mov %i0, %o0
40009b5c: 03 10 00 60 sethi %hi(0x40018000), %g1
40009b60: 82 10 62 10 or %g1, 0x210, %g1 ! 40018210 <_Per_CPU_Information>
/* TODO: flash critical section? */
if ( _Thread_Is_executing( thread ) || _Thread_Is_heir( thread ) ) {
40009b64: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
40009b68: 80 a6 00 02 cmp %i0, %g2
40009b6c: 02 80 00 06 be 40009b84 <_Scheduler_simple_Block+0x34>
40009b70: 01 00 00 00 nop
40009b74: c2 00 60 1c ld [ %g1 + 0x1c ], %g1
40009b78: 80 a6 00 01 cmp %i0, %g1
40009b7c: 12 80 00 04 bne 40009b8c <_Scheduler_simple_Block+0x3c> <== ALWAYS TAKEN
40009b80: 01 00 00 00 nop
( *schedule )( thread, true );
40009b84: 7f ff ff e0 call 40009b04 <_Scheduler_simple_Schedule_body>
40009b88: 93 e8 20 01 restore %g0, 1, %o1
40009b8c: 81 c7 e0 08 ret
40009b90: 81 e8 00 00 restore
40009c8c <_Scheduler_simple_Schedule>:
40009c8c: 03 10 00 5b sethi %hi(0x40016c00), %g1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
40009c90: c2 00 63 b8 ld [ %g1 + 0x3b8 ], %g1 ! 40016fb8 <_Scheduler>
40009c94: c6 00 40 00 ld [ %g1 ], %g3
RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
Thread_Control *heir,
bool force_dispatch
)
{
Thread_Control *executing = _Thread_Executing;
40009c98: 03 10 00 60 sethi %hi(0x40018000), %g1
40009c9c: 82 10 62 10 or %g1, 0x210, %g1 ! 40018210 <_Per_CPU_Information>
40009ca0: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
_Thread_Heir = heir;
if ( executing != heir && ( force_dispatch || executing->is_preemptible ) )
40009ca4: 80 a0 80 03 cmp %g2, %g3
40009ca8: 02 80 00 07 be 40009cc4 <_Scheduler_simple_Schedule+0x38>
40009cac: c6 20 60 1c st %g3, [ %g1 + 0x1c ]
40009cb0: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2
40009cb4: 80 a0 a0 00 cmp %g2, 0
40009cb8: 02 80 00 03 be 40009cc4 <_Scheduler_simple_Schedule+0x38> <== ALWAYS TAKEN
40009cbc: 84 10 20 01 mov 1, %g2
_Thread_Dispatch_necessary = true;
40009cc0: c4 28 60 14 stb %g2, [ %g1 + 0x14 ] <== NOT EXECUTED
40009cc4: 81 c3 e0 08 retl
40009b04 <_Scheduler_simple_Schedule_body>:
Thread_Control *thread,
bool force_dispatch
)
{
Thread_Control *heir = (Thread_Control *) _Chain_First(
(Chain_Control *) _Scheduler.information
40009b04: 03 10 00 5b sethi %hi(0x40016c00), %g1
40009b08: c2 00 63 b8 ld [ %g1 + 0x3b8 ], %g1 ! 40016fb8 <_Scheduler>
40009b0c: c6 00 40 00 ld [ %g1 ], %g3
RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
Thread_Control *heir,
bool force_dispatch
)
{
Thread_Control *executing = _Thread_Executing;
40009b10: 03 10 00 60 sethi %hi(0x40018000), %g1
40009b14: 82 10 62 10 or %g1, 0x210, %g1 ! 40018210 <_Per_CPU_Information>
40009b18: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
_Thread_Heir = heir;
if ( executing != heir && ( force_dispatch || executing->is_preemptible ) )
40009b1c: 80 a0 80 03 cmp %g2, %g3
40009b20: 02 80 00 0a be 40009b48 <_Scheduler_simple_Schedule_body+0x44><== NEVER TAKEN
40009b24: c6 20 60 1c st %g3, [ %g1 + 0x1c ]
40009b28: 80 a2 60 00 cmp %o1, 0
40009b2c: 32 80 00 06 bne,a 40009b44 <_Scheduler_simple_Schedule_body+0x40><== ALWAYS TAKEN
40009b30: 84 10 20 01 mov 1, %g2
40009b34: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 <== NOT EXECUTED
40009b38: 80 a0 a0 00 cmp %g2, 0 <== NOT EXECUTED
40009b3c: 02 80 00 03 be 40009b48 <_Scheduler_simple_Schedule_body+0x44><== NOT EXECUTED
40009b40: 84 10 20 01 mov 1, %g2 <== NOT EXECUTED
_Thread_Dispatch_necessary = true;
40009b44: c4 28 60 14 stb %g2, [ %g1 + 0x14 ]
40009b48: 81 c3 e0 08 retl
40009d28 <_Scheduler_simple_Yield>:
#include <rtems/score/schedulersimpleimpl.h>
#include <rtems/score/isr.h>
#include <rtems/score/threadimpl.h>
void _Scheduler_simple_Yield( Thread_Control *thread )
{
40009d28: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
_ISR_Disable( level );
40009d2c: 7f ff e2 f6 call 40002904 <sparc_disable_interrupts>
40009d30: 01 00 00 00 nop
40009d34: ba 10 00 08 mov %o0, %i5
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
40009d38: c4 06 00 00 ld [ %i0 ], %g2
previous = the_node->previous;
40009d3c: c2 06 20 04 ld [ %i0 + 4 ], %g1
{
/* extract */
_Chain_Extract_unprotected( &the_thread->Object.Node );
/* enqueue */
_Scheduler_simple_Ready_queue_enqueue( the_thread );
40009d40: 90 10 00 18 mov %i0, %o0
next->previous = previous;
40009d44: c2 20 a0 04 st %g1, [ %g2 + 4 ]
40009d48: 7f ff ff bd call 40009c3c <_Scheduler_simple_Ready_queue_enqueue>
40009d4c: c4 20 40 00 st %g2, [ %g1 ]
_Scheduler_simple_Ready_queue_requeue( &_Scheduler, thread );
_ISR_Flash( level );
40009d50: 7f ff e2 f1 call 40002914 <sparc_enable_interrupts>
40009d54: 90 10 00 1d mov %i5, %o0
40009d58: 7f ff e2 eb call 40002904 <sparc_disable_interrupts>
40009d5c: 01 00 00 00 nop
40009d60: b0 10 00 08 mov %o0, %i0
Thread_Control *thread,
bool force_dispatch
)
{
Thread_Control *heir = (Thread_Control *) _Chain_First(
(Chain_Control *) _Scheduler.information
40009d64: 03 10 00 5b sethi %hi(0x40016c00), %g1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
40009d68: c2 00 63 b8 ld [ %g1 + 0x3b8 ], %g1 ! 40016fb8 <_Scheduler>
40009d6c: c6 00 40 00 ld [ %g1 ], %g3
RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
Thread_Control *heir,
bool force_dispatch
)
{
Thread_Control *executing = _Thread_Executing;
40009d70: 03 10 00 60 sethi %hi(0x40018000), %g1
40009d74: 82 10 62 10 or %g1, 0x210, %g1 ! 40018210 <_Per_CPU_Information>
40009d78: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
_Thread_Heir = heir;
if ( executing != heir && ( force_dispatch || executing->is_preemptible ) )
40009d7c: 80 a0 80 03 cmp %g2, %g3
40009d80: 02 80 00 07 be 40009d9c <_Scheduler_simple_Yield+0x74>
40009d84: c6 20 60 1c st %g3, [ %g1 + 0x1c ]
40009d88: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2
40009d8c: 80 a0 a0 00 cmp %g2, 0
40009d90: 02 80 00 03 be 40009d9c <_Scheduler_simple_Yield+0x74> <== ALWAYS TAKEN
40009d94: 84 10 20 01 mov 1, %g2
_Thread_Dispatch_necessary = true;
40009d98: c4 28 60 14 stb %g2, [ %g1 + 0x14 ] <== NOT EXECUTED
_Scheduler_simple_Schedule_body( thread, false );
_ISR_Enable( level );
40009d9c: 7f ff e2 de call 40002914 <sparc_enable_interrupts>
40009da0: 81 e8 00 00 restore
40007f68 <_TOD_Validate>:
};
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
40007f68: 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 /
40007f6c: 03 10 00 5b sethi %hi(0x40016c00), %g1
40007f70: d2 00 60 d4 ld [ %g1 + 0xd4 ], %o1 ! 40016cd4 <Configuration+0xc>
40007f74: 11 00 03 d0 sethi %hi(0xf4000), %o0
40007f78: 40 00 33 15 call 40014bcc <.udiv>
40007f7c: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 <PROM_START+0xf4240>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
40007f80: 80 a6 20 00 cmp %i0, 0
40007f84: 02 80 00 33 be 40008050 <_TOD_Validate+0xe8> <== NEVER TAKEN
40007f88: 82 10 20 00 clr %g1
40007f8c: c4 06 20 18 ld [ %i0 + 0x18 ], %g2
40007f90: 80 a0 80 08 cmp %g2, %o0
40007f94: 3a 80 00 30 bcc,a 40008054 <_TOD_Validate+0xec>
40007f98: b0 08 60 01 and %g1, 1, %i0
(the_tod->ticks >= ticks_per_second) ||
40007f9c: c4 06 20 14 ld [ %i0 + 0x14 ], %g2
40007fa0: 80 a0 a0 3b cmp %g2, 0x3b
40007fa4: 38 80 00 2c bgu,a 40008054 <_TOD_Validate+0xec>
40007fa8: b0 08 60 01 and %g1, 1, %i0
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
40007fac: c4 06 20 10 ld [ %i0 + 0x10 ], %g2
40007fb0: 80 a0 a0 3b cmp %g2, 0x3b
40007fb4: 38 80 00 28 bgu,a 40008054 <_TOD_Validate+0xec>
40007fb8: b0 08 60 01 and %g1, 1, %i0
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
40007fbc: c4 06 20 0c ld [ %i0 + 0xc ], %g2
40007fc0: 80 a0 a0 17 cmp %g2, 0x17
40007fc4: 38 80 00 24 bgu,a 40008054 <_TOD_Validate+0xec>
40007fc8: b0 08 60 01 and %g1, 1, %i0
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
40007fcc: 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) ||
40007fd0: 84 07 3f ff add %i4, -1, %g2
40007fd4: 80 a0 a0 0b cmp %g2, 0xb
40007fd8: 38 80 00 1f bgu,a 40008054 <_TOD_Validate+0xec>
40007fdc: 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) ||
40007fe0: 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) ||
40007fe4: 80 a7 67 c3 cmp %i5, 0x7c3
40007fe8: 28 80 00 1b bleu,a 40008054 <_TOD_Validate+0xec>
40007fec: b0 08 60 01 and %g1, 1, %i0
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
40007ff0: 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) ||
40007ff4: 80 a6 e0 00 cmp %i3, 0
40007ff8: 02 80 00 16 be 40008050 <_TOD_Validate+0xe8> <== NEVER TAKEN
40007ffc: 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)) ||
40008000: 80 8f 60 03 btst 3, %i5
40008004: 12 80 00 08 bne 40008024 <_TOD_Validate+0xbc>
40008008: b4 16 a0 f0 or %i2, 0xf0, %i2
4000800c: 90 10 00 1d mov %i5, %o0
40008010: 40 00 33 9b call 40014e7c <.urem>
40008014: 92 10 20 64 mov 0x64, %o1
40008018: 80 a2 20 00 cmp %o0, 0
4000801c: 32 80 00 09 bne,a 40008040 <_TOD_Validate+0xd8>
40008020: b8 07 20 0d add %i4, 0xd, %i4
(the_tod->year % 400 == 0))
40008024: 90 10 00 1d mov %i5, %o0
40008028: 40 00 33 95 call 40014e7c <.urem>
4000802c: 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)) ||
40008030: 80 a2 20 00 cmp %o0, 0
40008034: 32 80 00 04 bne,a 40008044 <_TOD_Validate+0xdc>
40008038: b9 2f 20 02 sll %i4, 2, %i4
(the_tod->year % 400 == 0))
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
4000803c: b8 07 20 0d add %i4, 0xd, %i4
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
40008040: b9 2f 20 02 sll %i4, 2, %i4
40008044: c2 06 80 1c ld [ %i2 + %i4 ], %g1
if ( the_tod->day > days_in_month )
40008048: 80 a0 40 1b cmp %g1, %i3
4000804c: 82 60 3f ff subx %g0, -1, %g1
return false;
return true;
}
40008050: b0 08 60 01 and %g1, 1, %i0
40008054: 81 c7 e0 08 ret
40008058: 81 e8 00 00 restore
40009578 <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
40009578: 9d e3 bf a0 save %sp, -96, %sp
States_Control state, original_state;
/*
* Save original state
*/
original_state = the_thread->current_state;
4000957c: f8 06 20 10 ld [ %i0 + 0x10 ], %i4
/*
* Set a transient state for the thread so it is pulled off the Ready chains.
* This will prevent it from being scheduled no matter what happens in an
* ISR.
*/
_Thread_Set_transient( the_thread );
40009580: 40 00 03 2a call 4000a228 <_Thread_Set_transient>
40009584: 90 10 00 18 mov %i0, %o0
/*
* Do not bother recomputing all the priority related information if
* we are not REALLY changing priority.
*/
if ( the_thread->current_priority != new_priority )
40009588: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
4000958c: 80 a0 40 19 cmp %g1, %i1
40009590: 02 80 00 05 be 400095a4 <_Thread_Change_priority+0x2c>
40009594: ba 10 00 18 mov %i0, %i5
_Thread_Set_priority( the_thread, new_priority );
40009598: 90 10 00 18 mov %i0, %o0
4000959c: 40 00 03 0a call 4000a1c4 <_Thread_Set_priority>
400095a0: 92 10 00 19 mov %i1, %o1
_ISR_Disable( level );
400095a4: 7f ff e3 0f call 400021e0 <sparc_disable_interrupts>
400095a8: 01 00 00 00 nop
400095ac: b2 10 00 08 mov %o0, %i1
/*
* If the thread has more than STATES_TRANSIENT set, then it is blocked,
* If it is blocked on a thread queue, then we need to requeue it.
*/
state = the_thread->current_state;
400095b0: f6 07 60 10 ld [ %i5 + 0x10 ], %i3
400095b4: 82 0f 20 04 and %i4, 4, %g1
if ( state != STATES_TRANSIENT ) {
400095b8: 80 a6 e0 04 cmp %i3, 4
400095bc: 39 10 00 58 sethi %hi(0x40016000), %i4
400095c0: 02 80 00 14 be 40009610 <_Thread_Change_priority+0x98>
400095c4: b8 17 20 18 or %i4, 0x18, %i4 ! 40016018 <_Scheduler>
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
400095c8: 80 a0 60 00 cmp %g1, 0
400095cc: 32 80 00 05 bne,a 400095e0 <_Thread_Change_priority+0x68><== NEVER TAKEN
400095d0: c2 07 20 08 ld [ %i4 + 8 ], %g1 <== NOT EXECUTED
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
400095d4: 82 0e ff fb and %i3, -5, %g1
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
400095d8: c2 27 60 10 st %g1, [ %i5 + 0x10 ]
*
* @param[in] thread The thread which state changed previously.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( Thread_Control *thread )
{
_Scheduler.Operations.schedule( thread );
400095dc: c2 07 20 08 ld [ %i4 + 8 ], %g1
400095e0: 9f c0 40 00 call %g1
400095e4: 90 10 00 1d mov %i5, %o0
* result in a _Scheduler_Block() operation. Make sure we select an heir
* now.
*/
_Scheduler_Schedule( the_thread );
_ISR_Enable( level );
400095e8: 7f ff e3 02 call 400021f0 <sparc_enable_interrupts>
400095ec: 90 10 00 19 mov %i1, %o0
if ( _States_Is_waiting_on_thread_queue( state ) ) {
400095f0: 03 00 02 ef sethi %hi(0xbbc00), %g1
400095f4: 82 10 62 e0 or %g1, 0x2e0, %g1 ! bbee0 <PROM_START+0xbbee0>
400095f8: 80 8e c0 01 btst %i3, %g1
400095fc: 02 80 00 19 be 40009660 <_Thread_Change_priority+0xe8>
40009600: 01 00 00 00 nop
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
40009604: f0 07 60 44 ld [ %i5 + 0x44 ], %i0
40009608: 40 00 02 c1 call 4000a10c <_Thread_queue_Requeue>
4000960c: 93 e8 00 1d restore %g0, %i5, %o1
}
return;
}
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) ) {
40009610: 80 a0 60 00 cmp %g1, 0
40009614: 12 80 00 09 bne 40009638 <_Thread_Change_priority+0xc0> <== NEVER TAKEN
40009618: 80 a6 a0 00 cmp %i2, 0
* the TRANSIENT state. So we have to place it on the appropriate
* Ready Queue with interrupts off.
*/
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
if ( prepend_it )
4000961c: 02 80 00 04 be 4000962c <_Thread_Change_priority+0xb4>
40009620: c0 27 60 10 clr [ %i5 + 0x10 ]
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue_first( the_thread );
40009624: 10 80 00 03 b 40009630 <_Thread_Change_priority+0xb8>
40009628: c2 07 20 28 ld [ %i4 + 0x28 ], %g1
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue( the_thread );
4000962c: c2 07 20 24 ld [ %i4 + 0x24 ], %g1
40009630: 9f c0 40 00 call %g1
40009634: 90 10 00 1d mov %i5, %o0
_Scheduler_Enqueue_first( the_thread );
else
_Scheduler_Enqueue( the_thread );
}
_ISR_Flash( level );
40009638: 7f ff e2 ee call 400021f0 <sparc_enable_interrupts>
4000963c: 90 10 00 19 mov %i1, %o0
40009640: 7f ff e2 e8 call 400021e0 <sparc_disable_interrupts>
40009644: 01 00 00 00 nop
40009648: b0 10 00 08 mov %o0, %i0
*
* @param[in] thread The thread which state changed previously.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( Thread_Control *thread )
{
_Scheduler.Operations.schedule( thread );
4000964c: c2 07 20 08 ld [ %i4 + 8 ], %g1
40009650: 9f c0 40 00 call %g1
40009654: 90 10 00 1d mov %i5, %o0
* We altered the set of thread priorities. So let's figure out
* who is the heir and if we need to switch to them.
*/
_Scheduler_Schedule( the_thread );
_ISR_Enable( level );
40009658: 7f ff e2 e6 call 400021f0 <sparc_enable_interrupts>
4000965c: 81 e8 00 00 restore
40009660: 81 c7 e0 08 ret
40009664: 81 e8 00 00 restore
4000980c <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
4000980c: 9d e3 bf 98 save %sp, -104, %sp
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
40009810: 90 10 00 18 mov %i0, %o0
40009814: 40 00 00 68 call 400099b4 <_Thread_Get>
40009818: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
4000981c: c2 07 bf fc ld [ %fp + -4 ], %g1
40009820: 80 a0 60 00 cmp %g1, 0
40009824: 12 80 00 09 bne 40009848 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN
40009828: 13 04 00 00 sethi %hi(0x10000000), %o1
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
4000982c: 7f ff ff 8f call 40009668 <_Thread_Clear_state>
40009830: 92 12 60 18 or %o1, 0x18, %o1 ! 10000018 <RAM_SIZE+0xfc00018>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
40009834: 03 10 00 5c sethi %hi(0x40017000), %g1
40009838: 82 10 62 10 or %g1, 0x210, %g1 ! 40017210 <_Per_CPU_Information>
4000983c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
--level;
40009840: 84 00 bf ff add %g2, -1, %g2
_Thread_Dispatch_disable_level = level;
40009844: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
40009848: 81 c7 e0 08 ret
4000984c: 81 e8 00 00 restore
4000ed5c <_Thread_Handler>:
return doCons;
}
#endif
void _Thread_Handler( void )
{
4000ed5c: 9d e3 bf a0 save %sp, -96, %sp
Thread_Control *executing;
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
bool doCons;
#endif
executing = _Thread_Executing;
4000ed60: 03 10 00 5c sethi %hi(0x40017000), %g1
4000ed64: fa 00 62 28 ld [ %g1 + 0x228 ], %i5 ! 40017228 <_Per_CPU_Information+0x18>
/*
* 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();
4000ed68: 3f 10 00 3b sethi %hi(0x4000ec00), %i7
4000ed6c: be 17 e1 5c or %i7, 0x15c, %i7 ! 4000ed5c <_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;
4000ed70: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0
_ISR_Set_level( level );
4000ed74: 7f ff cd 1f call 400021f0 <sparc_enable_interrupts>
4000ed78: 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;
4000ed7c: 03 10 00 59 sethi %hi(0x40016400), %g1
doneConstructors = true;
4000ed80: 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;
4000ed84: f8 08 63 4c ldub [ %g1 + 0x34c ], %i4
);
}
static inline void _User_extensions_Thread_begin( Thread_Control *executing )
{
_User_extensions_Iterate(
4000ed88: 90 10 00 1d mov %i5, %o0
4000ed8c: 13 10 00 28 sethi %hi(0x4000a000), %o1
4000ed90: 92 12 63 f4 or %o1, 0x3f4, %o1 ! 4000a3f4 <_User_extensions_Thread_begin_visitor>
4000ed94: 7f ff ed b5 call 4000a468 <_User_extensions_Iterate>
4000ed98: c4 28 63 4c stb %g2, [ %g1 + 0x34c ]
* no thread dispatch necessary update.
*/
_Thread_Dispatch();
}
#else
_Thread_Enable_dispatch();
4000ed9c: 7f ff ea f9 call 40009980 <_Thread_Enable_dispatch>
4000eda0: 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) */ {
4000eda4: 80 8f 20 ff btst 0xff, %i4
4000eda8: 32 80 00 05 bne,a 4000edbc <_Thread_Handler+0x60>
4000edac: c2 07 60 90 ld [ %i5 + 0x90 ], %g1
INIT_NAME ();
4000edb0: 40 00 1c 5a call 40015f18 <_init>
4000edb4: 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 ) {
4000edb8: c2 07 60 90 ld [ %i5 + 0x90 ], %g1
4000edbc: 80 a0 60 00 cmp %g1, 0
4000edc0: 12 80 00 05 bne 4000edd4 <_Thread_Handler+0x78>
4000edc4: 80 a0 60 01 cmp %g1, 1
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
4000edc8: c2 07 60 8c ld [ %i5 + 0x8c ], %g1
4000edcc: 10 80 00 06 b 4000ede4 <_Thread_Handler+0x88>
4000edd0: 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 ) {
4000edd4: 12 80 00 08 bne 4000edf4 <_Thread_Handler+0x98> <== NEVER TAKEN
4000edd8: 90 10 00 1d mov %i5, %o0
executing->Wait.return_argument =
(*(Thread_Entry_pointer) executing->Start.entry_point)(
4000eddc: c2 07 60 8c ld [ %i5 + 0x8c ], %g1
4000ede0: d0 07 60 94 ld [ %i5 + 0x94 ], %o0
4000ede4: 9f c0 40 00 call %g1
4000ede8: 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 =
4000edec: d0 27 60 28 st %o0, [ %i5 + 0x28 ]
}
}
static inline void _User_extensions_Thread_exitted( Thread_Control *executing )
{
_User_extensions_Iterate(
4000edf0: 90 10 00 1d mov %i5, %o0
4000edf4: 13 10 00 29 sethi %hi(0x4000a400), %o1
4000edf8: 7f ff ed 9c call 4000a468 <_User_extensions_Iterate>
4000edfc: 92 12 60 18 or %o1, 0x18, %o1 ! 4000a418 <_User_extensions_Thread_exitted_visitor>
* able to fit in a (void *).
*/
_User_extensions_Thread_exitted( executing );
_Internal_error_Occurred(
4000ee00: 90 10 20 00 clr %o0
4000ee04: 92 10 20 01 mov 1, %o1
4000ee08: 7f ff e5 d5 call 4000855c <_Internal_error_Occurred>
4000ee0c: 94 10 20 05 mov 5, %o2
40009c20 <_Thread_Handler_initialization>:
#include <rtems/score/interr.h>
#include <rtems/score/sysstate.h>
#include <rtems/config.h>
void _Thread_Handler_initialization(void)
{
40009c20: 9d e3 bf 98 save %sp, -104, %sp
uint32_t ticks_per_timeslice =
40009c24: 03 10 00 52 sethi %hi(0x40014800), %g1
40009c28: 82 10 61 d0 or %g1, 0x1d0, %g1 ! 400149d0 <Configuration>
#if defined(RTEMS_MULTIPROCESSING)
uint32_t maximum_proxies =
_Configuration_MP_table->maximum_proxies;
#endif
if ( rtems_configuration_get_stack_allocate_hook() == NULL ||
40009c2c: c6 00 60 28 ld [ %g1 + 0x28 ], %g3
#include <rtems/score/sysstate.h>
#include <rtems/config.h>
void _Thread_Handler_initialization(void)
{
uint32_t ticks_per_timeslice =
40009c30: fa 00 60 14 ld [ %g1 + 0x14 ], %i5
rtems_configuration_get_ticks_per_timeslice();
uint32_t maximum_extensions =
40009c34: f8 00 60 08 ld [ %g1 + 8 ], %i4
#if defined(RTEMS_MULTIPROCESSING)
uint32_t maximum_proxies =
_Configuration_MP_table->maximum_proxies;
#endif
if ( rtems_configuration_get_stack_allocate_hook() == NULL ||
40009c38: 80 a0 e0 00 cmp %g3, 0
40009c3c: 02 80 00 06 be 40009c54 <_Thread_Handler_initialization+0x34><== NEVER TAKEN
40009c40: c4 00 60 24 ld [ %g1 + 0x24 ], %g2
40009c44: c6 00 60 2c ld [ %g1 + 0x2c ], %g3
40009c48: 80 a0 e0 00 cmp %g3, 0
40009c4c: 12 80 00 06 bne 40009c64 <_Thread_Handler_initialization+0x44>
40009c50: 80 a0 a0 00 cmp %g2, 0
rtems_configuration_get_stack_free_hook() == NULL)
_Internal_error_Occurred(
40009c54: 90 10 20 00 clr %o0
40009c58: 92 10 20 01 mov 1, %o1
40009c5c: 7f ff fa 40 call 4000855c <_Internal_error_Occurred>
40009c60: 94 10 20 0e mov 0xe, %o2
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_BAD_STACK_HOOK
);
if ( stack_allocate_init_hook != NULL )
40009c64: 22 80 00 05 be,a 40009c78 <_Thread_Handler_initialization+0x58>
40009c68: 03 10 00 5c sethi %hi(0x40017000), %g1
(*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() );
40009c6c: 9f c0 80 00 call %g2
40009c70: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 40017004 <_POSIX_Message_queue_Information+0x14>
_Thread_Dispatch_necessary = false;
40009c74: 03 10 00 5c sethi %hi(0x40017000), %g1
40009c78: 82 10 62 10 or %g1, 0x210, %g1 ! 40017210 <_Per_CPU_Information>
40009c7c: c0 28 60 14 clrb [ %g1 + 0x14 ]
_Thread_Executing = NULL;
40009c80: c0 20 60 18 clr [ %g1 + 0x18 ]
_Thread_Heir = NULL;
40009c84: c0 20 60 1c clr [ %g1 + 0x1c ]
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Thread_Allocated_fp = NULL;
#endif
_Thread_Maximum_extensions = maximum_extensions;
40009c88: 03 10 00 5b sethi %hi(0x40016c00), %g1
40009c8c: f8 20 61 b4 st %i4, [ %g1 + 0x1b4 ] ! 40016db4 <_Thread_Maximum_extensions>
_Thread_Ticks_per_timeslice = ticks_per_timeslice;
40009c90: 03 10 00 5b sethi %hi(0x40016c00), %g1
40009c94: fa 20 60 a0 st %i5, [ %g1 + 0xa0 ] ! 40016ca0 <_Thread_Ticks_per_timeslice>
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing )
maximum_internal_threads += 1;
#endif
_Objects_Initialize_information(
40009c98: 82 10 20 08 mov 8, %g1
40009c9c: 11 10 00 5b sethi %hi(0x40016c00), %o0
40009ca0: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
40009ca4: 90 12 21 e8 or %o0, 0x1e8, %o0
40009ca8: 92 10 20 01 mov 1, %o1
40009cac: 94 10 20 01 mov 1, %o2
40009cb0: 96 10 20 01 mov 1, %o3
40009cb4: 98 10 21 60 mov 0x160, %o4
40009cb8: 7f ff fb c2 call 40008bc0 <_Objects_Initialize_information>
40009cbc: 9a 10 20 00 clr %o5
40009cc0: 81 c7 e0 08 ret
40009cc4: 81 e8 00 00 restore
40009a50 <_Thread_Initialize>:
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
40009a50: 9d e3 bf 98 save %sp, -104, %sp
40009a54: c2 07 a0 6c ld [ %fp + 0x6c ], %g1
/*
* Zero out all the allocated memory fields
*/
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
the_thread->API_Extensions[i] = NULL;
40009a58: c0 26 61 4c clr [ %i1 + 0x14c ]
40009a5c: c0 26 61 50 clr [ %i1 + 0x150 ]
extensions_area = NULL;
the_thread->libc_reent = NULL;
40009a60: c0 26 61 48 clr [ %i1 + 0x148 ]
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
40009a64: e0 07 a0 60 ld [ %fp + 0x60 ], %l0
40009a68: e2 00 40 00 ld [ %g1 ], %l1
if ( !actual_stack_size || actual_stack_size < stack_size )
return false; /* stack allocation failed */
stack = the_thread->Start.stack;
#else
if ( !stack_area ) {
40009a6c: 80 a6 a0 00 cmp %i2, 0
40009a70: 12 80 00 0e bne 40009aa8 <_Thread_Initialize+0x58>
40009a74: e4 0f a0 5f ldub [ %fp + 0x5f ], %l2
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
40009a78: 90 10 00 19 mov %i1, %o0
40009a7c: 40 00 01 fa call 4000a264 <_Thread_Stack_Allocate>
40009a80: 92 10 00 1b mov %i3, %o1
if ( !actual_stack_size || actual_stack_size < stack_size )
40009a84: 80 a2 00 1b cmp %o0, %i3
40009a88: 0a 80 00 62 bcs 40009c10 <_Thread_Initialize+0x1c0>
40009a8c: 80 a2 20 00 cmp %o0, 0
40009a90: 02 80 00 60 be 40009c10 <_Thread_Initialize+0x1c0> <== NEVER TAKEN
40009a94: 82 10 20 01 mov 1, %g1
return false; /* stack allocation failed */
stack = the_thread->Start.stack;
40009a98: f4 06 60 bc ld [ %i1 + 0xbc ], %i2
the_thread->Start.core_allocated_stack = true;
40009a9c: c2 2e 60 b0 stb %g1, [ %i1 + 0xb0 ]
40009aa0: 10 80 00 03 b 40009aac <_Thread_Initialize+0x5c>
40009aa4: b6 10 00 08 mov %o0, %i3
} else {
stack = stack_area;
actual_stack_size = stack_size;
the_thread->Start.core_allocated_stack = false;
40009aa8: c0 2e 60 b0 clrb [ %i1 + 0xb0 ]
#endif
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
40009aac: 03 10 00 5b sethi %hi(0x40016c00), %g1
40009ab0: d0 00 61 b4 ld [ %g1 + 0x1b4 ], %o0 ! 40016db4 <_Thread_Maximum_extensions>
void *starting_address,
size_t size
)
{
the_stack->area = starting_address;
the_stack->size = size;
40009ab4: f6 26 60 b4 st %i3, [ %i1 + 0xb4 ]
Stack_Control *the_stack,
void *starting_address,
size_t size
)
{
the_stack->area = starting_address;
40009ab8: f4 26 60 b8 st %i2, [ %i1 + 0xb8 ]
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
40009abc: c0 26 60 50 clr [ %i1 + 0x50 ]
the_watchdog->routine = routine;
40009ac0: c0 26 60 64 clr [ %i1 + 0x64 ]
the_watchdog->id = id;
40009ac4: c0 26 60 68 clr [ %i1 + 0x68 ]
the_watchdog->user_data = user_data;
40009ac8: c0 26 60 6c clr [ %i1 + 0x6c ]
* Zero out all the allocated memory fields
*/
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
the_thread->API_Extensions[i] = NULL;
extensions_area = NULL;
40009acc: b8 10 20 00 clr %i4
#endif
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
40009ad0: 80 a2 20 00 cmp %o0, 0
40009ad4: 02 80 00 08 be 40009af4 <_Thread_Initialize+0xa4>
40009ad8: b6 10 00 01 mov %g1, %i3
extensions_area = _Workspace_Allocate(
40009adc: 90 02 20 01 inc %o0
40009ae0: 40 00 03 91 call 4000a924 <_Workspace_Allocate>
40009ae4: 91 2a 20 02 sll %o0, 2, %o0
(_Thread_Maximum_extensions + 1) * sizeof( void * )
);
if ( !extensions_area )
40009ae8: b8 92 20 00 orcc %o0, 0, %i4
40009aec: 22 80 00 3d be,a 40009be0 <_Thread_Initialize+0x190>
40009af0: b6 10 20 00 clr %i3
* if they are linked to the thread. An extension user may
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
40009af4: 80 a7 20 00 cmp %i4, 0
40009af8: 12 80 00 0c bne 40009b28 <_Thread_Initialize+0xd8>
40009afc: f8 26 61 54 st %i4, [ %i1 + 0x154 ]
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
the_thread->Start.budget_callout = budget_callout;
40009b00: c2 07 a0 64 ld [ %fp + 0x64 ], %g1
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
40009b04: e4 2e 60 9c stb %l2, [ %i1 + 0x9c ]
the_thread->Start.budget_algorithm = budget_algorithm;
40009b08: e0 26 60 a0 st %l0, [ %i1 + 0xa0 ]
the_thread->Start.budget_callout = budget_callout;
switch ( budget_algorithm ) {
40009b0c: 80 a4 20 02 cmp %l0, 2
40009b10: 12 80 00 0f bne 40009b4c <_Thread_Initialize+0xfc>
40009b14: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ]
case THREAD_CPU_BUDGET_ALGORITHM_NONE:
case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
40009b18: 03 10 00 5b sethi %hi(0x40016c00), %g1
40009b1c: c2 00 60 a0 ld [ %g1 + 0xa0 ], %g1 ! 40016ca0 <_Thread_Ticks_per_timeslice>
break;
40009b20: 10 80 00 0b b 40009b4c <_Thread_Initialize+0xfc>
40009b24: c2 26 60 74 st %g1, [ %i1 + 0x74 ]
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
40009b28: c4 06 e1 b4 ld [ %i3 + 0x1b4 ], %g2
40009b2c: 82 10 20 00 clr %g1
40009b30: 80 a0 40 02 cmp %g1, %g2
40009b34: 18 bf ff f3 bgu 40009b00 <_Thread_Initialize+0xb0>
40009b38: 87 28 60 02 sll %g1, 2, %g3
the_thread->extensions[i] = NULL;
40009b3c: c8 06 61 54 ld [ %i1 + 0x154 ], %g4
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
40009b40: 82 00 60 01 inc %g1
the_thread->extensions[i] = NULL;
40009b44: 10 bf ff fb b 40009b30 <_Thread_Initialize+0xe0>
40009b48: c0 21 00 03 clr [ %g4 + %g3 ]
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
40009b4c: c2 07 a0 68 ld [ %fp + 0x68 ], %g1
/* Initialize the cpu field for the non-SMP schedulers */
the_thread->cpu = _Per_CPU_Get_by_index( 0 );
#endif
the_thread->current_state = STATES_DORMANT;
40009b50: b4 10 20 01 mov 1, %i2
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
40009b54: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ]
*/
RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate(
Thread_Control *the_thread
)
{
return _Scheduler.Operations.allocate( the_thread );
40009b58: 03 10 00 58 sethi %hi(0x40016000), %g1
40009b5c: c2 00 60 30 ld [ %g1 + 0x30 ], %g1 ! 40016030 <_Scheduler+0x18>
/* Initialize the cpu field for the non-SMP schedulers */
the_thread->cpu = _Per_CPU_Get_by_index( 0 );
#endif
the_thread->current_state = STATES_DORMANT;
40009b60: f4 26 60 10 st %i2, [ %i1 + 0x10 ]
the_thread->Wait.queue = NULL;
40009b64: c0 26 60 44 clr [ %i1 + 0x44 ]
the_thread->resource_count = 0;
40009b68: c0 26 60 1c clr [ %i1 + 0x1c ]
the_thread->real_priority = priority;
40009b6c: fa 26 60 18 st %i5, [ %i1 + 0x18 ]
the_thread->Start.initial_priority = priority;
40009b70: fa 26 60 ac st %i5, [ %i1 + 0xac ]
40009b74: 9f c0 40 00 call %g1
40009b78: 90 10 00 19 mov %i1, %o0
sched =_Scheduler_Allocate( the_thread );
if ( !sched )
40009b7c: b6 92 20 00 orcc %o0, 0, %i3
40009b80: 02 80 00 18 be 40009be0 <_Thread_Initialize+0x190>
40009b84: 90 10 00 19 mov %i1, %o0
goto failed;
_Thread_Set_priority( the_thread, priority );
40009b88: 40 00 01 8f call 4000a1c4 <_Thread_Set_priority>
40009b8c: 92 10 00 1d mov %i5, %o1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40009b90: c4 06 20 1c ld [ %i0 + 0x1c ], %g2
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
40009b94: c2 16 60 0a lduh [ %i1 + 0xa ], %g1
static inline void _Timestamp64_implementation_Set_to_zero(
Timestamp64_Control *_time
)
{
*_time = 0;
40009b98: c0 26 60 80 clr [ %i1 + 0x80 ]
40009b9c: c0 26 60 84 clr [ %i1 + 0x84 ]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40009ba0: 83 28 60 02 sll %g1, 2, %g1
40009ba4: f2 20 80 01 st %i1, [ %g2 + %g1 ]
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
40009ba8: e2 26 60 0c st %l1, [ %i1 + 0xc ]
*/
/**@{**/
static inline bool _User_extensions_Thread_create( Thread_Control *created )
{
User_extensions_Thread_create_context ctx = { created, true };
40009bac: f2 27 bf f8 st %i1, [ %fp + -8 ]
40009bb0: f4 2f bf fc stb %i2, [ %fp + -4 ]
_User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor );
40009bb4: 90 07 bf f8 add %fp, -8, %o0
40009bb8: 13 10 00 28 sethi %hi(0x4000a000), %o1
40009bbc: 40 00 02 2b call 4000a468 <_User_extensions_Iterate>
40009bc0: 92 12 63 6c or %o1, 0x36c, %o1 ! 4000a36c <_User_extensions_Thread_create_visitor>
return ctx.ok;
40009bc4: 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 )
40009bc8: 80 8e 20 ff btst 0xff, %i0
40009bcc: 02 80 00 05 be 40009be0 <_Thread_Initialize+0x190>
40009bd0: 01 00 00 00 nop
40009bd4: b0 0e 20 ff and %i0, 0xff, %i0
40009bd8: 81 c7 e0 08 ret
40009bdc: 81 e8 00 00 restore
return true;
failed:
_Workspace_Free( the_thread->libc_reent );
40009be0: 40 00 03 59 call 4000a944 <_Workspace_Free>
40009be4: d0 06 61 48 ld [ %i1 + 0x148 ], %o0
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
_Workspace_Free( the_thread->API_Extensions[i] );
40009be8: 40 00 03 57 call 4000a944 <_Workspace_Free>
40009bec: d0 06 61 4c ld [ %i1 + 0x14c ], %o0
40009bf0: 40 00 03 55 call 4000a944 <_Workspace_Free>
40009bf4: d0 06 61 50 ld [ %i1 + 0x150 ], %o0
_Workspace_Free( extensions_area );
40009bf8: 40 00 03 53 call 4000a944 <_Workspace_Free>
40009bfc: 90 10 00 1c mov %i4, %o0
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Workspace_Free( fp_area );
#endif
_Workspace_Free( sched );
40009c00: 40 00 03 51 call 4000a944 <_Workspace_Free>
40009c04: 90 10 00 1b mov %i3, %o0
_Thread_Stack_Free( the_thread );
40009c08: 40 00 01 a7 call 4000a2a4 <_Thread_Stack_Free>
40009c0c: 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 */
40009c10: b0 10 20 00 clr %i0
_Workspace_Free( sched );
_Thread_Stack_Free( the_thread );
return false;
}
40009c14: b0 0e 20 ff and %i0, 0xff, %i0
40009c18: 81 c7 e0 08 ret
40009c1c: 81 e8 00 00 restore
4000a2a4 <_Thread_Stack_Free>:
#include <rtems/config.h>
void _Thread_Stack_Free(
Thread_Control *the_thread
)
{
4000a2a4: 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 )
4000a2a8: c4 0e 20 b0 ldub [ %i0 + 0xb0 ], %g2
void _Thread_Stack_Free(
Thread_Control *the_thread
)
{
rtems_stack_free_hook stack_free_hook =
4000a2ac: 03 10 00 52 sethi %hi(0x40014800), %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 )
4000a2b0: 80 a0 a0 00 cmp %g2, 0
4000a2b4: 02 80 00 04 be 4000a2c4 <_Thread_Stack_Free+0x20> <== NEVER TAKEN
4000a2b8: c2 00 61 fc ld [ %g1 + 0x1fc ], %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 );
4000a2bc: 9f c0 40 00 call %g1
4000a2c0: d0 06 20 b8 ld [ %i0 + 0xb8 ], %o0
4000a2c4: 81 c7 e0 08 ret
4000a2c8: 81 e8 00 00 restore
4000ee14 <_Thread_queue_Extract_fifo>:
#include <rtems/score/watchdogimpl.h>
bool _Thread_queue_Extract_fifo(
Thread_Control *the_thread
)
{
4000ee14: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED
ISR_Level level;
_ISR_Disable( level );
4000ee18: 7f ff cc f2 call 400021e0 <sparc_disable_interrupts> <== NOT EXECUTED
4000ee1c: 01 00 00 00 nop <== NOT EXECUTED
4000ee20: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 <== NOT EXECUTED
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
4000ee24: 03 00 02 ef sethi %hi(0xbbc00), %g1 <== NOT EXECUTED
4000ee28: 82 10 62 e0 or %g1, 0x2e0, %g1 ! bbee0 <PROM_START+0xbbee0><== NOT EXECUTED
4000ee2c: 80 88 80 01 btst %g2, %g1 <== NOT EXECUTED
4000ee30: 32 80 00 07 bne,a 4000ee4c <_Thread_queue_Extract_fifo+0x38><== NOT EXECUTED
4000ee34: c2 06 20 04 ld [ %i0 + 4 ], %g1 <== NOT EXECUTED
_ISR_Enable( level );
4000ee38: 7f ff cc ee call 400021f0 <sparc_enable_interrupts> <== NOT EXECUTED
4000ee3c: b0 10 20 00 clr %i0 <== NOT EXECUTED
4000ee40: b0 0e 20 01 and %i0, 1, %i0 <== NOT EXECUTED
4000ee44: 81 c7 e0 08 ret <== NOT EXECUTED
4000ee48: 81 e8 00 00 restore <== NOT EXECUTED
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
4000ee4c: c4 06 00 00 ld [ %i0 ], %g2 <== NOT EXECUTED
previous = the_node->previous;
next->previous = previous;
4000ee50: c2 20 a0 04 st %g1, [ %g2 + 4 ] <== NOT EXECUTED
previous->next = next;
4000ee54: c4 20 40 00 st %g2, [ %g1 ] <== NOT EXECUTED
_Chain_Extract_unprotected( &the_thread->Object.Node );
the_thread->Wait.queue = NULL;
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
4000ee58: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 <== NOT EXECUTED
4000ee5c: 80 a0 60 02 cmp %g1, 2 <== NOT EXECUTED
4000ee60: 02 80 00 06 be 4000ee78 <_Thread_queue_Extract_fifo+0x64> <== NOT EXECUTED
4000ee64: c0 26 20 44 clr [ %i0 + 0x44 ] <== NOT EXECUTED
_ISR_Enable( level );
4000ee68: 7f ff cc e2 call 400021f0 <sparc_enable_interrupts> <== NOT EXECUTED
4000ee6c: 01 00 00 00 nop <== NOT EXECUTED
4000ee70: 10 80 00 09 b 4000ee94 <_Thread_queue_Extract_fifo+0x80> <== NOT EXECUTED
4000ee74: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED
4000ee78: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED
4000ee7c: c2 26 20 50 st %g1, [ %i0 + 0x50 ] <== NOT EXECUTED
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
4000ee80: 7f ff cc dc call 400021f0 <sparc_enable_interrupts> <== NOT EXECUTED
4000ee84: 01 00 00 00 nop <== NOT EXECUTED
(void) _Watchdog_Remove( &the_thread->Timer );
4000ee88: 7f ff ee 0f call 4000a6c4 <_Watchdog_Remove> <== NOT EXECUTED
4000ee8c: 90 06 20 48 add %i0, 0x48, %o0 <== NOT EXECUTED
4000ee90: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED
4000ee94: 13 04 03 ff sethi %hi(0x100ffc00), %o1 <== NOT EXECUTED
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
return true;
4000ee98: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED
4000ee9c: 7f ff e9 f3 call 40009668 <_Thread_Clear_state> <== NOT EXECUTED
4000eea0: 92 12 63 f8 or %o1, 0x3f8, %o1 <== NOT EXECUTED
}
4000eea4: b0 0e 20 01 and %i0, 1, %i0 <== NOT EXECUTED
4000eea8: 81 c7 e0 08 ret <== NOT EXECUTED
4000eeac: 81 e8 00 00 restore <== NOT EXECUTED
4000a10c <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
4000a10c: 9d e3 bf 98 save %sp, -104, %sp
/*
* Just in case the thread really wasn't blocked on a thread queue
* when we get here.
*/
if ( !the_thread_queue )
4000a110: 80 a6 20 00 cmp %i0, 0
4000a114: 02 80 00 19 be 4000a178 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN
4000a118: 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 ) {
4000a11c: c2 06 20 34 ld [ %i0 + 0x34 ], %g1
4000a120: 80 a0 60 01 cmp %g1, 1
4000a124: 12 80 00 15 bne 4000a178 <_Thread_queue_Requeue+0x6c>
4000a128: 01 00 00 00 nop
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
4000a12c: 7f ff e0 2d call 400021e0 <sparc_disable_interrupts>
4000a130: 01 00 00 00 nop
4000a134: ba 10 00 08 mov %o0, %i5
4000a138: c4 06 60 10 ld [ %i1 + 0x10 ], %g2
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
4000a13c: 03 00 02 ef sethi %hi(0xbbc00), %g1
4000a140: 82 10 62 e0 or %g1, 0x2e0, %g1 ! bbee0 <PROM_START+0xbbee0>
4000a144: 80 88 80 01 btst %g2, %g1
4000a148: 02 80 00 0a be 4000a170 <_Thread_queue_Requeue+0x64> <== NEVER TAKEN
4000a14c: 82 10 20 01 mov 1, %g1
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( the_thread, true );
4000a150: 92 10 20 01 mov 1, %o1
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;
4000a154: c2 26 20 30 st %g1, [ %i0 + 0x30 ]
4000a158: 40 00 0b 77 call 4000cf34 <_Thread_queue_Extract_priority_helper>
4000a15c: 90 10 00 19 mov %i1, %o0
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
4000a160: 90 10 00 18 mov %i0, %o0
4000a164: 92 10 00 19 mov %i1, %o1
4000a168: 7f ff ff 56 call 40009ec0 <_Thread_queue_Enqueue_priority>
4000a16c: 94 07 bf fc add %fp, -4, %o2
}
_ISR_Enable( level );
4000a170: 7f ff e0 20 call 400021f0 <sparc_enable_interrupts>
4000a174: 90 10 00 1d mov %i5, %o0
4000a178: 81 c7 e0 08 ret
4000a17c: 81 e8 00 00 restore
4000a180 <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
4000a180: 9d e3 bf 98 save %sp, -104, %sp
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
4000a184: 90 10 00 18 mov %i0, %o0
4000a188: 7f ff fe 0b call 400099b4 <_Thread_Get>
4000a18c: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
4000a190: c2 07 bf fc ld [ %fp + -4 ], %g1
4000a194: 80 a0 60 00 cmp %g1, 0
4000a198: 12 80 00 09 bne 4000a1bc <_Thread_queue_Timeout+0x3c> <== NEVER TAKEN
4000a19c: 01 00 00 00 nop
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
4000a1a0: 40 00 0b a7 call 4000d03c <_Thread_queue_Process_timeout>
4000a1a4: 01 00 00 00 nop
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4000a1a8: 03 10 00 5c sethi %hi(0x40017000), %g1
4000a1ac: 82 10 62 10 or %g1, 0x210, %g1 ! 40017210 <_Per_CPU_Information>
4000a1b0: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
--level;
4000a1b4: 84 00 bf ff add %g2, -1, %g2
_Thread_Dispatch_disable_level = level;
4000a1b8: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
4000a1bc: 81 c7 e0 08 ret
4000a1c0: 81 e8 00 00 restore
40008880 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
40008880: 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;
40008884: 2d 10 00 63 sethi %hi(0x40018c00), %l6
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
40008888: b2 07 bf e8 add %fp, -24, %i1
4000888c: a0 07 bf ec add %fp, -20, %l0
40008890: b8 07 bf f4 add %fp, -12, %i4
40008894: b6 07 bf f8 add %fp, -8, %i3
40008898: e0 27 bf e8 st %l0, [ %fp + -24 ]
head->previous = NULL;
4000889c: c0 27 bf ec clr [ %fp + -20 ]
tail->previous = head;
400088a0: 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;
400088a4: f6 27 bf f4 st %i3, [ %fp + -12 ]
head->previous = NULL;
400088a8: c0 27 bf f8 clr [ %fp + -8 ]
tail->previous = head;
400088ac: 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 );
400088b0: 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 );
400088b4: b4 06 20 68 add %i0, 0x68, %i2
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
400088b8: 2b 10 00 64 sethi %hi(0x40019000), %l5
#endif
_Timer_server_SMP_lock_release();
_Timer_server_SMP_lock_aquire();
ts->active = true;
400088bc: 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 );
400088c0: 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 );
400088c4: 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;
400088c8: 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;
400088cc: c2 05 a3 60 ld [ %l6 + 0x360 ], %g1
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
400088d0: d2 06 20 3c ld [ %i0 + 0x3c ], %o1
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
400088d4: 94 10 00 1c mov %i4, %o2
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
400088d8: c2 26 20 3c st %g1, [ %i0 + 0x3c ]
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
400088dc: 90 10 00 11 mov %l1, %o0
400088e0: 40 00 0c b5 call 4000bbb4 <_Watchdog_Adjust_to_chain>
400088e4: 92 20 40 09 sub %g1, %o1, %o1
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
400088e8: 40 00 03 21 call 4000956c <_TOD_Seconds_since_epoch>
400088ec: 01 00 00 00 nop
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
400088f0: 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 ) {
400088f4: 80 a2 00 0a cmp %o0, %o2
400088f8: 08 80 00 07 bleu 40008914 <_Timer_server_Body+0x94>
400088fc: 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 );
40008900: 92 27 40 0a sub %i5, %o2, %o1
40008904: 90 10 00 1a mov %i2, %o0
40008908: 40 00 0c ab call 4000bbb4 <_Watchdog_Adjust_to_chain>
4000890c: 94 10 00 1c mov %i4, %o2
40008910: 30 80 00 06 b,a 40008928 <_Timer_server_Body+0xa8>
} else if ( snapshot < last_snapshot ) {
40008914: 1a 80 00 05 bcc 40008928 <_Timer_server_Body+0xa8>
40008918: 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 );
4000891c: 92 10 20 01 mov 1, %o1
40008920: 40 00 0c 7d call 4000bb14 <_Watchdog_Adjust>
40008924: 94 22 80 1d sub %o2, %i5, %o2
}
watchdogs->last_snapshot = snapshot;
40008928: 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 );
4000892c: d0 06 20 78 ld [ %i0 + 0x78 ], %o0
40008930: 40 00 01 ec call 400090e0 <_Chain_Get>
40008934: 01 00 00 00 nop
if ( timer == NULL ) {
40008938: 92 92 20 00 orcc %o0, 0, %o1
4000893c: 02 80 00 0c be 4000896c <_Timer_server_Body+0xec>
40008940: 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 ) {
40008944: c2 02 60 38 ld [ %o1 + 0x38 ], %g1
40008948: 80 a0 60 01 cmp %g1, 1
4000894c: 02 80 00 05 be 40008960 <_Timer_server_Body+0xe0>
40008950: 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 ) {
40008954: 80 a0 60 03 cmp %g1, 3
40008958: 12 bf ff f5 bne 4000892c <_Timer_server_Body+0xac> <== NEVER TAKEN
4000895c: 90 10 00 1a mov %i2, %o0
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
40008960: 40 00 0c bf call 4000bc5c <_Watchdog_Insert>
40008964: 92 02 60 10 add %o1, 0x10, %o1
40008968: 30 bf ff f1 b,a 4000892c <_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 );
4000896c: 7f ff e8 7e call 40002b64 <sparc_disable_interrupts>
40008970: 01 00 00 00 nop
if ( _Chain_Is_empty( insert_chain ) ) {
40008974: c2 07 bf e8 ld [ %fp + -24 ], %g1
40008978: 80 a0 40 10 cmp %g1, %l0
4000897c: 12 80 00 0a bne 400089a4 <_Timer_server_Body+0x124> <== NEVER TAKEN
40008980: 01 00 00 00 nop
ts->insert_chain = NULL;
40008984: c0 26 20 78 clr [ %i0 + 0x78 ]
_ISR_Enable( level );
40008988: 7f ff e8 7b call 40002b74 <sparc_enable_interrupts>
4000898c: 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 ) ) {
40008990: c2 07 bf f4 ld [ %fp + -12 ], %g1
40008994: 80 a0 40 1b cmp %g1, %i3
40008998: 12 80 00 06 bne 400089b0 <_Timer_server_Body+0x130>
4000899c: 01 00 00 00 nop
400089a0: 30 80 00 18 b,a 40008a00 <_Timer_server_Body+0x180>
ts->insert_chain = NULL;
_ISR_Enable( level );
break;
} else {
_ISR_Enable( level );
400089a4: 7f ff e8 74 call 40002b74 <sparc_enable_interrupts> <== NOT EXECUTED
400089a8: 01 00 00 00 nop <== NOT EXECUTED
400089ac: 30 bf ff c8 b,a 400088cc <_Timer_server_Body+0x4c> <== 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 );
400089b0: 7f ff e8 6d call 40002b64 <sparc_disable_interrupts>
400089b4: 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;
400089b8: 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))
400089bc: 80 a7 40 1b cmp %i5, %i3
400089c0: 02 80 00 0d be 400089f4 <_Timer_server_Body+0x174>
400089c4: 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;
400089c8: c2 07 40 00 ld [ %i5 ], %g1
head->next = new_first;
new_first->previous = head;
400089cc: 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;
400089d0: c2 27 bf f4 st %g1, [ %fp + -12 ]
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
400089d4: c0 27 60 08 clr [ %i5 + 8 ]
_ISR_Enable( level );
400089d8: 7f ff e8 67 call 40002b74 <sparc_enable_interrupts>
400089dc: 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 );
400089e0: c2 07 60 1c ld [ %i5 + 0x1c ], %g1
400089e4: d0 07 60 20 ld [ %i5 + 0x20 ], %o0
400089e8: 9f c0 40 00 call %g1
400089ec: d2 07 60 24 ld [ %i5 + 0x24 ], %o1
400089f0: 30 bf ff f0 b,a 400089b0 <_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 );
400089f4: 7f ff e8 60 call 40002b74 <sparc_enable_interrupts>
400089f8: 01 00 00 00 nop
400089fc: 30 bf ff b3 b,a 400088c8 <_Timer_server_Body+0x48>
(*watchdog->routine)( watchdog->id, watchdog->user_data );
_Timer_server_SMP_lock_aquire();
}
} else {
ts->active = false;
40008a00: c0 2e 20 7c clrb [ %i0 + 0x7c ]
40008a04: 82 15 63 90 or %l5, 0x390, %g1
40008a08: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
40008a0c: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40008a10: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
* Block until there is something to do.
*/
#if !defined( RTEMS_SMP )
_Thread_Disable_dispatch();
#endif
_Thread_Set_state( ts->thread, STATES_DELAYING );
40008a14: d0 06 00 00 ld [ %i0 ], %o0
40008a18: 40 00 0b 5d call 4000b78c <_Thread_Set_state>
40008a1c: 92 10 20 08 mov 8, %o1
_Timer_server_Reset_interval_system_watchdog( ts );
40008a20: 7f ff ff 1c call 40008690 <_Timer_server_Reset_interval_system_watchdog>
40008a24: 90 10 00 18 mov %i0, %o0
_Timer_server_Reset_tod_system_watchdog( ts );
40008a28: 7f ff ff 2e call 400086e0 <_Timer_server_Reset_tod_system_watchdog>
40008a2c: 90 10 00 18 mov %i0, %o0
#if !defined( RTEMS_SMP )
_Thread_Enable_dispatch();
40008a30: 40 00 09 3e call 4000af28 <_Thread_Enable_dispatch>
40008a34: 01 00 00 00 nop
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
40008a38: 90 10 00 13 mov %l3, %o0
#endif
_Timer_server_SMP_lock_release();
_Timer_server_SMP_lock_aquire();
ts->active = true;
40008a3c: 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 );
40008a40: 40 00 0c dd call 4000bdb4 <_Watchdog_Remove>
40008a44: 01 00 00 00 nop
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
40008a48: 40 00 0c db call 4000bdb4 <_Watchdog_Remove>
40008a4c: 90 10 00 12 mov %l2, %o0
40008a50: 30 bf ff 9e b,a 400088c8 <_Timer_server_Body+0x48>
40008730 <_Timer_server_Schedule_operation_method>:
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
40008730: 9d e3 bf a0 save %sp, -96, %sp
if ( ts->insert_chain == NULL ) {
40008734: c2 06 20 78 ld [ %i0 + 0x78 ], %g1
40008738: 80 a0 60 00 cmp %g1, 0
4000873c: 12 80 00 4e bne 40008874 <_Timer_server_Schedule_operation_method+0x144>
40008740: ba 10 00 19 mov %i1, %i5
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
40008744: 03 10 00 64 sethi %hi(0x40019000), %g1
40008748: 82 10 63 90 or %g1, 0x390, %g1 ! 40019390 <_Per_CPU_Information>
4000874c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
40008750: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40008754: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
* being inserted. This could result in an integer overflow.
*/
_Thread_Disable_dispatch();
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
40008758: c2 06 60 38 ld [ %i1 + 0x38 ], %g1
4000875c: 80 a0 60 01 cmp %g1, 1
40008760: 12 80 00 1f bne 400087dc <_Timer_server_Schedule_operation_method+0xac>
40008764: 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 );
40008768: 7f ff e8 ff call 40002b64 <sparc_disable_interrupts>
4000876c: 01 00 00 00 nop
snapshot = _Watchdog_Ticks_since_boot;
40008770: 03 10 00 63 sethi %hi(0x40018c00), %g1
40008774: c4 00 63 60 ld [ %g1 + 0x360 ], %g2 ! 40018f60 <_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;
40008778: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
last_snapshot = ts->Interval_watchdogs.last_snapshot;
4000877c: 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 );
40008780: 86 06 20 34 add %i0, 0x34, %g3
if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) {
40008784: 80 a0 40 03 cmp %g1, %g3
40008788: 02 80 00 08 be 400087a8 <_Timer_server_Schedule_operation_method+0x78>
4000878c: 88 20 80 04 sub %g2, %g4, %g4
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
40008790: f8 00 60 10 ld [ %g1 + 0x10 ], %i4
if (delta_interval > delta) {
40008794: 80 a7 00 04 cmp %i4, %g4
40008798: 08 80 00 03 bleu 400087a4 <_Timer_server_Schedule_operation_method+0x74>
4000879c: 86 10 20 00 clr %g3
delta_interval -= delta;
400087a0: 86 27 00 04 sub %i4, %g4, %g3
} else {
delta_interval = 0;
}
first_watchdog->delta_interval = delta_interval;
400087a4: c6 20 60 10 st %g3, [ %g1 + 0x10 ]
}
ts->Interval_watchdogs.last_snapshot = snapshot;
400087a8: c4 26 20 3c st %g2, [ %i0 + 0x3c ]
_ISR_Enable( level );
400087ac: 7f ff e8 f2 call 40002b74 <sparc_enable_interrupts>
400087b0: 01 00 00 00 nop
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
400087b4: 90 06 20 30 add %i0, 0x30, %o0
400087b8: 40 00 0d 29 call 4000bc5c <_Watchdog_Insert>
400087bc: 92 07 60 10 add %i5, 0x10, %o1
if ( !ts->active ) {
400087c0: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1
400087c4: 80 a0 60 00 cmp %g1, 0
400087c8: 12 80 00 29 bne 4000886c <_Timer_server_Schedule_operation_method+0x13c>
400087cc: 01 00 00 00 nop
_Timer_server_Reset_interval_system_watchdog( ts );
400087d0: 7f ff ff b0 call 40008690 <_Timer_server_Reset_interval_system_watchdog>
400087d4: 90 10 00 18 mov %i0, %o0
400087d8: 30 80 00 25 b,a 4000886c <_Timer_server_Schedule_operation_method+0x13c>
}
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
400087dc: 12 80 00 24 bne 4000886c <_Timer_server_Schedule_operation_method+0x13c>
400087e0: 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 );
400087e4: 7f ff e8 e0 call 40002b64 <sparc_disable_interrupts>
400087e8: 01 00 00 00 nop
400087ec: b6 10 00 08 mov %o0, %i3
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
400087f0: 40 00 03 5f call 4000956c <_TOD_Seconds_since_epoch>
400087f4: 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;
400087f8: c4 06 20 68 ld [ %i0 + 0x68 ], %g2
last_snapshot = ts->TOD_watchdogs.last_snapshot;
400087fc: 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 );
40008800: 88 06 20 6c add %i0, 0x6c, %g4
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
40008804: 80 a0 80 04 cmp %g2, %g4
40008808: 02 80 00 0d be 4000883c <_Timer_server_Schedule_operation_method+0x10c>
4000880c: 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 ) {
40008810: 08 80 00 08 bleu 40008830 <_Timer_server_Schedule_operation_method+0x100>
40008814: c8 00 a0 10 ld [ %g2 + 0x10 ], %g4
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
40008818: b8 22 00 03 sub %o0, %g3, %i4
if (delta_interval > delta) {
4000881c: 80 a1 00 1c cmp %g4, %i4
40008820: 08 80 00 06 bleu 40008838 <_Timer_server_Schedule_operation_method+0x108><== NEVER TAKEN
40008824: 86 10 20 00 clr %g3
delta_interval -= delta;
40008828: 10 80 00 04 b 40008838 <_Timer_server_Schedule_operation_method+0x108>
4000882c: 86 21 00 1c sub %g4, %i4, %g3
}
} else {
/*
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
40008830: 86 01 00 03 add %g4, %g3, %g3
delta_interval += delta;
40008834: 86 20 c0 08 sub %g3, %o0, %g3
}
first_watchdog->delta_interval = delta_interval;
40008838: c6 20 a0 10 st %g3, [ %g2 + 0x10 ]
}
ts->TOD_watchdogs.last_snapshot = snapshot;
4000883c: d0 26 20 74 st %o0, [ %i0 + 0x74 ]
_ISR_Enable( level );
40008840: 7f ff e8 cd call 40002b74 <sparc_enable_interrupts>
40008844: 90 10 00 1b mov %i3, %o0
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
40008848: 90 06 20 68 add %i0, 0x68, %o0
4000884c: 40 00 0d 04 call 4000bc5c <_Watchdog_Insert>
40008850: 92 07 60 10 add %i5, 0x10, %o1
if ( !ts->active ) {
40008854: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1
40008858: 80 a0 60 00 cmp %g1, 0
4000885c: 12 80 00 04 bne 4000886c <_Timer_server_Schedule_operation_method+0x13c>
40008860: 01 00 00 00 nop
_Timer_server_Reset_tod_system_watchdog( ts );
40008864: 7f ff ff 9f call 400086e0 <_Timer_server_Reset_tod_system_watchdog>
40008868: 90 10 00 18 mov %i0, %o0
}
}
_Thread_Enable_dispatch();
4000886c: 40 00 09 af call 4000af28 <_Thread_Enable_dispatch>
40008870: 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 );
40008874: f0 06 20 78 ld [ %i0 + 0x78 ], %i0
40008878: 40 00 02 0e call 400090b0 <_Chain_Append>
4000887c: 81 e8 00 00 restore
4000bcd0 <_Timestamp64_Divide>:
const Timestamp64_Control *_lhs,
const Timestamp64_Control *_rhs,
uint32_t *_ival_percentage,
uint32_t *_fval_percentage
)
{
4000bcd0: 9d e3 bf a0 save %sp, -96, %sp
Timestamp64_Control answer;
if ( *_rhs == 0 ) {
4000bcd4: d4 1e 40 00 ldd [ %i1 ], %o2
4000bcd8: 80 92 80 0b orcc %o2, %o3, %g0
4000bcdc: 32 80 00 06 bne,a 4000bcf4 <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN
4000bce0: d8 1e 00 00 ldd [ %i0 ], %o4
*_ival_percentage = 0;
4000bce4: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED
*_fval_percentage = 0;
4000bce8: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED
return;
4000bcec: 81 c7 e0 08 ret <== NOT EXECUTED
4000bcf0: 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;
4000bcf4: 83 2b 20 02 sll %o4, 2, %g1
4000bcf8: 87 2b 60 02 sll %o5, 2, %g3
4000bcfc: 89 33 60 1e srl %o5, 0x1e, %g4
4000bd00: bb 28 e0 05 sll %g3, 5, %i5
4000bd04: 84 11 00 01 or %g4, %g1, %g2
4000bd08: 83 30 e0 1b srl %g3, 0x1b, %g1
4000bd0c: b9 28 a0 05 sll %g2, 5, %i4
4000bd10: 86 a7 40 03 subcc %i5, %g3, %g3
4000bd14: b8 10 40 1c or %g1, %i4, %i4
4000bd18: 84 67 00 02 subx %i4, %g2, %g2
4000bd1c: b2 80 c0 0d addcc %g3, %o5, %i1
4000bd20: b0 40 80 0c addx %g2, %o4, %i0
4000bd24: 83 36 60 1e srl %i1, 0x1e, %g1
4000bd28: 87 2e 60 02 sll %i1, 2, %g3
4000bd2c: 85 2e 20 02 sll %i0, 2, %g2
4000bd30: 84 10 40 02 or %g1, %g2, %g2
4000bd34: ba 86 40 03 addcc %i1, %g3, %i5
4000bd38: b8 46 00 02 addx %i0, %g2, %i4
4000bd3c: 83 37 60 1e srl %i5, 0x1e, %g1
4000bd40: 87 2f 60 02 sll %i5, 2, %g3
4000bd44: 85 2f 20 02 sll %i4, 2, %g2
4000bd48: 84 10 40 02 or %g1, %g2, %g2
4000bd4c: 92 87 40 03 addcc %i5, %g3, %o1
4000bd50: 90 47 00 02 addx %i4, %g2, %o0
4000bd54: 87 32 60 1b srl %o1, 0x1b, %g3
4000bd58: 85 2a 20 05 sll %o0, 5, %g2
4000bd5c: 83 2a 60 05 sll %o1, 5, %g1
4000bd60: 90 10 c0 02 or %g3, %g2, %o0
4000bd64: 40 00 24 f2 call 4001512c <__divdi3>
4000bd68: 92 10 00 01 mov %g1, %o1
*_ival_percentage = answer / 1000;
4000bd6c: 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;
4000bd70: b8 10 00 08 mov %o0, %i4
4000bd74: ba 10 00 09 mov %o1, %i5
*_ival_percentage = answer / 1000;
4000bd78: 40 00 24 ed call 4001512c <__divdi3>
4000bd7c: 96 10 23 e8 mov 0x3e8, %o3
*_fval_percentage = answer % 1000;
4000bd80: 90 10 00 1c mov %i4, %o0
* TODO: Rounding on the last digit of the fval.
*/
answer = (*_lhs * 100000) / *_rhs;
*_ival_percentage = answer / 1000;
4000bd84: d2 26 80 00 st %o1, [ %i2 ]
*_fval_percentage = answer % 1000;
4000bd88: 94 10 20 00 clr %o2
4000bd8c: 92 10 00 1d mov %i5, %o1
4000bd90: 40 00 25 d9 call 400154f4 <__moddi3>
4000bd94: 96 10 23 e8 mov 0x3e8, %o3
4000bd98: d2 26 c0 00 st %o1, [ %i3 ]
4000bd9c: 81 c7 e0 08 ret
4000bda0: 81 e8 00 00 restore
4000a52c <_User_extensions_Handler_initialization>:
}
}
void _User_extensions_Handler_initialization(void)
{
4000a52c: 9d e3 bf 98 save %sp, -104, %sp
uint32_t number_of_initial_extensions =
4000a530: 03 10 00 52 sethi %hi(0x40014800), %g1
4000a534: c2 00 62 10 ld [ %g1 + 0x210 ], %g1 ! 40014a10 <Configuration+0x40>
rtems_configuration_get_number_of_initial_extensions();
if ( number_of_initial_extensions > 0 ) {
4000a538: 80 a0 60 00 cmp %g1, 0
4000a53c: 02 80 00 0a be 4000a564 <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN
4000a540: 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 )
4000a544: 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 =
4000a548: 40 00 01 05 call 4000a95c <_Workspace_Allocate_or_fatal_error>
4000a54c: 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 );
4000a550: 13 10 00 29 sethi %hi(0x4000a400), %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 };
4000a554: d0 27 bf fc st %o0, [ %fp + -4 ]
_User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
4000a558: 92 12 60 e8 or %o1, 0xe8, %o1
4000a55c: 7f ff ff c3 call 4000a468 <_User_extensions_Iterate>
4000a560: 90 07 bf fc add %fp, -4, %o0
4000a564: 81 c7 e0 08 ret
4000a568: 81 e8 00 00 restore
4000c008 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
4000c008: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
_ISR_Disable( level );
4000c00c: 7f ff dc 0a call 40003034 <sparc_disable_interrupts>
4000c010: 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;
4000c014: 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 );
4000c018: 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 ) ) {
4000c01c: 80 a0 40 1c cmp %g1, %i4
4000c020: 02 80 00 20 be 4000c0a0 <_Watchdog_Adjust+0x98>
4000c024: 80 a6 60 00 cmp %i1, 0
switch ( direction ) {
4000c028: 02 80 00 07 be 4000c044 <_Watchdog_Adjust+0x3c>
4000c02c: 80 a6 60 01 cmp %i1, 1
4000c030: 12 80 00 1c bne 4000c0a0 <_Watchdog_Adjust+0x98> <== NEVER TAKEN
4000c034: 01 00 00 00 nop
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
4000c038: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
4000c03c: 10 80 00 18 b 4000c09c <_Watchdog_Adjust+0x94>
4000c040: 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;
4000c044: 10 80 00 0d b 4000c078 <_Watchdog_Adjust+0x70>
4000c048: b6 10 20 01 mov 1, %i3
4000c04c: f6 20 60 10 st %i3, [ %g1 + 0x10 ]
_ISR_Enable( level );
4000c050: 7f ff db fd call 40003044 <sparc_enable_interrupts>
4000c054: 01 00 00 00 nop
_Watchdog_Tickle( header );
4000c058: 40 00 00 93 call 4000c2a4 <_Watchdog_Tickle>
4000c05c: 90 10 00 18 mov %i0, %o0
_ISR_Disable( level );
4000c060: 7f ff db f5 call 40003034 <sparc_disable_interrupts>
4000c064: 01 00 00 00 nop
if ( _Chain_Is_empty( header ) )
4000c068: c2 06 00 00 ld [ %i0 ], %g1
4000c06c: 80 a0 40 1c cmp %g1, %i4
4000c070: 02 80 00 0c be 4000c0a0 <_Watchdog_Adjust+0x98>
4000c074: 01 00 00 00 nop
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
4000c078: 80 a6 a0 00 cmp %i2, 0
4000c07c: 02 80 00 09 be 4000c0a0 <_Watchdog_Adjust+0x98> <== NEVER TAKEN
4000c080: 01 00 00 00 nop
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4000c084: c2 06 00 00 ld [ %i0 ], %g1
if ( units < _Watchdog_First( header )->delta_interval ) {
4000c088: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
4000c08c: 80 a6 80 02 cmp %i2, %g2
4000c090: 3a bf ff ef bcc,a 4000c04c <_Watchdog_Adjust+0x44>
4000c094: b4 26 80 02 sub %i2, %g2, %i2
_Watchdog_First( header )->delta_interval -= units;
4000c098: b4 20 80 1a sub %g2, %i2, %i2
4000c09c: f4 20 60 10 st %i2, [ %g1 + 0x10 ]
}
break;
}
}
_ISR_Enable( level );
4000c0a0: 7f ff db e9 call 40003044 <sparc_enable_interrupts>
4000c0a4: 91 e8 00 08 restore %g0, %o0, %o0
4000a6c4 <_Watchdog_Remove>:
#include <rtems/score/watchdogimpl.h>
Watchdog_States _Watchdog_Remove(
Watchdog_Control *the_watchdog
)
{
4000a6c4: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
4000a6c8: 7f ff de c6 call 400021e0 <sparc_disable_interrupts>
4000a6cc: ba 10 00 18 mov %i0, %i5
previous_state = the_watchdog->state;
4000a6d0: f0 06 20 08 ld [ %i0 + 8 ], %i0
switch ( previous_state ) {
4000a6d4: 80 a6 20 01 cmp %i0, 1
4000a6d8: 22 80 00 1d be,a 4000a74c <_Watchdog_Remove+0x88>
4000a6dc: c0 27 60 08 clr [ %i5 + 8 ]
4000a6e0: 0a 80 00 1b bcs 4000a74c <_Watchdog_Remove+0x88>
4000a6e4: 80 a6 20 03 cmp %i0, 3
4000a6e8: 28 80 00 04 bleu,a 4000a6f8 <_Watchdog_Remove+0x34> <== ALWAYS TAKEN
4000a6ec: 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;
4000a6f0: 10 80 00 18 b 4000a750 <_Watchdog_Remove+0x8c> <== NOT EXECUTED
4000a6f4: 03 10 00 5b sethi %hi(0x40016c00), %g1 <== NOT EXECUTED
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
4000a6f8: c0 27 60 08 clr [ %i5 + 8 ]
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
4000a6fc: c4 00 40 00 ld [ %g1 ], %g2
4000a700: 80 a0 a0 00 cmp %g2, 0
4000a704: 02 80 00 07 be 4000a720 <_Watchdog_Remove+0x5c>
4000a708: 05 10 00 5b sethi %hi(0x40016c00), %g2
next_watchdog->delta_interval += the_watchdog->delta_interval;
4000a70c: c6 00 60 10 ld [ %g1 + 0x10 ], %g3
4000a710: c4 07 60 10 ld [ %i5 + 0x10 ], %g2
4000a714: 84 00 c0 02 add %g3, %g2, %g2
4000a718: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
if ( _Watchdog_Sync_count )
4000a71c: 05 10 00 5b sethi %hi(0x40016c00), %g2
4000a720: c4 00 a1 dc ld [ %g2 + 0x1dc ], %g2 ! 40016ddc <_Watchdog_Sync_count>
4000a724: 80 a0 a0 00 cmp %g2, 0
4000a728: 22 80 00 07 be,a 4000a744 <_Watchdog_Remove+0x80>
4000a72c: c4 07 60 04 ld [ %i5 + 4 ], %g2
_Watchdog_Sync_level = _ISR_Nest_level;
4000a730: 05 10 00 5c sethi %hi(0x40017000), %g2
4000a734: c6 00 a2 1c ld [ %g2 + 0x21c ], %g3 ! 4001721c <_Per_CPU_Information+0xc>
4000a738: 05 10 00 5b sethi %hi(0x40016c00), %g2
4000a73c: c6 20 a1 bc st %g3, [ %g2 + 0x1bc ] ! 40016dbc <_Watchdog_Sync_level>
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
4000a740: c4 07 60 04 ld [ %i5 + 4 ], %g2
next->previous = previous;
4000a744: c4 20 60 04 st %g2, [ %g1 + 4 ]
previous->next = next;
4000a748: c2 20 80 00 st %g1, [ %g2 ]
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
4000a74c: 03 10 00 5b sethi %hi(0x40016c00), %g1
4000a750: c2 00 61 e0 ld [ %g1 + 0x1e0 ], %g1 ! 40016de0 <_Watchdog_Ticks_since_boot>
4000a754: c2 27 60 18 st %g1, [ %i5 + 0x18 ]
_ISR_Enable( level );
4000a758: 7f ff de a6 call 400021f0 <sparc_enable_interrupts>
4000a75c: 01 00 00 00 nop
return( previous_state );
}
4000a760: 81 c7 e0 08 ret
4000a764: 81 e8 00 00 restore
4000ba7c <_Watchdog_Report_chain>:
void _Watchdog_Report_chain(
const char *name,
Chain_Control *header
)
{
4000ba7c: 9d e3 bf a0 save %sp, -96, %sp
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4000ba80: 03 10 00 65 sethi %hi(0x40019400), %g1
4000ba84: 82 10 60 90 or %g1, 0x90, %g1 ! 40019490 <_Per_CPU_Information>
4000ba88: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
4000ba8c: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
4000ba90: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
ISR_Level level;
Chain_Node *node;
_Thread_Disable_dispatch();
_ISR_Disable( level );
4000ba94: 7f ff dc 8d call 40002cc8 <sparc_disable_interrupts>
4000ba98: 01 00 00 00 nop
4000ba9c: b8 10 00 08 mov %o0, %i4
printk( "Watchdog Chain: %s %p\n", name, header );
4000baa0: 11 10 00 5d sethi %hi(0x40017400), %o0
4000baa4: 94 10 00 19 mov %i1, %o2
4000baa8: 90 12 22 50 or %o0, 0x250, %o0
4000baac: 7f ff e4 87 call 40004cc8 <printk>
4000bab0: 92 10 00 18 mov %i0, %o1
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
4000bab4: fa 06 40 00 ld [ %i1 ], %i5
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
4000bab8: b2 06 60 04 add %i1, 4, %i1
if ( !_Chain_Is_empty( header ) ) {
4000babc: 80 a7 40 19 cmp %i5, %i1
4000bac0: 02 80 00 0e be 4000baf8 <_Watchdog_Report_chain+0x7c>
4000bac4: 11 10 00 5d sethi %hi(0x40017400), %o0
node != _Chain_Tail(header) ;
node = node->next )
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
4000bac8: 92 10 00 1d mov %i5, %o1
4000bacc: 40 00 00 11 call 4000bb10 <_Watchdog_Report>
4000bad0: 90 10 20 00 clr %o0
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = _Chain_First( header ) ;
node != _Chain_Tail(header) ;
node = node->next )
4000bad4: fa 07 40 00 ld [ %i5 ], %i5
_Thread_Disable_dispatch();
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = _Chain_First( header ) ;
4000bad8: 80 a7 40 19 cmp %i5, %i1
4000badc: 12 bf ff fc bne 4000bacc <_Watchdog_Report_chain+0x50> <== NEVER TAKEN
4000bae0: 92 10 00 1d mov %i5, %o1
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
4000bae4: 11 10 00 5d sethi %hi(0x40017400), %o0
4000bae8: 92 10 00 18 mov %i0, %o1
4000baec: 7f ff e4 77 call 40004cc8 <printk>
4000baf0: 90 12 22 68 or %o0, 0x268, %o0
4000baf4: 30 80 00 03 b,a 4000bb00 <_Watchdog_Report_chain+0x84>
} else {
printk( "Chain is empty\n" );
4000baf8: 7f ff e4 74 call 40004cc8 <printk>
4000bafc: 90 12 22 78 or %o0, 0x278, %o0
}
_ISR_Enable( level );
4000bb00: 7f ff dc 76 call 40002cd8 <sparc_enable_interrupts>
4000bb04: 90 10 00 1c mov %i4, %o0
_Thread_Enable_dispatch();
4000bb08: 7f ff fc 3b call 4000abf4 <_Thread_Enable_dispatch>
4000bb0c: 81 e8 00 00 restore
4000a768 <_Watchdog_Tickle>:
#include <rtems/score/watchdogimpl.h>
void _Watchdog_Tickle(
Chain_Control *header
)
{
4000a768: 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 );
4000a76c: 7f ff de 9d call 400021e0 <sparc_disable_interrupts>
4000a770: b8 10 00 18 mov %i0, %i4
4000a774: 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;
4000a778: 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 );
4000a77c: b6 07 20 04 add %i4, 4, %i3
if ( _Chain_Is_empty( header ) )
4000a780: 80 a7 40 1b cmp %i5, %i3
4000a784: 02 80 00 1f be 4000a800 <_Watchdog_Tickle+0x98>
4000a788: 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) {
4000a78c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
4000a790: 80 a0 60 00 cmp %g1, 0
4000a794: 02 80 00 06 be 4000a7ac <_Watchdog_Tickle+0x44> <== NEVER TAKEN
4000a798: 82 00 7f ff add %g1, -1, %g1
the_watchdog->delta_interval--;
4000a79c: c2 27 60 10 st %g1, [ %i5 + 0x10 ]
if ( the_watchdog->delta_interval != 0 )
4000a7a0: 80 a0 60 00 cmp %g1, 0
4000a7a4: 12 80 00 17 bne 4000a800 <_Watchdog_Tickle+0x98>
4000a7a8: 01 00 00 00 nop
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
4000a7ac: 7f ff ff c6 call 4000a6c4 <_Watchdog_Remove>
4000a7b0: 90 10 00 1d mov %i5, %o0
4000a7b4: b4 10 00 08 mov %o0, %i2
_ISR_Enable( level );
4000a7b8: 7f ff de 8e call 400021f0 <sparc_enable_interrupts>
4000a7bc: 90 10 00 18 mov %i0, %o0
switch( watchdog_state ) {
4000a7c0: 80 a6 a0 02 cmp %i2, 2
4000a7c4: 12 80 00 06 bne 4000a7dc <_Watchdog_Tickle+0x74>
4000a7c8: 01 00 00 00 nop
case WATCHDOG_ACTIVE:
(*the_watchdog->routine)(
4000a7cc: c2 07 60 1c ld [ %i5 + 0x1c ], %g1
4000a7d0: d0 07 60 20 ld [ %i5 + 0x20 ], %o0
4000a7d4: 9f c0 40 00 call %g1
4000a7d8: d2 07 60 24 ld [ %i5 + 0x24 ], %o1
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
4000a7dc: 7f ff de 81 call 400021e0 <sparc_disable_interrupts>
4000a7e0: 01 00 00 00 nop
4000a7e4: b0 10 00 08 mov %o0, %i0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4000a7e8: fa 07 00 00 ld [ %i4 ], %i5
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
4000a7ec: 80 a7 40 1b cmp %i5, %i3
4000a7f0: 02 80 00 04 be 4000a800 <_Watchdog_Tickle+0x98>
4000a7f4: 01 00 00 00 nop
}
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
4000a7f8: 10 bf ff ea b 4000a7a0 <_Watchdog_Tickle+0x38>
4000a7fc: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
4000a800: 7f ff de 7c call 400021f0 <sparc_enable_interrupts>
4000a804: 81 e8 00 00 restore
4000a808 <_Workspace_Handler_initialization>:
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
4000a808: 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();
4000a80c: 05 10 00 52 sethi %hi(0x40014800), %g2
4000a810: 82 10 a1 d0 or %g2, 0x1d0, %g1 ! 400149d0 <Configuration>
4000a814: c6 08 60 32 ldub [ %g1 + 0x32 ], %g3
4000a818: fa 00 a1 d0 ld [ %g2 + 0x1d0 ], %i5
4000a81c: 80 a0 e0 00 cmp %g3, 0
4000a820: 12 80 00 03 bne 4000a82c <_Workspace_Handler_initialization+0x24>
4000a824: 84 10 20 00 clr %g2
4000a828: c4 00 60 04 ld [ %g1 + 4 ], %g2
size_t i;
for (i = 0; i < area_count; ++i) {
Heap_Area *area = &areas [i];
if ( do_zero ) {
4000a82c: e2 08 60 30 ldub [ %g1 + 0x30 ], %l1
if ( area->size > overhead ) {
uintptr_t space_available;
uintptr_t size;
if ( unified ) {
4000a830: e4 08 60 31 ldub [ %g1 + 0x31 ], %l2
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
4000a834: 21 10 00 20 sethi %hi(0x40008000), %l0
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
4000a838: 27 10 00 5b sethi %hi(0x40016c00), %l3
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
4000a83c: ba 00 80 1d add %g2, %i5, %i5
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
4000a840: b6 10 20 00 clr %i3
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
4000a844: a0 14 23 00 or %l0, 0x300, %l0
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
4000a848: a6 14 e1 4c or %l3, 0x14c, %l3
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
4000a84c: 80 a6 c0 19 cmp %i3, %i1
4000a850: 02 80 00 2d be 4000a904 <_Workspace_Handler_initialization+0xfc>
4000a854: 80 a4 60 00 cmp %l1, 0
Heap_Area *area = &areas [i];
if ( do_zero ) {
4000a858: 22 80 00 07 be,a 4000a874 <_Workspace_Handler_initialization+0x6c>
4000a85c: f8 06 20 04 ld [ %i0 + 4 ], %i4
memset( area->begin, 0, area->size );
4000a860: d0 06 00 00 ld [ %i0 ], %o0
4000a864: d4 06 20 04 ld [ %i0 + 4 ], %o2
4000a868: 40 00 13 be call 4000f760 <memset>
4000a86c: 92 10 20 00 clr %o1
}
if ( area->size > overhead ) {
4000a870: f8 06 20 04 ld [ %i0 + 4 ], %i4
4000a874: 80 a7 20 16 cmp %i4, 0x16
4000a878: 28 80 00 21 bleu,a 4000a8fc <_Workspace_Handler_initialization+0xf4>
4000a87c: b6 06 e0 01 inc %i3
uintptr_t space_available;
uintptr_t size;
if ( unified ) {
4000a880: 80 a4 a0 00 cmp %l2, 0
4000a884: 32 80 00 0c bne,a 4000a8b4 <_Workspace_Handler_initialization+0xac>
4000a888: d2 06 00 00 ld [ %i0 ], %o1
size = area->size;
} else {
if ( remaining > 0 ) {
4000a88c: 80 a7 60 00 cmp %i5, 0
4000a890: 22 80 00 08 be,a 4000a8b0 <_Workspace_Handler_initialization+0xa8><== NEVER TAKEN
4000a894: b8 10 20 00 clr %i4 <== NOT EXECUTED
size = remaining < area->size - overhead ?
4000a898: 82 07 3f ea add %i4, -22, %g1
remaining + overhead : area->size;
4000a89c: 80 a7 40 01 cmp %i5, %g1
4000a8a0: 2a 80 00 04 bcs,a 4000a8b0 <_Workspace_Handler_initialization+0xa8><== ALWAYS TAKEN
4000a8a4: b8 07 60 16 add %i5, 0x16, %i4
4000a8a8: 10 80 00 03 b 4000a8b4 <_Workspace_Handler_initialization+0xac><== NOT EXECUTED
4000a8ac: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
4000a8b0: d2 06 00 00 ld [ %i0 ], %o1
4000a8b4: 94 10 00 1c mov %i4, %o2
4000a8b8: 90 10 00 13 mov %l3, %o0
4000a8bc: 9f c4 00 00 call %l0
4000a8c0: 96 10 20 08 mov 8, %o3
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
4000a8c4: c2 06 00 00 ld [ %i0 ], %g1
area->size -= size;
if ( space_available < remaining ) {
4000a8c8: 80 a2 00 1d cmp %o0, %i5
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
4000a8cc: 82 00 40 1c add %g1, %i4, %g1
4000a8d0: c2 26 00 00 st %g1, [ %i0 ]
area->size -= size;
4000a8d4: c2 06 20 04 ld [ %i0 + 4 ], %g1
4000a8d8: b8 20 40 1c sub %g1, %i4, %i4
if ( space_available < remaining ) {
4000a8dc: 1a 80 00 05 bcc 4000a8f0 <_Workspace_Handler_initialization+0xe8><== ALWAYS TAKEN
4000a8e0: f8 26 20 04 st %i4, [ %i0 + 4 ]
remaining -= space_available;
4000a8e4: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED
4000a8e8: 10 80 00 04 b 4000a8f8 <_Workspace_Handler_initialization+0xf0><== NOT EXECUTED
4000a8ec: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED
} else {
remaining = 0;
}
init_or_extend = extend;
4000a8f0: a0 10 00 1a mov %i2, %l0
area->size -= size;
if ( space_available < remaining ) {
remaining -= space_available;
} else {
remaining = 0;
4000a8f4: ba 10 20 00 clr %i5
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
4000a8f8: b6 06 e0 01 inc %i3
4000a8fc: 10 bf ff d4 b 4000a84c <_Workspace_Handler_initialization+0x44>
4000a900: b0 06 20 08 add %i0, 8, %i0
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
4000a904: 80 a7 60 00 cmp %i5, 0
4000a908: 02 80 00 05 be 4000a91c <_Workspace_Handler_initialization+0x114>
4000a90c: 90 10 20 00 clr %o0
_Internal_error_Occurred(
4000a910: 92 10 20 01 mov 1, %o1
4000a914: 7f ff f7 12 call 4000855c <_Internal_error_Occurred>
4000a918: 94 10 20 02 mov 2, %o2
4000a91c: 81 c7 e0 08 ret
4000a920: 81 e8 00 00 restore
40007240 <aio_cancel>:
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
40007240: 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);
40007244: 3b 10 00 62 sethi %hi(0x40018800), %i5
40007248: 40 00 04 67 call 400083e4 <pthread_mutex_lock>
4000724c: 90 17 63 dc or %i5, 0x3dc, %o0 ! 40018bdc <aio_request_queue>
if (fcntl (fildes, F_GETFD) < 0) {
40007250: 90 10 00 18 mov %i0, %o0
40007254: 92 10 20 01 mov 1, %o1
40007258: 40 00 19 c5 call 4000d96c <fcntl>
4000725c: b4 10 00 1d mov %i5, %i2
40007260: 80 a2 20 00 cmp %o0, 0
40007264: 16 80 00 08 bge 40007284 <aio_cancel+0x44>
40007268: 80 a6 60 00 cmp %i1, 0
pthread_mutex_unlock(&aio_request_queue.mutex);
4000726c: 40 00 04 7e call 40008464 <pthread_mutex_unlock>
40007270: 90 17 63 dc or %i5, 0x3dc, %o0
rtems_set_errno_and_return_minus_one (EBADF);
40007274: 40 00 27 c8 call 40011194 <__errno>
40007278: 01 00 00 00 nop
4000727c: 10 80 00 53 b 400073c8 <aio_cancel+0x188>
40007280: 82 10 20 09 mov 9, %g1 ! 9 <PROM_START+0x9>
}
/* if aiocbp is NULL remove all request for given file descriptor */
if (aiocbp == NULL) {
40007284: 32 80 00 34 bne,a 40007354 <aio_cancel+0x114>
40007288: f8 06 40 00 ld [ %i1 ], %i4
AIO_printf ("Cancel all requests\n");
r_chain = rtems_aio_search_fd (work_req_chain, fildes, 0);
4000728c: 11 10 00 63 sethi %hi(0x40018c00), %o0
40007290: 92 10 00 18 mov %i0, %o1
40007294: 90 12 20 30 or %o0, 0x30, %o0
40007298: 40 00 01 6d call 4000784c <rtems_aio_search_fd>
4000729c: 94 10 20 00 clr %o2
if (r_chain == NULL) {
400072a0: b8 92 20 00 orcc %o0, 0, %i4
400072a4: 12 80 00 1f bne 40007320 <aio_cancel+0xe0>
400072a8: 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;
400072ac: ba 17 63 dc or %i5, 0x3dc, %i5
AIO_printf ("Request chain not on [WQ]\n");
if (!rtems_chain_is_empty (idle_req_chain)) {
400072b0: c4 07 60 60 ld [ %i5 + 0x60 ], %g2
400072b4: 82 07 60 64 add %i5, 0x64, %g1
400072b8: 80 a0 80 01 cmp %g2, %g1
400072bc: 02 80 00 08 be 400072dc <aio_cancel+0x9c> <== NEVER TAKEN
400072c0: 90 07 60 60 add %i5, 0x60, %o0
r_chain = rtems_aio_search_fd (idle_req_chain, fildes, 0);
400072c4: 92 10 00 18 mov %i0, %o1
400072c8: 40 00 01 61 call 4000784c <rtems_aio_search_fd>
400072cc: 94 10 20 00 clr %o2
if (r_chain == NULL) {
400072d0: b8 92 20 00 orcc %o0, 0, %i4
400072d4: 12 80 00 07 bne 400072f0 <aio_cancel+0xb0>
400072d8: 01 00 00 00 nop
pthread_mutex_unlock(&aio_request_queue.mutex);
400072dc: 90 16 a3 dc or %i2, 0x3dc, %o0
400072e0: 40 00 04 61 call 40008464 <pthread_mutex_unlock>
400072e4: b0 10 20 02 mov 2, %i0
return AIO_ALLDONE;
400072e8: 81 c7 e0 08 ret
400072ec: 81 e8 00 00 restore
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
400072f0: 40 00 0a ba call 40009dd8 <_Chain_Extract>
400072f4: b6 07 20 1c add %i4, 0x1c, %i3
}
AIO_printf ("Request chain on [IQ]\n");
rtems_chain_explicit_extract (idle_req_chain, &r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
400072f8: 40 00 01 7d call 400078ec <rtems_aio_remove_fd>
400072fc: 90 10 00 1c mov %i4, %o0
pthread_mutex_destroy (&r_chain->mutex);
40007300: 40 00 03 8e call 40008138 <pthread_mutex_destroy>
40007304: 90 10 00 1b mov %i3, %o0
pthread_cond_destroy (&r_chain->mutex);
40007308: 40 00 02 ae call 40007dc0 <pthread_cond_destroy>
4000730c: 90 10 00 1b mov %i3, %o0
free (r_chain);
40007310: 7f ff f2 2f call 40003bcc <free>
40007314: 90 10 00 1c mov %i4, %o0
pthread_mutex_unlock (&aio_request_queue.mutex);
40007318: 10 80 00 0b b 40007344 <aio_cancel+0x104>
4000731c: 90 10 00 1d mov %i5, %o0
return AIO_ALLDONE;
}
AIO_printf ("Request chain on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
40007320: 40 00 04 31 call 400083e4 <pthread_mutex_lock>
40007324: 90 10 00 1b mov %i3, %o0
40007328: 40 00 0a ac call 40009dd8 <_Chain_Extract>
4000732c: 90 10 00 1c mov %i4, %o0
rtems_chain_explicit_extract (work_req_chain, &r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
40007330: 40 00 01 6f call 400078ec <rtems_aio_remove_fd>
40007334: 90 10 00 1c mov %i4, %o0
pthread_mutex_unlock (&r_chain->mutex);
40007338: 40 00 04 4b call 40008464 <pthread_mutex_unlock>
4000733c: 90 10 00 1b mov %i3, %o0
pthread_mutex_unlock (&aio_request_queue.mutex);
40007340: 90 17 63 dc or %i5, 0x3dc, %o0
40007344: 40 00 04 48 call 40008464 <pthread_mutex_unlock>
40007348: b0 10 20 00 clr %i0
return AIO_CANCELED;
4000734c: 81 c7 e0 08 ret
40007350: 81 e8 00 00 restore
} else {
AIO_printf ("Cancel request\n");
if (aiocbp->aio_fildes != fildes) {
40007354: 80 a7 00 18 cmp %i4, %i0
40007358: 12 80 00 17 bne 400073b4 <aio_cancel+0x174>
4000735c: 90 17 63 dc or %i5, 0x3dc, %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);
40007360: 11 10 00 63 sethi %hi(0x40018c00), %o0
40007364: 92 10 00 1c mov %i4, %o1
40007368: 90 12 20 30 or %o0, 0x30, %o0
4000736c: 40 00 01 38 call 4000784c <rtems_aio_search_fd>
40007370: 94 10 20 00 clr %o2
if (r_chain == NULL) {
40007374: b6 92 20 00 orcc %o0, 0, %i3
40007378: 32 80 00 1c bne,a 400073e8 <aio_cancel+0x1a8>
4000737c: b8 06 e0 1c add %i3, 0x1c, %i4
40007380: ba 17 63 dc or %i5, 0x3dc, %i5
if (!rtems_chain_is_empty (idle_req_chain)) {
40007384: c4 07 60 60 ld [ %i5 + 0x60 ], %g2
40007388: 82 07 60 64 add %i5, 0x64, %g1
4000738c: 80 a0 80 01 cmp %g2, %g1
40007390: 02 bf ff d3 be 400072dc <aio_cancel+0x9c> <== NEVER TAKEN
40007394: 90 07 60 60 add %i5, 0x60, %o0
r_chain = rtems_aio_search_fd (idle_req_chain, fildes, 0);
40007398: 92 10 00 1c mov %i4, %o1
4000739c: 40 00 01 2c call 4000784c <rtems_aio_search_fd>
400073a0: 94 10 20 00 clr %o2
if (r_chain == NULL) {
400073a4: 80 a2 20 00 cmp %o0, 0
400073a8: 12 80 00 0b bne 400073d4 <aio_cancel+0x194>
400073ac: 90 02 20 08 add %o0, 8, %o0
pthread_mutex_unlock (&aio_request_queue.mutex);
400073b0: 90 10 00 1d mov %i5, %o0
400073b4: 40 00 04 2c call 40008464 <pthread_mutex_unlock>
400073b8: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one (EINVAL);
400073bc: 40 00 27 76 call 40011194 <__errno>
400073c0: 01 00 00 00 nop
400073c4: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
400073c8: c2 22 00 00 st %g1, [ %o0 ]
400073cc: 81 c7 e0 08 ret
400073d0: 91 e8 3f ff restore %g0, -1, %o0
}
AIO_printf ("Request on [IQ]\n");
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
400073d4: 40 00 01 5b call 40007940 <rtems_aio_remove_req>
400073d8: 92 10 00 19 mov %i1, %o1
400073dc: b0 10 00 08 mov %o0, %i0
pthread_mutex_unlock (&aio_request_queue.mutex);
400073e0: 10 80 00 0b b 4000740c <aio_cancel+0x1cc>
400073e4: 90 10 00 1d mov %i5, %o0
return AIO_ALLDONE;
}
}
AIO_printf ("Request on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
400073e8: 40 00 03 ff call 400083e4 <pthread_mutex_lock>
400073ec: 90 10 00 1c mov %i4, %o0
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
400073f0: 92 10 00 19 mov %i1, %o1
400073f4: 40 00 01 53 call 40007940 <rtems_aio_remove_req>
400073f8: 90 06 e0 08 add %i3, 8, %o0
400073fc: b0 10 00 08 mov %o0, %i0
pthread_mutex_unlock (&r_chain->mutex);
40007400: 40 00 04 19 call 40008464 <pthread_mutex_unlock>
40007404: 90 10 00 1c mov %i4, %o0
pthread_mutex_unlock (&aio_request_queue.mutex);
40007408: 90 17 63 dc or %i5, 0x3dc, %o0
4000740c: 40 00 04 16 call 40008464 <pthread_mutex_unlock>
40007410: 01 00 00 00 nop
return result;
}
return AIO_ALLDONE;
}
40007414: 81 c7 e0 08 ret
40007418: 81 e8 00 00 restore
40007424 <aio_fsync>:
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
40007424: 9d e3 bf a0 save %sp, -96, %sp
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
40007428: 03 00 00 08 sethi %hi(0x2000), %g1
4000742c: 80 a6 00 01 cmp %i0, %g1
40007430: 12 80 00 10 bne 40007470 <aio_fsync+0x4c>
40007434: ba 10 20 16 mov 0x16, %i5
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
40007438: d0 06 40 00 ld [ %i1 ], %o0
4000743c: 40 00 19 4c call 4000d96c <fcntl>
40007440: 92 10 20 03 mov 3, %o1
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
40007444: 90 0a 20 03 and %o0, 3, %o0
40007448: 90 02 3f ff add %o0, -1, %o0
4000744c: 80 a2 20 01 cmp %o0, 1
40007450: 18 80 00 08 bgu 40007470 <aio_fsync+0x4c>
40007454: ba 10 20 09 mov 9, %i5
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
40007458: 7f ff f2 f4 call 40004028 <malloc>
4000745c: 90 10 20 18 mov 0x18, %o0
if (req == NULL)
40007460: b0 92 20 00 orcc %o0, 0, %i0
40007464: 32 80 00 0b bne,a 40007490 <aio_fsync+0x6c> <== ALWAYS TAKEN
40007468: f2 26 20 14 st %i1, [ %i0 + 0x14 ]
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
4000746c: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED
40007470: 82 10 3f ff mov -1, %g1
40007474: fa 26 60 34 st %i5, [ %i1 + 0x34 ]
40007478: c2 26 60 38 st %g1, [ %i1 + 0x38 ]
4000747c: 40 00 27 46 call 40011194 <__errno>
40007480: b0 10 3f ff mov -1, %i0
40007484: fa 22 00 00 st %i5, [ %o0 ]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
40007488: 81 c7 e0 08 ret
4000748c: 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;
40007490: 82 10 20 03 mov 3, %g1
40007494: c2 26 60 30 st %g1, [ %i1 + 0x30 ]
return rtems_aio_enqueue (req);
40007498: 40 00 01 48 call 400079b8 <rtems_aio_enqueue>
4000749c: 81 e8 00 00 restore
40007be0 <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
40007be0: 9d e3 bf a0 save %sp, -96, %sp
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
40007be4: d0 06 00 00 ld [ %i0 ], %o0
40007be8: 92 10 20 03 mov 3, %o1
40007bec: 40 00 17 60 call 4000d96c <fcntl>
40007bf0: ba 10 00 18 mov %i0, %i5
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
40007bf4: 80 8a 20 01 btst 1, %o0
40007bf8: 12 80 00 11 bne 40007c3c <aio_read+0x5c>
40007bfc: 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)
40007c00: c2 06 20 18 ld [ %i0 + 0x18 ], %g1
40007c04: 80 a0 60 00 cmp %g1, 0
40007c08: 22 80 00 04 be,a 40007c18 <aio_read+0x38>
40007c0c: c2 06 20 08 ld [ %i0 + 8 ], %g1
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
40007c10: 10 80 00 0b b 40007c3c <aio_read+0x5c>
40007c14: b8 10 20 16 mov 0x16, %i4
if (aiocbp->aio_offset < 0)
40007c18: 80 a0 60 00 cmp %g1, 0
40007c1c: 06 80 00 08 bl 40007c3c <aio_read+0x5c>
40007c20: b8 10 20 16 mov 0x16, %i4
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
40007c24: 7f ff f1 01 call 40004028 <malloc>
40007c28: 90 10 20 18 mov 0x18, %o0
if (req == NULL)
40007c2c: b0 92 20 00 orcc %o0, 0, %i0
40007c30: 32 80 00 0b bne,a 40007c5c <aio_read+0x7c> <== ALWAYS TAKEN
40007c34: fa 26 20 14 st %i5, [ %i0 + 0x14 ]
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
40007c38: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED
40007c3c: 82 10 3f ff mov -1, %g1
40007c40: f8 27 60 34 st %i4, [ %i5 + 0x34 ]
40007c44: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
40007c48: 40 00 25 53 call 40011194 <__errno>
40007c4c: b0 10 3f ff mov -1, %i0
40007c50: f8 22 00 00 st %i4, [ %o0 ]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
40007c54: 81 c7 e0 08 ret
40007c58: 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;
40007c5c: 82 10 20 01 mov 1, %g1
40007c60: c2 27 60 30 st %g1, [ %i5 + 0x30 ]
return rtems_aio_enqueue (req);
40007c64: 7f ff ff 55 call 400079b8 <rtems_aio_enqueue>
40007c68: 81 e8 00 00 restore
40007c74 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
40007c74: 9d e3 bf a0 save %sp, -96, %sp
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
40007c78: d0 06 00 00 ld [ %i0 ], %o0
40007c7c: 40 00 17 3c call 4000d96c <fcntl>
40007c80: 92 10 20 03 mov 3, %o1
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
40007c84: 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)))
40007c88: 90 0a 20 03 and %o0, 3, %o0
40007c8c: 90 02 3f ff add %o0, -1, %o0
40007c90: 80 a2 20 01 cmp %o0, 1
40007c94: 18 80 00 11 bgu 40007cd8 <aio_write+0x64>
40007c98: 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)
40007c9c: c2 06 20 18 ld [ %i0 + 0x18 ], %g1
40007ca0: 80 a0 60 00 cmp %g1, 0
40007ca4: 22 80 00 04 be,a 40007cb4 <aio_write+0x40>
40007ca8: c2 06 20 08 ld [ %i0 + 8 ], %g1
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
40007cac: 10 80 00 0b b 40007cd8 <aio_write+0x64>
40007cb0: b8 10 20 16 mov 0x16, %i4
if (aiocbp->aio_offset < 0)
40007cb4: 80 a0 60 00 cmp %g1, 0
40007cb8: 06 80 00 08 bl 40007cd8 <aio_write+0x64>
40007cbc: b8 10 20 16 mov 0x16, %i4
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
40007cc0: 7f ff f0 da call 40004028 <malloc>
40007cc4: 90 10 20 18 mov 0x18, %o0
if (req == NULL)
40007cc8: b0 92 20 00 orcc %o0, 0, %i0
40007ccc: 32 80 00 0b bne,a 40007cf8 <aio_write+0x84> <== ALWAYS TAKEN
40007cd0: fa 26 20 14 st %i5, [ %i0 + 0x14 ]
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
40007cd4: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED
40007cd8: 82 10 3f ff mov -1, %g1
40007cdc: f8 27 60 34 st %i4, [ %i5 + 0x34 ]
40007ce0: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
40007ce4: 40 00 25 2c call 40011194 <__errno>
40007ce8: b0 10 3f ff mov -1, %i0
40007cec: f8 22 00 00 st %i4, [ %o0 ]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
40007cf0: 81 c7 e0 08 ret
40007cf4: 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;
40007cf8: 82 10 20 02 mov 2, %g1
40007cfc: c2 27 60 30 st %g1, [ %i5 + 0x30 ]
return rtems_aio_enqueue (req);
40007d00: 7f ff ff 2e call 400079b8 <rtems_aio_enqueue>
40007d04: 81 e8 00 00 restore
40006aec <clock_gettime>:
int clock_gettime(
clockid_t clock_id,
struct timespec *tp
)
{
40006aec: 9d e3 bf 98 save %sp, -104, %sp
if ( !tp )
40006af0: 80 a6 60 00 cmp %i1, 0
40006af4: 12 80 00 06 bne 40006b0c <clock_gettime+0x20>
40006af8: 80 a6 20 01 cmp %i0, 1
rtems_set_errno_and_return_minus_one( EINVAL );
40006afc: 40 00 22 53 call 4000f448 <__errno>
40006b00: 01 00 00 00 nop
40006b04: 10 80 00 25 b 40006b98 <clock_gettime+0xac>
40006b08: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
if ( clock_id == CLOCK_REALTIME ) {
40006b0c: 12 80 00 16 bne 40006b64 <clock_gettime+0x78>
40006b10: 80 a6 20 04 cmp %i0, 4
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
40006b14: 90 07 bf f8 add %fp, -8, %o0
40006b18: 13 10 00 64 sethi %hi(0x40019000), %o1
40006b1c: 40 00 06 37 call 400083f8 <_TOD_Get_with_nanoseconds>
40006b20: 92 12 62 00 or %o1, 0x200, %o1 ! 40019200 <_TOD>
static inline void _TOD_Get(
struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
40006b24: 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);
40006b28: 94 10 20 00 clr %o2
40006b2c: 90 10 00 1c mov %i4, %o0
40006b30: 92 10 00 1d mov %i5, %o1
40006b34: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
40006b38: 40 00 39 63 call 400150c4 <__divdi3>
40006b3c: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
40006b40: 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);
40006b44: d2 26 40 00 st %o1, [ %i1 ]
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
40006b48: 94 10 20 00 clr %o2
40006b4c: 92 10 00 1d mov %i5, %o1
40006b50: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
40006b54: 40 00 3a 4e call 4001548c <__moddi3>
40006b58: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
40006b5c: 10 80 00 06 b 40006b74 <clock_gettime+0x88>
40006b60: d2 26 60 04 st %o1, [ %i1 + 4 ]
_TOD_Get(tp);
return 0;
}
#ifdef CLOCK_MONOTONIC
if ( clock_id == CLOCK_MONOTONIC ) {
40006b64: 12 80 00 06 bne 40006b7c <clock_gettime+0x90> <== ALWAYS TAKEN
40006b68: 80 a6 20 02 cmp %i0, 2
_TOD_Get_uptime_as_timespec( tp );
40006b6c: 40 00 06 34 call 4000843c <_TOD_Get_uptime_as_timespec>
40006b70: 90 10 00 19 mov %i1, %o0
return 0;
40006b74: 81 c7 e0 08 ret
40006b78: 91 e8 20 00 restore %g0, 0, %o0
}
#endif
#ifdef _POSIX_CPUTIME
if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
40006b7c: 02 bf ff fc be 40006b6c <clock_gettime+0x80>
40006b80: 80 a6 20 03 cmp %i0, 3
return 0;
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
40006b84: 12 bf ff de bne 40006afc <clock_gettime+0x10>
40006b88: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( ENOSYS );
40006b8c: 40 00 22 2f call 4000f448 <__errno>
40006b90: 01 00 00 00 nop
40006b94: 82 10 20 58 mov 0x58, %g1 ! 58 <PROM_START+0x58>
40006b98: c2 22 00 00 st %g1, [ %o0 ]
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
}
40006b9c: 81 c7 e0 08 ret
40006ba0: 91 e8 3f ff restore %g0, -1, %o0
40006f00 <clock_settime>:
int clock_settime(
clockid_t clock_id,
const struct timespec *tp
)
{
40006f00: 9d e3 bf 98 save %sp, -104, %sp
if ( !tp )
40006f04: 82 96 60 00 orcc %i1, 0, %g1
40006f08: 12 80 00 06 bne 40006f20 <clock_settime+0x20> <== ALWAYS TAKEN
40006f0c: 80 a6 20 01 cmp %i0, 1
rtems_set_errno_and_return_minus_one( EINVAL );
40006f10: 40 00 24 ec call 400102c0 <__errno>
40006f14: 01 00 00 00 nop
40006f18: 10 80 00 4b b 40007044 <clock_settime+0x144>
40006f1c: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
if ( clock_id == CLOCK_REALTIME ) {
40006f20: 32 80 00 43 bne,a 4000702c <clock_settime+0x12c>
40006f24: b0 06 3f fe add %i0, -2, %i0
if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 )
40006f28: c6 00 40 00 ld [ %g1 ], %g3
40006f2c: 05 08 76 b9 sethi %hi(0x21dae400), %g2
40006f30: 84 10 a0 ff or %g2, 0xff, %g2 ! 21dae4ff <RAM_SIZE+0x219ae4ff>
40006f34: 80 a0 c0 02 cmp %g3, %g2
40006f38: 08 bf ff f6 bleu 40006f10 <clock_settime+0x10>
40006f3c: 05 10 00 6a sethi %hi(0x4001a800), %g2
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
40006f40: 84 10 a0 70 or %g2, 0x70, %g2 ! 4001a870 <_Per_CPU_Information>
40006f44: c6 00 a0 10 ld [ %g2 + 0x10 ], %g3
++level;
40006f48: 86 00 e0 01 inc %g3
_Thread_Dispatch_disable_level = level;
40006f4c: c6 20 a0 10 st %g3, [ %g2 + 0x10 ]
const struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
_Timestamp_Set(
40006f50: c8 00 40 00 ld [ %g1 ], %g4
40006f54: c2 00 60 04 ld [ %g1 + 4 ], %g1
40006f58: 86 10 00 04 mov %g4, %g3
40006f5c: 85 39 20 1f sra %g4, 0x1f, %g2
Timestamp64_Control *_time,
Timestamp64_Control _seconds,
Timestamp64_Control _nanoseconds
)
{
*_time = _seconds * 1000000000L + _nanoseconds;
40006f60: b7 31 20 1d srl %g4, 0x1d, %i3
40006f64: 89 28 a0 03 sll %g2, 3, %g4
40006f68: bb 28 e0 03 sll %g3, 3, %i5
40006f6c: b8 16 c0 04 or %i3, %g4, %i4
40006f70: 89 37 60 1b srl %i5, 0x1b, %g4
40006f74: b5 2f 20 05 sll %i4, 5, %i2
40006f78: b7 2f 60 05 sll %i5, 5, %i3
40006f7c: b4 11 00 1a or %g4, %i2, %i2
40006f80: ba a6 c0 1d subcc %i3, %i5, %i5
40006f84: 89 37 60 1a srl %i5, 0x1a, %g4
40006f88: b8 66 80 1c subx %i2, %i4, %i4
40006f8c: b7 2f 60 06 sll %i5, 6, %i3
40006f90: b5 2f 20 06 sll %i4, 6, %i2
40006f94: b6 a6 c0 1d subcc %i3, %i5, %i3
40006f98: b4 11 00 1a or %g4, %i2, %i2
40006f9c: b4 66 80 1c subx %i2, %i4, %i2
40006fa0: b2 86 c0 03 addcc %i3, %g3, %i1
40006fa4: b0 46 80 02 addx %i2, %g2, %i0
40006fa8: 89 36 60 1e srl %i1, 0x1e, %g4
40006fac: 85 2e 20 02 sll %i0, 2, %g2
40006fb0: 84 11 00 02 or %g4, %g2, %g2
40006fb4: 87 2e 60 02 sll %i1, 2, %g3
40006fb8: ba 86 40 03 addcc %i1, %g3, %i5
40006fbc: b8 46 00 02 addx %i0, %g2, %i4
40006fc0: 89 37 60 1e srl %i5, 0x1e, %g4
40006fc4: 85 2f 20 02 sll %i4, 2, %g2
40006fc8: 84 11 00 02 or %g4, %g2, %g2
40006fcc: 87 2f 60 02 sll %i5, 2, %g3
40006fd0: b6 87 40 03 addcc %i5, %g3, %i3
40006fd4: b4 47 00 02 addx %i4, %g2, %i2
40006fd8: 85 36 e0 1e srl %i3, 0x1e, %g2
40006fdc: bb 2e e0 02 sll %i3, 2, %i5
40006fe0: b9 2e a0 02 sll %i2, 2, %i4
40006fe4: 86 86 c0 1d addcc %i3, %i5, %g3
40006fe8: b8 10 80 1c or %g2, %i4, %i4
40006fec: 84 46 80 1c addx %i2, %i4, %g2
40006ff0: 89 28 e0 09 sll %g3, 9, %g4
40006ff4: b9 30 e0 17 srl %g3, 0x17, %i4
40006ff8: 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 );
40006ffc: 90 07 bf f8 add %fp, -8, %o0
40007000: bb 28 a0 09 sll %g2, 9, %i5
40007004: 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;
40007008: b0 10 20 00 clr %i0
const struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
_Timestamp_Set(
4000700c: b9 38 60 1f sra %g1, 0x1f, %i4
40007010: 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 );
40007014: 40 00 07 d0 call 40008f54 <_TOD_Set_with_timestamp>
40007018: 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();
4000701c: 40 00 0e 09 call 4000a840 <_Thread_Enable_dispatch>
40007020: 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;
40007024: 81 c7 e0 08 ret
40007028: 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 )
4000702c: 80 a6 20 01 cmp %i0, 1
40007030: 18 bf ff b8 bgu 40006f10 <clock_settime+0x10>
40007034: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( ENOSYS );
40007038: 40 00 24 a2 call 400102c0 <__errno>
4000703c: 01 00 00 00 nop
40007040: 82 10 20 58 mov 0x58, %g1 ! 58 <PROM_START+0x58>
40007044: c2 22 00 00 st %g1, [ %o0 ]
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
}
40007048: 81 c7 e0 08 ret
4000704c: 91 e8 3f ff restore %g0, -1, %o0
40028dcc <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
40028dcc: 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() )
40028dd0: 7f ff ff 27 call 40028a6c <getpid>
40028dd4: 01 00 00 00 nop
40028dd8: 80 a6 00 08 cmp %i0, %o0
40028ddc: 02 80 00 06 be 40028df4 <killinfo+0x28>
40028de0: 80 a6 60 00 cmp %i1, 0
rtems_set_errno_and_return_minus_one( ESRCH );
40028de4: 7f ff b9 35 call 400172b8 <__errno>
40028de8: 01 00 00 00 nop
40028dec: 10 80 00 07 b 40028e08 <killinfo+0x3c>
40028df0: 82 10 20 03 mov 3, %g1 ! 3 <PROM_START+0x3>
/*
* Validate the signal passed.
*/
if ( !sig )
40028df4: 12 80 00 08 bne 40028e14 <killinfo+0x48>
40028df8: ba 06 7f ff add %i1, -1, %i5
rtems_set_errno_and_return_minus_one( EINVAL );
40028dfc: 7f ff b9 2f call 400172b8 <__errno>
40028e00: 01 00 00 00 nop
40028e04: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
40028e08: c2 22 00 00 st %g1, [ %o0 ]
40028e0c: 81 c7 e0 08 ret
40028e10: 91 e8 3f ff restore %g0, -1, %o0
if ( !is_valid_signo(sig) )
40028e14: 80 a7 60 1f cmp %i5, 0x1f
40028e18: 18 bf ff f9 bgu 40028dfc <killinfo+0x30>
40028e1c: 23 10 00 bd sethi %hi(0x4002f400), %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 )
40028e20: b1 2e 60 02 sll %i1, 2, %i0
40028e24: a2 14 60 b8 or %l1, 0xb8, %l1
40028e28: a1 2e 60 04 sll %i1, 4, %l0
40028e2c: 82 24 00 18 sub %l0, %i0, %g1
40028e30: 82 04 40 01 add %l1, %g1, %g1
40028e34: c2 00 60 08 ld [ %g1 + 8 ], %g1
40028e38: 80 a0 60 01 cmp %g1, 1
40028e3c: 02 80 00 98 be 4002909c <killinfo+0x2d0>
40028e40: 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 ) )
40028e44: 02 80 00 06 be 40028e5c <killinfo+0x90>
40028e48: 80 a6 60 04 cmp %i1, 4
40028e4c: 02 80 00 04 be 40028e5c <killinfo+0x90>
40028e50: 80 a6 60 0b cmp %i1, 0xb
40028e54: 12 80 00 08 bne 40028e74 <killinfo+0xa8>
40028e58: 82 10 20 01 mov 1, %g1
return pthread_kill( pthread_self(), sig );
40028e5c: 40 00 01 20 call 400292dc <pthread_self>
40028e60: 01 00 00 00 nop
40028e64: 40 00 00 ec call 40029214 <pthread_kill>
40028e68: 92 10 00 19 mov %i1, %o1
40028e6c: 81 c7 e0 08 ret
40028e70: 91 e8 00 08 restore %g0, %o0, %o0
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
40028e74: f2 27 bf f4 st %i1, [ %fp + -12 ]
siginfo->si_code = SI_USER;
40028e78: c2 27 bf f8 st %g1, [ %fp + -8 ]
if ( !value ) {
40028e7c: 80 a6 a0 00 cmp %i2, 0
40028e80: 12 80 00 04 bne 40028e90 <killinfo+0xc4>
40028e84: bb 28 40 1d sll %g1, %i5, %i5
40028e88: 10 80 00 04 b 40028e98 <killinfo+0xcc>
40028e8c: c0 27 bf fc clr [ %fp + -4 ]
siginfo->si_value.sival_int = 0;
} else {
siginfo->si_value = *value;
40028e90: c2 06 80 00 ld [ %i2 ], %g1
40028e94: c2 27 bf fc st %g1, [ %fp + -4 ]
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
40028e98: 03 10 00 bd sethi %hi(0x4002f400), %g1
40028e9c: 82 10 60 70 or %g1, 0x70, %g1 ! 4002f470 <_Per_CPU_Information>
40028ea0: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
40028ea4: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40028ea8: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
#define _POSIX_signals_Release( level ) \
_ISR_lock_Release_and_ISR_enable( &_POSIX_signals_Lock, level )
static inline void _POSIX_signals_Add_post_switch_extension(void)
{
_API_extensions_Add_post_switch( &_POSIX_signals_Post_switch );
40028eac: 11 10 00 b7 sethi %hi(0x4002dc00), %o0
40028eb0: 7f ff 8c 06 call 4000bec8 <_API_extensions_Add_post_switch>
40028eb4: 90 12 20 58 or %o0, 0x58, %o0 ! 4002dc58 <_POSIX_signals_Post_switch>
/*
* Is the currently executing thread interested? If so then it will
* get it an execute it as soon as the dispatcher executes.
*/
the_thread = _Thread_Executing;
40028eb8: 03 10 00 bd sethi %hi(0x4002f400), %g1
40028ebc: d0 00 60 88 ld [ %g1 + 0x88 ], %o0 ! 4002f488 <_Per_CPU_Information+0x18>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
40028ec0: c4 02 21 50 ld [ %o0 + 0x150 ], %g2
40028ec4: c4 00 a0 dc ld [ %g2 + 0xdc ], %g2
40028ec8: 80 af 40 02 andncc %i5, %g2, %g0
40028ecc: 12 80 00 50 bne 4002900c <killinfo+0x240>
40028ed0: 03 10 00 bd sethi %hi(0x4002f400), %g1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
40028ed4: d0 00 62 44 ld [ %g1 + 0x244 ], %o0 ! 4002f644 <_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 );
40028ed8: 05 10 00 bd sethi %hi(0x4002f400), %g2
40028edc: 84 10 a2 48 or %g2, 0x248, %g2 ! 4002f648 <_POSIX_signals_Wait_queue+0x4>
40028ee0: 80 a2 00 02 cmp %o0, %g2
40028ee4: 02 80 00 0c be 40028f14 <killinfo+0x148>
40028ee8: 03 10 00 b6 sethi %hi(0x4002d800), %g1
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
40028eec: c8 02 20 30 ld [ %o0 + 0x30 ], %g4
40028ef0: 80 8f 40 04 btst %i5, %g4
40028ef4: 12 80 00 46 bne 4002900c <killinfo+0x240>
40028ef8: c6 02 21 50 ld [ %o0 + 0x150 ], %g3
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
40028efc: c6 00 e0 dc ld [ %g3 + 0xdc ], %g3
40028f00: 80 af 40 03 andncc %i5, %g3, %g0
40028f04: 12 80 00 43 bne 40029010 <killinfo+0x244>
40028f08: 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 ) {
40028f0c: 10 bf ff f5 b 40028ee0 <killinfo+0x114>
40028f10: d0 02 00 00 ld [ %o0 ], %o0
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
40028f14: c6 08 60 a8 ldub [ %g1 + 0xa8 ], %g3
*
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
40028f18: 90 10 20 00 clr %o0
interested_priority = PRIORITY_MAXIMUM + 1;
40028f1c: 86 00 e0 01 inc %g3
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
40028f20: 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 ] )
40028f24: 19 10 00 bb sethi %hi(0x4002ec00), %o4
*/
RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal (
States_Control the_states
)
{
return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL);
40028f28: 35 04 00 00 sethi %hi(0x10000000), %i2
40028f2c: 85 2f 20 02 sll %i4, 2, %g2
40028f30: 88 13 22 c4 or %o4, 0x2c4, %g4
40028f34: c4 01 00 02 ld [ %g4 + %g2 ], %g2
40028f38: 80 a0 a0 00 cmp %g2, 0
40028f3c: 02 80 00 2d be 40028ff0 <killinfo+0x224> <== NEVER TAKEN
40028f40: b6 10 20 01 mov 1, %i3
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
40028f44: c4 00 a0 04 ld [ %g2 + 4 ], %g2
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
40028f48: d6 10 a0 10 lduh [ %g2 + 0x10 ], %o3
object_table = the_info->local_table;
40028f4c: d4 00 a0 1c ld [ %g2 + 0x1c ], %o2
for ( index = 1 ; index <= maximum ; index++ ) {
40028f50: 80 a6 c0 0b cmp %i3, %o3
40028f54: 18 80 00 27 bgu 40028ff0 <killinfo+0x224>
40028f58: 85 2e e0 02 sll %i3, 2, %g2
the_thread = (Thread_Control *) object_table[ index ];
40028f5c: c4 02 80 02 ld [ %o2 + %g2 ], %g2
if ( !the_thread )
40028f60: 80 a0 a0 00 cmp %g2, 0
40028f64: 22 bf ff fb be,a 40028f50 <killinfo+0x184>
40028f68: 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 )
40028f6c: c8 00 a0 14 ld [ %g2 + 0x14 ], %g4
40028f70: 80 a1 00 03 cmp %g4, %g3
40028f74: 38 bf ff f7 bgu,a 40028f50 <killinfo+0x184>
40028f78: b6 06 e0 01 inc %i3
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
40028f7c: de 00 a1 50 ld [ %g2 + 0x150 ], %o7
40028f80: de 03 e0 dc ld [ %o7 + 0xdc ], %o7
40028f84: 80 af 40 0f andncc %i5, %o7, %g0
40028f88: 22 bf ff f2 be,a 40028f50 <killinfo+0x184>
40028f8c: 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 ) {
40028f90: 80 a1 00 03 cmp %g4, %g3
40028f94: 2a 80 00 14 bcs,a 40028fe4 <killinfo+0x218>
40028f98: 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 ) ) {
40028f9c: 80 a2 20 00 cmp %o0, 0
40028fa0: 22 bf ff ec be,a 40028f50 <killinfo+0x184> <== NEVER TAKEN
40028fa4: b6 06 e0 01 inc %i3 <== NOT EXECUTED
40028fa8: da 02 20 10 ld [ %o0 + 0x10 ], %o5
40028fac: 80 a3 60 00 cmp %o5, 0
40028fb0: 22 bf ff e8 be,a 40028f50 <killinfo+0x184> <== NEVER TAKEN
40028fb4: b6 06 e0 01 inc %i3 <== NOT EXECUTED
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
40028fb8: de 00 a0 10 ld [ %g2 + 0x10 ], %o7
40028fbc: 80 a3 e0 00 cmp %o7, 0
40028fc0: 22 80 00 09 be,a 40028fe4 <killinfo+0x218>
40028fc4: 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) ) {
40028fc8: 80 8b 40 1a btst %o5, %i2
40028fcc: 32 bf ff e1 bne,a 40028f50 <killinfo+0x184>
40028fd0: b6 06 e0 01 inc %i3
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
40028fd4: 80 8b c0 1a btst %o7, %i2
40028fd8: 22 bf ff de be,a 40028f50 <killinfo+0x184>
40028fdc: b6 06 e0 01 inc %i3
40028fe0: 86 10 00 04 mov %g4, %g3
40028fe4: 90 10 00 02 mov %g2, %o0
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
40028fe8: 10 bf ff da b 40028f50 <killinfo+0x184>
40028fec: 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++) {
40028ff0: b8 07 20 01 inc %i4
40028ff4: 80 a7 20 04 cmp %i4, 4
40028ff8: 12 bf ff ce bne 40028f30 <killinfo+0x164>
40028ffc: 85 2f 20 02 sll %i4, 2, %g2
}
}
}
}
if ( interested ) {
40029000: 80 a2 20 00 cmp %o0, 0
40029004: 02 80 00 0b be 40029030 <killinfo+0x264>
40029008: 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 ) ) {
4002900c: 92 10 00 19 mov %i1, %o1
40029010: 40 00 00 30 call 400290d0 <_POSIX_signals_Unblock_thread>
40029014: 94 07 bf f4 add %fp, -12, %o2
40029018: 80 a2 20 00 cmp %o0, 0
4002901c: 02 80 00 05 be 40029030 <killinfo+0x264>
40029020: 01 00 00 00 nop
_Thread_Enable_dispatch();
40029024: 7f ff 93 ad call 4000ded8 <_Thread_Enable_dispatch>
40029028: b0 10 20 00 clr %i0 ! 0 <PROM_START>
4002902c: 30 80 00 1d b,a 400290a0 <killinfo+0x2d4>
/*
* 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 );
40029030: 40 00 00 1e call 400290a8 <_POSIX_signals_Set_process_signals>
40029034: 90 10 00 1d mov %i5, %o0
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
40029038: b8 24 00 18 sub %l0, %i0, %i4
4002903c: c2 04 40 1c ld [ %l1 + %i4 ], %g1
40029040: 80 a0 60 02 cmp %g1, 2
40029044: 12 bf ff f8 bne 40029024 <killinfo+0x258>
40029048: 11 10 00 bd sethi %hi(0x4002f400), %o0
psiginfo = (POSIX_signals_Siginfo_node *)
4002904c: 7f ff 8c 09 call 4000c070 <_Chain_Get>
40029050: 90 12 22 38 or %o0, 0x238, %o0 ! 4002f638 <_POSIX_signals_Inactive_siginfo>
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
40029054: ba 92 20 00 orcc %o0, 0, %i5
40029058: 12 80 00 08 bne 40029078 <killinfo+0x2ac>
4002905c: 92 07 bf f4 add %fp, -12, %o1
_Thread_Enable_dispatch();
40029060: 7f ff 93 9e call 4000ded8 <_Thread_Enable_dispatch>
40029064: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EAGAIN );
40029068: 7f ff b8 94 call 400172b8 <__errno>
4002906c: 01 00 00 00 nop
40029070: 10 bf ff 66 b 40028e08 <killinfo+0x3c>
40029074: 82 10 20 0b mov 0xb, %g1 ! b <PROM_START+0xb>
}
psiginfo->Info = *siginfo;
40029078: 90 07 60 08 add %i5, 8, %o0
4002907c: 7f ff bf 65 call 40018e10 <memcpy>
40029080: 94 10 20 0c mov 0xc, %o2
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
40029084: 11 10 00 bd sethi %hi(0x4002f400), %o0
40029088: 92 10 00 1d mov %i5, %o1
4002908c: 90 12 22 88 or %o0, 0x288, %o0
40029090: 7f ff 8b ec call 4000c040 <_Chain_Append>
40029094: 90 02 00 1c add %o0, %i4, %o0
40029098: 30 bf ff e3 b,a 40029024 <killinfo+0x258>
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
return 0;
4002909c: b0 10 20 00 clr %i0
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
400290a0: 81 c7 e0 08 ret
400290a4: 81 e8 00 00 restore
4000c0c4 <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
4000c0c4: 82 10 00 08 mov %o0, %g1
if ( !attr || !attr->is_initialized )
4000c0c8: 80 a0 60 00 cmp %g1, 0
4000c0cc: 02 80 00 0f be 4000c108 <pthread_attr_setschedpolicy+0x44>
4000c0d0: 90 10 20 16 mov 0x16, %o0
4000c0d4: c4 00 40 00 ld [ %g1 ], %g2
4000c0d8: 80 a0 a0 00 cmp %g2, 0
4000c0dc: 02 80 00 0b be 4000c108 <pthread_attr_setschedpolicy+0x44>
4000c0e0: 80 a2 60 04 cmp %o1, 4
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
4000c0e4: 18 80 00 09 bgu 4000c108 <pthread_attr_setschedpolicy+0x44>
4000c0e8: 90 10 20 86 mov 0x86, %o0
4000c0ec: 84 10 20 01 mov 1, %g2
4000c0f0: 85 28 80 09 sll %g2, %o1, %g2
4000c0f4: 80 88 a0 17 btst 0x17, %g2
4000c0f8: 02 80 00 04 be 4000c108 <pthread_attr_setschedpolicy+0x44><== NEVER TAKEN
4000c0fc: 01 00 00 00 nop
switch ( policy ) {
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
4000c100: d2 20 60 14 st %o1, [ %g1 + 0x14 ]
return 0;
4000c104: 90 10 20 00 clr %o0
default:
return ENOTSUP;
}
}
4000c108: 81 c3 e0 08 retl
40007628 <pthread_barrier_init>:
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
40007628: 9d e3 bf 90 save %sp, -112, %sp
const pthread_barrierattr_t *the_attr;
/*
* Error check parameters
*/
if ( !barrier )
4000762c: 80 a6 20 00 cmp %i0, 0
40007630: 02 80 00 30 be 400076f0 <pthread_barrier_init+0xc8>
40007634: 80 a6 a0 00 cmp %i2, 0
return EINVAL;
if ( count == 0 )
40007638: 02 80 00 2f be 400076f4 <pthread_barrier_init+0xcc>
4000763c: b8 10 20 16 mov 0x16, %i4
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
40007640: 80 a6 60 00 cmp %i1, 0
40007644: 32 80 00 06 bne,a 4000765c <pthread_barrier_init+0x34>
40007648: c2 06 40 00 ld [ %i1 ], %g1
the_attr = attr;
} else {
(void) pthread_barrierattr_init( &my_attr );
4000764c: 90 07 bf f8 add %fp, -8, %o0
40007650: 7f ff ff be call 40007548 <pthread_barrierattr_init>
40007654: 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 )
40007658: c2 06 40 00 ld [ %i1 ], %g1
4000765c: 80 a0 60 00 cmp %g1, 0
40007660: 02 80 00 25 be 400076f4 <pthread_barrier_init+0xcc>
40007664: b8 10 20 16 mov 0x16, %i4
return EINVAL;
switch ( the_attr->process_shared ) {
40007668: f8 06 60 04 ld [ %i1 + 4 ], %i4
4000766c: 80 a7 20 00 cmp %i4, 0
40007670: 32 80 00 21 bne,a 400076f4 <pthread_barrier_init+0xcc> <== NEVER TAKEN
40007674: 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;
40007678: f4 27 bf f4 st %i2, [ %fp + -12 ]
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4000767c: 03 10 00 61 sethi %hi(0x40018400), %g1
40007680: 82 10 60 f0 or %g1, 0xf0, %g1 ! 400184f0 <_Per_CPU_Information>
40007684: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
}
/*
* Convert from POSIX attributes to Core Barrier attributes
*/
the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE;
40007688: c0 27 bf f0 clr [ %fp + -16 ]
++level;
4000768c: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40007690: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
* 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 *)
40007694: 37 10 00 60 sethi %hi(0x40018000), %i3
40007698: 40 00 08 57 call 400097f4 <_Objects_Allocate>
4000769c: 90 16 e3 48 or %i3, 0x348, %o0 ! 40018348 <_POSIX_Barrier_Information>
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_barrier = _POSIX_Barrier_Allocate();
if ( !the_barrier ) {
400076a0: ba 92 20 00 orcc %o0, 0, %i5
400076a4: 12 80 00 06 bne 400076bc <pthread_barrier_init+0x94>
400076a8: 90 07 60 10 add %i5, 0x10, %o0
_Thread_Enable_dispatch();
400076ac: 40 00 0d 09 call 4000aad0 <_Thread_Enable_dispatch>
400076b0: b8 10 20 0b mov 0xb, %i4
return EAGAIN;
400076b4: 81 c7 e0 08 ret
400076b8: 91 e8 00 1c restore %g0, %i4, %o0
}
_CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes );
400076bc: 40 00 05 cf call 40008df8 <_CORE_barrier_Initialize>
400076c0: 92 07 bf f0 add %fp, -16, %o1
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
400076c4: c4 17 60 0a lduh [ %i5 + 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_u32(
Objects_Information *information,
400076c8: b6 16 e3 48 or %i3, 0x348, %i3
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
400076cc: c6 06 e0 1c ld [ %i3 + 0x1c ], %g3
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
400076d0: c2 07 60 08 ld [ %i5 + 8 ], %g1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
400076d4: 85 28 a0 02 sll %g2, 2, %g2
400076d8: fa 20 c0 02 st %i5, [ %g3 + %g2 ]
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
400076dc: c0 27 60 0c clr [ %i5 + 0xc ]
/*
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
_Thread_Enable_dispatch();
400076e0: 40 00 0c fc call 4000aad0 <_Thread_Enable_dispatch>
400076e4: c2 26 00 00 st %g1, [ %i0 ]
return 0;
400076e8: 81 c7 e0 08 ret
400076ec: 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;
400076f0: b8 10 20 16 mov 0x16, %i4
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
_Thread_Enable_dispatch();
return 0;
}
400076f4: b0 10 00 1c mov %i4, %i0
400076f8: 81 c7 e0 08 ret
400076fc: 81 e8 00 00 restore
40007e5c <pthread_cond_init>:
*/
int pthread_cond_init(
pthread_cond_t *cond,
const pthread_condattr_t *attr
)
{
40007e5c: 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;
40007e60: 80 a6 60 00 cmp %i1, 0
40007e64: 32 80 00 05 bne,a 40007e78 <pthread_cond_init+0x1c>
40007e68: c4 06 60 04 ld [ %i1 + 4 ], %g2
else the_attr = &_POSIX_Condition_variables_Default_attributes;
40007e6c: 33 10 00 5e sethi %hi(0x40017800), %i1
40007e70: b2 16 60 64 or %i1, 0x64, %i1 ! 40017864 <_POSIX_Condition_variables_Default_attributes>
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
40007e74: c4 06 60 04 ld [ %i1 + 4 ], %g2
40007e78: 80 a0 a0 01 cmp %g2, 1
40007e7c: 02 80 00 26 be 40007f14 <pthread_cond_init+0xb8> <== NEVER TAKEN
40007e80: 82 10 20 16 mov 0x16, %g1
return EINVAL;
if ( !the_attr->is_initialized )
40007e84: c4 06 40 00 ld [ %i1 ], %g2
40007e88: 80 a0 a0 00 cmp %g2, 0
40007e8c: 02 80 00 22 be 40007f14 <pthread_cond_init+0xb8>
40007e90: 01 00 00 00 nop
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
40007e94: 03 10 00 65 sethi %hi(0x40019400), %g1
40007e98: 82 10 61 80 or %g1, 0x180, %g1 ! 40019580 <_Per_CPU_Information>
40007e9c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
40007ea0: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40007ea4: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
* 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 *)
40007ea8: 39 10 00 65 sethi %hi(0x40019400), %i4
40007eac: 40 00 0a 07 call 4000a6c8 <_Objects_Allocate>
40007eb0: 90 17 20 6c or %i4, 0x6c, %o0 ! 4001946c <_POSIX_Condition_variables_Information>
_Thread_Disable_dispatch();
the_cond = _POSIX_Condition_variables_Allocate();
if ( !the_cond ) {
40007eb4: ba 92 20 00 orcc %o0, 0, %i5
40007eb8: 32 80 00 06 bne,a 40007ed0 <pthread_cond_init+0x74>
40007ebc: c2 06 60 04 ld [ %i1 + 4 ], %g1
_Thread_Enable_dispatch();
40007ec0: 40 00 0e b9 call 4000b9a4 <_Thread_Enable_dispatch>
40007ec4: 01 00 00 00 nop
return ENOMEM;
40007ec8: 10 80 00 13 b 40007f14 <pthread_cond_init+0xb8>
40007ecc: 82 10 20 0c mov 0xc, %g1 ! c <PROM_START+0xc>
the_cond->process_shared = the_attr->process_shared;
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
40007ed0: 90 07 60 18 add %i5, 0x18, %o0
if ( !the_cond ) {
_Thread_Enable_dispatch();
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
40007ed4: c2 27 60 10 st %g1, [ %i5 + 0x10 ]
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
40007ed8: 92 10 20 00 clr %o1
40007edc: 15 04 00 02 sethi %hi(0x10000800), %o2
40007ee0: 96 10 20 74 mov 0x74, %o3
40007ee4: 40 00 10 95 call 4000c138 <_Thread_queue_Initialize>
40007ee8: c0 27 60 14 clr [ %i5 + 0x14 ]
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
40007eec: c4 17 60 0a lduh [ %i5 + 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_u32(
Objects_Information *information,
40007ef0: b8 17 20 6c or %i4, 0x6c, %i4
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40007ef4: c6 07 20 1c ld [ %i4 + 0x1c ], %g3
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
40007ef8: c2 07 60 08 ld [ %i5 + 8 ], %g1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40007efc: 85 28 a0 02 sll %g2, 2, %g2
40007f00: fa 20 c0 02 st %i5, [ %g3 + %g2 ]
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
40007f04: c0 27 60 0c clr [ %i5 + 0xc ]
0
);
*cond = the_cond->Object.id;
_Thread_Enable_dispatch();
40007f08: 40 00 0e a7 call 4000b9a4 <_Thread_Enable_dispatch>
40007f0c: c2 26 00 00 st %g1, [ %i0 ]
return 0;
40007f10: 82 10 20 00 clr %g1
}
40007f14: 81 c7 e0 08 ret
40007f18: 91 e8 00 01 restore %g0, %g1, %o0
40007cc8 <pthread_condattr_destroy>:
*/
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
40007cc8: 82 10 00 08 mov %o0, %g1
if ( !attr || attr->is_initialized == false )
40007ccc: 80 a0 60 00 cmp %g1, 0
40007cd0: 02 80 00 08 be 40007cf0 <pthread_condattr_destroy+0x28>
40007cd4: 90 10 20 16 mov 0x16, %o0
40007cd8: c4 00 40 00 ld [ %g1 ], %g2
40007cdc: 80 a0 a0 00 cmp %g2, 0
40007ce0: 02 80 00 04 be 40007cf0 <pthread_condattr_destroy+0x28> <== NEVER TAKEN
40007ce4: 01 00 00 00 nop
return EINVAL;
attr->is_initialized = false;
40007ce8: c0 20 40 00 clr [ %g1 ]
return 0;
40007cec: 90 10 20 00 clr %o0
}
40007cf0: 81 c3 e0 08 retl
4000722c <pthread_create>:
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
4000722c: 9d e3 bf 58 save %sp, -168, %sp
int schedpolicy = SCHED_RR;
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
40007230: 80 a6 a0 00 cmp %i2, 0
40007234: 02 80 00 93 be 40007480 <pthread_create+0x254>
40007238: ba 10 20 0e mov 0xe, %i5
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
4000723c: 80 a6 60 00 cmp %i1, 0
40007240: 32 80 00 05 bne,a 40007254 <pthread_create+0x28>
40007244: c2 06 40 00 ld [ %i1 ], %g1
40007248: 33 10 00 77 sethi %hi(0x4001dc00), %i1
4000724c: b2 16 60 8c or %i1, 0x8c, %i1 ! 4001dc8c <_POSIX_Threads_Default_attributes>
if ( !the_attr->is_initialized )
40007250: c2 06 40 00 ld [ %i1 ], %g1
40007254: 80 a0 60 00 cmp %g1, 0
40007258: 22 80 00 8a be,a 40007480 <pthread_create+0x254>
4000725c: 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) )
40007260: c2 06 60 04 ld [ %i1 + 4 ], %g1
40007264: 80 a0 60 00 cmp %g1, 0
40007268: 02 80 00 07 be 40007284 <pthread_create+0x58>
4000726c: 03 10 00 7a sethi %hi(0x4001e800), %g1
40007270: c4 06 60 08 ld [ %i1 + 8 ], %g2
40007274: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1
40007278: 80 a0 80 01 cmp %g2, %g1
4000727c: 2a 80 00 81 bcs,a 40007480 <pthread_create+0x254>
40007280: 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 ) {
40007284: c2 06 60 10 ld [ %i1 + 0x10 ], %g1
40007288: 80 a0 60 01 cmp %g1, 1
4000728c: 02 80 00 08 be 400072ac <pthread_create+0x80>
40007290: 80 a0 60 02 cmp %g1, 2
40007294: 12 80 00 7b bne 40007480 <pthread_create+0x254>
40007298: ba 10 20 16 mov 0x16, %i5
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
4000729c: e2 06 60 14 ld [ %i1 + 0x14 ], %l1
schedparam = the_attr->schedparam;
400072a0: 90 07 bf e4 add %fp, -28, %o0
400072a4: 10 80 00 08 b 400072c4 <pthread_create+0x98>
400072a8: 92 06 60 18 add %i1, 0x18, %o1
ISR_Level level;
_ISR_Disable_without_giant( level );
#endif
executing = _Thread_Executing;
400072ac: 03 10 00 7e sethi %hi(0x4001f800), %g1
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Get_executing()->API_Extensions[ THREAD_API_POSIX ];
400072b0: c2 00 63 68 ld [ %g1 + 0x368 ], %g1 ! 4001fb68 <_Per_CPU_Information+0x18>
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
400072b4: 90 07 bf e4 add %fp, -28, %o0
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Get_executing()->API_Extensions[ THREAD_API_POSIX ];
400072b8: d2 00 61 50 ld [ %g1 + 0x150 ], %o1
schedpolicy = api->schedpolicy;
400072bc: e2 02 60 90 ld [ %o1 + 0x90 ], %l1
schedparam = api->schedparam;
400072c0: 92 02 60 94 add %o1, 0x94, %o1
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
400072c4: 40 00 22 9d call 4000fd38 <memcpy>
400072c8: 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 )
400072cc: fa 06 60 0c ld [ %i1 + 0xc ], %i5
400072d0: 80 a7 60 00 cmp %i5, 0
400072d4: 32 80 00 6b bne,a 40007480 <pthread_create+0x254>
400072d8: ba 10 20 86 mov 0x86, %i5
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
400072dc: 40 00 17 b0 call 4000d19c <_POSIX_Priority_Is_valid>
400072e0: d0 07 bf e4 ld [ %fp + -28 ], %o0
400072e4: 80 a2 20 00 cmp %o0, 0
400072e8: 22 80 00 66 be,a 40007480 <pthread_create+0x254> <== NEVER TAKEN
400072ec: 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);
400072f0: 03 10 00 7a sethi %hi(0x4001e800), %g1
return EINVAL;
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
400072f4: e8 07 bf e4 ld [ %fp + -28 ], %l4
400072f8: ea 08 60 dc ldub [ %g1 + 0xdc ], %l5
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
400072fc: 90 10 00 11 mov %l1, %o0
40007300: 92 07 bf e4 add %fp, -28, %o1
40007304: 94 07 bf dc add %fp, -36, %o2
40007308: 40 00 17 b0 call 4000d1c8 <_POSIX_Thread_Translate_sched_param>
4000730c: 96 07 bf e0 add %fp, -32, %o3
schedpolicy,
&schedparam,
&budget_algorithm,
&budget_callout
);
if ( rc )
40007310: 80 a2 20 00 cmp %o0, 0
40007314: 32 80 00 5b bne,a 40007480 <pthread_create+0x254>
40007318: ba 10 00 08 mov %o0, %i5
#endif
/*
* Lock the allocator mutex for protection
*/
_RTEMS_Lock_allocator();
4000731c: 39 10 00 7d sethi %hi(0x4001f400), %i4
40007320: d0 07 22 f8 ld [ %i4 + 0x2f8 ], %o0 ! 4001f6f8 <_RTEMS_Allocator_Mutex>
40007324: 40 00 05 b7 call 40008a00 <_API_Mutex_Lock>
40007328: 27 10 00 7e sethi %hi(0x4001f800), %l3
* _POSIX_Threads_Allocate
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
4000732c: 40 00 08 73 call 400094f8 <_Objects_Allocate>
40007330: 90 14 e0 40 or %l3, 0x40, %o0 ! 4001f840 <_POSIX_Threads_Information>
40007334: a4 10 00 1c mov %i4, %l2
* Allocate the thread control block.
*
* NOTE: Global threads are not currently supported.
*/
the_thread = _POSIX_Threads_Allocate();
if ( !the_thread ) {
40007338: a0 92 20 00 orcc %o0, 0, %l0
4000733c: 12 80 00 04 bne 4000734c <pthread_create+0x120>
40007340: 90 10 00 13 mov %l3, %o0
_RTEMS_Unlock_allocator();
40007344: 10 80 00 21 b 400073c8 <pthread_create+0x19c>
40007348: 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;
4000734c: 03 10 00 7a sethi %hi(0x4001e800), %g1
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
40007350: d6 00 60 e0 ld [ %g1 + 0xe0 ], %o3 ! 4001e8e0 <rtems_minimum_stack_size>
40007354: 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(
40007358: c0 27 bf d4 clr [ %fp + -44 ]
4000735c: 97 2a e0 01 sll %o3, 1, %o3
40007360: 80 a2 c0 01 cmp %o3, %g1
40007364: 1a 80 00 03 bcc 40007370 <pthread_create+0x144>
40007368: d4 06 60 04 ld [ %i1 + 4 ], %o2
4000736c: 96 10 00 01 mov %g1, %o3
40007370: 82 10 20 01 mov 1, %g1
40007374: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
40007378: c2 07 bf dc ld [ %fp + -36 ], %g1
4000737c: 9a 0d 60 ff and %l5, 0xff, %o5
40007380: c2 23 a0 60 st %g1, [ %sp + 0x60 ]
40007384: c2 07 bf e0 ld [ %fp + -32 ], %g1
40007388: c0 23 a0 68 clr [ %sp + 0x68 ]
4000738c: c2 23 a0 64 st %g1, [ %sp + 0x64 ]
40007390: 82 07 bf d4 add %fp, -44, %g1
40007394: 90 12 20 40 or %o0, 0x40, %o0
40007398: c2 23 a0 6c st %g1, [ %sp + 0x6c ]
4000739c: 92 10 00 10 mov %l0, %o1
400073a0: 98 10 20 00 clr %o4
400073a4: 40 00 0d 40 call 4000a8a4 <_Thread_Initialize>
400073a8: 9a 23 40 14 sub %o5, %l4, %o5
budget_callout,
0, /* isr level */
name /* posix threads don't have a name */
);
if ( !status ) {
400073ac: 80 a2 20 00 cmp %o0, 0
400073b0: 12 80 00 0a bne 400073d8 <pthread_create+0x1ac>
400073b4: 11 10 00 7e sethi %hi(0x4001f800), %o0
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
400073b8: 92 10 00 10 mov %l0, %o1
400073bc: 40 00 09 39 call 400098a0 <_Objects_Free>
400073c0: 90 12 20 40 or %o0, 0x40, %o0
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
400073c4: d0 04 a2 f8 ld [ %l2 + 0x2f8 ], %o0
400073c8: 40 00 05 be call 40008ac0 <_API_Mutex_Unlock>
400073cc: ba 10 20 0b mov 0xb, %i5
return EAGAIN;
400073d0: 81 c7 e0 08 ret
400073d4: 91 e8 00 1d restore %g0, %i5, %o0
}
/*
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
400073d8: f8 04 21 50 ld [ %l0 + 0x150 ], %i4
api->Attributes = *the_attr;
400073dc: 92 10 00 19 mov %i1, %o1
400073e0: 90 10 00 1c mov %i4, %o0
400073e4: 40 00 22 55 call 4000fd38 <memcpy>
400073e8: 94 10 20 4c mov 0x4c, %o2
api->detachstate = the_attr->detachstate;
400073ec: c2 06 60 3c ld [ %i1 + 0x3c ], %g1
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
400073f0: 90 07 20 94 add %i4, 0x94, %o0
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
400073f4: c2 27 20 4c st %g1, [ %i4 + 0x4c ]
api->schedpolicy = schedpolicy;
400073f8: e2 27 20 90 st %l1, [ %i4 + 0x90 ]
api->schedparam = schedparam;
400073fc: 92 07 bf e4 add %fp, -28, %o1
40007400: 40 00 22 4e call 4000fd38 <memcpy>
40007404: 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 level = _Thread_Dispatch_disable_level;
40007408: 03 10 00 7e sethi %hi(0x4001f800), %g1
4000740c: 82 10 63 50 or %g1, 0x350, %g1 ! 4001fb50 <_Per_CPU_Information>
40007410: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
40007414: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40007418: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
_Thread_Disable_dispatch();
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
4000741c: 92 10 20 01 mov 1, %o1
40007420: 90 10 00 10 mov %l0, %o0
40007424: 94 10 00 1a mov %i2, %o2
40007428: 96 10 00 1b mov %i3, %o3
4000742c: 98 10 20 00 clr %o4
40007430: 40 00 0f 45 call 4000b144 <_Thread_Start>
40007434: 9a 10 20 00 clr %o5
_RTEMS_Unlock_allocator();
return EINVAL;
}
#endif
if ( schedpolicy == SCHED_SPORADIC ) {
40007438: 80 a4 60 04 cmp %l1, 4
4000743c: 12 80 00 09 bne 40007460 <pthread_create+0x234>
40007440: 01 00 00 00 nop
_Watchdog_Insert_ticks(
40007444: 40 00 0f 74 call 4000b214 <_Timespec_To_ticks>
40007448: 90 07 20 9c add %i4, 0x9c, %o0
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4000744c: 92 07 20 b4 add %i4, 0xb4, %o1
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40007450: d0 27 20 c0 st %o0, [ %i4 + 0xc0 ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40007454: 11 10 00 7d sethi %hi(0x4001f400), %o0
40007458: 40 00 10 24 call 4000b4e8 <_Watchdog_Insert>
4000745c: 90 12 23 10 or %o0, 0x310, %o0 ! 4001f710 <_Watchdog_Ticks_chain>
&api->Sporadic_timer,
_Timespec_To_ticks( &api->schedparam.sched_ss_repl_period )
);
}
_Thread_Enable_dispatch();
40007460: 40 00 0c dd call 4000a7d4 <_Thread_Enable_dispatch>
40007464: 01 00 00 00 nop
/*
* Return the id and indicate we successfully created the thread
*/
*thread = the_thread->Object.id;
40007468: c2 04 20 08 ld [ %l0 + 8 ], %g1
_RTEMS_Unlock_allocator();
4000746c: d0 04 a2 f8 ld [ %l2 + 0x2f8 ], %o0
40007470: 40 00 05 94 call 40008ac0 <_API_Mutex_Unlock>
40007474: c2 26 00 00 st %g1, [ %i0 ]
return 0;
40007478: 81 c7 e0 08 ret
4000747c: 91 e8 00 1d restore %g0, %i5, %o0
}
40007480: b0 10 00 1d mov %i5, %i0
40007484: 81 c7 e0 08 ret
40007488: 81 e8 00 00 restore
40029214 <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
40029214: 9d e3 bf 98 save %sp, -104, %sp
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
40029218: 80 a6 60 00 cmp %i1, 0
4002921c: 12 80 00 06 bne 40029234 <pthread_kill+0x20>
40029220: ba 06 7f ff add %i1, -1, %i5
rtems_set_errno_and_return_minus_one( EINVAL );
40029224: 7f ff b8 25 call 400172b8 <__errno>
40029228: 01 00 00 00 nop
4002922c: 10 80 00 29 b 400292d0 <pthread_kill+0xbc>
40029230: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
if ( !is_valid_signo(sig) )
40029234: 80 a7 60 1f cmp %i5, 0x1f
40029238: 18 bf ff fb bgu 40029224 <pthread_kill+0x10>
4002923c: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EINVAL );
the_thread = _Thread_Get( thread, &location );
40029240: 90 10 00 18 mov %i0, %o0
40029244: 7f ff 93 32 call 4000df0c <_Thread_Get>
40029248: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
4002924c: c2 07 bf fc ld [ %fp + -4 ], %g1
40029250: 80 a0 60 00 cmp %g1, 0
40029254: 12 80 00 1c bne 400292c4 <pthread_kill+0xb0> <== NEVER TAKEN
40029258: b8 10 00 08 mov %o0, %i4
4002925c: 11 10 00 b7 sethi %hi(0x4002dc00), %o0
40029260: 7f ff 8b 1a call 4000bec8 <_API_extensions_Add_post_switch>
40029264: 90 12 20 58 or %o0, 0x58, %o0 ! 4002dc58 <_POSIX_signals_Post_switch>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
40029268: 87 2e 60 02 sll %i1, 2, %g3
4002926c: 89 2e 60 04 sll %i1, 4, %g4
40029270: 05 10 00 bd sethi %hi(0x4002f400), %g2
40029274: 86 21 00 03 sub %g4, %g3, %g3
40029278: 84 10 a0 b8 or %g2, 0xb8, %g2
4002927c: 84 00 80 03 add %g2, %g3, %g2
40029280: c4 00 a0 08 ld [ %g2 + 8 ], %g2
40029284: 80 a0 a0 01 cmp %g2, 1
40029288: 02 80 00 0b be 400292b4 <pthread_kill+0xa0>
4002928c: c2 07 21 50 ld [ %i4 + 0x150 ], %g1
40029290: 84 10 20 01 mov 1, %g2
40029294: bb 28 80 1d sll %g2, %i5, %i5
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
40029298: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
4002929c: 90 10 00 1c mov %i4, %o0
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
400292a0: ba 10 80 1d or %g2, %i5, %i5
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
400292a4: 92 10 00 19 mov %i1, %o1
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
400292a8: fa 20 60 e0 st %i5, [ %g1 + 0xe0 ]
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
400292ac: 7f ff ff 89 call 400290d0 <_POSIX_signals_Unblock_thread>
400292b0: 94 10 20 00 clr %o2
RTEMS_INLINE_ROUTINE void _Objects_Put(
Objects_Control *the_object
)
{
(void) the_object;
_Thread_Enable_dispatch();
400292b4: 7f ff 93 09 call 4000ded8 <_Thread_Enable_dispatch>
400292b8: b0 10 20 00 clr %i0
}
_Objects_Put( &the_thread->Object );
return 0;
400292bc: 81 c7 e0 08 ret
400292c0: 81 e8 00 00 restore
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
400292c4: 7f ff b7 fd call 400172b8 <__errno> <== NOT EXECUTED
400292c8: 01 00 00 00 nop <== NOT EXECUTED
400292cc: 82 10 20 03 mov 3, %g1 ! 3 <PROM_START+0x3> <== NOT EXECUTED
400292d0: c2 22 00 00 st %g1, [ %o0 ]
}
400292d4: 81 c7 e0 08 ret
400292d8: 91 e8 3f ff restore %g0, -1, %o0
400094d0 <pthread_mutex_timedlock>:
*/
int pthread_mutex_timedlock(
pthread_mutex_t *mutex,
const struct timespec *abstime
)
{
400094d0: 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 );
400094d4: 92 07 bf fc add %fp, -4, %o1
400094d8: 40 00 00 35 call 400095ac <_POSIX_Absolute_timeout_to_ticks>
400094dc: 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 );
400094e0: 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 )
400094e4: 82 1a 20 03 xor %o0, 3, %g1
400094e8: 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 );
400094ec: ba 10 00 08 mov %o0, %i5
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
400094f0: b8 60 3f ff subx %g0, -1, %i4
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
400094f4: 90 10 00 18 mov %i0, %o0
400094f8: 7f ff ff b7 call 400093d4 <_POSIX_Mutex_Lock_support>
400094fc: 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) ) {
40009500: 80 a7 20 00 cmp %i4, 0
40009504: 32 80 00 0d bne,a 40009538 <pthread_mutex_timedlock+0x68>
40009508: b0 10 00 08 mov %o0, %i0
4000950c: 80 a2 20 10 cmp %o0, 0x10
40009510: 32 80 00 0a bne,a 40009538 <pthread_mutex_timedlock+0x68>
40009514: b0 10 00 08 mov %o0, %i0
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
40009518: 80 a7 60 00 cmp %i5, 0
4000951c: 02 80 00 07 be 40009538 <pthread_mutex_timedlock+0x68> <== NEVER TAKEN
40009520: b0 10 20 16 mov 0x16, %i0
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
40009524: ba 07 7f ff add %i5, -1, %i5
40009528: 80 a7 60 01 cmp %i5, 1
4000952c: 18 80 00 03 bgu 40009538 <pthread_mutex_timedlock+0x68> <== NEVER TAKEN
40009530: b0 10 20 10 mov 0x10, %i0
40009534: b0 10 20 74 mov 0x74, %i0
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return lock_status;
}
40009538: 81 c7 e0 08 ret
4000953c: 81 e8 00 00 restore
40006978 <pthread_mutexattr_gettype>:
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
int pthread_mutexattr_gettype(
const pthread_mutexattr_t *attr,
int *type
)
{
40006978: 82 10 00 08 mov %o0, %g1
if ( !attr )
4000697c: 80 a0 60 00 cmp %g1, 0
40006980: 02 80 00 0b be 400069ac <pthread_mutexattr_gettype+0x34>
40006984: 90 10 20 16 mov 0x16, %o0
return EINVAL;
if ( !attr->is_initialized )
40006988: c4 00 40 00 ld [ %g1 ], %g2
4000698c: 80 a0 a0 00 cmp %g2, 0
40006990: 02 80 00 07 be 400069ac <pthread_mutexattr_gettype+0x34>
40006994: 80 a2 60 00 cmp %o1, 0
return EINVAL;
if ( !type )
40006998: 02 80 00 05 be 400069ac <pthread_mutexattr_gettype+0x34> <== NEVER TAKEN
4000699c: 01 00 00 00 nop
return EINVAL;
*type = attr->type;
400069a0: c2 00 60 10 ld [ %g1 + 0x10 ], %g1
return 0;
400069a4: 90 10 20 00 clr %o0
return EINVAL;
if ( !type )
return EINVAL;
*type = attr->type;
400069a8: c2 22 40 00 st %g1, [ %o1 ]
return 0;
}
400069ac: 81 c3 e0 08 retl
40009090 <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
40009090: 82 10 00 08 mov %o0, %g1
if ( !attr || !attr->is_initialized )
40009094: 80 a0 60 00 cmp %g1, 0
40009098: 02 80 00 0a be 400090c0 <pthread_mutexattr_setpshared+0x30>
4000909c: 90 10 20 16 mov 0x16, %o0
400090a0: c4 00 40 00 ld [ %g1 ], %g2
400090a4: 80 a0 a0 00 cmp %g2, 0
400090a8: 02 80 00 06 be 400090c0 <pthread_mutexattr_setpshared+0x30>
400090ac: 80 a2 60 01 cmp %o1, 1
return EINVAL;
switch ( pshared ) {
400090b0: 18 80 00 04 bgu 400090c0 <pthread_mutexattr_setpshared+0x30><== NEVER TAKEN
400090b4: 01 00 00 00 nop
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
400090b8: d2 20 60 04 st %o1, [ %g1 + 4 ]
return 0;
400090bc: 90 10 20 00 clr %o0
default:
return EINVAL;
}
}
400090c0: 81 c3 e0 08 retl
4000e3e0 <pthread_mutexattr_settype>:
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
int pthread_mutexattr_settype(
pthread_mutexattr_t *attr,
int type
)
{
4000e3e0: 82 10 00 08 mov %o0, %g1
if ( !attr || !attr->is_initialized )
4000e3e4: 80 a0 60 00 cmp %g1, 0
4000e3e8: 02 80 00 0a be 4000e410 <pthread_mutexattr_settype+0x30>
4000e3ec: 90 10 20 16 mov 0x16, %o0
4000e3f0: c4 00 40 00 ld [ %g1 ], %g2
4000e3f4: 80 a0 a0 00 cmp %g2, 0
4000e3f8: 02 80 00 06 be 4000e410 <pthread_mutexattr_settype+0x30> <== NEVER TAKEN
4000e3fc: 80 a2 60 03 cmp %o1, 3
return EINVAL;
switch ( type ) {
4000e400: 18 80 00 04 bgu 4000e410 <pthread_mutexattr_settype+0x30>
4000e404: 01 00 00 00 nop
case PTHREAD_MUTEX_NORMAL:
case PTHREAD_MUTEX_RECURSIVE:
case PTHREAD_MUTEX_ERRORCHECK:
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
4000e408: d2 20 60 10 st %o1, [ %g1 + 0x10 ]
return 0;
4000e40c: 90 10 20 00 clr %o0
default:
return EINVAL;
}
}
4000e410: 81 c3 e0 08 retl
400078f4 <pthread_once>:
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
400078f4: 9d e3 bf a0 save %sp, -96, %sp
int r = 0;
if ( !once_control || !init_routine )
400078f8: ba 96 20 00 orcc %i0, 0, %i5
400078fc: 02 80 00 24 be 4000798c <pthread_once+0x98>
40007900: b0 10 20 16 mov 0x16, %i0
40007904: 80 a6 60 00 cmp %i1, 0
40007908: 02 80 00 21 be 4000798c <pthread_once+0x98>
4000790c: 01 00 00 00 nop
return EINVAL;
if ( once_control->is_initialized != 1 )
40007910: f6 07 40 00 ld [ %i5 ], %i3
40007914: 80 a6 e0 01 cmp %i3, 1
40007918: 12 80 00 1d bne 4000798c <pthread_once+0x98> <== NEVER TAKEN
4000791c: 01 00 00 00 nop
return EINVAL;
if ( once_control->init_executed != PTHREAD_ONCE_INIT_COMPLETE ) {
40007920: c2 07 60 04 ld [ %i5 + 4 ], %g1
40007924: 80 a0 60 02 cmp %g1, 2
40007928: 02 80 00 19 be 4000798c <pthread_once+0x98>
4000792c: b0 10 20 00 clr %i0
r = pthread_mutex_lock( &_POSIX_Once_Lock );
40007930: 35 10 00 7e sethi %hi(0x4001f800), %i2
40007934: 40 00 15 52 call 4000ce7c <pthread_mutex_lock>
40007938: 90 16 a1 e4 or %i2, 0x1e4, %o0 ! 4001f9e4 <_POSIX_Once_Lock>
if ( r == 0 ) {
4000793c: b0 92 20 00 orcc %o0, 0, %i0
40007940: 12 80 00 13 bne 4000798c <pthread_once+0x98> <== NEVER TAKEN
40007944: b8 10 00 08 mov %o0, %i4
* 2. The init has finished and the state is PTHREAD_ONCE_INIT_RUN.
* 3. The init is being run by this thread and the state
* PTHREAD_ONCE_INIT_RUNNING so we are nesting. This is an error.
*/
switch ( once_control->init_executed ) {
40007948: c2 07 60 04 ld [ %i5 + 4 ], %g1
4000794c: 80 a0 60 00 cmp %g1, 0
40007950: 02 80 00 05 be 40007964 <pthread_once+0x70>
40007954: 80 a0 60 01 cmp %g1, 1
40007958: 22 80 00 07 be,a 40007974 <pthread_once+0x80> <== ALWAYS TAKEN
4000795c: b8 10 20 16 mov 0x16, %i4
40007960: 30 80 00 05 b,a 40007974 <pthread_once+0x80> <== NOT EXECUTED
case PTHREAD_ONCE_INIT_NOT_RUN:
once_control->init_executed = PTHREAD_ONCE_INIT_RUNNING;
(*init_routine)();
40007964: 9f c6 40 00 call %i1
40007968: f6 27 60 04 st %i3, [ %i5 + 4 ]
once_control->init_executed = PTHREAD_ONCE_INIT_COMPLETE;
4000796c: 82 10 20 02 mov 2, %g1
40007970: c2 27 60 04 st %g1, [ %i5 + 4 ]
r = EINVAL;
break;
default:
break;
}
rr = pthread_mutex_unlock( &_POSIX_Once_Lock );
40007974: 40 00 15 7d call 4000cf68 <pthread_mutex_unlock>
40007978: 90 16 a1 e4 or %i2, 0x1e4, %o0
if ( r == 0 )
4000797c: 80 a7 20 00 cmp %i4, 0
40007980: 02 80 00 03 be 4000798c <pthread_once+0x98>
40007984: b0 10 00 08 mov %o0, %i0
40007988: b0 10 00 1c mov %i4, %i0
r = rr;
}
}
return r;
}
4000798c: 81 c7 e0 08 ret
40007990: 81 e8 00 00 restore
4000809c <pthread_rwlock_init>:
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
4000809c: 9d e3 bf 90 save %sp, -112, %sp
const pthread_rwlockattr_t *the_attr;
/*
* Error check parameters
*/
if ( !rwlock )
400080a0: 80 a6 20 00 cmp %i0, 0
400080a4: 02 80 00 2c be 40008154 <pthread_rwlock_init+0xb8>
400080a8: 80 a6 60 00 cmp %i1, 0
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
400080ac: 32 80 00 06 bne,a 400080c4 <pthread_rwlock_init+0x28>
400080b0: c2 06 40 00 ld [ %i1 ], %g1
the_attr = attr;
} else {
(void) pthread_rwlockattr_init( &default_attr );
400080b4: 90 07 bf f8 add %fp, -8, %o0
400080b8: 40 00 01 c4 call 400087c8 <pthread_rwlockattr_init>
400080bc: 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 )
400080c0: c2 06 40 00 ld [ %i1 ], %g1
400080c4: 80 a0 60 00 cmp %g1, 0
400080c8: 02 80 00 24 be 40008158 <pthread_rwlock_init+0xbc> <== NEVER TAKEN
400080cc: b8 10 20 16 mov 0x16, %i4
return EINVAL;
switch ( the_attr->process_shared ) {
400080d0: f8 06 60 04 ld [ %i1 + 4 ], %i4
400080d4: 80 a7 20 00 cmp %i4, 0
400080d8: 32 80 00 20 bne,a 40008158 <pthread_rwlock_init+0xbc> <== NEVER TAKEN
400080dc: b8 10 20 16 mov 0x16, %i4 <== NOT EXECUTED
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
400080e0: 03 10 00 73 sethi %hi(0x4001cc00), %g1
400080e4: 82 10 62 d0 or %g1, 0x2d0, %g1 ! 4001ced0 <_Per_CPU_Information>
400080e8: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
*/
RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes(
CORE_RWLock_Attributes *the_attributes
)
{
the_attributes->XXX = 0;
400080ec: c0 27 bf f4 clr [ %fp + -12 ]
++level;
400080f0: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
400080f4: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
* 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 *)
400080f8: 37 10 00 72 sethi %hi(0x4001c800), %i3
400080fc: 40 00 0b 31 call 4000adc0 <_Objects_Allocate>
40008100: 90 16 e3 80 or %i3, 0x380, %o0 ! 4001cb80 <_POSIX_RWLock_Information>
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_rwlock = _POSIX_RWLock_Allocate();
if ( !the_rwlock ) {
40008104: ba 92 20 00 orcc %o0, 0, %i5
40008108: 12 80 00 06 bne 40008120 <pthread_rwlock_init+0x84>
4000810c: 90 07 60 10 add %i5, 0x10, %o0
_Thread_Enable_dispatch();
40008110: 40 00 10 1b call 4000c17c <_Thread_Enable_dispatch>
40008114: b8 10 20 0b mov 0xb, %i4
return EAGAIN;
40008118: 81 c7 e0 08 ret
4000811c: 91 e8 00 1c restore %g0, %i4, %o0
}
_CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes );
40008120: 40 00 09 48 call 4000a640 <_CORE_RWLock_Initialize>
40008124: 92 07 bf f4 add %fp, -12, %o1
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
40008128: c4 17 60 0a lduh [ %i5 + 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_u32(
Objects_Information *information,
4000812c: b6 16 e3 80 or %i3, 0x380, %i3
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40008130: c6 06 e0 1c ld [ %i3 + 0x1c ], %g3
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
40008134: c2 07 60 08 ld [ %i5 + 8 ], %g1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40008138: 85 28 a0 02 sll %g2, 2, %g2
4000813c: fa 20 c0 02 st %i5, [ %g3 + %g2 ]
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
40008140: c0 27 60 0c clr [ %i5 + 0xc ]
0
);
*rwlock = the_rwlock->Object.id;
_Thread_Enable_dispatch();
40008144: 40 00 10 0e call 4000c17c <_Thread_Enable_dispatch>
40008148: c2 26 00 00 st %g1, [ %i0 ]
return 0;
4000814c: 81 c7 e0 08 ret
40008150: 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;
40008154: b8 10 20 16 mov 0x16, %i4
*rwlock = the_rwlock->Object.id;
_Thread_Enable_dispatch();
return 0;
}
40008158: b0 10 00 1c mov %i4, %i0
4000815c: 81 c7 e0 08 ret
40008160: 81 e8 00 00 restore
40008654 <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
40008654: 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 )
40008658: 80 a6 20 00 cmp %i0, 0
4000865c: 02 80 00 2c be 4000870c <pthread_rwlock_timedrdlock+0xb8>
40008660: 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 );
40008664: 40 00 18 e4 call 4000e9f4 <_POSIX_Absolute_timeout_to_ticks>
40008668: 90 10 00 19 mov %i1, %o0
4000866c: d2 06 00 00 ld [ %i0 ], %o1
40008670: ba 10 00 08 mov %o0, %i5
40008674: 94 07 bf f8 add %fp, -8, %o2
40008678: 11 10 00 6a sethi %hi(0x4001a800), %o0
4000867c: 40 00 0b 14 call 4000b2cc <_Objects_Get>
40008680: 90 12 23 b4 or %o0, 0x3b4, %o0 ! 4001abb4 <_POSIX_RWLock_Information>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
40008684: c2 07 bf f8 ld [ %fp + -8 ], %g1
40008688: 80 a0 60 00 cmp %g1, 0
4000868c: 32 80 00 21 bne,a 40008710 <pthread_rwlock_timedrdlock+0xbc>
40008690: b0 10 20 16 mov 0x16, %i0
case OBJECTS_LOCAL:
executing = _Thread_Executing;
40008694: 05 10 00 6b sethi %hi(0x4001ac00), %g2
40008698: f8 00 a3 18 ld [ %g2 + 0x318 ], %i4 ! 4001af18 <_Per_CPU_Information+0x18>
_CORE_RWLock_Obtain_for_reading(
4000869c: d4 06 00 00 ld [ %i0 ], %o2
400086a0: 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 )
400086a4: 82 1f 60 03 xor %i5, 3, %g1
switch ( location ) {
case OBJECTS_LOCAL:
executing = _Thread_Executing;
_CORE_RWLock_Obtain_for_reading(
400086a8: 90 02 20 10 add %o0, 0x10, %o0
400086ac: 80 a0 00 01 cmp %g0, %g1
400086b0: 92 10 00 1c mov %i4, %o1
400086b4: b6 60 3f ff subx %g0, -1, %i3
400086b8: 9a 10 20 00 clr %o5
400086bc: 40 00 07 6b call 4000a468 <_CORE_RWLock_Obtain_for_reading>
400086c0: 96 10 00 1b mov %i3, %o3
400086c4: 40 00 0e 6a call 4000c06c <_Thread_Enable_dispatch>
400086c8: 01 00 00 00 nop
ticks,
NULL
);
_Objects_Put( &the_rwlock->Object );
if ( !do_wait ) {
400086cc: 80 a6 e0 00 cmp %i3, 0
400086d0: 12 80 00 0b bne 400086fc <pthread_rwlock_timedrdlock+0xa8>
400086d4: d0 07 20 34 ld [ %i4 + 0x34 ], %o0
if ( executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
400086d8: 80 a2 20 02 cmp %o0, 2
400086dc: 12 80 00 08 bne 400086fc <pthread_rwlock_timedrdlock+0xa8>
400086e0: 80 a7 60 00 cmp %i5, 0
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
400086e4: 22 80 00 0b be,a 40008710 <pthread_rwlock_timedrdlock+0xbc><== NEVER TAKEN
400086e8: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
400086ec: ba 07 7f ff add %i5, -1, %i5
400086f0: 80 a7 60 01 cmp %i5, 1
400086f4: 08 80 00 07 bleu 40008710 <pthread_rwlock_timedrdlock+0xbc><== ALWAYS TAKEN
400086f8: b0 10 20 74 mov 0x74, %i0
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
400086fc: 40 00 00 38 call 400087dc <_POSIX_RWLock_Translate_core_RWLock_return_code>
40008700: 01 00 00 00 nop
40008704: 81 c7 e0 08 ret
40008708: 91 e8 00 08 restore %g0, %o0, %o0
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
4000870c: b0 10 20 16 mov 0x16, %i0
}
40008710: 81 c7 e0 08 ret
40008714: 81 e8 00 00 restore
40008718 <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
40008718: 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 )
4000871c: 80 a6 20 00 cmp %i0, 0
40008720: 02 80 00 2c be 400087d0 <pthread_rwlock_timedwrlock+0xb8>
40008724: 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 );
40008728: 40 00 18 b3 call 4000e9f4 <_POSIX_Absolute_timeout_to_ticks>
4000872c: 90 10 00 19 mov %i1, %o0
40008730: d2 06 00 00 ld [ %i0 ], %o1
40008734: ba 10 00 08 mov %o0, %i5
40008738: 94 07 bf f8 add %fp, -8, %o2
4000873c: 11 10 00 6a sethi %hi(0x4001a800), %o0
40008740: 40 00 0a e3 call 4000b2cc <_Objects_Get>
40008744: 90 12 23 b4 or %o0, 0x3b4, %o0 ! 4001abb4 <_POSIX_RWLock_Information>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
40008748: c2 07 bf f8 ld [ %fp + -8 ], %g1
4000874c: 80 a0 60 00 cmp %g1, 0
40008750: 32 80 00 21 bne,a 400087d4 <pthread_rwlock_timedwrlock+0xbc>
40008754: b0 10 20 16 mov 0x16, %i0
case OBJECTS_LOCAL:
executing = _Thread_Executing;
40008758: 05 10 00 6b sethi %hi(0x4001ac00), %g2
4000875c: f8 00 a3 18 ld [ %g2 + 0x318 ], %i4 ! 4001af18 <_Per_CPU_Information+0x18>
_CORE_RWLock_Obtain_for_writing(
40008760: d4 06 00 00 ld [ %i0 ], %o2
40008764: 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 )
40008768: 82 1f 60 03 xor %i5, 3, %g1
switch ( location ) {
case OBJECTS_LOCAL:
executing = _Thread_Executing;
_CORE_RWLock_Obtain_for_writing(
4000876c: 90 02 20 10 add %o0, 0x10, %o0
40008770: 80 a0 00 01 cmp %g0, %g1
40008774: 92 10 00 1c mov %i4, %o1
40008778: b6 60 3f ff subx %g0, -1, %i3
4000877c: 9a 10 20 00 clr %o5
40008780: 40 00 07 68 call 4000a520 <_CORE_RWLock_Obtain_for_writing>
40008784: 96 10 00 1b mov %i3, %o3
40008788: 40 00 0e 39 call 4000c06c <_Thread_Enable_dispatch>
4000878c: 01 00 00 00 nop
ticks,
NULL
);
_Objects_Put( &the_rwlock->Object );
if ( !do_wait &&
40008790: 80 a6 e0 00 cmp %i3, 0
40008794: 12 80 00 0b bne 400087c0 <pthread_rwlock_timedwrlock+0xa8>
40008798: d0 07 20 34 ld [ %i4 + 0x34 ], %o0
4000879c: 80 a2 20 02 cmp %o0, 2
400087a0: 12 80 00 08 bne 400087c0 <pthread_rwlock_timedwrlock+0xa8>
400087a4: 80 a7 60 00 cmp %i5, 0
(executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
400087a8: 22 80 00 0b be,a 400087d4 <pthread_rwlock_timedwrlock+0xbc><== NEVER TAKEN
400087ac: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
400087b0: ba 07 7f ff add %i5, -1, %i5
400087b4: 80 a7 60 01 cmp %i5, 1
400087b8: 08 80 00 07 bleu 400087d4 <pthread_rwlock_timedwrlock+0xbc><== ALWAYS TAKEN
400087bc: b0 10 20 74 mov 0x74, %i0
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
400087c0: 40 00 00 07 call 400087dc <_POSIX_RWLock_Translate_core_RWLock_return_code>
400087c4: 01 00 00 00 nop
400087c8: 81 c7 e0 08 ret
400087cc: 91 e8 00 08 restore %g0, %o0, %o0
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
400087d0: b0 10 20 16 mov 0x16, %i0
}
400087d4: 81 c7 e0 08 ret
400087d8: 81 e8 00 00 restore
40008fb4 <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
40008fb4: 82 10 00 08 mov %o0, %g1
if ( !attr )
40008fb8: 80 a0 60 00 cmp %g1, 0
40008fbc: 02 80 00 0a be 40008fe4 <pthread_rwlockattr_setpshared+0x30>
40008fc0: 90 10 20 16 mov 0x16, %o0
return EINVAL;
if ( !attr->is_initialized )
40008fc4: c4 00 40 00 ld [ %g1 ], %g2
40008fc8: 80 a0 a0 00 cmp %g2, 0
40008fcc: 02 80 00 06 be 40008fe4 <pthread_rwlockattr_setpshared+0x30>
40008fd0: 80 a2 60 01 cmp %o1, 1
return EINVAL;
switch ( pshared ) {
40008fd4: 18 80 00 04 bgu 40008fe4 <pthread_rwlockattr_setpshared+0x30><== NEVER TAKEN
40008fd8: 01 00 00 00 nop
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
40008fdc: d2 20 60 04 st %o1, [ %g1 + 4 ]
return 0;
40008fe0: 90 10 20 00 clr %o0
default:
return EINVAL;
}
}
40008fe4: 81 c3 e0 08 retl
40009dd4 <pthread_setschedparam>:
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
40009dd4: 9d e3 bf 90 save %sp, -112, %sp
int rc;
/*
* Check all the parameters
*/
if ( !param )
40009dd8: 80 a6 a0 00 cmp %i2, 0
40009ddc: 02 80 00 3e be 40009ed4 <pthread_setschedparam+0x100>
40009de0: 90 10 20 16 mov 0x16, %o0
return EINVAL;
rc = _POSIX_Thread_Translate_sched_param(
40009de4: 90 10 00 19 mov %i1, %o0
40009de8: 92 10 00 1a mov %i2, %o1
40009dec: 94 07 bf f4 add %fp, -12, %o2
40009df0: 40 00 16 41 call 4000f6f4 <_POSIX_Thread_Translate_sched_param>
40009df4: 96 07 bf f8 add %fp, -8, %o3
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( rc )
40009df8: 80 a2 20 00 cmp %o0, 0
40009dfc: 12 80 00 36 bne 40009ed4 <pthread_setschedparam+0x100>
40009e00: 01 00 00 00 nop
return rc;
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _Thread_Get( thread, &location );
40009e04: 90 10 00 18 mov %i0, %o0
40009e08: 40 00 0b c6 call 4000cd20 <_Thread_Get>
40009e0c: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
40009e10: c2 07 bf fc ld [ %fp + -4 ], %g1
return rc;
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _Thread_Get( thread, &location );
40009e14: b8 10 00 08 mov %o0, %i4
switch ( location ) {
40009e18: 80 a0 60 00 cmp %g1, 0
40009e1c: 12 80 00 2e bne 40009ed4 <pthread_setschedparam+0x100>
40009e20: 90 10 20 03 mov 3, %o0
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
40009e24: fa 07 21 50 ld [ %i4 + 0x150 ], %i5
if ( api->schedpolicy == SCHED_SPORADIC )
40009e28: c2 07 60 90 ld [ %i5 + 0x90 ], %g1
40009e2c: 80 a0 60 04 cmp %g1, 4
40009e30: 32 80 00 05 bne,a 40009e44 <pthread_setschedparam+0x70>
40009e34: f2 27 60 90 st %i1, [ %i5 + 0x90 ]
(void) _Watchdog_Remove( &api->Sporadic_timer );
40009e38: 40 00 0f 8e call 4000dc70 <_Watchdog_Remove>
40009e3c: 90 07 60 b4 add %i5, 0xb4, %o0
api->schedpolicy = policy;
40009e40: f2 27 60 90 st %i1, [ %i5 + 0x90 ]
api->schedparam = *param;
40009e44: 90 07 60 94 add %i5, 0x94, %o0
40009e48: 92 10 00 1a mov %i2, %o1
40009e4c: 40 00 20 73 call 40012018 <memcpy>
40009e50: 94 10 20 1c mov 0x1c, %o2
the_thread->budget_algorithm = budget_algorithm;
40009e54: c2 07 bf f4 ld [ %fp + -12 ], %g1
the_thread->budget_callout = budget_callout;
switch ( api->schedpolicy ) {
40009e58: 80 a6 60 00 cmp %i1, 0
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
api->schedpolicy = policy;
api->schedparam = *param;
the_thread->budget_algorithm = budget_algorithm;
40009e5c: c2 27 20 78 st %g1, [ %i4 + 0x78 ]
the_thread->budget_callout = budget_callout;
40009e60: c2 07 bf f8 ld [ %fp + -8 ], %g1
switch ( api->schedpolicy ) {
40009e64: 06 80 00 19 bl 40009ec8 <pthread_setschedparam+0xf4> <== NEVER TAKEN
40009e68: c2 27 20 7c st %g1, [ %i4 + 0x7c ]
40009e6c: 80 a6 60 02 cmp %i1, 2
40009e70: 04 80 00 0b ble 40009e9c <pthread_setschedparam+0xc8>
40009e74: 80 a6 60 04 cmp %i1, 4
40009e78: 12 80 00 14 bne 40009ec8 <pthread_setschedparam+0xf4> <== NEVER TAKEN
40009e7c: 90 07 60 b4 add %i5, 0xb4, %o0
true
);
break;
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
40009e80: c2 07 60 94 ld [ %i5 + 0x94 ], %g1
_Watchdog_Remove( &api->Sporadic_timer );
40009e84: 40 00 0f 7b call 4000dc70 <_Watchdog_Remove>
40009e88: c2 27 60 b0 st %g1, [ %i5 + 0xb0 ]
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
40009e8c: 90 10 20 00 clr %o0
40009e90: 7f ff ff 23 call 40009b1c <_POSIX_Threads_Sporadic_budget_TSR>
40009e94: 92 10 00 1c mov %i4, %o1
break;
40009e98: 30 80 00 0c b,a 40009ec8 <pthread_setschedparam+0xf4>
switch ( api->schedpolicy ) {
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
40009e9c: 03 10 00 6f sethi %hi(0x4001bc00), %g1
40009ea0: c2 00 62 20 ld [ %g1 + 0x220 ], %g1 ! 4001be20 <_Thread_Ticks_per_timeslice>
the_thread->real_priority =
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
40009ea4: 90 10 00 1c mov %i4, %o0
switch ( api->schedpolicy ) {
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
40009ea8: c2 27 20 74 st %g1, [ %i4 + 0x74 ]
40009eac: 03 10 00 6c sethi %hi(0x4001b000), %g1
40009eb0: d2 08 60 b4 ldub [ %g1 + 0xb4 ], %o1 ! 4001b0b4 <rtems_maximum_priority>
40009eb4: c2 07 60 94 ld [ %i5 + 0x94 ], %g1
the_thread->real_priority =
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
40009eb8: 94 10 20 01 mov 1, %o2
40009ebc: 92 22 40 01 sub %o1, %g1, %o1
40009ec0: 40 00 0a 89 call 4000c8e4 <_Thread_Change_priority>
40009ec4: d2 27 20 18 st %o1, [ %i4 + 0x18 ]
40009ec8: 40 00 0b 89 call 4000ccec <_Thread_Enable_dispatch>
40009ecc: 01 00 00 00 nop
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
break;
}
_Objects_Put( &the_thread->Object );
return 0;
40009ed0: 90 10 20 00 clr %o0 ! 0 <PROM_START>
case OBJECTS_ERROR:
break;
}
return ESRCH;
}
40009ed4: 81 c7 e0 08 ret
40009ed8: 91 e8 00 08 restore %g0, %o0, %o0
400071d4 <pthread_setspecific>:
int pthread_setspecific(
pthread_key_t key,
const void *value
)
{
400071d4: 9d e3 bf 98 save %sp, -104, %sp
400071d8: 11 10 00 64 sethi %hi(0x40019000), %o0
400071dc: 92 10 00 18 mov %i0, %o1
400071e0: 90 12 20 d0 or %o0, 0xd0, %o0
400071e4: 40 00 0a 0d call 40009a18 <_Objects_Get>
400071e8: 94 07 bf fc add %fp, -4, %o2
Objects_Locations location;
POSIX_Keys_Key_value_pair *value_pair_ptr;
POSIX_API_Control *api;
the_key = _POSIX_Keys_Get( key, &location );
switch ( location ) {
400071ec: c2 07 bf fc ld [ %fp + -4 ], %g1
400071f0: 80 a0 60 00 cmp %g1, 0
400071f4: 12 80 00 2b bne 400072a0 <pthread_setspecific+0xcc>
400071f8: 39 10 00 64 sethi %hi(0x40019000), %i4
}
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 );
400071fc: 40 00 07 74 call 40008fcc <_Freechain_Get>
40007200: 90 17 21 48 or %i4, 0x148, %o0 ! 40019148 <_POSIX_Keys_Keypool>
case OBJECTS_LOCAL:
value_pair_ptr = _POSIX_Keys_Key_value_pair_allocate();
if ( !value_pair_ptr ) {
40007204: ba 92 20 00 orcc %o0, 0, %i5
40007208: 12 80 00 06 bne 40007220 <pthread_setspecific+0x4c> <== ALWAYS TAKEN
4000720c: 37 10 00 64 sethi %hi(0x40019000), %i3
40007210: 40 00 0f 58 call 4000af70 <_Thread_Enable_dispatch> <== NOT EXECUTED
40007214: b0 10 20 0c mov 0xc, %i0 <== NOT EXECUTED
_Objects_Put( &the_key->Object );
return ENOMEM;
40007218: 81 c7 e0 08 ret <== NOT EXECUTED
4000721c: 81 e8 00 00 restore <== NOT EXECUTED
}
value_pair_ptr->key = key;
value_pair_ptr->thread_id = _Thread_Executing->Object.id;
40007220: b6 16 e2 20 or %i3, 0x220, %i3
40007224: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1
_Objects_Put( &the_key->Object );
return ENOMEM;
}
value_pair_ptr->key = key;
40007228: f0 27 60 18 st %i0, [ %i5 + 0x18 ]
value_pair_ptr->thread_id = _Thread_Executing->Object.id;
4000722c: c2 00 60 08 ld [ %g1 + 8 ], %g1
value_pair_ptr->value = value;
if ( _RBTree_Insert( &_POSIX_Keys_Key_value_lookup_tree,
40007230: 11 10 00 64 sethi %hi(0x40019000), %o0
return ENOMEM;
}
value_pair_ptr->key = key;
value_pair_ptr->thread_id = _Thread_Executing->Object.id;
40007234: c2 27 60 1c st %g1, [ %i5 + 0x1c ]
value_pair_ptr->value = value;
40007238: f2 27 60 20 st %i1, [ %i5 + 0x20 ]
if ( _RBTree_Insert( &_POSIX_Keys_Key_value_lookup_tree,
4000723c: 90 12 21 8c or %o0, 0x18c, %o0
40007240: 40 00 0b e1 call 4000a1c4 <_RBTree_Insert>
40007244: 92 07 60 08 add %i5, 8, %o1
40007248: 80 a2 20 00 cmp %o0, 0
4000724c: 02 80 00 09 be 40007270 <pthread_setspecific+0x9c> <== ALWAYS TAKEN
40007250: 90 17 21 48 or %i4, 0x148, %o0
&(value_pair_ptr->Key_value_lookup_node) ) ) {
_Freechain_Put( (Freechain_Control *)&_POSIX_Keys_Keypool,
40007254: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED
40007258: 40 00 07 70 call 40009018 <_Freechain_Put> <== NOT EXECUTED
4000725c: b0 10 20 0b mov 0xb, %i0 <== NOT EXECUTED
40007260: 40 00 0f 44 call 4000af70 <_Thread_Enable_dispatch> <== NOT EXECUTED
40007264: 01 00 00 00 nop <== NOT EXECUTED
(void *) value_pair_ptr );
_Objects_Put( &the_key->Object );
return EAGAIN;
40007268: 81 c7 e0 08 ret <== NOT EXECUTED
4000726c: 81 e8 00 00 restore <== NOT EXECUTED
}
/** append rb_node to the thread API extension's chain */
api = (POSIX_API_Control *)\
40007270: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1
(_Thread_Executing->API_Extensions[THREAD_API_POSIX]);
_Chain_Append_unprotected( &api->Key_Chain, &value_pair_ptr->Key_values_per_thread_node );
_Objects_Put( &the_key->Object );
return 0;
40007274: b0 10 20 00 clr %i0
return EAGAIN;
}
/** append rb_node to the thread API extension's chain */
api = (POSIX_API_Control *)\
40007278: c2 00 61 50 ld [ %g1 + 0x150 ], %g1
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
4000727c: c4 00 60 fc ld [ %g1 + 0xfc ], %g2
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
40007280: 86 00 60 f8 add %g1, 0xf8, %g3
Chain_Node *old_last = tail->previous;
the_node->next = tail;
40007284: c6 27 40 00 st %g3, [ %i5 ]
tail->previous = the_node;
40007288: fa 20 60 fc st %i5, [ %g1 + 0xfc ]
old_last->next = the_node;
4000728c: fa 20 80 00 st %i5, [ %g2 ]
40007290: 40 00 0f 38 call 4000af70 <_Thread_Enable_dispatch>
40007294: c4 27 60 04 st %g2, [ %i5 + 4 ]
(_Thread_Executing->API_Extensions[THREAD_API_POSIX]);
_Chain_Append_unprotected( &api->Key_Chain, &value_pair_ptr->Key_values_per_thread_node );
_Objects_Put( &the_key->Object );
return 0;
40007298: 81 c7 e0 08 ret
4000729c: 81 e8 00 00 restore
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
400072a0: 81 c7 e0 08 ret
400072a4: 91 e8 20 16 restore %g0, 0x16, %o0
40007480 <pthread_testcancel>:
/*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
void pthread_testcancel( void )
{
40007480: 9d e3 bf a0 save %sp, -96, %sp
40007484: 03 10 00 61 sethi %hi(0x40018400), %g1
40007488: 82 10 63 b0 or %g1, 0x3b0, %g1 ! 400187b0 <_Per_CPU_Information>
* 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() )
4000748c: c4 00 60 0c ld [ %g1 + 0xc ], %g2
40007490: 80 a0 a0 00 cmp %g2, 0
40007494: 12 80 00 15 bne 400074e8 <pthread_testcancel+0x68> <== NEVER TAKEN
40007498: 01 00 00 00 nop
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4000749c: c6 00 60 10 ld [ %g1 + 0x10 ], %g3
++level;
400074a0: 86 00 e0 01 inc %g3
_Thread_Dispatch_disable_level = level;
400074a4: c6 20 60 10 st %g3, [ %g1 + 0x10 ]
return;
_Thread_Disable_dispatch();
executing = _Thread_Executing;
400074a8: f0 00 60 18 ld [ %g1 + 0x18 ], %i0
thread_support = executing->API_Extensions[ THREAD_API_POSIX ];
400074ac: c2 06 21 50 ld [ %i0 + 0x150 ], %g1
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
400074b0: c4 00 60 e4 ld [ %g1 + 0xe4 ], %g2
400074b4: 80 a0 a0 00 cmp %g2, 0
400074b8: 12 80 00 05 bne 400074cc <pthread_testcancel+0x4c> <== NEVER TAKEN
400074bc: ba 10 20 00 clr %i5
400074c0: c2 00 60 ec ld [ %g1 + 0xec ], %g1
400074c4: 80 a0 00 01 cmp %g0, %g1
400074c8: ba 40 20 00 addx %g0, 0, %i5
thread_support->cancelation_requested )
cancel = true;
_Thread_Enable_dispatch();
400074cc: 40 00 0b 4b call 4000a1f8 <_Thread_Enable_dispatch>
400074d0: 01 00 00 00 nop
if ( cancel )
400074d4: 80 8f 60 ff btst 0xff, %i5
400074d8: 02 80 00 04 be 400074e8 <pthread_testcancel+0x68>
400074dc: 01 00 00 00 nop
_POSIX_Thread_Exit( executing, PTHREAD_CANCELED );
400074e0: 40 00 15 f8 call 4000ccc0 <_POSIX_Thread_Exit>
400074e4: 93 e8 3f ff restore %g0, -1, %o1
400074e8: 81 c7 e0 08 ret
400074ec: 81 e8 00 00 restore
400079b8 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
400079b8: 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);
400079bc: 3b 10 00 62 sethi %hi(0x40018800), %i5
400079c0: 90 17 63 dc or %i5, 0x3dc, %o0 ! 40018bdc <aio_request_queue>
400079c4: 40 00 02 88 call 400083e4 <pthread_mutex_lock>
400079c8: a0 10 00 1d mov %i5, %l0
if (result != 0) {
400079cc: b8 92 20 00 orcc %o0, 0, %i4
400079d0: 02 80 00 06 be 400079e8 <rtems_aio_enqueue+0x30> <== ALWAYS TAKEN
400079d4: 90 10 00 18 mov %i0, %o0
free (req);
400079d8: 7f ff f0 7d call 40003bcc <free> <== NOT EXECUTED
400079dc: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED
return result;
400079e0: 81 c7 e0 08 ret <== NOT EXECUTED
400079e4: 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);
400079e8: 40 00 04 a1 call 40008c6c <pthread_self>
400079ec: ba 17 63 dc or %i5, 0x3dc, %i5
400079f0: 92 07 bf e0 add %fp, -32, %o1
400079f4: 40 00 03 a8 call 40008894 <pthread_getschedparam>
400079f8: 94 07 bf e4 add %fp, -28, %o2
req->caller_thread = pthread_self ();
400079fc: 40 00 04 9c call 40008c6c <pthread_self>
40007a00: b8 10 00 1d mov %i5, %i4
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
40007a04: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
40007a08: c6 07 bf e4 ld [ %fp + -28 ], %g3
40007a0c: 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 ();
40007a10: d0 26 20 10 st %o0, [ %i0 + 0x10 ]
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
40007a14: 84 20 c0 02 sub %g3, %g2, %g2
40007a18: c4 26 20 0c st %g2, [ %i0 + 0xc ]
req->policy = policy;
40007a1c: c4 07 bf e0 ld [ %fp + -32 ], %g2
40007a20: c4 26 20 08 st %g2, [ %i0 + 8 ]
req->aiocbp->error_code = EINPROGRESS;
40007a24: 84 10 20 77 mov 0x77, %g2
40007a28: c4 20 60 34 st %g2, [ %g1 + 0x34 ]
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
40007a2c: 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;
40007a30: c0 20 60 38 clr [ %g1 + 0x38 ]
if ((aio_request_queue.idle_threads == 0) &&
40007a34: 80 a0 a0 00 cmp %g2, 0
40007a38: 12 80 00 33 bne 40007b04 <rtems_aio_enqueue+0x14c> <== NEVER TAKEN
40007a3c: d2 00 40 00 ld [ %g1 ], %o1
40007a40: c2 07 60 70 ld [ %i5 + 0x70 ], %g1
40007a44: 80 a0 60 04 cmp %g1, 4
40007a48: 14 80 00 30 bg 40007b08 <rtems_aio_enqueue+0x150>
40007a4c: 11 10 00 63 sethi %hi(0x40018c00), %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);
40007a50: 90 07 60 54 add %i5, 0x54, %o0
40007a54: 7f ff ff 7e call 4000784c <rtems_aio_search_fd>
40007a58: 94 10 20 01 mov 1, %o2
if (r_chain->new_fd == 1) {
40007a5c: 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);
40007a60: b8 10 00 08 mov %o0, %i4
if (r_chain->new_fd == 1) {
40007a64: 80 a0 60 01 cmp %g1, 1
40007a68: b2 02 20 08 add %o0, 8, %i1
40007a6c: b6 02 20 1c add %o0, 0x1c, %i3
40007a70: 12 80 00 1c bne 40007ae0 <rtems_aio_enqueue+0x128>
40007a74: 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);
40007a78: 92 10 00 18 mov %i0, %o1
40007a7c: 40 00 08 f0 call 40009e3c <_Chain_Insert>
40007a80: 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);
40007a84: 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;
40007a88: c0 27 20 18 clr [ %i4 + 0x18 ]
pthread_mutex_init (&r_chain->mutex, NULL);
40007a8c: 40 00 01 fa call 40008274 <pthread_mutex_init>
40007a90: 90 10 00 1b mov %i3, %o0
pthread_cond_init (&r_chain->cond, NULL);
40007a94: 92 10 20 00 clr %o1
40007a98: 40 00 00 fe call 40007e90 <pthread_cond_init>
40007a9c: 90 10 00 1a mov %i2, %o0
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
40007aa0: 90 07 bf dc add %fp, -36, %o0
40007aa4: 92 07 60 08 add %i5, 8, %o1
40007aa8: 15 10 00 1d sethi %hi(0x40007400), %o2
40007aac: 96 10 00 1c mov %i4, %o3
40007ab0: 40 00 02 e1 call 40008634 <pthread_create>
40007ab4: 94 12 a0 fc or %o2, 0xfc, %o2
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
40007ab8: b0 92 20 00 orcc %o0, 0, %i0
40007abc: 22 80 00 06 be,a 40007ad4 <rtems_aio_enqueue+0x11c> <== ALWAYS TAKEN
40007ac0: c2 07 60 70 ld [ %i5 + 0x70 ], %g1
pthread_mutex_unlock (&aio_request_queue.mutex);
40007ac4: 40 00 02 68 call 40008464 <pthread_mutex_unlock> <== NOT EXECUTED
40007ac8: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED
return result;
40007acc: 81 c7 e0 08 ret <== NOT EXECUTED
40007ad0: 81 e8 00 00 restore <== NOT EXECUTED
}
++aio_request_queue.active_threads;
40007ad4: 82 00 60 01 inc %g1
40007ad8: 10 80 00 3d b 40007bcc <rtems_aio_enqueue+0x214>
40007adc: c2 27 60 70 st %g1, [ %i5 + 0x70 ]
}
else {
/* put request in the fd chain it belongs to */
pthread_mutex_lock (&r_chain->mutex);
40007ae0: 40 00 02 41 call 400083e4 <pthread_mutex_lock>
40007ae4: 90 10 00 1b mov %i3, %o0
rtems_aio_insert_prio (&r_chain->perfd, req);
40007ae8: 90 10 00 19 mov %i1, %o0
40007aec: 7f ff fe 6d call 400074a0 <rtems_aio_insert_prio>
40007af0: 92 10 00 18 mov %i0, %o1
pthread_cond_signal (&r_chain->cond);
40007af4: 40 00 01 17 call 40007f50 <pthread_cond_signal>
40007af8: 90 10 00 1a mov %i2, %o0
pthread_mutex_unlock (&r_chain->mutex);
40007afc: 10 80 00 12 b 40007b44 <rtems_aio_enqueue+0x18c>
40007b00: 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,
40007b04: 11 10 00 63 sethi %hi(0x40018c00), %o0 <== NOT EXECUTED
40007b08: 94 10 20 00 clr %o2
40007b0c: 7f ff ff 50 call 4000784c <rtems_aio_search_fd>
40007b10: 90 12 20 30 or %o0, 0x30, %o0
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
40007b14: ba 92 20 00 orcc %o0, 0, %i5
40007b18: 22 80 00 0f be,a 40007b54 <rtems_aio_enqueue+0x19c>
40007b1c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
{
pthread_mutex_lock (&r_chain->mutex);
40007b20: b8 07 60 1c add %i5, 0x1c, %i4
40007b24: 40 00 02 30 call 400083e4 <pthread_mutex_lock>
40007b28: 90 10 00 1c mov %i4, %o0
rtems_aio_insert_prio (&r_chain->perfd, req);
40007b2c: 90 07 60 08 add %i5, 8, %o0
40007b30: 7f ff fe 5c call 400074a0 <rtems_aio_insert_prio>
40007b34: 92 10 00 18 mov %i0, %o1
pthread_cond_signal (&r_chain->cond);
40007b38: 40 00 01 06 call 40007f50 <pthread_cond_signal>
40007b3c: 90 07 60 20 add %i5, 0x20, %o0
pthread_mutex_unlock (&r_chain->mutex);
40007b40: 90 10 00 1c mov %i4, %o0
40007b44: 40 00 02 48 call 40008464 <pthread_mutex_unlock>
40007b48: 01 00 00 00 nop
40007b4c: 10 80 00 21 b 40007bd0 <rtems_aio_enqueue+0x218>
40007b50: 90 14 23 dc or %l0, 0x3dc, %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);
40007b54: 11 10 00 63 sethi %hi(0x40018c00), %o0
40007b58: d2 00 40 00 ld [ %g1 ], %o1
40007b5c: 90 12 20 3c or %o0, 0x3c, %o0
40007b60: 7f ff ff 3b call 4000784c <rtems_aio_search_fd>
40007b64: 94 10 20 01 mov 1, %o2
if (r_chain->new_fd == 1) {
40007b68: 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);
40007b6c: ba 10 00 08 mov %o0, %i5
40007b70: 92 10 00 18 mov %i0, %o1
if (r_chain->new_fd == 1) {
40007b74: 80 a0 60 01 cmp %g1, 1
40007b78: 12 80 00 0d bne 40007bac <rtems_aio_enqueue+0x1f4>
40007b7c: 90 02 20 08 add %o0, 8, %o0
40007b80: 40 00 08 af call 40009e3c <_Chain_Insert>
40007b84: 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);
40007b88: 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;
40007b8c: c0 27 60 18 clr [ %i5 + 0x18 ]
pthread_mutex_init (&r_chain->mutex, NULL);
40007b90: 40 00 01 b9 call 40008274 <pthread_mutex_init>
40007b94: 92 10 20 00 clr %o1
pthread_cond_init (&r_chain->cond, NULL);
40007b98: 90 07 60 20 add %i5, 0x20, %o0
40007b9c: 40 00 00 bd call 40007e90 <pthread_cond_init>
40007ba0: 92 10 20 00 clr %o1
40007ba4: 10 80 00 05 b 40007bb8 <rtems_aio_enqueue+0x200>
40007ba8: 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);
40007bac: 7f ff fe 3d call 400074a0 <rtems_aio_insert_prio>
40007bb0: 01 00 00 00 nop
if (aio_request_queue.idle_threads > 0)
40007bb4: c2 07 20 74 ld [ %i4 + 0x74 ], %g1
40007bb8: 80 a0 60 00 cmp %g1, 0
40007bbc: 04 80 00 05 ble 40007bd0 <rtems_aio_enqueue+0x218> <== ALWAYS TAKEN
40007bc0: 90 14 23 dc or %l0, 0x3dc, %o0
pthread_cond_signal (&aio_request_queue.new_req);
40007bc4: 40 00 00 e3 call 40007f50 <pthread_cond_signal> <== NOT EXECUTED
40007bc8: 90 07 20 04 add %i4, 4, %o0 <== NOT EXECUTED
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
40007bcc: 90 14 23 dc or %l0, 0x3dc, %o0
40007bd0: 40 00 02 25 call 40008464 <pthread_mutex_unlock>
40007bd4: b0 10 20 00 clr %i0
return 0;
}
40007bd8: 81 c7 e0 08 ret
40007bdc: 81 e8 00 00 restore
400074fc <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
400074fc: 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);
40007500: 3b 10 00 62 sethi %hi(0x40018800), %i5
40007504: ba 17 63 dc or %i5, 0x3dc, %i5 ! 40018bdc <aio_request_queue>
}
}
/* 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);
40007508: 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)) {
4000750c: 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 &&
40007510: 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);
40007514: b6 06 20 1c add %i0, 0x1c, %i3
40007518: 40 00 03 b3 call 400083e4 <pthread_mutex_lock>
4000751c: 90 10 00 1b mov %i3, %o0
if (result != 0)
40007520: 80 a2 20 00 cmp %o0, 0
40007524: 12 80 00 93 bne 40007770 <rtems_aio_handle+0x274> <== NEVER TAKEN
40007528: 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;
4000752c: 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)) {
40007530: 80 a7 00 01 cmp %i4, %g1
40007534: 02 80 00 3b be 40007620 <rtems_aio_handle+0x124>
40007538: 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);
4000753c: 40 00 05 cc call 40008c6c <pthread_self>
40007540: 01 00 00 00 nop
40007544: 92 07 bf d8 add %fp, -40, %o1
40007548: 40 00 04 d3 call 40008894 <pthread_getschedparam>
4000754c: 94 07 bf e4 add %fp, -28, %o2
param.sched_priority = req->priority;
40007550: c2 07 20 0c ld [ %i4 + 0xc ], %g1
pthread_setschedparam (pthread_self(), req->policy, ¶m);
40007554: 40 00 05 c6 call 40008c6c <pthread_self>
40007558: c2 27 bf e4 st %g1, [ %fp + -28 ]
4000755c: d2 07 20 08 ld [ %i4 + 8 ], %o1
40007560: 40 00 05 c7 call 40008c7c <pthread_setschedparam>
40007564: 94 07 bf e4 add %fp, -28, %o2
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
40007568: 40 00 0a 1c call 40009dd8 <_Chain_Extract>
4000756c: 90 10 00 1c mov %i4, %o0
rtems_chain_explicit_extract (chain, node);
pthread_mutex_unlock (&r_chain->mutex);
40007570: 40 00 03 bd call 40008464 <pthread_mutex_unlock>
40007574: 90 10 00 1b mov %i3, %o0
switch (req->aiocbp->aio_lio_opcode) {
40007578: c2 07 20 14 ld [ %i4 + 0x14 ], %g1
4000757c: c4 00 60 30 ld [ %g1 + 0x30 ], %g2
40007580: 80 a0 a0 02 cmp %g2, 2
40007584: 22 80 00 10 be,a 400075c4 <rtems_aio_handle+0xc8>
40007588: c4 18 60 08 ldd [ %g1 + 8 ], %g2
4000758c: 80 a0 a0 03 cmp %g2, 3
40007590: 02 80 00 15 be 400075e4 <rtems_aio_handle+0xe8> <== NEVER TAKEN
40007594: 80 a0 a0 01 cmp %g2, 1
40007598: 32 80 00 19 bne,a 400075fc <rtems_aio_handle+0x100> <== NEVER TAKEN
4000759c: f8 07 20 14 ld [ %i4 + 0x14 ], %i4 <== NOT EXECUTED
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
400075a0: c4 18 60 08 ldd [ %g1 + 8 ], %g2
400075a4: d0 00 40 00 ld [ %g1 ], %o0
400075a8: d2 00 60 10 ld [ %g1 + 0x10 ], %o1
400075ac: d4 00 60 14 ld [ %g1 + 0x14 ], %o2
400075b0: 96 10 00 02 mov %g2, %o3
400075b4: 40 00 27 dd call 40011528 <pread>
400075b8: 98 10 00 03 mov %g3, %o4
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
400075bc: 10 80 00 0d b 400075f0 <rtems_aio_handle+0xf4>
400075c0: 80 a2 3f ff cmp %o0, -1
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
400075c4: d0 00 40 00 ld [ %g1 ], %o0
400075c8: d2 00 60 10 ld [ %g1 + 0x10 ], %o1
400075cc: d4 00 60 14 ld [ %g1 + 0x14 ], %o2
400075d0: 96 10 00 02 mov %g2, %o3
400075d4: 40 00 28 11 call 40011618 <pwrite>
400075d8: 98 10 00 03 mov %g3, %o4
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
400075dc: 10 80 00 05 b 400075f0 <rtems_aio_handle+0xf4>
400075e0: 80 a2 3f ff cmp %o0, -1
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
400075e4: 40 00 19 b2 call 4000dcac <fsync> <== NOT EXECUTED
400075e8: d0 00 40 00 ld [ %g1 ], %o0 <== NOT EXECUTED
break;
default:
result = -1;
}
if (result == -1) {
400075ec: 80 a2 3f ff cmp %o0, -1 <== NOT EXECUTED
400075f0: 32 80 00 09 bne,a 40007614 <rtems_aio_handle+0x118> <== ALWAYS TAKEN
400075f4: c2 07 20 14 ld [ %i4 + 0x14 ], %g1
req->aiocbp->return_value = -1;
400075f8: f8 07 20 14 ld [ %i4 + 0x14 ], %i4 <== NOT EXECUTED
400075fc: 82 10 3f ff mov -1, %g1 <== NOT EXECUTED
req->aiocbp->error_code = errno;
40007600: 40 00 26 e5 call 40011194 <__errno> <== NOT EXECUTED
40007604: c2 27 20 38 st %g1, [ %i4 + 0x38 ] <== NOT EXECUTED
40007608: c2 02 00 00 ld [ %o0 ], %g1 <== NOT EXECUTED
4000760c: 10 bf ff c2 b 40007514 <rtems_aio_handle+0x18> <== NOT EXECUTED
40007610: c2 27 20 34 st %g1, [ %i4 + 0x34 ] <== NOT EXECUTED
} else {
req->aiocbp->return_value = result;
40007614: d0 20 60 38 st %o0, [ %g1 + 0x38 ]
req->aiocbp->error_code = 0;
40007618: 10 bf ff bf b 40007514 <rtems_aio_handle+0x18>
4000761c: 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);
40007620: 40 00 03 91 call 40008464 <pthread_mutex_unlock>
40007624: 90 10 00 1b mov %i3, %o0
pthread_mutex_lock (&aio_request_queue.mutex);
40007628: 40 00 03 6f call 400083e4 <pthread_mutex_lock>
4000762c: 90 10 00 1d mov %i5, %o0
if (rtems_chain_is_empty (chain))
40007630: c2 06 20 08 ld [ %i0 + 8 ], %g1
40007634: 80 a0 40 1c cmp %g1, %i4
40007638: 12 80 00 4a bne 40007760 <rtems_aio_handle+0x264> <== NEVER TAKEN
4000763c: 92 07 bf dc add %fp, -36, %o1
{
clock_gettime (CLOCK_REALTIME, &timeout);
40007640: 40 00 01 b2 call 40007d08 <clock_gettime>
40007644: 90 10 20 01 mov 1, %o0
timeout.tv_sec += 3;
40007648: c2 07 bf dc ld [ %fp + -36 ], %g1
timeout.tv_nsec = 0;
4000764c: 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;
40007650: 82 00 60 03 add %g1, 3, %g1
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
40007654: 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;
40007658: c2 27 bf dc st %g1, [ %fp + -36 ]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
4000765c: 90 10 00 1c mov %i4, %o0
40007660: 92 10 00 1d mov %i5, %o1
40007664: 40 00 02 58 call 40007fc4 <pthread_cond_timedwait>
40007668: 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) {
4000766c: 80 a2 20 74 cmp %o0, 0x74
40007670: 12 80 00 3c bne 40007760 <rtems_aio_handle+0x264> <== NEVER TAKEN
40007674: 01 00 00 00 nop
40007678: 40 00 09 d8 call 40009dd8 <_Chain_Extract>
4000767c: 90 10 00 18 mov %i0, %o0
rtems_chain_explicit_extract (&aio_request_queue.work_req,
&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
40007680: 40 00 02 ae call 40008138 <pthread_mutex_destroy>
40007684: 90 10 00 1b mov %i3, %o0
pthread_cond_destroy (&r_chain->cond);
40007688: 40 00 01 ce call 40007dc0 <pthread_cond_destroy>
4000768c: 90 10 00 1c mov %i4, %o0
free (r_chain);
40007690: 7f ff f1 4f call 40003bcc <free>
40007694: 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)) {
40007698: c2 07 60 60 ld [ %i5 + 0x60 ], %g1
4000769c: 80 a0 40 19 cmp %g1, %i1
400076a0: 12 80 00 1b bne 4000770c <rtems_aio_handle+0x210>
400076a4: 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);
400076a8: 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;
400076ac: 82 00 60 01 inc %g1
400076b0: c2 27 60 74 st %g1, [ %i5 + 0x74 ]
--aio_request_queue.active_threads;
400076b4: c2 07 60 70 ld [ %i5 + 0x70 ], %g1
clock_gettime (CLOCK_REALTIME, &timeout);
400076b8: 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;
400076bc: 82 00 7f ff add %g1, -1, %g1
clock_gettime (CLOCK_REALTIME, &timeout);
400076c0: 40 00 01 92 call 40007d08 <clock_gettime>
400076c4: c2 27 60 70 st %g1, [ %i5 + 0x70 ]
timeout.tv_sec += 3;
400076c8: c2 07 bf dc ld [ %fp + -36 ], %g1
timeout.tv_nsec = 0;
400076cc: 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;
400076d0: 82 00 60 03 add %g1, 3, %g1
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
400076d4: 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;
400076d8: c2 27 bf dc st %g1, [ %fp + -36 ]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
400076dc: 92 10 00 1d mov %i5, %o1
400076e0: 40 00 02 39 call 40007fc4 <pthread_cond_timedwait>
400076e4: 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) {
400076e8: 80 a2 20 74 cmp %o0, 0x74
400076ec: 12 80 00 08 bne 4000770c <rtems_aio_handle+0x210> <== NEVER TAKEN
400076f0: c2 07 60 74 ld [ %i5 + 0x74 ], %g1
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
pthread_mutex_unlock (&aio_request_queue.mutex);
400076f4: 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;
400076f8: 82 00 7f ff add %g1, -1, %g1
pthread_mutex_unlock (&aio_request_queue.mutex);
400076fc: 40 00 03 5a call 40008464 <pthread_mutex_unlock>
40007700: c2 27 60 74 st %g1, [ %i5 + 0x74 ]
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
40007704: 81 c7 e0 08 ret
40007708: 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;
4000770c: 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;
40007710: 82 00 7f ff add %g1, -1, %g1
40007714: c2 27 60 74 st %g1, [ %i5 + 0x74 ]
++aio_request_queue.active_threads;
40007718: c2 07 60 70 ld [ %i5 + 0x70 ], %g1
4000771c: 90 10 00 18 mov %i0, %o0
40007720: 82 00 60 01 inc %g1
40007724: 40 00 09 ad call 40009dd8 <_Chain_Extract>
40007728: c2 27 60 70 st %g1, [ %i5 + 0x70 ]
4000772c: 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 &&
40007730: c4 06 20 14 ld [ %i0 + 0x14 ], %g2
40007734: c6 00 60 14 ld [ %g1 + 0x14 ], %g3
40007738: 80 a0 c0 02 cmp %g3, %g2
4000773c: 16 80 00 06 bge 40007754 <rtems_aio_handle+0x258>
40007740: 80 a0 40 10 cmp %g1, %l0
40007744: 22 80 00 05 be,a 40007758 <rtems_aio_handle+0x25c> <== NEVER TAKEN
40007748: 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
4000774c: 10 bf ff fa b 40007734 <rtems_aio_handle+0x238>
40007750: 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 );
40007754: d0 00 60 04 ld [ %g1 + 4 ], %o0
40007758: 40 00 09 b9 call 40009e3c <_Chain_Insert>
4000775c: 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);
40007760: 40 00 03 41 call 40008464 <pthread_mutex_unlock>
40007764: 90 10 00 1a mov %i2, %o0
40007768: 10 bf ff 6c b 40007518 <rtems_aio_handle+0x1c>
4000776c: b6 06 20 1c add %i0, 0x1c, %i3
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
40007770: b0 10 20 00 clr %i0 <== NOT EXECUTED
40007774: 81 c7 e0 08 ret <== NOT EXECUTED
40007778: 81 e8 00 00 restore <== NOT EXECUTED
4000777c <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
4000777c: 9d e3 bf a0 save %sp, -96, %sp
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
40007780: 3b 10 00 62 sethi %hi(0x40018800), %i5
40007784: 40 00 03 92 call 400085cc <pthread_attr_init>
40007788: 90 17 63 e4 or %i5, 0x3e4, %o0 ! 40018be4 <aio_request_queue+0x8>
if (result != 0)
4000778c: b0 92 20 00 orcc %o0, 0, %i0
40007790: 12 80 00 2d bne 40007844 <rtems_aio_init+0xc8> <== NEVER TAKEN
40007794: 90 17 63 e4 or %i5, 0x3e4, %o0
return result;
result =
40007798: 40 00 03 99 call 400085fc <pthread_attr_setdetachstate>
4000779c: 92 10 20 00 clr %o1
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
400077a0: 80 a2 20 00 cmp %o0, 0
400077a4: 02 80 00 05 be 400077b8 <rtems_aio_init+0x3c> <== ALWAYS TAKEN
400077a8: 39 10 00 62 sethi %hi(0x40018800), %i4
pthread_attr_destroy (&aio_request_queue.attr);
400077ac: 40 00 03 7c call 4000859c <pthread_attr_destroy> <== NOT EXECUTED
400077b0: 90 17 63 e4 or %i5, 0x3e4, %o0 <== NOT EXECUTED
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
400077b4: 39 10 00 62 sethi %hi(0x40018800), %i4 <== NOT EXECUTED
400077b8: 92 10 20 00 clr %o1
400077bc: 40 00 02 ae call 40008274 <pthread_mutex_init>
400077c0: 90 17 23 dc or %i4, 0x3dc, %o0
if (result != 0)
400077c4: 80 a2 20 00 cmp %o0, 0
400077c8: 22 80 00 05 be,a 400077dc <rtems_aio_init+0x60> <== ALWAYS TAKEN
400077cc: 11 10 00 62 sethi %hi(0x40018800), %o0
pthread_attr_destroy (&aio_request_queue.attr);
400077d0: 40 00 03 73 call 4000859c <pthread_attr_destroy> <== NOT EXECUTED
400077d4: 90 17 63 e4 or %i5, 0x3e4, %o0 <== NOT EXECUTED
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
400077d8: 11 10 00 62 sethi %hi(0x40018800), %o0 <== NOT EXECUTED
400077dc: 92 10 20 00 clr %o1
400077e0: 40 00 01 ac call 40007e90 <pthread_cond_init>
400077e4: 90 12 23 e0 or %o0, 0x3e0, %o0
if (result != 0) {
400077e8: b0 92 20 00 orcc %o0, 0, %i0
400077ec: 02 80 00 07 be 40007808 <rtems_aio_init+0x8c> <== ALWAYS TAKEN
400077f0: 82 17 23 dc or %i4, 0x3dc, %g1
pthread_mutex_destroy (&aio_request_queue.mutex);
400077f4: 40 00 02 51 call 40008138 <pthread_mutex_destroy> <== NOT EXECUTED
400077f8: 90 17 23 dc or %i4, 0x3dc, %o0 <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
400077fc: 40 00 03 68 call 4000859c <pthread_attr_destroy> <== NOT EXECUTED
40007800: 90 17 63 e4 or %i5, 0x3e4, %o0 <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
40007804: 82 17 23 dc or %i4, 0x3dc, %g1 <== NOT EXECUTED
40007808: 84 00 60 58 add %g1, 0x58, %g2
4000780c: c4 20 60 54 st %g2, [ %g1 + 0x54 ]
head->previous = NULL;
tail->previous = head;
40007810: 84 00 60 54 add %g1, 0x54, %g2
40007814: 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;
40007818: 84 00 60 64 add %g1, 0x64, %g2
4000781c: c4 20 60 60 st %g2, [ %g1 + 0x60 ]
head->previous = NULL;
tail->previous = head;
40007820: 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;
40007824: c0 20 60 58 clr [ %g1 + 0x58 ]
tail->previous = head;
40007828: 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;
4000782c: 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;
40007830: 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;
40007834: c0 20 60 70 clr [ %g1 + 0x70 ]
aio_request_queue.idle_threads = 0;
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
40007838: 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;
4000783c: c0 20 60 74 clr [ %g1 + 0x74 ]
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
40007840: c4 20 60 6c st %g2, [ %g1 + 0x6c ]
return result;
}
40007844: 81 c7 e0 08 ret
40007848: 81 e8 00 00 restore
400074a0 <rtems_aio_insert_prio>:
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
400074a0: 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 );
400074a4: 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)) {
400074a8: 80 a0 40 03 cmp %g1, %g3
400074ac: 02 80 00 0b be 400074d8 <rtems_aio_insert_prio+0x38> <== NEVER TAKEN
400074b0: 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;
400074b4: c8 00 60 14 ld [ %g1 + 0x14 ], %g4
while (req->aiocbp->aio_reqprio > prio &&
400074b8: 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;
400074bc: c8 01 20 18 ld [ %g4 + 0x18 ], %g4
while (req->aiocbp->aio_reqprio > prio &&
400074c0: da 03 60 18 ld [ %o5 + 0x18 ], %o5
400074c4: 80 a3 40 04 cmp %o5, %g4
400074c8: 14 80 00 07 bg 400074e4 <rtems_aio_insert_prio+0x44> <== NEVER TAKEN
400074cc: 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 );
400074d0: d0 00 60 04 ld [ %g1 + 4 ], %o0
400074d4: 92 10 00 02 mov %g2, %o1
400074d8: 82 13 c0 00 mov %o7, %g1
400074dc: 40 00 0a 58 call 40009e3c <_Chain_Insert>
400074e0: 9e 10 40 00 mov %g1, %o7
400074e4: 22 bf ff fc be,a 400074d4 <rtems_aio_insert_prio+0x34> <== NOT EXECUTED
400074e8: 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
400074ec: 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;
400074f0: c8 00 60 14 ld [ %g1 + 0x14 ], %g4 <== NOT EXECUTED
400074f4: 10 bf ff f4 b 400074c4 <rtems_aio_insert_prio+0x24> <== NOT EXECUTED
400074f8: c8 01 20 18 ld [ %g4 + 0x18 ], %g4 <== NOT EXECUTED
40007940 <rtems_aio_remove_req>:
* 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)
{
40007940: 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;
40007944: 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 );
40007948: 82 06 20 04 add %i0, 4, %g1
if (rtems_chain_is_empty (chain))
4000794c: 80 a7 40 01 cmp %i5, %g1
40007950: 02 80 00 18 be 400079b0 <rtems_aio_remove_req+0x70>
40007954: 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) {
40007958: c4 07 60 14 ld [ %i5 + 0x14 ], %g2
4000795c: 80 a0 80 19 cmp %g2, %i1
40007960: 02 80 00 08 be 40007980 <rtems_aio_remove_req+0x40> <== ALWAYS TAKEN
40007964: 80 a7 40 01 cmp %i5, %g1
40007968: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED
4000796c: 80 a7 40 01 cmp %i5, %g1 <== NOT EXECUTED
40007970: 32 bf ff fb bne,a 4000795c <rtems_aio_remove_req+0x1c> <== NOT EXECUTED
40007974: 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;
40007978: 81 c7 e0 08 ret <== NOT EXECUTED
4000797c: 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))
40007980: 02 80 00 0c be 400079b0 <rtems_aio_remove_req+0x70> <== NEVER TAKEN
40007984: b0 10 20 01 mov 1, %i0
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
40007988: 40 00 09 14 call 40009dd8 <_Chain_Extract>
4000798c: 90 10 00 1d mov %i5, %o0
return AIO_NOTCANCELED;
else
{
rtems_chain_explicit_extract (chain, node);
current->aiocbp->error_code = ECANCELED;
40007990: c2 07 60 14 ld [ %i5 + 0x14 ], %g1
40007994: 84 10 20 8c mov 0x8c, %g2
40007998: c4 20 60 34 st %g2, [ %g1 + 0x34 ]
current->aiocbp->return_value = -1;
4000799c: 84 10 3f ff mov -1, %g2
free (current);
400079a0: 90 10 00 1d mov %i5, %o0
return AIO_NOTCANCELED;
else
{
rtems_chain_explicit_extract (chain, node);
current->aiocbp->error_code = ECANCELED;
current->aiocbp->return_value = -1;
400079a4: c4 20 60 38 st %g2, [ %g1 + 0x38 ]
free (current);
400079a8: 7f ff f0 89 call 40003bcc <free>
400079ac: b0 10 20 00 clr %i0
}
return AIO_CANCELED;
400079b0: 81 c7 e0 08 ret
400079b4: 81 e8 00 00 restore
400080c8 <rtems_chain_get_with_wait>:
rtems_chain_control *chain,
rtems_event_set events,
rtems_interval timeout,
rtems_chain_node **node_ptr
)
{
400080c8: 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->Chain );
400080cc: 40 00 01 7c call 400086bc <_Chain_Get>
400080d0: 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
400080d4: ba 92 20 00 orcc %o0, 0, %i5
400080d8: 12 80 00 0b bne 40008104 <rtems_chain_get_with_wait+0x3c>
400080dc: 90 10 00 19 mov %i1, %o0
) {
rtems_event_set out;
sc = rtems_event_receive(
400080e0: 92 10 20 00 clr %o1
400080e4: 94 10 00 1a mov %i2, %o2
400080e8: 7f ff fd 08 call 40007508 <rtems_event_receive>
400080ec: 96 07 bf fc add %fp, -4, %o3
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
400080f0: 80 a2 20 00 cmp %o0, 0
400080f4: 02 bf ff f6 be 400080cc <rtems_chain_get_with_wait+0x4> <== NEVER TAKEN
400080f8: 01 00 00 00 nop
400080fc: 10 80 00 04 b 4000810c <rtems_chain_get_with_wait+0x44>
40008100: fa 26 c0 00 st %i5, [ %i3 ]
40008104: 90 10 20 00 clr %o0
timeout,
&out
);
}
*node_ptr = node;
40008108: fa 26 c0 00 st %i5, [ %i3 ]
return sc;
}
4000810c: 81 c7 e0 08 ret
40008110: 91 e8 00 08 restore %g0, %o0, %o0
4000ca48 <rtems_iterate_over_all_threads>:
#include <rtems/score/thread.h>
#include <rtems/score/objectimpl.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
{
4000ca48: 9d e3 bf a0 save %sp, -96, %sp
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
4000ca4c: ba 10 20 01 mov 1, %i5
4000ca50: 80 a6 20 00 cmp %i0, 0
4000ca54: 02 80 00 1a be 4000cabc <rtems_iterate_over_all_threads+0x74><== NEVER TAKEN
4000ca58: 35 10 00 bb sethi %hi(0x4002ec00), %i2
4000ca5c: 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 ];
4000ca60: 84 16 a2 c4 or %i2, 0x2c4, %g2
4000ca64: c2 00 80 01 ld [ %g2 + %g1 ], %g1
4000ca68: f6 00 60 04 ld [ %g1 + 4 ], %i3
if ( !information )
4000ca6c: 80 a6 e0 00 cmp %i3, 0
4000ca70: 22 80 00 10 be,a 4000cab0 <rtems_iterate_over_all_threads+0x68>
4000ca74: ba 07 60 01 inc %i5
4000ca78: 10 80 00 09 b 4000ca9c <rtems_iterate_over_all_threads+0x54>
4000ca7c: b8 10 20 01 mov 1, %i4
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
4000ca80: 83 2f 20 02 sll %i4, 2, %g1
4000ca84: d0 00 80 01 ld [ %g2 + %g1 ], %o0
if ( !the_thread )
4000ca88: 80 a2 20 00 cmp %o0, 0
4000ca8c: 02 80 00 04 be 4000ca9c <rtems_iterate_over_all_threads+0x54><== NEVER TAKEN
4000ca90: b8 07 20 01 inc %i4
continue;
(*routine)(the_thread);
4000ca94: 9f c6 00 00 call %i0
4000ca98: 01 00 00 00 nop
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
4000ca9c: c2 16 e0 10 lduh [ %i3 + 0x10 ], %g1
4000caa0: 80 a7 00 01 cmp %i4, %g1
4000caa4: 28 bf ff f7 bleu,a 4000ca80 <rtems_iterate_over_all_threads+0x38>
4000caa8: 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++ ) {
4000caac: ba 07 60 01 inc %i5
4000cab0: 80 a7 60 04 cmp %i5, 4
4000cab4: 12 bf ff eb bne 4000ca60 <rtems_iterate_over_all_threads+0x18>
4000cab8: 83 2f 60 02 sll %i5, 2, %g1
4000cabc: 81 c7 e0 08 ret
4000cac0: 81 e8 00 00 restore
40009050 <rtems_partition_create>:
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
40009050: 9d e3 bf a0 save %sp, -96, %sp
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
40009054: 80 a6 20 00 cmp %i0, 0
40009058: 02 80 00 39 be 4000913c <rtems_partition_create+0xec>
4000905c: 82 10 20 03 mov 3, %g1
return RTEMS_INVALID_NAME;
if ( !starting_address )
40009060: 80 a6 60 00 cmp %i1, 0
40009064: 02 80 00 36 be 4000913c <rtems_partition_create+0xec>
40009068: 82 10 20 09 mov 9, %g1
return RTEMS_INVALID_ADDRESS;
if ( !id )
4000906c: 80 a7 60 00 cmp %i5, 0
40009070: 02 80 00 33 be 4000913c <rtems_partition_create+0xec> <== NEVER TAKEN
40009074: 80 a6 a0 00 cmp %i2, 0
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
40009078: 02 80 00 31 be 4000913c <rtems_partition_create+0xec>
4000907c: 82 10 20 08 mov 8, %g1
40009080: 80 a6 e0 00 cmp %i3, 0
40009084: 02 80 00 2e be 4000913c <rtems_partition_create+0xec>
40009088: 80 a6 80 1b cmp %i2, %i3
4000908c: 0a 80 00 2c bcs 4000913c <rtems_partition_create+0xec>
40009090: 80 8e e0 07 btst 7, %i3
40009094: 12 80 00 2a bne 4000913c <rtems_partition_create+0xec>
40009098: 80 8e 60 07 btst 7, %i1
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
4000909c: 12 80 00 28 bne 4000913c <rtems_partition_create+0xec>
400090a0: 82 10 20 09 mov 9, %g1
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
400090a4: 03 10 00 73 sethi %hi(0x4001cc00), %g1
400090a8: 82 10 62 d0 or %g1, 0x2d0, %g1 ! 4001ced0 <_Per_CPU_Information>
400090ac: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
400090b0: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
400090b4: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
* 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 );
400090b8: 23 10 00 71 sethi %hi(0x4001c400), %l1
400090bc: 40 00 07 41 call 4000adc0 <_Objects_Allocate>
400090c0: 90 14 63 88 or %l1, 0x388, %o0 ! 4001c788 <_Partition_Information>
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
400090c4: a0 92 20 00 orcc %o0, 0, %l0
400090c8: 32 80 00 06 bne,a 400090e0 <rtems_partition_create+0x90>
400090cc: f8 24 20 1c st %i4, [ %l0 + 0x1c ]
_Thread_Enable_dispatch();
400090d0: 40 00 0c 2b call 4000c17c <_Thread_Enable_dispatch>
400090d4: 01 00 00 00 nop
return RTEMS_TOO_MANY;
400090d8: 10 80 00 19 b 4000913c <rtems_partition_create+0xec>
400090dc: 82 10 20 05 mov 5, %g1 ! 5 <PROM_START+0x5>
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 );
400090e0: 92 10 00 1b mov %i3, %o1
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
400090e4: f2 24 20 10 st %i1, [ %l0 + 0x10 ]
the_partition->length = length;
400090e8: f4 24 20 14 st %i2, [ %l0 + 0x14 ]
the_partition->buffer_size = buffer_size;
400090ec: f6 24 20 18 st %i3, [ %l0 + 0x18 ]
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
400090f0: c0 24 20 20 clr [ %l0 + 0x20 ]
_Chain_Initialize( &the_partition->Memory, starting_address,
length / buffer_size, buffer_size );
400090f4: 40 00 30 5b call 40015260 <.udiv>
400090f8: 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,
400090fc: 92 10 00 19 mov %i1, %o1
length / buffer_size, buffer_size );
40009100: 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,
40009104: 96 10 00 1b mov %i3, %o3
40009108: b8 04 20 24 add %l0, 0x24, %i4
4000910c: 40 00 04 40 call 4000a20c <_Chain_Initialize>
40009110: 90 10 00 1c mov %i4, %o0
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
40009114: 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,
40009118: a2 14 63 88 or %l1, 0x388, %l1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4000911c: c6 04 60 1c ld [ %l1 + 0x1c ], %g3
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
40009120: c2 04 20 08 ld [ %l0 + 8 ], %g1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40009124: 85 28 a0 02 sll %g2, 2, %g2
40009128: e0 20 c0 02 st %l0, [ %g3 + %g2 ]
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
4000912c: f0 24 20 0c st %i0, [ %l0 + 0xc ]
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
40009130: 40 00 0c 13 call 4000c17c <_Thread_Enable_dispatch>
40009134: c2 27 40 00 st %g1, [ %i5 ]
return RTEMS_SUCCESSFUL;
40009138: 82 10 20 00 clr %g1
}
4000913c: 81 c7 e0 08 ret
40009140: 91 e8 00 01 restore %g0, %g1, %o0
40007b90 <rtems_partition_return_buffer>:
rtems_status_code rtems_partition_return_buffer(
rtems_id id,
void *buffer
)
{
40007b90: 9d e3 bf 98 save %sp, -104, %sp
RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Partition_Control *)
40007b94: 11 10 00 63 sethi %hi(0x40018c00), %o0
40007b98: 92 10 00 18 mov %i0, %o1
40007b9c: 90 12 22 2c or %o0, 0x22c, %o0
40007ba0: 40 00 07 31 call 40009864 <_Objects_Get>
40007ba4: 94 07 bf fc add %fp, -4, %o2
register Partition_Control *the_partition;
Objects_Locations location;
the_partition = _Partition_Get( id, &location );
switch ( location ) {
40007ba8: c2 07 bf fc ld [ %fp + -4 ], %g1
40007bac: 80 a0 60 00 cmp %g1, 0
40007bb0: 12 80 00 21 bne 40007c34 <rtems_partition_return_buffer+0xa4>
40007bb4: ba 10 00 08 mov %o0, %i5
)
{
void *starting;
void *ending;
starting = the_partition->starting_address;
40007bb8: 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);
40007bbc: c2 07 60 14 ld [ %i5 + 0x14 ], %g1
40007bc0: 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 ) &&
40007bc4: 80 a6 40 01 cmp %i1, %g1
40007bc8: 18 80 00 0b bgu 40007bf4 <rtems_partition_return_buffer+0x64>
40007bcc: 82 10 20 00 clr %g1
40007bd0: 80 a6 40 08 cmp %i1, %o0
40007bd4: 0a 80 00 09 bcs 40007bf8 <rtems_partition_return_buffer+0x68><== NEVER TAKEN
40007bd8: 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);
40007bdc: d2 07 60 18 ld [ %i5 + 0x18 ], %o1
40007be0: 40 00 2f 4a call 40013908 <.urem>
40007be4: 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 ) &&
40007be8: 80 a0 00 08 cmp %g0, %o0
40007bec: 10 80 00 02 b 40007bf4 <rtems_partition_return_buffer+0x64>
40007bf0: 82 60 3f ff subx %g0, -1, %g1
case OBJECTS_LOCAL:
if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) {
40007bf4: 80 a0 60 00 cmp %g1, 0
40007bf8: 02 80 00 0b be 40007c24 <rtems_partition_return_buffer+0x94>
40007bfc: 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 );
40007c00: 40 00 03 48 call 40008920 <_Chain_Append>
40007c04: 92 10 00 19 mov %i1, %o1
_Partition_Free_buffer( the_partition, buffer );
the_partition->number_of_used_blocks -= 1;
40007c08: c2 07 60 20 ld [ %i5 + 0x20 ], %g1
_Objects_Put( &the_partition->Object );
return RTEMS_SUCCESSFUL;
40007c0c: 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;
40007c10: 82 00 7f ff add %g1, -1, %g1
40007c14: 40 00 0a a1 call 4000a698 <_Thread_Enable_dispatch>
40007c18: c2 27 60 20 st %g1, [ %i5 + 0x20 ]
_Objects_Put( &the_partition->Object );
return RTEMS_SUCCESSFUL;
40007c1c: 81 c7 e0 08 ret
40007c20: 81 e8 00 00 restore
40007c24: 40 00 0a 9d call 4000a698 <_Thread_Enable_dispatch>
40007c28: b0 10 20 09 mov 9, %i0
}
_Objects_Put( &the_partition->Object );
return RTEMS_INVALID_ADDRESS;
40007c2c: 81 c7 e0 08 ret
40007c30: 81 e8 00 00 restore
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
40007c34: 81 c7 e0 08 ret
40007c38: 91 e8 20 04 restore %g0, 4, %o0
40007ef4 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
40007ef4: 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 *)
40007ef8: 11 10 00 63 sethi %hi(0x40018c00), %o0
40007efc: 92 10 00 18 mov %i0, %o1
40007f00: 90 12 20 cc or %o0, 0xcc, %o0
40007f04: 40 00 09 13 call 4000a350 <_Objects_Get>
40007f08: 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 ) {
40007f0c: c2 07 bf fc ld [ %fp + -4 ], %g1
40007f10: 80 a0 60 00 cmp %g1, 0
40007f14: 12 80 00 6d bne 400080c8 <rtems_rate_monotonic_period+0x1d4>
40007f18: ba 10 00 08 mov %o0, %i5
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
40007f1c: 37 10 00 64 sethi %hi(0x40019000), %i3
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
40007f20: c4 02 20 40 ld [ %o0 + 0x40 ], %g2
40007f24: b6 16 e3 10 or %i3, 0x310, %i3
40007f28: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1
40007f2c: 80 a0 80 01 cmp %g2, %g1
40007f30: 02 80 00 06 be 40007f48 <rtems_rate_monotonic_period+0x54>
40007f34: 80 a6 60 00 cmp %i1, 0
RTEMS_INLINE_ROUTINE void _Objects_Put(
Objects_Control *the_object
)
{
(void) the_object;
_Thread_Enable_dispatch();
40007f38: 40 00 0c 93 call 4000b184 <_Thread_Enable_dispatch>
40007f3c: b0 10 20 17 mov 0x17, %i0
_Objects_Put( &the_period->Object );
return RTEMS_NOT_OWNER_OF_RESOURCE;
40007f40: 81 c7 e0 08 ret
40007f44: 81 e8 00 00 restore
}
if ( length == RTEMS_PERIOD_STATUS ) {
40007f48: 12 80 00 0f bne 40007f84 <rtems_rate_monotonic_period+0x90>
40007f4c: 01 00 00 00 nop
switch ( the_period->state ) {
40007f50: c2 02 20 38 ld [ %o0 + 0x38 ], %g1
40007f54: 80 a0 60 00 cmp %g1, 0
40007f58: 02 80 00 07 be 40007f74 <rtems_rate_monotonic_period+0x80>
40007f5c: b0 10 20 0b mov 0xb, %i0
40007f60: 82 00 7f fd add %g1, -3, %g1
40007f64: 80 a0 60 01 cmp %g1, 1
40007f68: 18 80 00 03 bgu 40007f74 <rtems_rate_monotonic_period+0x80>
40007f6c: 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;
40007f70: b0 10 20 06 mov 6, %i0
40007f74: 40 00 0c 84 call 4000b184 <_Thread_Enable_dispatch>
40007f78: 01 00 00 00 nop
default: /* unreached -- only to remove warnings */
return_value = RTEMS_SUCCESSFUL;
break;
}
_Objects_Put( &the_period->Object );
return( return_value );
40007f7c: 81 c7 e0 08 ret
40007f80: 81 e8 00 00 restore
}
_ISR_Disable( level );
40007f84: 7f ff eb c3 call 40002e90 <sparc_disable_interrupts>
40007f88: 01 00 00 00 nop
40007f8c: b8 10 00 08 mov %o0, %i4
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
40007f90: c2 07 60 38 ld [ %i5 + 0x38 ], %g1
40007f94: 80 a0 60 00 cmp %g1, 0
40007f98: 12 80 00 15 bne 40007fec <rtems_rate_monotonic_period+0xf8>
40007f9c: 80 a0 60 02 cmp %g1, 2
_ISR_Enable( level );
40007fa0: 7f ff eb c0 call 40002ea0 <sparc_enable_interrupts>
40007fa4: 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 );
40007fa8: 90 10 00 1d mov %i5, %o0
40007fac: 7f ff ff b6 call 40007e84 <_Rate_monotonic_Initiate_statistics>
40007fb0: f2 27 60 3c st %i1, [ %i5 + 0x3c ]
the_period->state = RATE_MONOTONIC_ACTIVE;
40007fb4: 82 10 20 02 mov 2, %g1
40007fb8: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
40007fbc: 03 10 00 20 sethi %hi(0x40008000), %g1
40007fc0: 82 10 63 8c or %g1, 0x38c, %g1 ! 4000838c <_Rate_monotonic_Timeout>
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
40007fc4: c0 27 60 18 clr [ %i5 + 0x18 ]
the_watchdog->routine = routine;
40007fc8: c2 27 60 2c st %g1, [ %i5 + 0x2c ]
the_watchdog->id = id;
40007fcc: f0 27 60 30 st %i0, [ %i5 + 0x30 ]
the_watchdog->user_data = user_data;
40007fd0: c0 27 60 34 clr [ %i5 + 0x34 ]
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40007fd4: f2 27 60 1c st %i1, [ %i5 + 0x1c ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40007fd8: 11 10 00 63 sethi %hi(0x40018c00), %o0
40007fdc: 92 07 60 10 add %i5, 0x10, %o1
40007fe0: 40 00 0f aa call 4000be88 <_Watchdog_Insert>
40007fe4: 90 12 22 d0 or %o0, 0x2d0, %o0
40007fe8: 30 80 00 1c b,a 40008058 <rtems_rate_monotonic_period+0x164>
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Objects_Put( &the_period->Object );
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_ACTIVE ) {
40007fec: 12 80 00 1f bne 40008068 <rtems_rate_monotonic_period+0x174>
40007ff0: 80 a0 60 04 cmp %g1, 4
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
40007ff4: 7f ff ff 5b call 40007d60 <_Rate_monotonic_Update_statistics>
40007ff8: 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;
40007ffc: 82 10 20 01 mov 1, %g1
the_period->next_length = length;
40008000: 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;
40008004: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
the_period->next_length = length;
_ISR_Enable( level );
40008008: 7f ff eb a6 call 40002ea0 <sparc_enable_interrupts>
4000800c: 90 10 00 1c mov %i4, %o0
_Thread_Executing->Wait.id = the_period->Object.id;
40008010: d0 06 e0 18 ld [ %i3 + 0x18 ], %o0
40008014: c2 07 60 08 ld [ %i5 + 8 ], %g1
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
40008018: 13 00 00 10 sethi %hi(0x4000), %o1
4000801c: 40 00 0e 73 call 4000b9e8 <_Thread_Set_state>
40008020: c2 22 20 20 st %g1, [ %o0 + 0x20 ]
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
40008024: 7f ff eb 9b call 40002e90 <sparc_disable_interrupts>
40008028: 01 00 00 00 nop
local_state = the_period->state;
the_period->state = RATE_MONOTONIC_ACTIVE;
4000802c: 82 10 20 02 mov 2, %g1 ! 2 <PROM_START+0x2>
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
local_state = the_period->state;
40008030: f8 07 60 38 ld [ %i5 + 0x38 ], %i4
the_period->state = RATE_MONOTONIC_ACTIVE;
40008034: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
_ISR_Enable( level );
40008038: 7f ff eb 9a call 40002ea0 <sparc_enable_interrupts>
4000803c: 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 )
40008040: 80 a7 20 03 cmp %i4, 3
40008044: 12 80 00 05 bne 40008058 <rtems_rate_monotonic_period+0x164>
40008048: 01 00 00 00 nop
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
4000804c: d0 06 e0 18 ld [ %i3 + 0x18 ], %o0
40008050: 40 00 0b 87 call 4000ae6c <_Thread_Clear_state>
40008054: 13 00 00 10 sethi %hi(0x4000), %o1
40008058: 40 00 0c 4b call 4000b184 <_Thread_Enable_dispatch>
4000805c: b0 10 20 00 clr %i0
_Objects_Put( &the_period->Object );
return RTEMS_SUCCESSFUL;
40008060: 81 c7 e0 08 ret
40008064: 81 e8 00 00 restore
}
if ( the_period->state == RATE_MONOTONIC_EXPIRED ) {
40008068: 12 bf ff b6 bne 40007f40 <rtems_rate_monotonic_period+0x4c><== NEVER TAKEN
4000806c: b0 10 20 04 mov 4, %i0
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
40008070: 7f ff ff 3c call 40007d60 <_Rate_monotonic_Update_statistics>
40008074: 90 10 00 1d mov %i5, %o0
_ISR_Enable( level );
40008078: 7f ff eb 8a call 40002ea0 <sparc_enable_interrupts>
4000807c: 90 10 00 1c mov %i4, %o0
the_period->state = RATE_MONOTONIC_ACTIVE;
40008080: 82 10 20 02 mov 2, %g1
40008084: 92 07 60 10 add %i5, 0x10, %o1
40008088: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
the_period->next_length = length;
4000808c: f2 27 60 3c st %i1, [ %i5 + 0x3c ]
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40008090: f2 27 60 1c st %i1, [ %i5 + 0x1c ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40008094: 11 10 00 63 sethi %hi(0x40018c00), %o0
40008098: 40 00 0f 7c call 4000be88 <_Watchdog_Insert>
4000809c: 90 12 22 d0 or %o0, 0x2d0, %o0 ! 40018ed0 <_Watchdog_Ticks_chain>
400080a0: d0 07 60 40 ld [ %i5 + 0x40 ], %o0
400080a4: d2 07 60 3c ld [ %i5 + 0x3c ], %o1
400080a8: 03 10 00 60 sethi %hi(0x40018000), %g1
400080ac: c2 00 60 7c ld [ %g1 + 0x7c ], %g1 ! 4001807c <_Scheduler+0x34>
400080b0: 9f c0 40 00 call %g1
400080b4: b0 10 20 06 mov 6, %i0
400080b8: 40 00 0c 33 call 4000b184 <_Thread_Enable_dispatch>
400080bc: 01 00 00 00 nop
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Scheduler_Release_job(the_period->owner, the_period->next_length);
_Objects_Put( &the_period->Object );
return RTEMS_TIMEOUT;
400080c0: 81 c7 e0 08 ret
400080c4: 81 e8 00 00 restore
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
400080c8: b0 10 20 04 mov 4, %i0
}
400080cc: 81 c7 e0 08 ret
400080d0: 81 e8 00 00 restore
400080d4 <rtems_rate_monotonic_report_statistics_with_plugin>:
void rtems_rate_monotonic_report_statistics_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
400080d4: 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 )
400080d8: 80 a6 60 00 cmp %i1, 0
400080dc: 02 80 00 76 be 400082b4 <rtems_rate_monotonic_report_statistics_with_plugin+0x1e0><== NEVER TAKEN
400080e0: 90 10 00 18 mov %i0, %o0
return;
(*print)( context, "Period information by period\n" );
400080e4: 13 10 00 5c sethi %hi(0x40017000), %o1
400080e8: 9f c6 40 00 call %i1
400080ec: 92 12 63 a0 or %o1, 0x3a0, %o1 ! 400173a0 <rtems_filesystem_null_handlers+0x58>
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)( context, "--- CPU times are in seconds ---\n" );
400080f0: 90 10 00 18 mov %i0, %o0
400080f4: 13 10 00 5c sethi %hi(0x40017000), %o1
400080f8: 9f c6 40 00 call %i1
400080fc: 92 12 63 c0 or %o1, 0x3c0, %o1 ! 400173c0 <rtems_filesystem_null_handlers+0x78>
(*print)( context, "--- Wall times are in seconds ---\n" );
40008100: 90 10 00 18 mov %i0, %o0
40008104: 13 10 00 5c sethi %hi(0x40017000), %o1
40008108: 9f c6 40 00 call %i1
4000810c: 92 12 63 e8 or %o1, 0x3e8, %o1 ! 400173e8 <rtems_filesystem_null_handlers+0xa0>
Be sure to test the various cases.
(*print)( context,"\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
*/
(*print)( context, " ID OWNER COUNT MISSED "
40008110: 90 10 00 18 mov %i0, %o0
40008114: 13 10 00 5d sethi %hi(0x40017400), %o1
40008118: 9f c6 40 00 call %i1
4000811c: 92 12 60 10 or %o1, 0x10, %o1 ! 40017410 <rtems_filesystem_null_handlers+0xc8>
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
" "
#endif
" WALL TIME\n"
);
(*print)( context, " "
40008120: 90 10 00 18 mov %i0, %o0
40008124: 13 10 00 5d sethi %hi(0x40017400), %o1
40008128: 9f c6 40 00 call %i1
4000812c: 92 12 60 60 or %o1, 0x60, %o1 ! 40017460 <rtems_filesystem_null_handlers+0x118>
/*
* 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 ;
40008130: 03 10 00 63 sethi %hi(0x40018c00), %g1
40008134: 82 10 60 cc or %g1, 0xcc, %g1 ! 40018ccc <_Rate_monotonic_Information>
40008138: 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,
4000813c: 37 10 00 5d sethi %hi(0x40017400), %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,
40008140: 35 10 00 5d sethi %hi(0x40017400), %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,
40008144: 21 10 00 5d sethi %hi(0x40017400), %l0
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
40008148: 23 10 00 59 sethi %hi(0x40016400), %l1
4000814c: 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,
40008150: b6 16 e0 b0 or %i3, 0xb0, %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,
40008154: b4 16 a0 c8 or %i2, 0xc8, %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,
40008158: a0 14 20 e8 or %l0, 0xe8, %l0
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
4000815c: a2 14 61 f0 or %l1, 0x1f0, %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 ;
40008160: c2 07 20 0c ld [ %i4 + 0xc ], %g1
40008164: 80 a7 40 01 cmp %i5, %g1
40008168: 18 80 00 53 bgu 400082b4 <rtems_rate_monotonic_report_statistics_with_plugin+0x1e0>
4000816c: 90 10 00 1d mov %i5, %o0
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
40008170: 40 00 17 2f call 4000de2c <rtems_rate_monotonic_get_statistics>
40008174: 92 07 bf c8 add %fp, -56, %o1
if ( status != RTEMS_SUCCESSFUL )
40008178: 80 a2 20 00 cmp %o0, 0
4000817c: 32 bf ff f9 bne,a 40008160 <rtems_rate_monotonic_report_statistics_with_plugin+0x8c>
40008180: 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 );
40008184: 92 07 bf b0 add %fp, -80, %o1
40008188: 40 00 17 9a call 4000dff0 <rtems_rate_monotonic_get_status>
4000818c: 90 10 00 1d mov %i5, %o0
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
40008190: d0 07 bf b0 ld [ %fp + -80 ], %o0
40008194: 92 10 20 05 mov 5, %o1
40008198: 40 00 00 ac call 40008448 <rtems_object_get_name>
4000819c: 94 07 bf a0 add %fp, -96, %o2
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
400081a0: d8 1f bf c8 ldd [ %fp + -56 ], %o4
400081a4: 92 10 00 1b mov %i3, %o1
400081a8: 90 10 00 18 mov %i0, %o0
400081ac: 94 10 00 1d mov %i5, %o2
400081b0: 9f c6 40 00 call %i1
400081b4: 96 07 bf a0 add %fp, -96, %o3
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
400081b8: d2 07 bf c8 ld [ %fp + -56 ], %o1
400081bc: 80 a2 60 00 cmp %o1, 0
400081c0: 12 80 00 07 bne 400081dc <rtems_rate_monotonic_report_statistics_with_plugin+0x108>
400081c4: 94 07 bf a8 add %fp, -88, %o2
(*print)( context, "\n" );
400081c8: 90 10 00 18 mov %i0, %o0
400081cc: 9f c6 40 00 call %i1
400081d0: 92 10 00 11 mov %l1, %o1
continue;
400081d4: 10 bf ff e3 b 40008160 <rtems_rate_monotonic_report_statistics_with_plugin+0x8c>
400081d8: 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 );
400081dc: 40 00 0e 65 call 4000bb70 <_Timespec_Divide_by_integer>
400081e0: 90 07 bf e0 add %fp, -32, %o0
(*print)( context,
400081e4: d0 07 bf d4 ld [ %fp + -44 ], %o0
400081e8: 40 00 30 e6 call 40014580 <.div>
400081ec: 92 10 23 e8 mov 0x3e8, %o1
400081f0: a8 10 00 08 mov %o0, %l4
400081f4: d0 07 bf dc ld [ %fp + -36 ], %o0
400081f8: 40 00 30 e2 call 40014580 <.div>
400081fc: 92 10 23 e8 mov 0x3e8, %o1
40008200: c2 07 bf a8 ld [ %fp + -88 ], %g1
40008204: a4 10 00 08 mov %o0, %l2
40008208: d0 07 bf ac ld [ %fp + -84 ], %o0
4000820c: ea 07 bf d0 ld [ %fp + -48 ], %l5
40008210: e6 07 bf d8 ld [ %fp + -40 ], %l3
40008214: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
40008218: 40 00 30 da call 40014580 <.div>
4000821c: 92 10 23 e8 mov 0x3e8, %o1
40008220: 96 10 00 14 mov %l4, %o3
40008224: 98 10 00 13 mov %l3, %o4
40008228: 9a 10 00 12 mov %l2, %o5
4000822c: 94 10 00 15 mov %l5, %o2
40008230: d0 23 a0 60 st %o0, [ %sp + 0x60 ]
40008234: 92 10 00 1a mov %i2, %o1
40008238: 9f c6 40 00 call %i1
4000823c: 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);
40008240: d2 07 bf c8 ld [ %fp + -56 ], %o1
40008244: 94 07 bf a8 add %fp, -88, %o2
40008248: 40 00 0e 4a call 4000bb70 <_Timespec_Divide_by_integer>
4000824c: 90 07 bf f8 add %fp, -8, %o0
(*print)( context,
40008250: d0 07 bf ec ld [ %fp + -20 ], %o0
40008254: 40 00 30 cb call 40014580 <.div>
40008258: 92 10 23 e8 mov 0x3e8, %o1
4000825c: a8 10 00 08 mov %o0, %l4
40008260: d0 07 bf f4 ld [ %fp + -12 ], %o0
40008264: 40 00 30 c7 call 40014580 <.div>
40008268: 92 10 23 e8 mov 0x3e8, %o1
4000826c: c2 07 bf a8 ld [ %fp + -88 ], %g1
40008270: a4 10 00 08 mov %o0, %l2
40008274: d0 07 bf ac ld [ %fp + -84 ], %o0
40008278: ea 07 bf e8 ld [ %fp + -24 ], %l5
4000827c: e6 07 bf f0 ld [ %fp + -16 ], %l3
40008280: 92 10 23 e8 mov 0x3e8, %o1
40008284: 40 00 30 bf call 40014580 <.div>
40008288: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
4000828c: 92 10 00 10 mov %l0, %o1
40008290: d0 23 a0 60 st %o0, [ %sp + 0x60 ]
40008294: 94 10 00 15 mov %l5, %o2
40008298: 90 10 00 18 mov %i0, %o0
4000829c: 96 10 00 14 mov %l4, %o3
400082a0: 98 10 00 13 mov %l3, %o4
400082a4: 9f c6 40 00 call %i1
400082a8: 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++ ) {
400082ac: 10 bf ff ad b 40008160 <rtems_rate_monotonic_report_statistics_with_plugin+0x8c>
400082b0: ba 07 60 01 inc %i5
400082b4: 81 c7 e0 08 ret
400082b8: 81 e8 00 00 restore
4000845c <rtems_rbheap_allocate>:
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
4000845c: 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;
40008460: fa 06 20 30 ld [ %i0 + 0x30 ], %i5
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
40008464: 90 10 00 19 mov %i1, %o0
40008468: 92 10 00 1d mov %i5, %o1
4000846c: 40 00 2d cb call 40013b98 <.urem>
40008470: b6 10 00 19 mov %i1, %i3
if (excess > 0) {
40008474: 80 a2 20 00 cmp %o0, 0
40008478: 02 80 00 05 be 4000848c <rtems_rbheap_allocate+0x30>
4000847c: 80 a6 c0 19 cmp %i3, %i1
value += alignment - excess;
40008480: b6 06 40 1d add %i1, %i5, %i3
40008484: 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) {
40008488: 80 a6 c0 19 cmp %i3, %i1
4000848c: 0a 80 00 04 bcs 4000849c <rtems_rbheap_allocate+0x40> <== NEVER TAKEN
40008490: 80 a6 60 00 cmp %i1, 0
40008494: 32 80 00 04 bne,a 400084a4 <rtems_rbheap_allocate+0x48>
40008498: c2 06 00 00 ld [ %i0 ], %g1
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
4000849c: 81 c7 e0 08 ret
400084a0: 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);
400084a4: 84 06 20 04 add %i0, 4, %g2
rtems_rbheap_chunk *big_enough = NULL;
400084a8: ba 10 20 00 clr %i5
while (current != tail && big_enough == NULL) {
400084ac: 80 a7 60 00 cmp %i5, 0
400084b0: 12 80 00 0a bne 400084d8 <rtems_rbheap_allocate+0x7c>
400084b4: 80 a0 40 02 cmp %g1, %g2
400084b8: 02 80 00 09 be 400084dc <rtems_rbheap_allocate+0x80>
400084bc: 80 a7 60 00 cmp %i5, 0
rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current;
if (free_chunk->size >= size) {
400084c0: c6 00 60 1c ld [ %g1 + 0x1c ], %g3
400084c4: 80 a0 c0 1b cmp %g3, %i3
400084c8: ba 40 3f ff addx %g0, -1, %i5
400084cc: 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
400084d0: 10 bf ff f7 b 400084ac <rtems_rbheap_allocate+0x50>
400084d4: 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) {
400084d8: 80 a7 60 00 cmp %i5, 0
400084dc: 02 bf ff f0 be 4000849c <rtems_rbheap_allocate+0x40>
400084e0: 01 00 00 00 nop
uintptr_t free_size = free_chunk->size;
400084e4: f4 07 60 1c ld [ %i5 + 0x1c ], %i2
if (free_size > aligned_size) {
400084e8: 80 a6 80 1b cmp %i2, %i3
400084ec: 28 80 00 14 bleu,a 4000853c <rtems_rbheap_allocate+0xe0>
400084f0: c4 07 40 00 ld [ %i5 ], %g2
rtems_rbheap_chunk *new_chunk = get_chunk(control);
400084f4: 7f ff ff 56 call 4000824c <get_chunk>
400084f8: 90 10 00 18 mov %i0, %o0
if (new_chunk != NULL) {
400084fc: b8 92 20 00 orcc %o0, 0, %i4
40008500: 02 bf ff e7 be 4000849c <rtems_rbheap_allocate+0x40>
40008504: 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;
40008508: 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;
4000850c: f4 27 60 1c st %i2, [ %i5 + 0x1c ]
new_chunk->begin = free_chunk->begin + new_free_size;
new_chunk->size = aligned_size;
40008510: 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;
40008514: b4 06 80 01 add %i2, %g1, %i2
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
40008518: c0 27 20 04 clr [ %i4 + 4 ]
4000851c: f4 27 20 18 st %i2, [ %i4 + 0x18 ]
40008520: c0 27 00 00 clr [ %i4 ]
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert(tree, &chunk->tree_node);
40008524: 90 06 20 18 add %i0, 0x18, %o0
40008528: 40 00 06 c3 call 4000a034 <_RBTree_Insert>
4000852c: 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;
40008530: f0 07 20 18 ld [ %i4 + 0x18 ], %i0
40008534: 81 c7 e0 08 ret
40008538: 81 e8 00 00 restore
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
4000853c: 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;
40008540: f0 07 60 18 ld [ %i5 + 0x18 ], %i0
next->previous = previous;
40008544: c2 20 a0 04 st %g1, [ %g2 + 4 ]
previous->next = next;
40008548: c4 20 40 00 st %g2, [ %g1 ]
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
4000854c: c0 27 60 04 clr [ %i5 + 4 ]
40008550: c0 27 40 00 clr [ %i5 ]
}
}
}
return ptr;
}
40008554: 81 c7 e0 08 ret
40008558: 81 e8 00 00 restore
40012560 <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
40012560: 9d e3 bf 98 save %sp, -104, %sp
register Thread_Control *the_thread;
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
40012564: 80 a6 60 00 cmp %i1, 0
40012568: 02 80 00 35 be 4001263c <rtems_signal_send+0xdc>
4001256c: 82 10 20 0a mov 0xa, %g1
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
40012570: 90 10 00 18 mov %i0, %o0
40012574: 40 00 0c d3 call 400158c0 <_Thread_Get>
40012578: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
4001257c: c2 07 bf fc ld [ %fp + -4 ], %g1
40012580: 80 a0 60 00 cmp %g1, 0
40012584: 12 80 00 2d bne 40012638 <rtems_signal_send+0xd8>
40012588: b8 10 00 08 mov %o0, %i4
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
4001258c: fa 02 21 4c ld [ %o0 + 0x14c ], %i5
asr = &api->Signal;
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
40012590: c2 07 60 0c ld [ %i5 + 0xc ], %g1
40012594: 80 a0 60 00 cmp %g1, 0
40012598: 02 80 00 24 be 40012628 <rtems_signal_send+0xc8>
4001259c: 01 00 00 00 nop
if ( asr->is_enabled ) {
400125a0: c2 0f 60 08 ldub [ %i5 + 8 ], %g1
400125a4: 80 a0 60 00 cmp %g1, 0
400125a8: 02 80 00 15 be 400125fc <rtems_signal_send+0x9c>
400125ac: 01 00 00 00 nop
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_lock_ISR_disable_and_acquire( &asr->Lock, _level );
400125b0: 7f ff e5 fc call 4000bda0 <sparc_disable_interrupts>
400125b4: 01 00 00 00 nop
*signal_set |= signals;
400125b8: c2 07 60 14 ld [ %i5 + 0x14 ], %g1
400125bc: b2 10 40 19 or %g1, %i1, %i1
400125c0: f2 27 60 14 st %i1, [ %i5 + 0x14 ]
_ISR_lock_Release_and_ISR_enable( &asr->Lock, _level );
400125c4: 7f ff e5 fb call 4000bdb0 <sparc_enable_interrupts>
400125c8: 01 00 00 00 nop
ISR_Level level;
_ISR_Disable_without_giant( level );
#endif
isr_nest_level = _ISR_Nest_level;
400125cc: 03 10 00 a8 sethi %hi(0x4002a000), %g1
400125d0: 82 10 60 e0 or %g1, 0xe0, %g1 ! 4002a0e0 <_Per_CPU_Information>
return idle->Wait.return_code;
}
RTEMS_INLINE_ROUTINE void _Thread_Signal_notification( Thread_Control *thread )
{
if ( _ISR_Is_in_progress() && _Thread_Is_executing( thread ) ) {
400125d4: c4 00 60 0c ld [ %g1 + 0xc ], %g2
400125d8: 80 a0 a0 00 cmp %g2, 0
400125dc: 02 80 00 0f be 40012618 <rtems_signal_send+0xb8>
400125e0: 01 00 00 00 nop
400125e4: c4 00 60 18 ld [ %g1 + 0x18 ], %g2
400125e8: 80 a7 00 02 cmp %i4, %g2
400125ec: 12 80 00 0b bne 40012618 <rtems_signal_send+0xb8> <== NEVER TAKEN
400125f0: 84 10 20 01 mov 1, %g2
_Thread_Dispatch_necessary = true;
400125f4: c4 28 60 14 stb %g2, [ %g1 + 0x14 ]
400125f8: 30 80 00 08 b,a 40012618 <rtems_signal_send+0xb8>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_lock_ISR_disable_and_acquire( &asr->Lock, _level );
400125fc: 7f ff e5 e9 call 4000bda0 <sparc_disable_interrupts>
40012600: 01 00 00 00 nop
*signal_set |= signals;
40012604: c2 07 60 18 ld [ %i5 + 0x18 ], %g1
40012608: b2 10 40 19 or %g1, %i1, %i1
4001260c: f2 27 60 18 st %i1, [ %i5 + 0x18 ]
_ISR_lock_Release_and_ISR_enable( &asr->Lock, _level );
40012610: 7f ff e5 e8 call 4000bdb0 <sparc_enable_interrupts>
40012614: 01 00 00 00 nop
40012618: 40 00 0c 9d call 4001588c <_Thread_Enable_dispatch>
4001261c: 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;
40012620: 10 80 00 07 b 4001263c <rtems_signal_send+0xdc>
40012624: 82 10 20 00 clr %g1 ! 0 <PROM_START>
40012628: 40 00 0c 99 call 4001588c <_Thread_Enable_dispatch>
4001262c: 01 00 00 00 nop
}
_Objects_Put( &the_thread->Object );
return RTEMS_NOT_DEFINED;
40012630: 10 80 00 03 b 4001263c <rtems_signal_send+0xdc>
40012634: 82 10 20 0b mov 0xb, %g1 ! b <PROM_START+0xb>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
40012638: 82 10 20 04 mov 4, %g1
}
4001263c: 81 c7 e0 08 ret
40012640: 91 e8 00 01 restore %g0, %g1, %o0
4000c5bc <rtems_status_code_to_errno>:
[RTEMS_IO_ERROR] = EIO,
[RTEMS_PROXY_BLOCKING] = EIO
};
int rtems_status_code_to_errno(rtems_status_code sc)
{
4000c5bc: 9d e3 bf a0 save %sp, -96, %sp
if (sc == RTEMS_SUCCESSFUL) {
4000c5c0: 80 a6 20 00 cmp %i0, 0
4000c5c4: 02 80 00 0d be 4000c5f8 <rtems_status_code_to_errno+0x3c>
4000c5c8: 82 10 20 00 clr %g1
return 0;
} else {
int eno = EINVAL;
if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
4000c5cc: 80 a6 20 1c cmp %i0, 0x1c
4000c5d0: 18 80 00 06 bgu 4000c5e8 <rtems_status_code_to_errno+0x2c><== NEVER TAKEN
4000c5d4: ba 10 20 16 mov 0x16, %i5
eno = status_code_to_errno [sc];
4000c5d8: b1 2e 20 02 sll %i0, 2, %i0
4000c5dc: 03 10 00 56 sethi %hi(0x40015800), %g1
4000c5e0: 82 10 61 80 or %g1, 0x180, %g1 ! 40015980 <status_code_to_errno>
4000c5e4: fa 00 40 18 ld [ %g1 + %i0 ], %i5
}
errno = eno;
4000c5e8: 40 00 0a 39 call 4000eecc <__errno>
4000c5ec: 01 00 00 00 nop
return -1;
4000c5f0: 82 10 3f ff mov -1, %g1 ! ffffffff <RAM_END+0xbfbfffff>
if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
eno = status_code_to_errno [sc];
}
errno = eno;
4000c5f4: fa 22 00 00 st %i5, [ %o0 ]
return -1;
}
}
4000c5f8: 81 c7 e0 08 ret
4000c5fc: 91 e8 00 01 restore %g0, %g1, %o0
4001069c <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
4001069c: 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 )
400106a0: 80 a6 a0 00 cmp %i2, 0
400106a4: 02 80 00 56 be 400107fc <rtems_task_mode+0x160>
400106a8: 82 10 20 09 mov 9, %g1
400106ac: 37 10 00 6b sethi %hi(0x4001ac00), %i3
400106b0: b6 16 e1 60 or %i3, 0x160, %i3 ! 4001ad60 <_Per_CPU_Information>
400106b4: fa 06 e0 18 ld [ %i3 + 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;
400106b8: 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 ];
400106bc: f8 07 61 4c ld [ %i5 + 0x14c ], %i4
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
400106c0: 80 a0 00 01 cmp %g0, %g1
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
400106c4: 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;
400106c8: a0 60 3f ff subx %g0, -1, %l0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
400106cc: 80 a0 60 00 cmp %g1, 0
400106d0: 02 80 00 03 be 400106dc <rtems_task_mode+0x40>
400106d4: a1 2c 20 08 sll %l0, 8, %l0
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
400106d8: a0 14 22 00 or %l0, 0x200, %l0
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
400106dc: c2 0f 20 08 ldub [ %i4 + 8 ], %g1
400106e0: 80 a0 00 01 cmp %g0, %g1
old_mode |= _ISR_Get_level();
400106e4: 7f ff ed e4 call 4000be74 <_CPU_ISR_Get_level>
400106e8: a2 60 3f ff subx %g0, -1, %l1
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;
400106ec: a3 2c 60 0a sll %l1, 0xa, %l1
400106f0: 90 14 40 08 or %l1, %o0, %o0
old_mode |= _ISR_Get_level();
400106f4: a0 12 00 10 or %o0, %l0, %l0
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK ) {
400106f8: 80 8e 61 00 btst 0x100, %i1
400106fc: 02 80 00 06 be 40010714 <rtems_task_mode+0x78>
40010700: e0 26 80 00 st %l0, [ %i2 ]
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
40010704: 83 36 20 08 srl %i0, 8, %g1
40010708: 82 18 60 01 xor %g1, 1, %g1
4001070c: 82 08 60 01 and %g1, 1, %g1
) {
return RTEMS_NOT_IMPLEMENTED;
}
#endif
executing->is_preemptible = _Modes_Is_preempt( mode_set );
40010710: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ]
}
if ( mask & RTEMS_TIMESLICE_MASK ) {
40010714: 80 8e 62 00 btst 0x200, %i1
40010718: 02 80 00 0b be 40010744 <rtems_task_mode+0xa8>
4001071c: 80 8e 60 0f btst 0xf, %i1
if ( _Modes_Is_timeslice(mode_set) ) {
40010720: 80 8e 22 00 btst 0x200, %i0
40010724: 22 80 00 07 be,a 40010740 <rtems_task_mode+0xa4>
40010728: c0 27 60 78 clr [ %i5 + 0x78 ]
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
4001072c: 82 10 20 01 mov 1, %g1
40010730: c2 27 60 78 st %g1, [ %i5 + 0x78 ]
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
40010734: 03 10 00 69 sethi %hi(0x4001a400), %g1
40010738: c2 00 63 f0 ld [ %g1 + 0x3f0 ], %g1 ! 4001a7f0 <_Thread_Ticks_per_timeslice>
4001073c: c2 27 60 74 st %g1, [ %i5 + 0x74 ]
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
40010740: 80 8e 60 0f btst 0xf, %i1
40010744: 02 80 00 06 be 4001075c <rtems_task_mode+0xc0>
40010748: 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 );
4001074c: 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 ) );
40010750: 7f ff c8 af call 40002a0c <sparc_enable_interrupts>
40010754: 91 2a 20 08 sll %o0, 8, %o0
/*
* This is specific to the RTEMS API
*/
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
40010758: 80 8e 64 00 btst 0x400, %i1
4001075c: 02 80 00 14 be 400107ac <rtems_task_mode+0x110>
40010760: 84 10 20 00 clr %g2
bool is_asr_enabled = !_Modes_Is_asr_disabled( mode_set );
if ( is_asr_enabled != asr->is_enabled ) {
40010764: c2 0f 20 08 ldub [ %i4 + 8 ], %g1
/*
* This is specific to the RTEMS API
*/
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
bool is_asr_enabled = !_Modes_Is_asr_disabled( mode_set );
40010768: b1 36 20 0a srl %i0, 0xa, %i0
4001076c: b0 1e 20 01 xor %i0, 1, %i0
40010770: b0 0e 20 01 and %i0, 1, %i0
if ( is_asr_enabled != asr->is_enabled ) {
40010774: 80 a6 00 01 cmp %i0, %g1
40010778: 02 80 00 0d be 400107ac <rtems_task_mode+0x110>
4001077c: 01 00 00 00 nop
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_lock_ISR_disable_and_acquire( &asr->Lock, _level );
40010780: 7f ff c8 9f call 400029fc <sparc_disable_interrupts>
40010784: f0 2f 20 08 stb %i0, [ %i4 + 8 ]
_signals = asr->signals_pending;
40010788: c2 07 20 18 ld [ %i4 + 0x18 ], %g1
asr->signals_pending = asr->signals_posted;
4001078c: c4 07 20 14 ld [ %i4 + 0x14 ], %g2
asr->signals_posted = _signals;
40010790: c2 27 20 14 st %g1, [ %i4 + 0x14 ]
rtems_signal_set _signals;
ISR_Level _level;
_ISR_lock_ISR_disable_and_acquire( &asr->Lock, _level );
_signals = asr->signals_pending;
asr->signals_pending = asr->signals_posted;
40010794: c4 27 20 18 st %g2, [ %i4 + 0x18 ]
asr->signals_posted = _signals;
_ISR_lock_Release_and_ISR_enable( &asr->Lock, _level );
40010798: 7f ff c8 9d call 40002a0c <sparc_enable_interrupts>
4001079c: 01 00 00 00 nop
asr->is_enabled = is_asr_enabled;
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
400107a0: c2 07 20 14 ld [ %i4 + 0x14 ], %g1
400107a4: 80 a0 00 01 cmp %g0, %g1
400107a8: 84 40 20 00 addx %g0, 0, %g2
ISR_Level level;
_ISR_Disable_without_giant( level );
#endif
enabled = _Thread_Dispatch_disable_level == 0;
400107ac: c6 06 e0 10 ld [ %i3 + 0x10 ], %g3
static void _RTEMS_Tasks_Dispatch_if_necessary(
Thread_Control *executing,
bool needs_asr_dispatching
)
{
if ( _Thread_Dispatch_is_enabled() ) {
400107b0: 80 a0 e0 00 cmp %g3, 0
400107b4: 12 80 00 12 bne 400107fc <rtems_task_mode+0x160>
400107b8: 82 10 20 00 clr %g1
ISR_Level level;
_ISR_Disable_without_giant( level );
#endif
if ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) {
400107bc: c2 06 e0 1c ld [ %i3 + 0x1c ], %g1
400107c0: 80 a7 40 01 cmp %i5, %g1
400107c4: 02 80 00 09 be 400107e8 <rtems_task_mode+0x14c>
400107c8: 80 88 a0 ff btst 0xff, %g2
400107cc: c2 0f 60 70 ldub [ %i5 + 0x70 ], %g1
400107d0: 80 a0 60 00 cmp %g1, 0
400107d4: 02 80 00 05 be 400107e8 <rtems_task_mode+0x14c> <== NEVER TAKEN
400107d8: 80 88 a0 ff btst 0xff, %g2
dispatch_necessary = true;
_Thread_Dispatch_necessary = dispatch_necessary;
400107dc: 82 10 20 01 mov 1, %g1
400107e0: c2 2e e0 14 stb %g1, [ %i3 + 0x14 ]
400107e4: 30 80 00 03 b,a 400107f0 <rtems_task_mode+0x154>
#if defined( RTEMS_SMP )
_ISR_Enable_without_giant( level );
#endif
if ( dispatch_necessary ) {
400107e8: 02 80 00 05 be 400107fc <rtems_task_mode+0x160>
400107ec: 82 10 20 00 clr %g1
_Thread_Dispatch();
400107f0: 7f ff e9 76 call 4000adc8 <_Thread_Dispatch>
400107f4: 01 00 00 00 nop
}
}
_RTEMS_Tasks_Dispatch_if_necessary( executing, needs_asr_dispatching );
return RTEMS_SUCCESSFUL;
400107f8: 82 10 20 00 clr %g1 ! 0 <PROM_START>
}
400107fc: 81 c7 e0 08 ret
40010800: 91 e8 00 01 restore %g0, %g1, %o0
4000b87c <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
4000b87c: 9d e3 bf 98 save %sp, -104, %sp
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
4000b880: 80 a6 60 00 cmp %i1, 0
4000b884: 02 80 00 08 be 4000b8a4 <rtems_task_set_priority+0x28>
4000b888: 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 ) );
4000b88c: 03 10 00 67 sethi %hi(0x40019c00), %g1
4000b890: c4 08 62 a4 ldub [ %g1 + 0x2a4 ], %g2 ! 40019ea4 <rtems_maximum_priority>
4000b894: 80 a6 40 02 cmp %i1, %g2
4000b898: 18 80 00 1e bgu 4000b910 <rtems_task_set_priority+0x94>
4000b89c: 82 10 20 13 mov 0x13, %g1
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
4000b8a0: 80 a6 a0 00 cmp %i2, 0
4000b8a4: 02 80 00 1b be 4000b910 <rtems_task_set_priority+0x94>
4000b8a8: 82 10 20 09 mov 9, %g1
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
4000b8ac: 90 10 00 18 mov %i0, %o0
4000b8b0: 40 00 09 58 call 4000de10 <_Thread_Get>
4000b8b4: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
4000b8b8: c2 07 bf fc ld [ %fp + -4 ], %g1
4000b8bc: 80 a0 60 00 cmp %g1, 0
4000b8c0: 12 80 00 14 bne 4000b910 <rtems_task_set_priority+0x94>
4000b8c4: 82 10 20 04 mov 4, %g1
case OBJECTS_LOCAL:
*old_priority = _RTEMS_tasks_Priority_from_Core(
4000b8c8: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
the_thread->current_priority
);
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
4000b8cc: 80 a6 60 00 cmp %i1, 0
4000b8d0: 02 80 00 0d be 4000b904 <rtems_task_set_priority+0x88>
4000b8d4: c2 26 80 00 st %g1, [ %i2 ]
the_thread->real_priority = _RTEMS_tasks_Priority_to_Core(
new_priority
);
if ( the_thread->resource_count == 0 ||
4000b8d8: c2 02 20 1c ld [ %o0 + 0x1c ], %g1
4000b8dc: 80 a0 60 00 cmp %g1, 0
4000b8e0: 02 80 00 06 be 4000b8f8 <rtems_task_set_priority+0x7c>
4000b8e4: f2 22 20 18 st %i1, [ %o0 + 0x18 ]
4000b8e8: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
4000b8ec: 80 a0 40 19 cmp %g1, %i1
4000b8f0: 08 80 00 05 bleu 4000b904 <rtems_task_set_priority+0x88> <== ALWAYS TAKEN
4000b8f4: 01 00 00 00 nop
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
4000b8f8: 92 10 00 19 mov %i1, %o1
4000b8fc: 40 00 08 36 call 4000d9d4 <_Thread_Change_priority>
4000b900: 94 10 20 00 clr %o2
4000b904: 40 00 09 36 call 4000dddc <_Thread_Enable_dispatch>
4000b908: 01 00 00 00 nop
4000b90c: 82 10 20 00 clr %g1 ! 0 <PROM_START>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4000b910: 81 c7 e0 08 ret
4000b914: 91 e8 00 01 restore %g0, %g1, %o0
4000b09c <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
4000b09c: 9d e3 bf 98 save %sp, -104, %sp
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
4000b0a0: 11 10 00 73 sethi %hi(0x4001cc00), %o0
4000b0a4: 92 10 00 18 mov %i0, %o1
4000b0a8: 90 12 23 10 or %o0, 0x310, %o0
4000b0ac: 40 00 06 15 call 4000c900 <_Objects_Get>
4000b0b0: 94 07 bf fc add %fp, -4, %o2
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
4000b0b4: c2 07 bf fc ld [ %fp + -4 ], %g1
4000b0b8: 80 a0 60 00 cmp %g1, 0
4000b0bc: 12 80 00 0c bne 4000b0ec <rtems_timer_cancel+0x50>
4000b0c0: 01 00 00 00 nop
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
4000b0c4: c2 02 20 38 ld [ %o0 + 0x38 ], %g1
4000b0c8: 80 a0 60 04 cmp %g1, 4
4000b0cc: 02 80 00 04 be 4000b0dc <rtems_timer_cancel+0x40> <== NEVER TAKEN
4000b0d0: 01 00 00 00 nop
(void) _Watchdog_Remove( &the_timer->Ticker );
4000b0d4: 40 00 0c ec call 4000e484 <_Watchdog_Remove>
4000b0d8: 90 02 20 10 add %o0, 0x10, %o0
4000b0dc: 40 00 09 71 call 4000d6a0 <_Thread_Enable_dispatch>
4000b0e0: b0 10 20 00 clr %i0
_Objects_Put( &the_timer->Object );
return RTEMS_SUCCESSFUL;
4000b0e4: 81 c7 e0 08 ret
4000b0e8: 81 e8 00 00 restore
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4000b0ec: 81 c7 e0 08 ret
4000b0f0: 91 e8 20 04 restore %g0, 4, %o0
4000b104 <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
4000b104: 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;
4000b108: 03 10 00 6f sethi %hi(0x4001bc00), %g1
4000b10c: f8 00 63 e0 ld [ %g1 + 0x3e0 ], %i4 ! 4001bfe0 <_Timer_server>
if ( !timer_server )
4000b110: 80 a7 20 00 cmp %i4, 0
4000b114: 02 80 00 33 be 4000b1e0 <rtems_timer_server_fire_when+0xdc>
4000b118: 82 10 20 0e mov 0xe, %g1
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set() )
4000b11c: 03 10 00 70 sethi %hi(0x4001c000), %g1
4000b120: c4 08 60 78 ldub [ %g1 + 0x78 ], %g2 ! 4001c078 <_TOD+0x18>
4000b124: 80 a0 a0 00 cmp %g2, 0
4000b128: 02 80 00 2e be 4000b1e0 <rtems_timer_server_fire_when+0xdc><== NEVER TAKEN
4000b12c: 82 10 20 0b mov 0xb, %g1
return RTEMS_NOT_DEFINED;
if ( !routine )
4000b130: 80 a6 a0 00 cmp %i2, 0
4000b134: 02 80 00 2b be 4000b1e0 <rtems_timer_server_fire_when+0xdc>
4000b138: 82 10 20 09 mov 9, %g1
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
4000b13c: 7f ff fb d9 call 4000a0a0 <_TOD_Validate>
4000b140: 90 10 00 19 mov %i1, %o0
4000b144: 80 a2 20 00 cmp %o0, 0
4000b148: 02 80 00 26 be 4000b1e0 <rtems_timer_server_fire_when+0xdc>
4000b14c: 82 10 20 14 mov 0x14, %g1
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
4000b150: 7f ff fb 9a call 40009fb8 <_TOD_To_seconds>
4000b154: 90 10 00 19 mov %i1, %o0
if ( seconds <= _TOD_Seconds_since_epoch() )
4000b158: 40 00 03 db call 4000c0c4 <_TOD_Seconds_since_epoch>
4000b15c: b2 10 00 08 mov %o0, %i1
4000b160: 80 a6 40 08 cmp %i1, %o0
4000b164: 08 80 00 1f bleu 4000b1e0 <rtems_timer_server_fire_when+0xdc>
4000b168: 82 10 20 14 mov 0x14, %g1
4000b16c: 11 10 00 6f sethi %hi(0x4001bc00), %o0
4000b170: 92 10 00 18 mov %i0, %o1
4000b174: 90 12 23 a4 or %o0, 0x3a4, %o0
4000b178: 40 00 06 b5 call 4000cc4c <_Objects_Get>
4000b17c: 94 07 bf fc add %fp, -4, %o2
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
4000b180: c2 07 bf fc ld [ %fp + -4 ], %g1
4000b184: 80 a0 60 00 cmp %g1, 0
4000b188: 12 80 00 15 bne 4000b1dc <rtems_timer_server_fire_when+0xd8>
4000b18c: ba 10 00 08 mov %o0, %i5
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
4000b190: 40 00 0d df call 4000e90c <_Watchdog_Remove>
4000b194: 90 02 20 10 add %o0, 0x10, %o0
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
4000b198: 82 10 20 03 mov 3, %g1
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
4000b19c: c0 27 60 18 clr [ %i5 + 0x18 ]
4000b1a0: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
the_watchdog->routine = routine;
4000b1a4: f4 27 60 2c st %i2, [ %i5 + 0x2c ]
the_watchdog->id = id;
4000b1a8: 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();
4000b1ac: 40 00 03 c6 call 4000c0c4 <_TOD_Seconds_since_epoch>
4000b1b0: f6 27 60 34 st %i3, [ %i5 + 0x34 ]
(*timer_server->schedule_operation)( timer_server, the_timer );
4000b1b4: 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();
4000b1b8: 90 26 40 08 sub %i1, %o0, %o0
(*timer_server->schedule_operation)( timer_server, the_timer );
4000b1bc: 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();
4000b1c0: d0 27 60 1c st %o0, [ %i5 + 0x1c ]
(*timer_server->schedule_operation)( timer_server, the_timer );
4000b1c4: 9f c0 40 00 call %g1
4000b1c8: 90 10 00 1c mov %i4, %o0
4000b1cc: 40 00 0a 2d call 4000da80 <_Thread_Enable_dispatch>
4000b1d0: 01 00 00 00 nop
_Objects_Put( &the_timer->Object );
return RTEMS_SUCCESSFUL;
4000b1d4: 10 80 00 03 b 4000b1e0 <rtems_timer_server_fire_when+0xdc>
4000b1d8: 82 10 20 00 clr %g1 ! 0 <PROM_START>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
4000b1dc: 82 10 20 04 mov 4, %g1
}
4000b1e0: 81 c7 e0 08 ret
4000b1e4: 91 e8 00 01 restore %g0, %g1, %o0
400079a4 <sched_get_priority_max>:
#include <rtems/posix/priorityimpl.h>
int sched_get_priority_max(
int policy
)
{
400079a4: 9d e3 bf a0 save %sp, -96, %sp
400079a8: 80 a6 20 04 cmp %i0, 4
400079ac: 18 80 00 06 bgu 400079c4 <sched_get_priority_max+0x20>
400079b0: 82 10 20 01 mov 1, %g1
400079b4: b1 28 40 18 sll %g1, %i0, %i0
400079b8: 80 8e 20 17 btst 0x17, %i0
default:
rtems_set_errno_and_return_minus_one( EINVAL );
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
400079bc: 12 80 00 08 bne 400079dc <sched_get_priority_max+0x38> <== ALWAYS TAKEN
400079c0: 03 10 00 7a sethi %hi(0x4001e800), %g1
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
400079c4: 40 00 20 af call 4000fc80 <__errno>
400079c8: b0 10 3f ff mov -1, %i0
400079cc: 82 10 20 16 mov 0x16, %g1
400079d0: c2 22 00 00 st %g1, [ %o0 ]
400079d4: 81 c7 e0 08 ret
400079d8: 81 e8 00 00 restore
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
400079dc: f0 08 60 dc ldub [ %g1 + 0xdc ], %i0
}
400079e0: 81 c7 e0 08 ret
400079e4: 91 ee 3f ff restore %i0, -1, %o0
400079e8 <sched_get_priority_min>:
* 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
*/
int sched_get_priority_min(
int policy
)
{
400079e8: 9d e3 bf a0 save %sp, -96, %sp
400079ec: 80 a6 20 04 cmp %i0, 4
400079f0: 18 80 00 06 bgu 40007a08 <sched_get_priority_min+0x20>
400079f4: 82 10 20 01 mov 1, %g1
400079f8: 83 28 40 18 sll %g1, %i0, %g1
400079fc: 80 88 60 17 btst 0x17, %g1
default:
rtems_set_errno_and_return_minus_one( EINVAL );
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
40007a00: 12 80 00 06 bne 40007a18 <sched_get_priority_min+0x30> <== ALWAYS TAKEN
40007a04: b0 10 20 01 mov 1, %i0
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
40007a08: 40 00 20 9e call 4000fc80 <__errno>
40007a0c: b0 10 3f ff mov -1, %i0
40007a10: 82 10 20 16 mov 0x16, %g1
40007a14: c2 22 00 00 st %g1, [ %o0 ]
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
}
40007a18: 81 c7 e0 08 ret
40007a1c: 81 e8 00 00 restore
40007a20 <sched_rr_get_interval>:
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
)
{
40007a20: 9d e3 bf a0 save %sp, -96, %sp
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid && pid != getpid() )
40007a24: 80 a6 20 00 cmp %i0, 0
40007a28: 02 80 00 0b be 40007a54 <sched_rr_get_interval+0x34> <== NEVER TAKEN
40007a2c: 80 a6 60 00 cmp %i1, 0
40007a30: 7f ff f0 d9 call 40003d94 <getpid>
40007a34: 01 00 00 00 nop
40007a38: 80 a6 00 08 cmp %i0, %o0
40007a3c: 02 80 00 06 be 40007a54 <sched_rr_get_interval+0x34>
40007a40: 80 a6 60 00 cmp %i1, 0
rtems_set_errno_and_return_minus_one( ESRCH );
40007a44: 40 00 20 8f call 4000fc80 <__errno>
40007a48: 01 00 00 00 nop
40007a4c: 10 80 00 07 b 40007a68 <sched_rr_get_interval+0x48>
40007a50: 82 10 20 03 mov 3, %g1 ! 3 <PROM_START+0x3>
if ( !interval )
40007a54: 12 80 00 08 bne 40007a74 <sched_rr_get_interval+0x54>
40007a58: 03 10 00 7d sethi %hi(0x4001f400), %g1
rtems_set_errno_and_return_minus_one( EINVAL );
40007a5c: 40 00 20 89 call 4000fc80 <__errno>
40007a60: 01 00 00 00 nop
40007a64: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
40007a68: c2 22 00 00 st %g1, [ %o0 ]
40007a6c: 81 c7 e0 08 ret
40007a70: 91 e8 3f ff restore %g0, -1, %o0
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
40007a74: d0 00 61 e0 ld [ %g1 + 0x1e0 ], %o0
40007a78: 92 10 00 19 mov %i1, %o1
40007a7c: 40 00 0d d1 call 4000b1c0 <_Timespec_From_ticks>
40007a80: b0 10 20 00 clr %i0
return 0;
}
40007a84: 81 c7 e0 08 ret
40007a88: 81 e8 00 00 restore
400087f0 <sem_open>:
int oflag,
...
/* mode_t mode, */
/* unsigned int value */
)
{
400087f0: 9d e3 bf 88 save %sp, -120, %sp
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
400087f4: 03 10 00 73 sethi %hi(0x4001cc00), %g1
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
va_start(arg, oflag);
400087f8: f4 27 a0 4c st %i2, [ %fp + 0x4c ]
400087fc: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
40008800: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
40008804: fa 27 a0 58 st %i5, [ %fp + 0x58 ]
40008808: 82 10 62 d0 or %g1, 0x2d0, %g1
4000880c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
40008810: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40008814: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
Objects_Locations location;
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
40008818: b4 8e 62 00 andcc %i1, 0x200, %i2
4000881c: 02 80 00 05 be 40008830 <sem_open+0x40>
40008820: b8 10 20 00 clr %i4
va_start(arg, oflag);
mode = va_arg( arg, mode_t );
value = va_arg( arg, unsigned int );
40008824: f8 07 a0 50 ld [ %fp + 0x50 ], %i4
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
va_start(arg, oflag);
40008828: 82 07 a0 4c add %fp, 0x4c, %g1
4000882c: c2 27 bf ec st %g1, [ %fp + -20 ]
const char *name,
Objects_Id *id,
size_t *len
)
{
return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len );
40008830: 37 10 00 73 sethi %hi(0x4001cc00), %i3
40008834: 92 10 00 18 mov %i0, %o1
40008838: 90 16 e0 34 or %i3, 0x34, %o0
4000883c: 94 07 bf f0 add %fp, -16, %o2
40008840: 7f ff fe 6e call 400081f8 <_POSIX_Name_to_id>
40008844: 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 ) {
40008848: ba 92 20 00 orcc %o0, 0, %i5
4000884c: 22 80 00 0e be,a 40008884 <sem_open+0x94>
40008850: 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) ) ) {
40008854: 80 a7 60 02 cmp %i5, 2
40008858: 12 80 00 04 bne 40008868 <sem_open+0x78>
4000885c: 80 a6 a0 00 cmp %i2, 0
40008860: 12 80 00 20 bne 400088e0 <sem_open+0xf0>
40008864: d2 07 bf fc ld [ %fp + -4 ], %o1
_Thread_Enable_dispatch();
40008868: 40 00 0e 45 call 4000c17c <_Thread_Enable_dispatch>
4000886c: b0 10 3f ff mov -1, %i0
rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
40008870: 40 00 23 90 call 400116b0 <__errno>
40008874: 01 00 00 00 nop
40008878: fa 22 00 00 st %i5, [ %o0 ]
4000887c: 81 c7 e0 08 ret
40008880: 81 e8 00 00 restore
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
40008884: 80 a6 6a 00 cmp %i1, 0xa00
40008888: 12 80 00 0a bne 400088b0 <sem_open+0xc0>
4000888c: d2 07 bf f0 ld [ %fp + -16 ], %o1
_Thread_Enable_dispatch();
40008890: 40 00 0e 3b call 4000c17c <_Thread_Enable_dispatch>
40008894: b0 10 3f ff mov -1, %i0
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
40008898: 40 00 23 86 call 400116b0 <__errno>
4000889c: 01 00 00 00 nop
400088a0: 82 10 20 11 mov 0x11, %g1 ! 11 <PROM_START+0x11>
400088a4: c2 22 00 00 st %g1, [ %o0 ]
400088a8: 81 c7 e0 08 ret
400088ac: 81 e8 00 00 restore
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
sem_t *id,
Objects_Locations *location
)
{
return (POSIX_Semaphore_Control *)
400088b0: 94 07 bf f8 add %fp, -8, %o2
400088b4: 40 00 0a 92 call 4000b2fc <_Objects_Get>
400088b8: 90 16 e0 34 or %i3, 0x34, %o0
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
the_semaphore->open_count += 1;
400088bc: c2 02 20 18 ld [ %o0 + 0x18 ], %g1
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
400088c0: d0 27 bf f4 st %o0, [ %fp + -12 ]
the_semaphore->open_count += 1;
400088c4: 82 00 60 01 inc %g1
_Thread_Enable_dispatch();
400088c8: 40 00 0e 2d call 4000c17c <_Thread_Enable_dispatch>
400088cc: c2 22 20 18 st %g1, [ %o0 + 0x18 ]
_Thread_Enable_dispatch();
400088d0: 40 00 0e 2b call 4000c17c <_Thread_Enable_dispatch>
400088d4: 01 00 00 00 nop
goto return_id;
400088d8: 10 80 00 0d b 4000890c <sem_open+0x11c>
400088dc: 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(
400088e0: 94 10 20 00 clr %o2
400088e4: 96 10 00 1c mov %i4, %o3
400088e8: 98 07 bf f4 add %fp, -12, %o4
400088ec: 40 00 19 5a call 4000ee54 <_POSIX_Semaphore_Create_support>
400088f0: 90 10 00 18 mov %i0, %o0
/*
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
400088f4: 40 00 0e 22 call 4000c17c <_Thread_Enable_dispatch>
400088f8: ba 10 00 08 mov %o0, %i5
if ( status == -1 )
400088fc: 80 a7 7f ff cmp %i5, -1
40008900: 22 80 00 04 be,a 40008910 <sem_open+0x120> <== NEVER TAKEN
40008904: 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;
40008908: f0 07 bf f4 ld [ %fp + -12 ], %i0
4000890c: b0 06 20 08 add %i0, 8, %i0
#endif
}
40008910: 81 c7 e0 08 ret
40008914: 81 e8 00 00 restore
4000a69c <sem_timedwait>:
int sem_timedwait(
sem_t *__restrict sem,
const struct timespec *__restrict abstime
)
{
4000a69c: 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 );
4000a6a0: 92 07 bf fc add %fp, -4, %o1
4000a6a4: 40 00 14 d7 call 4000fa00 <_POSIX_Absolute_timeout_to_ticks>
4000a6a8: 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 );
4000a6ac: 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 )
4000a6b0: 90 1a 20 03 xor %o0, 3, %o0
4000a6b4: 80 a0 00 08 cmp %g0, %o0
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
4000a6b8: 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 )
4000a6bc: ba 60 3f ff subx %g0, -1, %i5
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
4000a6c0: 40 00 17 60 call 40010440 <_POSIX_Semaphore_Wait_support>
4000a6c4: 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) ) {
4000a6c8: 80 a7 60 00 cmp %i5, 0
4000a6cc: 12 80 00 06 bne 4000a6e4 <sem_timedwait+0x48> <== ALWAYS TAKEN
4000a6d0: 80 a2 20 10 cmp %o0, 0x10
4000a6d4: 12 80 00 04 bne 4000a6e4 <sem_timedwait+0x48> <== NOT EXECUTED
4000a6d8: 01 00 00 00 nop <== NOT EXECUTED
4000a6dc: 81 c7 e0 08 ret <== NOT EXECUTED
4000a6e0: 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;
}
4000a6e4: 81 c7 e0 08 ret
4000a6e8: 91 e8 00 08 restore %g0, %o0, %o0
40007800 <sigaction>:
int sigaction(
int sig,
const struct sigaction *__restrict act,
struct sigaction *__restrict oact
)
{
40007800: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
if ( !sig )
40007804: 82 06 3f ff add %i0, -1, %g1
40007808: 80 a0 60 1f cmp %g1, 0x1f
4000780c: 08 80 00 08 bleu 4000782c <sigaction+0x2c>
40007810: 80 a6 20 09 cmp %i0, 9
rtems_set_errno_and_return_minus_one( EINVAL );
40007814: 40 00 22 ab call 400102c0 <__errno>
40007818: b0 10 3f ff mov -1, %i0
4000781c: 82 10 20 16 mov 0x16, %g1
40007820: c2 22 00 00 st %g1, [ %o0 ]
40007824: 81 c7 e0 08 ret
40007828: 81 e8 00 00 restore
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
4000782c: 02 bf ff fa be 40007814 <sigaction+0x14>
40007830: 03 10 00 6a sethi %hi(0x4001a800), %g1
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
40007834: 82 10 60 70 or %g1, 0x70, %g1 ! 4001a870 <_Per_CPU_Information>
40007838: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
4000783c: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40007840: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
rtems_set_errno_and_return_minus_one( EINVAL );
_Thread_Disable_dispatch();
if ( oact )
40007844: 80 a6 a0 00 cmp %i2, 0
40007848: 02 80 00 0a be 40007870 <sigaction+0x70>
4000784c: 83 2e 20 02 sll %i0, 2, %g1
*oact = _POSIX_signals_Vectors[ sig ];
40007850: 85 2e 20 04 sll %i0, 4, %g2
40007854: 82 20 80 01 sub %g2, %g1, %g1
40007858: 13 10 00 6a sethi %hi(0x4001a800), %o1
4000785c: 90 10 00 1a mov %i2, %o0
40007860: 92 12 60 98 or %o1, 0x98, %o1
40007864: 94 10 20 0c mov 0xc, %o2
40007868: 40 00 24 80 call 40010a68 <memcpy>
4000786c: 92 02 40 01 add %o1, %g1, %o1
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
40007870: 80 a6 60 00 cmp %i1, 0
40007874: 02 80 00 1b be 400078e0 <sigaction+0xe0> <== NEVER TAKEN
40007878: 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 );
4000787c: 7f ff eb 50 call 400025bc <sparc_disable_interrupts>
40007880: 01 00 00 00 nop
40007884: b4 10 00 08 mov %o0, %i2
if ( act->sa_handler == SIG_DFL ) {
40007888: c2 06 60 08 ld [ %i1 + 8 ], %g1
4000788c: 3b 10 00 6a sethi %hi(0x4001a800), %i5
40007890: 80 a0 60 00 cmp %g1, 0
40007894: ba 17 60 98 or %i5, 0x98, %i5
40007898: b9 2e 20 02 sll %i0, 2, %i4
4000789c: 12 80 00 08 bne 400078bc <sigaction+0xbc>
400078a0: b7 2e 20 04 sll %i0, 4, %i3
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
400078a4: b8 26 c0 1c sub %i3, %i4, %i4
400078a8: 13 10 00 63 sethi %hi(0x40018c00), %o1
400078ac: 90 07 40 1c add %i5, %i4, %o0
400078b0: 92 12 61 14 or %o1, 0x114, %o1
400078b4: 10 80 00 07 b 400078d0 <sigaction+0xd0>
400078b8: 92 02 40 1c add %o1, %i4, %o1
} else {
_POSIX_signals_Clear_process_signals( sig );
400078bc: 40 00 16 12 call 4000d104 <_POSIX_signals_Clear_process_signals>
400078c0: 90 10 00 18 mov %i0, %o0
_POSIX_signals_Vectors[ sig ] = *act;
400078c4: 90 26 c0 1c sub %i3, %i4, %o0
400078c8: 92 10 00 19 mov %i1, %o1
400078cc: 90 07 40 08 add %i5, %o0, %o0
400078d0: 40 00 24 66 call 40010a68 <memcpy>
400078d4: 94 10 20 0c mov 0xc, %o2
}
_ISR_Enable( level );
400078d8: 7f ff eb 3d call 400025cc <sparc_enable_interrupts>
400078dc: 90 10 00 1a mov %i2, %o0
}
_Thread_Enable_dispatch();
400078e0: 40 00 0b d8 call 4000a840 <_Thread_Enable_dispatch>
400078e4: b0 10 20 00 clr %i0
return 0;
}
400078e8: 81 c7 e0 08 ret
400078ec: 81 e8 00 00 restore
40007d8c <sigtimedwait>:
int sigtimedwait(
const sigset_t *__restrict set,
siginfo_t *__restrict info,
const struct timespec *__restrict timeout
)
{
40007d8c: 9d e3 bf 90 save %sp, -112, %sp
ISR_Level level;
/*
* Error check parameters before disabling interrupts.
*/
if ( !set )
40007d90: 80 a6 20 00 cmp %i0, 0
40007d94: 02 80 00 0e be 40007dcc <sigtimedwait+0x40>
40007d98: 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 ) {
40007d9c: 22 80 00 10 be,a 40007ddc <sigtimedwait+0x50>
40007da0: b4 10 20 00 clr %i2
if ( !_Timespec_Is_valid( timeout ) )
40007da4: 40 00 0e 8d call 4000b7d8 <_Timespec_Is_valid>
40007da8: 90 10 00 1a mov %i2, %o0
40007dac: 80 a2 20 00 cmp %o0, 0
40007db0: 02 80 00 07 be 40007dcc <sigtimedwait+0x40>
40007db4: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EINVAL );
interval = _Timespec_To_ticks( timeout );
40007db8: 40 00 0e 9a call 4000b820 <_Timespec_To_ticks>
40007dbc: 90 10 00 1a mov %i2, %o0
if ( !interval )
40007dc0: b4 92 20 00 orcc %o0, 0, %i2
40007dc4: 12 80 00 07 bne 40007de0 <sigtimedwait+0x54> <== ALWAYS TAKEN
40007dc8: 80 a6 60 00 cmp %i1, 0
rtems_set_errno_and_return_minus_one( EINVAL );
40007dcc: 40 00 23 14 call 40010a1c <__errno>
40007dd0: 01 00 00 00 nop
40007dd4: 10 80 00 66 b 40007f6c <sigtimedwait+0x1e0>
40007dd8: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
/*
* Initialize local variables.
*/
the_info = ( info ) ? info : &signal_information;
40007ddc: 80 a6 60 00 cmp %i1, 0
40007de0: 22 80 00 02 be,a 40007de8 <sigtimedwait+0x5c>
40007de4: b2 07 bf f4 add %fp, -12, %i1
40007de8: 03 10 00 6c sethi %hi(0x4001b000), %g1
40007dec: fa 00 60 c8 ld [ %g1 + 0xc8 ], %i5 ! 4001b0c8 <_Per_CPU_Information+0x18>
* What if they are already pending?
*/
/* API signals pending? */
_POSIX_signals_Acquire( level );
40007df0: 7f ff ea df call 4000296c <sparc_disable_interrupts>
40007df4: f8 07 61 50 ld [ %i5 + 0x150 ], %i4
40007df8: b6 10 00 08 mov %o0, %i3
if ( *set & api->signals_pending ) {
40007dfc: c4 06 00 00 ld [ %i0 ], %g2
40007e00: d0 07 20 e0 ld [ %i4 + 0xe0 ], %o0
40007e04: 03 10 00 6c sethi %hi(0x4001b000), %g1
40007e08: 80 88 80 08 btst %g2, %o0
40007e0c: 02 80 00 13 be 40007e58 <sigtimedwait+0xcc>
40007e10: 82 10 60 b0 or %g1, 0xb0, %g1
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending );
40007e14: 7f ff ff c6 call 40007d2c <_POSIX_signals_Get_lowest>
40007e18: 01 00 00 00 nop
_POSIX_signals_Clear_signals(
40007e1c: 94 10 00 19 mov %i1, %o2
/* API signals pending? */
_POSIX_signals_Acquire( level );
if ( *set & api->signals_pending ) {
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending );
40007e20: 92 10 00 08 mov %o0, %o1
40007e24: d0 26 40 00 st %o0, [ %i1 ]
_POSIX_signals_Clear_signals(
40007e28: 96 10 20 00 clr %o3
40007e2c: 90 10 00 1c mov %i4, %o0
40007e30: 98 10 20 00 clr %o4
40007e34: 40 00 16 da call 4000d99c <_POSIX_signals_Clear_signals>
40007e38: 9a 10 20 00 clr %o5
the_info,
false,
false,
false
);
_POSIX_signals_Release( level );
40007e3c: 7f ff ea d0 call 4000297c <sparc_enable_interrupts>
40007e40: 90 10 00 1b mov %i3, %o0
the_info->si_code = SI_USER;
40007e44: 82 10 20 01 mov 1, %g1
the_info->si_value.sival_int = 0;
40007e48: c0 26 60 08 clr [ %i1 + 8 ]
false,
false
);
_POSIX_signals_Release( level );
the_info->si_code = SI_USER;
40007e4c: c2 26 60 04 st %g1, [ %i1 + 4 ]
the_info->si_value.sival_int = 0;
return the_info->si_signo;
40007e50: 10 80 00 49 b 40007f74 <sigtimedwait+0x1e8>
40007e54: d0 06 40 00 ld [ %i1 ], %o0
}
/* Process pending signals? */
if ( *set & _POSIX_signals_Pending ) {
40007e58: 07 10 00 6c sethi %hi(0x4001b000), %g3
40007e5c: d0 00 e2 a4 ld [ %g3 + 0x2a4 ], %o0 ! 4001b2a4 <_POSIX_signals_Pending>
40007e60: 80 88 80 08 btst %g2, %o0
40007e64: 02 80 00 14 be 40007eb4 <sigtimedwait+0x128>
40007e68: 84 10 3f ff mov -1, %g2
signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending );
40007e6c: 7f ff ff b0 call 40007d2c <_POSIX_signals_Get_lowest>
40007e70: 01 00 00 00 nop
_POSIX_signals_Clear_signals( api, signo, the_info, true, false, false );
40007e74: 94 10 00 19 mov %i1, %o2
}
/* Process pending signals? */
if ( *set & _POSIX_signals_Pending ) {
signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending );
40007e78: ba 10 00 08 mov %o0, %i5
_POSIX_signals_Clear_signals( api, signo, the_info, true, false, false );
40007e7c: 96 10 20 01 mov 1, %o3
40007e80: 90 10 00 1c mov %i4, %o0
40007e84: 92 10 00 1d mov %i5, %o1
40007e88: 98 10 20 00 clr %o4
40007e8c: 40 00 16 c4 call 4000d99c <_POSIX_signals_Clear_signals>
40007e90: 9a 10 20 00 clr %o5
_POSIX_signals_Release( level );
40007e94: 7f ff ea ba call 4000297c <sparc_enable_interrupts>
40007e98: 90 10 00 1b mov %i3, %o0
the_info->si_signo = signo;
the_info->si_code = SI_USER;
40007e9c: 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( level );
the_info->si_signo = signo;
40007ea0: fa 26 40 00 st %i5, [ %i1 ]
the_info->si_code = SI_USER;
40007ea4: c2 26 60 04 st %g1, [ %i1 + 4 ]
the_info->si_value.sival_int = 0;
40007ea8: c0 26 60 08 clr [ %i1 + 8 ]
return signo;
40007eac: 10 80 00 32 b 40007f74 <sigtimedwait+0x1e8>
40007eb0: 90 10 00 1d mov %i5, %o0
}
the_info->si_signo = -1;
40007eb4: c4 26 40 00 st %g2, [ %i1 ]
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
40007eb8: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
40007ebc: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40007ec0: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
_Thread_Disable_dispatch();
executing->Wait.queue = &_POSIX_signals_Wait_queue;
executing->Wait.return_code = EINTR;
40007ec4: 84 10 20 04 mov 4, %g2
40007ec8: c4 27 60 34 st %g2, [ %i5 + 0x34 ]
executing->Wait.option = *set;
40007ecc: c4 06 00 00 ld [ %i0 ], %g2
executing->Wait.return_argument = the_info;
40007ed0: 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;
40007ed4: c4 27 60 30 st %g2, [ %i5 + 0x30 ]
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
executing->Wait.queue = &_POSIX_signals_Wait_queue;
40007ed8: 03 10 00 6c sethi %hi(0x4001b000), %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;
40007edc: 84 10 20 01 mov 1, %g2
40007ee0: 82 10 62 64 or %g1, 0x264, %g1
40007ee4: c2 27 60 44 st %g1, [ %i5 + 0x44 ]
40007ee8: c4 20 60 30 st %g2, [ %g1 + 0x30 ]
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( level );
40007eec: 7f ff ea a4 call 4000297c <sparc_enable_interrupts>
40007ef0: 90 10 00 1b mov %i3, %o0
_Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, executing, interval );
40007ef4: 92 10 00 1d mov %i5, %o1
40007ef8: 94 10 00 1a mov %i2, %o2
40007efc: 11 10 00 6c sethi %hi(0x4001b000), %o0
40007f00: 17 10 00 2d sethi %hi(0x4000b400), %o3
40007f04: 90 12 22 64 or %o0, 0x264, %o0
40007f08: 40 00 0c e6 call 4000b2a0 <_Thread_queue_Enqueue_with_handler>
40007f0c: 96 12 e1 ec or %o3, 0x1ec, %o3
_Thread_Enable_dispatch();
40007f10: 40 00 0b b7 call 4000adec <_Thread_Enable_dispatch>
40007f14: 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(
40007f18: d2 06 40 00 ld [ %i1 ], %o1
40007f1c: 90 10 00 1c mov %i4, %o0
40007f20: 94 10 00 19 mov %i1, %o2
40007f24: 96 10 20 00 clr %o3
40007f28: 98 10 20 00 clr %o4
40007f2c: 40 00 16 9c call 4000d99c <_POSIX_signals_Clear_signals>
40007f30: 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)
40007f34: c2 07 60 34 ld [ %i5 + 0x34 ], %g1
40007f38: 80 a0 60 04 cmp %g1, 4
40007f3c: 12 80 00 09 bne 40007f60 <sigtimedwait+0x1d4>
40007f40: 84 10 20 01 mov 1, %g2
|| !(*set & signo_to_mask( the_info->si_signo )) ) {
40007f44: d0 06 40 00 ld [ %i1 ], %o0
40007f48: 82 02 3f ff add %o0, -1, %g1
40007f4c: 85 28 80 01 sll %g2, %g1, %g2
40007f50: c2 06 00 00 ld [ %i0 ], %g1
40007f54: 80 88 80 01 btst %g2, %g1
40007f58: 12 80 00 07 bne 40007f74 <sigtimedwait+0x1e8>
40007f5c: 01 00 00 00 nop
errno = executing->Wait.return_code;
40007f60: 40 00 22 af call 40010a1c <__errno>
40007f64: 01 00 00 00 nop
40007f68: c2 07 60 34 ld [ %i5 + 0x34 ], %g1
40007f6c: c2 22 00 00 st %g1, [ %o0 ]
return -1;
40007f70: 90 10 3f ff mov -1, %o0
}
return the_info->si_signo;
}
40007f74: 81 c7 e0 08 ret
40007f78: 91 e8 00 08 restore %g0, %o0, %o0
40009a14 <sigwait>:
int sigwait(
const sigset_t *__restrict set,
int *__restrict sig
)
{
40009a14: 9d e3 bf a0 save %sp, -96, %sp
int status;
status = sigtimedwait( set, NULL, NULL );
40009a18: 92 10 20 00 clr %o1
40009a1c: 90 10 00 18 mov %i0, %o0
40009a20: 7f ff ff 7d call 40009814 <sigtimedwait>
40009a24: 94 10 20 00 clr %o2
if ( status != -1 ) {
40009a28: 80 a2 3f ff cmp %o0, -1
40009a2c: 02 80 00 06 be 40009a44 <sigwait+0x30>
40009a30: 80 a6 60 00 cmp %i1, 0
if ( sig )
40009a34: 32 80 00 09 bne,a 40009a58 <sigwait+0x44> <== ALWAYS TAKEN
40009a38: d0 26 40 00 st %o0, [ %i1 ]
*sig = status;
return 0;
40009a3c: 81 c7 e0 08 ret <== NOT EXECUTED
40009a40: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED
}
return errno;
40009a44: 40 00 22 5c call 400123b4 <__errno>
40009a48: 01 00 00 00 nop
40009a4c: f0 02 00 00 ld [ %o0 ], %i0
40009a50: 81 c7 e0 08 ret
40009a54: 81 e8 00 00 restore
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
*sig = status;
return 0;
40009a58: b0 10 20 00 clr %i0
}
return errno;
}
40009a5c: 81 c7 e0 08 ret
40009a60: 81 e8 00 00 restore
40006a9c <sysconf>:
*/
long sysconf(
int name
)
{
40006a9c: 9d e3 bf a0 save %sp, -96, %sp
if ( name == _SC_CLK_TCK )
40006aa0: 80 a6 20 02 cmp %i0, 2
40006aa4: 12 80 00 09 bne 40006ac8 <sysconf+0x2c>
40006aa8: 03 10 00 5a sethi %hi(0x40016800), %g1
return (TOD_MICROSECONDS_PER_SECOND /
40006aac: 03 10 00 55 sethi %hi(0x40015400), %g1
40006ab0: d2 00 60 0c ld [ %g1 + 0xc ], %o1 ! 4001540c <Configuration+0xc>
40006ab4: 11 00 03 d0 sethi %hi(0xf4000), %o0
40006ab8: 40 00 31 d6 call 40013210 <.udiv>
40006abc: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 <PROM_START+0xf4240>
40006ac0: 81 c7 e0 08 ret
40006ac4: 91 e8 00 08 restore %g0, %o0, %o0
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
40006ac8: 80 a6 20 04 cmp %i0, 4
40006acc: 02 80 00 13 be 40006b18 <sysconf+0x7c>
40006ad0: d0 00 63 68 ld [ %g1 + 0x368 ], %o0
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
40006ad4: 80 a6 20 33 cmp %i0, 0x33
40006ad8: 02 80 00 10 be 40006b18 <sysconf+0x7c>
40006adc: 90 10 24 00 mov 0x400, %o0
return 1024;
if ( name == _SC_PAGESIZE )
40006ae0: 80 a6 20 08 cmp %i0, 8
40006ae4: 02 80 00 0d be 40006b18 <sysconf+0x7c>
40006ae8: 11 00 00 04 sethi %hi(0x1000), %o0
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
40006aec: 80 a6 20 4f cmp %i0, 0x4f
40006af0: 02 80 00 0a be 40006b18 <sysconf+0x7c> <== NEVER TAKEN
40006af4: 90 10 20 20 mov 0x20, %o0
return RTEMS_FILESYSTEM_SYMLOOP_MAX;
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
40006af8: 80 a6 22 03 cmp %i0, 0x203
40006afc: 02 80 00 07 be 40006b18 <sysconf+0x7c> <== NEVER TAKEN
40006b00: 90 10 20 00 clr %o0
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
40006b04: 40 00 21 88 call 4000f124 <__errno>
40006b08: 01 00 00 00 nop
40006b0c: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
40006b10: c2 22 00 00 st %g1, [ %o0 ]
40006b14: 90 10 3f ff mov -1, %o0
}
40006b18: b0 10 00 08 mov %o0, %i0
40006b1c: 81 c7 e0 08 ret
40006b20: 81 e8 00 00 restore
40008918 <timer_create>:
int timer_create(
clockid_t clock_id,
struct sigevent *__restrict evp,
timer_t *__restrict timerid
)
{
40008918: 9d e3 bf a0 save %sp, -96, %sp
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
4000891c: 80 a6 20 01 cmp %i0, 1
40008920: 02 80 00 06 be 40008938 <timer_create+0x20>
40008924: 80 a6 a0 00 cmp %i2, 0
rtems_set_errno_and_return_minus_one( EINVAL );
40008928: 40 00 23 62 call 400116b0 <__errno>
4000892c: 01 00 00 00 nop
40008930: 10 80 00 20 b 400089b0 <timer_create+0x98>
40008934: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
if ( !timerid )
40008938: 02 bf ff fc be 40008928 <timer_create+0x10>
4000893c: 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) {
40008940: 02 80 00 0d be 40008974 <timer_create+0x5c>
40008944: 03 10 00 73 sethi %hi(0x4001cc00), %g1
/* The structure has data */
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
40008948: c2 06 40 00 ld [ %i1 ], %g1
4000894c: 82 00 7f ff add %g1, -1, %g1
40008950: 80 a0 60 01 cmp %g1, 1
40008954: 18 bf ff f5 bgu 40008928 <timer_create+0x10> <== NEVER TAKEN
40008958: 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 )
4000895c: c2 06 60 04 ld [ %i1 + 4 ], %g1
40008960: 82 00 7f ff add %g1, -1, %g1
40008964: 80 a0 60 1f cmp %g1, 0x1f
40008968: 18 bf ff f0 bgu 40008928 <timer_create+0x10> <== NEVER TAKEN
4000896c: 01 00 00 00 nop
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
40008970: 03 10 00 73 sethi %hi(0x4001cc00), %g1
40008974: 82 10 62 d0 or %g1, 0x2d0, %g1 ! 4001ced0 <_Per_CPU_Information>
40008978: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
++level;
4000897c: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40008980: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
* 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 );
40008984: 3b 10 00 73 sethi %hi(0x4001cc00), %i5
40008988: 40 00 09 0e call 4000adc0 <_Objects_Allocate>
4000898c: 90 17 60 70 or %i5, 0x70, %o0 ! 4001cc70 <_POSIX_Timer_Information>
/*
* Allocate a timer
*/
ptimer = _POSIX_Timer_Allocate();
if ( !ptimer ) {
40008990: 80 a2 20 00 cmp %o0, 0
40008994: 12 80 00 0a bne 400089bc <timer_create+0xa4>
40008998: 82 10 20 02 mov 2, %g1
RTEMS_INLINE_ROUTINE void _Objects_Put(
Objects_Control *the_object
)
{
(void) the_object;
_Thread_Enable_dispatch();
4000899c: 40 00 0d f8 call 4000c17c <_Thread_Enable_dispatch>
400089a0: 01 00 00 00 nop
_Objects_Put( &ptimer->Object );
rtems_set_errno_and_return_minus_one( EAGAIN );
400089a4: 40 00 23 43 call 400116b0 <__errno>
400089a8: 01 00 00 00 nop
400089ac: 82 10 20 0b mov 0xb, %g1 ! b <PROM_START+0xb>
400089b0: c2 22 00 00 st %g1, [ %o0 ]
400089b4: 81 c7 e0 08 ret
400089b8: 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;
400089bc: c2 2a 20 3c stb %g1, [ %o0 + 0x3c ]
ptimer->thread_id = _Thread_Executing->Object.id;
400089c0: 03 10 00 73 sethi %hi(0x4001cc00), %g1
400089c4: 82 10 62 d0 or %g1, 0x2d0, %g1 ! 4001ced0 <_Per_CPU_Information>
400089c8: c2 00 60 18 ld [ %g1 + 0x18 ], %g1
if ( evp != NULL ) {
400089cc: 80 a6 60 00 cmp %i1, 0
}
/* The data of the created timer are stored to use them later */
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
ptimer->thread_id = _Thread_Executing->Object.id;
400089d0: c2 00 60 08 ld [ %g1 + 8 ], %g1
if ( evp != NULL ) {
400089d4: 02 80 00 08 be 400089f4 <timer_create+0xdc>
400089d8: c2 22 20 38 st %g1, [ %o0 + 0x38 ]
ptimer->inf.sigev_notify = evp->sigev_notify;
400089dc: c2 06 40 00 ld [ %i1 ], %g1
400089e0: c2 22 20 40 st %g1, [ %o0 + 0x40 ]
ptimer->inf.sigev_signo = evp->sigev_signo;
400089e4: c2 06 60 04 ld [ %i1 + 4 ], %g1
400089e8: c2 22 20 44 st %g1, [ %o0 + 0x44 ]
ptimer->inf.sigev_value = evp->sigev_value;
400089ec: c2 06 60 08 ld [ %i1 + 8 ], %g1
400089f0: c2 22 20 48 st %g1, [ %o0 + 0x48 ]
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
400089f4: c4 12 20 0a lduh [ %o0 + 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_u32(
Objects_Information *information,
400089f8: ba 17 60 70 or %i5, 0x70, %i5
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
400089fc: c6 07 60 1c ld [ %i5 + 0x1c ], %g3
}
ptimer->overrun = 0;
40008a00: c0 22 20 68 clr [ %o0 + 0x68 ]
ptimer->timer_data.it_value.tv_sec = 0;
40008a04: c0 22 20 5c clr [ %o0 + 0x5c ]
ptimer->timer_data.it_value.tv_nsec = 0;
40008a08: c0 22 20 60 clr [ %o0 + 0x60 ]
ptimer->timer_data.it_interval.tv_sec = 0;
40008a0c: c0 22 20 54 clr [ %o0 + 0x54 ]
ptimer->timer_data.it_interval.tv_nsec = 0;
40008a10: c0 22 20 58 clr [ %o0 + 0x58 ]
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
40008a14: c0 22 20 18 clr [ %o0 + 0x18 ]
the_watchdog->routine = routine;
40008a18: c0 22 20 2c clr [ %o0 + 0x2c ]
the_watchdog->id = id;
40008a1c: c0 22 20 30 clr [ %o0 + 0x30 ]
the_watchdog->user_data = user_data;
40008a20: c0 22 20 34 clr [ %o0 + 0x34 ]
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
40008a24: c2 02 20 08 ld [ %o0 + 8 ], %g1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40008a28: 85 28 a0 02 sll %g2, 2, %g2
40008a2c: d0 20 c0 02 st %o0, [ %g3 + %g2 ]
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
40008a30: c0 22 20 0c clr [ %o0 + 0xc ]
_Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL );
_Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0);
*timerid = ptimer->Object.id;
40008a34: c2 26 80 00 st %g1, [ %i2 ]
RTEMS_INLINE_ROUTINE void _Objects_Put(
Objects_Control *the_object
)
{
(void) the_object;
_Thread_Enable_dispatch();
40008a38: 40 00 0d d1 call 4000c17c <_Thread_Enable_dispatch>
40008a3c: b0 10 20 00 clr %i0
_Objects_Put( &ptimer->Object );
return 0;
}
40008a40: 81 c7 e0 08 ret
40008a44: 81 e8 00 00 restore
40006cc4 <timer_settime>:
timer_t timerid,
int flags,
const struct itimerspec *__restrict value,
struct itimerspec *__restrict ovalue
)
{
40006cc4: 9d e3 bf 80 save %sp, -128, %sp
Objects_Locations location;
bool activated;
uint32_t initial_period;
struct itimerspec normalize;
if ( !value )
40006cc8: 80 a6 a0 00 cmp %i2, 0
40006ccc: 02 80 00 84 be 40006edc <timer_settime+0x218> <== NEVER TAKEN
40006cd0: 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) ) ) {
40006cd4: 40 00 0f 17 call 4000a930 <_Timespec_Is_valid>
40006cd8: 90 06 a0 08 add %i2, 8, %o0
40006cdc: 80 a2 20 00 cmp %o0, 0
40006ce0: 02 80 00 7f be 40006edc <timer_settime+0x218>
40006ce4: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !_Timespec_Is_valid( &(value->it_interval) ) ) {
40006ce8: 40 00 0f 12 call 4000a930 <_Timespec_Is_valid>
40006cec: 90 10 00 1a mov %i2, %o0
40006cf0: 80 a2 20 00 cmp %o0, 0
40006cf4: 02 80 00 7a be 40006edc <timer_settime+0x218> <== NEVER TAKEN
40006cf8: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) {
40006cfc: b0 8e 7f fb andcc %i1, -5, %i0
40006d00: 12 80 00 77 bne 40006edc <timer_settime+0x218>
40006d04: 90 07 bf f0 add %fp, -16, %o0
rtems_set_errno_and_return_minus_one( EINVAL );
}
normalize = *value;
40006d08: 92 10 00 1a mov %i2, %o1
40006d0c: 40 00 25 67 call 400102a8 <memcpy>
40006d10: 94 10 20 10 mov 0x10, %o2
/* Convert absolute to relative time */
if (flags == TIMER_ABSTIME) {
40006d14: 80 a6 60 04 cmp %i1, 4
40006d18: 12 80 00 1f bne 40006d94 <timer_settime+0xd0>
40006d1c: 11 10 00 63 sethi %hi(0x40018c00), %o0
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
40006d20: 90 07 bf e0 add %fp, -32, %o0
40006d24: 13 10 00 62 sethi %hi(0x40018800), %o1
40006d28: 40 00 06 5d call 4000869c <_TOD_Get_with_nanoseconds>
40006d2c: 92 12 61 80 or %o1, 0x180, %o1 ! 40018980 <_TOD>
static inline void _TOD_Get(
struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
40006d30: 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);
40006d34: 94 10 20 00 clr %o2
40006d38: 90 10 00 1c mov %i4, %o0
40006d3c: 92 10 00 1d mov %i5, %o1
40006d40: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
40006d44: 40 00 35 c6 call 4001445c <__divdi3>
40006d48: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
40006d4c: 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);
40006d50: d2 27 bf e8 st %o1, [ %fp + -24 ]
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
40006d54: 90 10 00 1c mov %i4, %o0
40006d58: 92 10 00 1d mov %i5, %o1
40006d5c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
40006d60: 40 00 36 b1 call 40014824 <__moddi3>
40006d64: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
struct timespec now;
_TOD_Get( &now );
/* Check for seconds in the past */
if ( _Timespec_Greater_than( &now, &normalize.it_value ) )
40006d68: 90 07 bf f8 add %fp, -8, %o0
40006d6c: d2 27 bf ec st %o1, [ %fp + -20 ]
40006d70: 40 00 0f 02 call 4000a978 <_Timespec_Less_than>
40006d74: 92 07 bf e8 add %fp, -24, %o1
40006d78: 80 a2 20 00 cmp %o0, 0
40006d7c: 12 80 00 58 bne 40006edc <timer_settime+0x218>
40006d80: 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 );
40006d84: 90 07 bf e8 add %fp, -24, %o0
40006d88: 40 00 0f 0c call 4000a9b8 <_Timespec_Subtract>
40006d8c: 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 *)
40006d90: 11 10 00 63 sethi %hi(0x40018c00), %o0
40006d94: 92 10 00 10 mov %l0, %o1
40006d98: 90 12 20 b4 or %o0, 0xb4, %o0
40006d9c: 40 00 09 02 call 400091a4 <_Objects_Get>
40006da0: 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 ) {
40006da4: c2 07 bf e0 ld [ %fp + -32 ], %g1
40006da8: 80 a0 60 00 cmp %g1, 0
40006dac: 12 80 00 4c bne 40006edc <timer_settime+0x218>
40006db0: 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 ) {
40006db4: c2 07 bf f8 ld [ %fp + -8 ], %g1
40006db8: 80 a0 60 00 cmp %g1, 0
40006dbc: 12 80 00 16 bne 40006e14 <timer_settime+0x150>
40006dc0: ba 02 20 10 add %o0, 0x10, %i5
40006dc4: c2 07 bf fc ld [ %fp + -4 ], %g1
40006dc8: 80 a0 60 00 cmp %g1, 0
40006dcc: 12 80 00 12 bne 40006e14 <timer_settime+0x150>
40006dd0: 01 00 00 00 nop
/* Stop the timer */
(void) _Watchdog_Remove( &ptimer->Timer );
40006dd4: 40 00 0f fc call 4000adc4 <_Watchdog_Remove>
40006dd8: 90 10 00 1d mov %i5, %o0
/* The old data of the timer are returned */
if ( ovalue )
40006ddc: 80 a6 e0 00 cmp %i3, 0
40006de0: 02 80 00 06 be 40006df8 <timer_settime+0x134>
40006de4: ba 06 60 54 add %i1, 0x54, %i5
*ovalue = ptimer->timer_data;
40006de8: 90 10 00 1b mov %i3, %o0
40006dec: 92 10 00 1d mov %i5, %o1
40006df0: 40 00 25 2e call 400102a8 <memcpy>
40006df4: 94 10 20 10 mov 0x10, %o2
/* The new data are set */
ptimer->timer_data = normalize;
40006df8: 90 10 00 1d mov %i5, %o0
40006dfc: 92 07 bf f0 add %fp, -16, %o1
40006e00: 40 00 25 2a call 400102a8 <memcpy>
40006e04: 94 10 20 10 mov 0x10, %o2
/* Indicates that the timer is created and stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
40006e08: 82 10 20 04 mov 4, %g1
40006e0c: 10 80 00 30 b 40006ecc <timer_settime+0x208>
40006e10: 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 );
40006e14: 40 00 0e fa call 4000a9fc <_Timespec_To_ticks>
40006e18: 90 10 00 1a mov %i2, %o0
40006e1c: d0 26 60 64 st %o0, [ %i1 + 0x64 ]
initial_period = _Timespec_To_ticks( &normalize.it_value );
40006e20: 40 00 0e f7 call 4000a9fc <_Timespec_To_ticks>
40006e24: 90 07 bf f8 add %fp, -8, %o0
activated = _POSIX_Timer_Insert_helper(
40006e28: 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 );
40006e2c: 92 10 00 08 mov %o0, %o1
activated = _POSIX_Timer_Insert_helper(
40006e30: 17 10 00 1b sethi %hi(0x40006c00), %o3
40006e34: 90 10 00 1d mov %i5, %o0
40006e38: 96 12 e2 f4 or %o3, 0x2f4, %o3
40006e3c: 40 00 17 8b call 4000cc68 <_POSIX_Timer_Insert_helper>
40006e40: 98 10 00 19 mov %i1, %o4
initial_period,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated ) {
40006e44: 80 a2 20 00 cmp %o0, 0
40006e48: 02 80 00 21 be 40006ecc <timer_settime+0x208>
40006e4c: 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 )
40006e50: 02 80 00 06 be 40006e68 <timer_settime+0x1a4>
40006e54: ba 06 60 54 add %i1, 0x54, %i5
*ovalue = ptimer->timer_data;
40006e58: 90 10 00 1b mov %i3, %o0
40006e5c: 92 10 00 1d mov %i5, %o1
40006e60: 40 00 25 12 call 400102a8 <memcpy>
40006e64: 94 10 20 10 mov 0x10, %o2
ptimer->timer_data = normalize;
40006e68: 94 10 20 10 mov 0x10, %o2
40006e6c: 90 10 00 1d mov %i5, %o0
40006e70: 40 00 25 0e call 400102a8 <memcpy>
40006e74: 92 07 bf f0 add %fp, -16, %o1
/* Indicate that the time is running */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
40006e78: 82 10 20 03 mov 3, %g1
tod_as_timestamp_ptr =
40006e7c: 90 07 bf e8 add %fp, -24, %o0
40006e80: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ]
40006e84: 13 10 00 62 sethi %hi(0x40018800), %o1
40006e88: 40 00 06 05 call 4000869c <_TOD_Get_with_nanoseconds>
40006e8c: 92 12 61 80 or %o1, 0x180, %o1 ! 40018980 <_TOD>
static inline void _TOD_Get(
struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
40006e90: 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);
40006e94: 94 10 20 00 clr %o2
40006e98: 90 10 00 1c mov %i4, %o0
40006e9c: 92 10 00 1d mov %i5, %o1
40006ea0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
40006ea4: 40 00 35 6e call 4001445c <__divdi3>
40006ea8: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
40006eac: 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);
40006eb0: d2 26 60 6c st %o1, [ %i1 + 0x6c ]
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
40006eb4: 94 10 20 00 clr %o2
40006eb8: 92 10 00 1d mov %i5, %o1
40006ebc: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
40006ec0: 40 00 36 59 call 40014824 <__moddi3>
40006ec4: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
40006ec8: d2 26 60 70 st %o1, [ %i1 + 0x70 ]
40006ecc: 40 00 0c 1e call 40009f44 <_Thread_Enable_dispatch>
40006ed0: 01 00 00 00 nop
_TOD_Get( &ptimer->time );
_Objects_Put( &ptimer->Object );
return 0;
40006ed4: 81 c7 e0 08 ret
40006ed8: 81 e8 00 00 restore
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EINVAL );
40006edc: 40 00 23 0d call 4000fb10 <__errno>
40006ee0: b0 10 3f ff mov -1, %i0
40006ee4: 82 10 20 16 mov 0x16, %g1
40006ee8: c2 22 00 00 st %g1, [ %o0 ]
}
40006eec: 81 c7 e0 08 ret
40006ef0: 81 e8 00 00 restore