RTEMS 4.11Annotated Report
Thu Dec 20 18:44:44 2012
4001165c <_CORE_message_queue_Initialize>:
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Attributes *the_message_queue_attributes,
uint32_t maximum_pending_messages,
size_t maximum_message_size
)
{
4001165c: 9d e3 bf a0 save %sp, -96, %sp
size_t message_buffering_required = 0;
size_t allocated_message_size;
the_message_queue->maximum_pending_messages = maximum_pending_messages;
40011660: f4 26 20 44 st %i2, [ %i0 + 0x44 ]
the_message_queue->number_of_pending_messages = 0;
40011664: c0 26 20 48 clr [ %i0 + 0x48 ]
/*
* Check if allocated_message_size is aligned to uintptr-size boundary.
* If not, it will increase allocated_message_size to multiplicity of pointer
* size.
*/
if (allocated_message_size & (sizeof(uintptr_t) - 1)) {
40011668: 80 8e e0 03 btst 3, %i3
4001166c: 02 80 00 09 be 40011690 <_CORE_message_queue_Initialize+0x34>
40011670: f6 26 20 4c st %i3, [ %i0 + 0x4c ]
allocated_message_size += sizeof(uintptr_t);
40011674: 96 06 e0 04 add %i3, 4, %o3
allocated_message_size &= ~(sizeof(uintptr_t) - 1);
40011678: 96 0a ff fc and %o3, -4, %o3
/*
* Check for an overflow. It can occur while increasing allocated_message_size
* to multiplicity of uintptr_t above.
*/
if (allocated_message_size < maximum_message_size)
4001167c: 80 a2 c0 1b cmp %o3, %i3
40011680: 3a 80 00 06 bcc,a 40011698 <_CORE_message_queue_Initialize+0x3c>
40011684: ba 02 e0 10 add %o3, 0x10, %i5
return false;
40011688: 10 80 00 24 b 40011718 <_CORE_message_queue_Initialize+0xbc>
4001168c: b0 10 20 00 clr %i0
/*
* Check if allocated_message_size is aligned to uintptr-size boundary.
* If not, it will increase allocated_message_size to multiplicity of pointer
* size.
*/
if (allocated_message_size & (sizeof(uintptr_t) - 1)) {
40011690: 96 10 00 1b mov %i3, %o3
/*
* Calculate how much total memory is required for message buffering and
* check for overflow on the multiplication.
*/
if ( !size_t_mult32_with_overflow(
40011694: ba 02 e0 10 add %o3, 0x10, %i5
size_t a,
size_t b,
size_t *c
)
{
long long x = (long long)a*b;
40011698: 90 10 20 00 clr %o0
4001169c: 92 10 00 1a mov %i2, %o1
400116a0: 94 10 20 00 clr %o2
400116a4: 40 00 3d 92 call 40020cec <__muldi3>
400116a8: 96 10 00 1d mov %i5, %o3
if ( x > SIZE_MAX )
400116ac: 80 a2 20 00 cmp %o0, 0
400116b0: 34 80 00 1a bg,a 40011718 <_CORE_message_queue_Initialize+0xbc>
400116b4: b0 10 20 00 clr %i0
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
_Workspace_Allocate( message_buffering_required );
400116b8: 40 00 0b bf call 400145b4 <_Workspace_Allocate>
400116bc: 90 10 00 09 mov %o1, %o0
return false;
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
400116c0: d0 26 20 5c st %o0, [ %i0 + 0x5c ]
_Workspace_Allocate( message_buffering_required );
if (the_message_queue->message_buffers == 0)
400116c4: 80 a2 20 00 cmp %o0, 0
400116c8: 02 bf ff f0 be 40011688 <_CORE_message_queue_Initialize+0x2c><== NEVER TAKEN
400116cc: 92 10 00 08 mov %o0, %o1
/*
* Initialize the pool of inactive messages, pending messages,
* and set of waiting threads.
*/
_Chain_Initialize (
400116d0: 90 06 20 60 add %i0, 0x60, %o0
400116d4: 94 10 00 1a mov %i2, %o2
400116d8: 7f ff ff d3 call 40011624 <_Chain_Initialize>
400116dc: 96 10 00 1d mov %i5, %o3
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
400116e0: 82 06 20 50 add %i0, 0x50, %g1
head->next = tail;
head->previous = NULL;
tail->previous = head;
400116e4: c2 26 20 58 st %g1, [ %i0 + 0x58 ]
*/
RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_priority(
CORE_message_queue_Attributes *the_attribute
)
{
return
400116e8: c2 06 40 00 ld [ %i1 ], %g1
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
400116ec: 84 06 20 54 add %i0, 0x54, %g2
400116f0: 82 18 60 01 xor %g1, 1, %g1
allocated_message_size + sizeof( CORE_message_queue_Buffer_control )
);
_Chain_Initialize_empty( &the_message_queue->Pending_messages );
_Thread_queue_Initialize(
400116f4: 80 a0 00 01 cmp %g0, %g1
head->next = tail;
400116f8: c4 26 20 50 st %g2, [ %i0 + 0x50 ]
head->previous = NULL;
400116fc: c0 26 20 54 clr [ %i0 + 0x54 ]
40011700: 90 10 00 18 mov %i0, %o0
40011704: 92 60 3f ff subx %g0, -1, %o1
40011708: 94 10 20 80 mov 0x80, %o2
4001170c: 96 10 20 06 mov 6, %o3
40011710: 40 00 09 87 call 40013d2c <_Thread_queue_Initialize>
40011714: b0 10 20 01 mov 1, %i0
STATES_WAITING_FOR_MESSAGE,
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
);
return true;
}
40011718: b0 0e 20 01 and %i0, 1, %i0
4001171c: 81 c7 e0 08 ret
40011720: 81 e8 00 00 restore
40008e8c <_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
)
{
40008e8c: 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)) ) {
40008e90: 90 10 00 18 mov %i0, %o0
40008e94: 40 00 07 27 call 4000ab30 <_Thread_queue_Dequeue>
40008e98: ba 10 00 18 mov %i0, %i5
40008e9c: 80 a2 20 00 cmp %o0, 0
40008ea0: 12 80 00 0e bne 40008ed8 <_CORE_semaphore_Surrender+0x4c>
40008ea4: 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 );
40008ea8: 7f ff e5 68 call 40002448 <sparc_disable_interrupts>
40008eac: 01 00 00 00 nop
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
40008eb0: c2 07 60 48 ld [ %i5 + 0x48 ], %g1
40008eb4: c4 07 60 40 ld [ %i5 + 0x40 ], %g2
40008eb8: 80 a0 40 02 cmp %g1, %g2
40008ebc: 1a 80 00 05 bcc 40008ed0 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN
40008ec0: b0 10 20 04 mov 4, %i0
the_semaphore->count += 1;
40008ec4: 82 00 60 01 inc %g1
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
40008ec8: b0 10 20 00 clr %i0
#endif
} else {
_ISR_Disable( level );
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
the_semaphore->count += 1;
40008ecc: c2 27 60 48 st %g1, [ %i5 + 0x48 ]
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
_ISR_Enable( level );
40008ed0: 7f ff e5 62 call 40002458 <sparc_enable_interrupts>
40008ed4: 01 00 00 00 nop
}
return status;
}
40008ed8: 81 c7 e0 08 ret
40008edc: 81 e8 00 00 restore
40007b84 <_Event_Surrender>:
rtems_event_set event_in,
Event_Control *event,
Thread_blocking_operation_States *sync_state,
States_Control wait_state
)
{
40007b84: 9d e3 bf a0 save %sp, -96, %sp
rtems_event_set pending_events;
rtems_event_set event_condition;
rtems_event_set seized_events;
rtems_option option_set;
option_set = the_thread->Wait.option;
40007b88: e0 06 20 30 ld [ %i0 + 0x30 ], %l0
_ISR_Disable( level );
40007b8c: 7f ff ea 2f call 40002448 <sparc_disable_interrupts>
40007b90: ba 10 00 18 mov %i0, %i5
40007b94: b0 10 00 08 mov %o0, %i0
RTEMS_INLINE_ROUTINE void _Event_sets_Post(
rtems_event_set the_new_events,
rtems_event_set *the_event_set
)
{
*the_event_set |= the_new_events;
40007b98: c2 06 80 00 ld [ %i2 ], %g1
40007b9c: b2 16 40 01 or %i1, %g1, %i1
40007ba0: f2 26 80 00 st %i1, [ %i2 ]
_Event_sets_Post( event_in, &event->pending_events );
pending_events = event->pending_events;
event_condition = the_thread->Wait.count;
40007ba4: c4 07 60 24 ld [ %i5 + 0x24 ], %g2
seized_events = _Event_sets_Get( pending_events, event_condition );
/*
* No events were seized in this operation
*/
if ( _Event_sets_Is_empty( seized_events ) ) {
40007ba8: 82 8e 40 02 andcc %i1, %g2, %g1
40007bac: 02 80 00 3d be 40007ca0 <_Event_Surrender+0x11c>
40007bb0: 07 10 00 78 sethi %hi(0x4001e000), %g3
/*
* If we are in an ISR and sending to the current thread, then
* we have a critical section issue to deal with.
*/
if ( _ISR_Is_in_progress() &&
40007bb4: 86 10 e1 30 or %g3, 0x130, %g3 ! 4001e130 <_Per_CPU_Information>
40007bb8: c8 00 e0 08 ld [ %g3 + 8 ], %g4
40007bbc: 80 a1 20 00 cmp %g4, 0
40007bc0: 22 80 00 18 be,a 40007c20 <_Event_Surrender+0x9c>
40007bc4: c6 07 60 10 ld [ %i5 + 0x10 ], %g3
40007bc8: c6 00 e0 10 ld [ %g3 + 0x10 ], %g3
40007bcc: 80 a7 40 03 cmp %i5, %g3
40007bd0: 32 80 00 14 bne,a 40007c20 <_Event_Surrender+0x9c>
40007bd4: c6 07 60 10 ld [ %i5 + 0x10 ], %g3
_Thread_Is_executing( the_thread ) &&
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
40007bd8: c6 06 c0 00 ld [ %i3 ], %g3
40007bdc: 86 00 ff ff add %g3, -1, %g3
/*
* If we are in an ISR and sending to the current thread, then
* we have a critical section issue to deal with.
*/
if ( _ISR_Is_in_progress() &&
_Thread_Is_executing( the_thread ) &&
40007be0: 80 a0 e0 01 cmp %g3, 1
40007be4: 38 80 00 0f bgu,a 40007c20 <_Event_Surrender+0x9c>
40007be8: c6 07 60 10 ld [ %i5 + 0x10 ], %g3
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
40007bec: 80 a0 40 02 cmp %g1, %g2
40007bf0: 02 80 00 04 be 40007c00 <_Event_Surrender+0x7c>
40007bf4: 80 8c 20 02 btst 2, %l0
40007bf8: 02 80 00 2a be 40007ca0 <_Event_Surrender+0x11c> <== NEVER TAKEN
40007bfc: 01 00 00 00 nop
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
rtems_event_set the_event_set,
rtems_event_set the_mask
)
{
return ( the_event_set & ~(the_mask) );
40007c00: b2 2e 40 01 andn %i1, %g1, %i1
event->pending_events = _Event_sets_Clear(
pending_events,
seized_events
);
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
40007c04: c4 07 60 28 ld [ %i5 + 0x28 ], %g2
if ( _ISR_Is_in_progress() &&
_Thread_Is_executing( the_thread ) &&
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
event->pending_events = _Event_sets_Clear(
40007c08: f2 26 80 00 st %i1, [ %i2 ]
pending_events,
seized_events
);
the_thread->Wait.count = 0;
40007c0c: c0 27 60 24 clr [ %i5 + 0x24 ]
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
40007c10: c2 20 80 00 st %g1, [ %g2 ]
*sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
40007c14: 82 10 20 03 mov 3, %g1
40007c18: 10 80 00 22 b 40007ca0 <_Event_Surrender+0x11c>
40007c1c: c2 26 c0 00 st %g1, [ %i3 ]
}
/*
* Otherwise, this is a normal send to another thread
*/
if ( _States_Are_set( the_thread->current_state, wait_state ) ) {
40007c20: 80 8f 00 03 btst %i4, %g3
40007c24: 02 80 00 1f be 40007ca0 <_Event_Surrender+0x11c>
40007c28: 80 a0 40 02 cmp %g1, %g2
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
40007c2c: 02 80 00 04 be 40007c3c <_Event_Surrender+0xb8>
40007c30: 80 8c 20 02 btst 2, %l0
40007c34: 02 80 00 1b be 40007ca0 <_Event_Surrender+0x11c> <== NEVER TAKEN
40007c38: 01 00 00 00 nop
event->pending_events = _Event_sets_Clear(
pending_events,
seized_events
);
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
40007c3c: c4 07 60 28 ld [ %i5 + 0x28 ], %g2
40007c40: b2 2e 40 01 andn %i1, %g1, %i1
/*
* Otherwise, this is a normal send to another thread
*/
if ( _States_Are_set( the_thread->current_state, wait_state ) ) {
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
event->pending_events = _Event_sets_Clear(
40007c44: f2 26 80 00 st %i1, [ %i2 ]
pending_events,
seized_events
);
the_thread->Wait.count = 0;
40007c48: c0 27 60 24 clr [ %i5 + 0x24 ]
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
40007c4c: c2 20 80 00 st %g1, [ %g2 ]
_ISR_Flash( level );
40007c50: 7f ff ea 02 call 40002458 <sparc_enable_interrupts>
40007c54: 90 10 00 18 mov %i0, %o0
40007c58: 7f ff e9 fc call 40002448 <sparc_disable_interrupts>
40007c5c: 01 00 00 00 nop
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
40007c60: c2 07 60 50 ld [ %i5 + 0x50 ], %g1
40007c64: 80 a0 60 02 cmp %g1, 2
40007c68: 02 80 00 06 be 40007c80 <_Event_Surrender+0xfc>
40007c6c: 82 10 20 03 mov 3, %g1
_ISR_Enable( level );
40007c70: 7f ff e9 fa call 40002458 <sparc_enable_interrupts>
40007c74: 33 04 01 ff sethi %hi(0x1007fc00), %i1
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
40007c78: 10 80 00 08 b 40007c98 <_Event_Surrender+0x114>
40007c7c: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 <RAM_SIZE+0xfc7fff8>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
40007c80: c2 27 60 50 st %g1, [ %i5 + 0x50 ]
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
40007c84: 7f ff e9 f5 call 40002458 <sparc_enable_interrupts>
40007c88: 33 04 01 ff sethi %hi(0x1007fc00), %i1
(void) _Watchdog_Remove( &the_thread->Timer );
40007c8c: 40 00 0e 35 call 4000b560 <_Watchdog_Remove>
40007c90: 90 07 60 48 add %i5, 0x48, %o0
40007c94: b2 16 63 f8 or %i1, 0x3f8, %i1
40007c98: 40 00 0a 03 call 4000a4a4 <_Thread_Clear_state>
40007c9c: 91 e8 00 1d restore %g0, %i5, %o0
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
40007ca0: 7f ff e9 ee call 40002458 <sparc_enable_interrupts>
40007ca4: 81 e8 00 00 restore
40007ca8 <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *arg
)
{
40007ca8: 9d e3 bf 98 save %sp, -104, %sp
ISR_Level level;
Thread_blocking_operation_States *sync_state;
sync_state = arg;
the_thread = _Thread_Get( id, &location );
40007cac: 90 10 00 18 mov %i0, %o0
40007cb0: 40 00 0a df call 4000a82c <_Thread_Get>
40007cb4: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
40007cb8: c2 07 bf fc ld [ %fp + -4 ], %g1
40007cbc: 80 a0 60 00 cmp %g1, 0
40007cc0: 12 80 00 1b bne 40007d2c <_Event_Timeout+0x84> <== NEVER TAKEN
40007cc4: ba 10 00 08 mov %o0, %i5
*
* If it is not satisfied, then it is "nothing happened" and
* this is the "timeout" transition. After a request is satisfied,
* a timeout is not allowed to occur.
*/
_ISR_Disable( level );
40007cc8: 7f ff e9 e0 call 40002448 <sparc_disable_interrupts>
40007ccc: 01 00 00 00 nop
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
40007cd0: 03 10 00 78 sethi %hi(0x4001e000), %g1
return;
}
#endif
the_thread->Wait.count = 0;
if ( _Thread_Is_executing( the_thread ) ) {
40007cd4: c2 00 61 40 ld [ %g1 + 0x140 ], %g1 ! 4001e140 <_Per_CPU_Information+0x10>
40007cd8: 80 a7 40 01 cmp %i5, %g1
40007cdc: 12 80 00 08 bne 40007cfc <_Event_Timeout+0x54>
40007ce0: c0 27 60 24 clr [ %i5 + 0x24 ]
if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
40007ce4: c2 06 40 00 ld [ %i1 ], %g1
40007ce8: 80 a0 60 01 cmp %g1, 1
40007cec: 12 80 00 05 bne 40007d00 <_Event_Timeout+0x58>
40007cf0: 82 10 20 06 mov 6, %g1
*sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
40007cf4: 82 10 20 02 mov 2, %g1
40007cf8: c2 26 40 00 st %g1, [ %i1 ]
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
40007cfc: 82 10 20 06 mov 6, %g1
40007d00: c2 27 60 34 st %g1, [ %i5 + 0x34 ]
_ISR_Enable( level );
40007d04: 7f ff e9 d5 call 40002458 <sparc_enable_interrupts>
40007d08: 01 00 00 00 nop
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
40007d0c: 90 10 00 1d mov %i5, %o0
40007d10: 13 04 01 ff sethi %hi(0x1007fc00), %o1
40007d14: 40 00 09 e4 call 4000a4a4 <_Thread_Clear_state>
40007d18: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 <RAM_SIZE+0xfc7fff8>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
40007d1c: 03 10 00 77 sethi %hi(0x4001dc00), %g1
40007d20: c4 00 63 30 ld [ %g1 + 0x330 ], %g2 ! 4001df30 <_Thread_Dispatch_disable_level>
--level;
40007d24: 84 00 bf ff add %g2, -1, %g2
_Thread_Dispatch_disable_level = level;
40007d28: c4 20 63 30 st %g2, [ %g1 + 0x330 ]
40007d2c: 81 c7 e0 08 ret
40007d30: 81 e8 00 00 restore
4000d40c <_Heap_Free>:
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
4000d40c: 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 ) {
4000d410: 80 a6 60 00 cmp %i1, 0
4000d414: 02 80 00 7a be 4000d5fc <_Heap_Free+0x1f0>
4000d418: 88 10 20 01 mov 1, %g4
4000d41c: d2 06 20 10 ld [ %i0 + 0x10 ], %o1
4000d420: 40 00 2b 64 call 400181b0 <.urem>
4000d424: 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
4000d428: f6 06 20 20 ld [ %i0 + 0x20 ], %i3
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
4000d42c: 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);
4000d430: 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;
4000d434: 80 a2 00 1b cmp %o0, %i3
4000d438: 0a 80 00 05 bcs 4000d44c <_Heap_Free+0x40>
4000d43c: 82 10 20 00 clr %g1
4000d440: c2 06 20 24 ld [ %i0 + 0x24 ], %g1
4000d444: 80 a0 40 08 cmp %g1, %o0
4000d448: 82 60 3f ff subx %g0, -1, %g1
}
alloc_begin = (uintptr_t) alloc_begin_ptr;
block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
4000d44c: 80 a0 60 00 cmp %g1, 0
4000d450: 02 80 00 6b be 4000d5fc <_Heap_Free+0x1f0>
4000d454: 88 10 20 00 clr %g4
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
4000d458: f8 02 20 04 ld [ %o0 + 4 ], %i4
4000d45c: 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);
4000d460: 82 02 00 02 add %o0, %g2, %g1
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
4000d464: 80 a0 40 1b cmp %g1, %i3
4000d468: 0a 80 00 05 bcs 4000d47c <_Heap_Free+0x70> <== NEVER TAKEN
4000d46c: 86 10 20 00 clr %g3
4000d470: c6 06 20 24 ld [ %i0 + 0x24 ], %g3
4000d474: 80 a0 c0 01 cmp %g3, %g1
4000d478: 86 60 3f ff subx %g0, -1, %g3
_Heap_Protection_block_check( heap, block );
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
4000d47c: 80 a0 e0 00 cmp %g3, 0
4000d480: 02 80 00 5f be 4000d5fc <_Heap_Free+0x1f0> <== NEVER TAKEN
4000d484: 88 10 20 00 clr %g4
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
4000d488: fa 00 60 04 ld [ %g1 + 4 ], %i5
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
4000d48c: 80 8f 60 01 btst 1, %i5
4000d490: 22 80 00 5c be,a 4000d600 <_Heap_Free+0x1f4> <== NEVER TAKEN
4000d494: b0 09 20 01 and %g4, 1, %i0 <== NOT EXECUTED
if ( !_Heap_Protection_determine_block_free( heap, block ) ) {
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
4000d498: c8 06 20 24 ld [ %i0 + 0x24 ], %g4
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
4000d49c: 80 a0 40 04 cmp %g1, %g4
4000d4a0: 02 80 00 07 be 4000d4bc <_Heap_Free+0xb0>
4000d4a4: ba 0f 7f fe and %i5, -2, %i5
4000d4a8: 86 00 40 1d add %g1, %i5, %g3
4000d4ac: f4 00 e0 04 ld [ %g3 + 4 ], %i2
4000d4b0: b4 1e a0 01 xor %i2, 1, %i2
4000d4b4: 10 80 00 03 b 4000d4c0 <_Heap_Free+0xb4>
4000d4b8: b4 0e a0 01 and %i2, 1, %i2
4000d4bc: b4 10 20 00 clr %i2
if ( !_Heap_Is_prev_used( block ) ) {
4000d4c0: 80 8f 20 01 btst 1, %i4
4000d4c4: 12 80 00 26 bne 4000d55c <_Heap_Free+0x150>
4000d4c8: 80 8e a0 ff btst 0xff, %i2
uintptr_t const prev_size = block->prev_size;
4000d4cc: 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);
4000d4d0: 86 22 00 1c sub %o0, %i4, %g3
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
4000d4d4: 80 a0 c0 1b cmp %g3, %i3
4000d4d8: 0a 80 00 04 bcs 4000d4e8 <_Heap_Free+0xdc> <== NEVER TAKEN
4000d4dc: b2 10 20 00 clr %i1
4000d4e0: 80 a1 00 03 cmp %g4, %g3
4000d4e4: b2 60 3f ff subx %g0, -1, %i1
Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size );
if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) {
4000d4e8: 80 a6 60 00 cmp %i1, 0
4000d4ec: 02 80 00 44 be 4000d5fc <_Heap_Free+0x1f0> <== NEVER TAKEN
4000d4f0: 88 10 20 00 clr %g4
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
4000d4f4: f6 00 e0 04 ld [ %g3 + 4 ], %i3
return( false );
}
/* As we always coalesce free blocks, the block that preceedes prev_block
must have been used. */
if ( !_Heap_Is_prev_used ( prev_block) ) {
4000d4f8: 80 8e e0 01 btst 1, %i3
4000d4fc: 02 80 00 40 be 4000d5fc <_Heap_Free+0x1f0> <== NEVER TAKEN
4000d500: 80 8e a0 ff btst 0xff, %i2
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
4000d504: 22 80 00 0f be,a 4000d540 <_Heap_Free+0x134>
4000d508: b8 00 80 1c add %g2, %i4, %i4
return _Heap_Free_list_tail(heap)->prev;
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
4000d50c: c8 00 60 08 ld [ %g1 + 8 ], %g4
Heap_Block *prev = block->prev;
4000d510: c2 00 60 0c ld [ %g1 + 0xc ], %g1
uintptr_t const size = block_size + prev_size + next_block_size;
4000d514: ba 00 80 1d add %g2, %i5, %i5
prev->next = next;
4000d518: c8 20 60 08 st %g4, [ %g1 + 8 ]
next->prev = prev;
4000d51c: c2 21 20 0c st %g1, [ %g4 + 0xc ]
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
4000d520: c2 06 20 38 ld [ %i0 + 0x38 ], %g1
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
4000d524: b8 07 40 1c add %i5, %i4, %i4
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
4000d528: 82 00 7f ff add %g1, -1, %g1
4000d52c: c2 26 20 38 st %g1, [ %i0 + 0x38 ]
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
4000d530: f8 20 c0 1c st %i4, [ %g3 + %i4 ]
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4000d534: 82 17 20 01 or %i4, 1, %g1
4000d538: 10 80 00 27 b 4000d5d4 <_Heap_Free+0x1c8>
4000d53c: c2 20 e0 04 st %g1, [ %g3 + 4 ]
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4000d540: 88 17 20 01 or %i4, 1, %g4
4000d544: c8 20 e0 04 st %g4, [ %g3 + 4 ]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4000d548: c6 00 60 04 ld [ %g1 + 4 ], %g3
next_block->prev_size = size;
4000d54c: f8 22 00 02 st %i4, [ %o0 + %g2 ]
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4000d550: 86 08 ff fe and %g3, -2, %g3
4000d554: 10 80 00 20 b 4000d5d4 <_Heap_Free+0x1c8>
4000d558: c6 20 60 04 st %g3, [ %g1 + 4 ]
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
4000d55c: 22 80 00 0d be,a 4000d590 <_Heap_Free+0x184>
4000d560: c6 06 20 08 ld [ %i0 + 8 ], %g3
RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace(
Heap_Block *old_block,
Heap_Block *new_block
)
{
Heap_Block *next = old_block->next;
4000d564: c8 00 60 08 ld [ %g1 + 8 ], %g4
Heap_Block *prev = old_block->prev;
4000d568: c2 00 60 0c ld [ %g1 + 0xc ], %g1
new_block->next = next;
4000d56c: c8 22 20 08 st %g4, [ %o0 + 8 ]
new_block->prev = prev;
4000d570: c2 22 20 0c st %g1, [ %o0 + 0xc ]
uintptr_t const size = block_size + next_block_size;
4000d574: 86 07 40 02 add %i5, %g2, %g3
next->prev = new_block;
prev->next = new_block;
4000d578: d0 20 60 08 st %o0, [ %g1 + 8 ]
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
4000d57c: d0 21 20 0c st %o0, [ %g4 + 0xc ]
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4000d580: 82 10 e0 01 or %g3, 1, %g1
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
4000d584: c6 22 00 03 st %g3, [ %o0 + %g3 ]
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
uintptr_t const size = block_size + next_block_size;
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4000d588: 10 80 00 13 b 4000d5d4 <_Heap_Free+0x1c8>
4000d58c: c2 22 20 04 st %g1, [ %o0 + 4 ]
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
4000d590: f0 22 20 0c st %i0, [ %o0 + 0xc ]
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
4000d594: c6 22 20 08 st %g3, [ %o0 + 8 ]
new_block->prev = block_before;
block_before->next = new_block;
next->prev = new_block;
4000d598: d0 20 e0 0c st %o0, [ %g3 + 0xc ]
next_block->prev_size = size;
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
4000d59c: 86 10 a0 01 or %g2, 1, %g3
4000d5a0: c6 22 20 04 st %g3, [ %o0 + 4 ]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4000d5a4: c6 00 60 04 ld [ %g1 + 4 ], %g3
next_block->prev_size = block_size;
4000d5a8: c4 22 00 02 st %g2, [ %o0 + %g2 ]
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4000d5ac: 86 08 ff fe and %g3, -2, %g3
4000d5b0: c6 20 60 04 st %g3, [ %g1 + 4 ]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
4000d5b4: c2 06 20 38 ld [ %i0 + 0x38 ], %g1
if ( stats->max_free_blocks < stats->free_blocks ) {
4000d5b8: c6 06 20 3c ld [ %i0 + 0x3c ], %g3
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
4000d5bc: 82 00 60 01 inc %g1
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
4000d5c0: d0 26 20 08 st %o0, [ %i0 + 8 ]
if ( stats->max_free_blocks < stats->free_blocks ) {
4000d5c4: 80 a0 c0 01 cmp %g3, %g1
4000d5c8: 1a 80 00 03 bcc 4000d5d4 <_Heap_Free+0x1c8>
4000d5cc: c2 26 20 38 st %g1, [ %i0 + 0x38 ]
stats->max_free_blocks = stats->free_blocks;
4000d5d0: c2 26 20 3c st %g1, [ %i0 + 0x3c ]
}
}
/* Statistics */
--stats->used_blocks;
4000d5d4: c2 06 20 40 ld [ %i0 + 0x40 ], %g1
4000d5d8: 82 00 7f ff add %g1, -1, %g1
4000d5dc: c2 26 20 40 st %g1, [ %i0 + 0x40 ]
++stats->frees;
4000d5e0: c2 06 20 50 ld [ %i0 + 0x50 ], %g1
4000d5e4: 82 00 60 01 inc %g1
4000d5e8: c2 26 20 50 st %g1, [ %i0 + 0x50 ]
stats->free_size += block_size;
4000d5ec: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
4000d5f0: 84 00 40 02 add %g1, %g2, %g2
4000d5f4: c4 26 20 30 st %g2, [ %i0 + 0x30 ]
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
return true;
4000d5f8: 88 10 20 01 mov 1, %g4
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4000d5fc: b0 09 20 01 and %g4, 1, %i0
4000d600: 81 c7 e0 08 ret
4000d604: 81 e8 00 00 restore
4000b07c <_Heap_Greedy_allocate>:
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
4000b07c: 9d e3 bf a0 save %sp, -96, %sp
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
4000b080: b6 10 20 00 clr %i3
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
4000b084: ba 10 00 18 mov %i0, %i5
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
4000b088: 10 80 00 11 b 4000b0cc <_Heap_Greedy_allocate+0x50>
4000b08c: b8 10 20 00 clr %i4
* @brief See _Heap_Allocate_aligned_with_boundary() with alignment and
* boundary equals zero.
*/
RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size )
{
return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
4000b090: d2 06 40 01 ld [ %i1 + %g1 ], %o1
4000b094: 90 10 00 1d mov %i5, %o0
4000b098: 94 10 20 00 clr %o2
4000b09c: 40 00 1b 73 call 40011e68 <_Heap_Allocate_aligned_with_boundary>
4000b0a0: 96 10 20 00 clr %o3
void *next = _Heap_Allocate( heap, block_sizes [i] );
if ( next != NULL ) {
4000b0a4: 82 92 20 00 orcc %o0, 0, %g1
4000b0a8: 22 80 00 09 be,a 4000b0cc <_Heap_Greedy_allocate+0x50> <== NEVER TAKEN
4000b0ac: b6 06 e0 01 inc %i3 <== NOT EXECUTED
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
4000b0b0: d2 07 60 10 ld [ %i5 + 0x10 ], %o1
4000b0b4: 40 00 31 25 call 40017548 <.urem>
4000b0b8: b0 00 7f f8 add %g1, -8, %i0
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
4000b0bc: 90 26 00 08 sub %i0, %o0, %o0
Heap_Block *next_block = _Heap_Block_of_alloc_area(
(uintptr_t) next,
heap->page_size
);
next_block->next = allocated_blocks;
4000b0c0: f8 22 20 08 st %i4, [ %o0 + 8 ]
4000b0c4: b8 10 00 08 mov %o0, %i4
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
4000b0c8: b6 06 e0 01 inc %i3
4000b0cc: 80 a6 c0 1a cmp %i3, %i2
4000b0d0: 12 bf ff f0 bne 4000b090 <_Heap_Greedy_allocate+0x14>
4000b0d4: 83 2e e0 02 sll %i3, 2, %g1
4000b0d8: 10 80 00 0a b 4000b100 <_Heap_Greedy_allocate+0x84>
4000b0dc: b0 10 20 00 clr %i0
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
_Heap_Block_allocate(
4000b0e0: 90 10 00 1d mov %i5, %o0
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
4000b0e4: 96 0a ff fe and %o3, -2, %o3
4000b0e8: 92 10 00 1b mov %i3, %o1
4000b0ec: 94 06 e0 08 add %i3, 8, %o2
4000b0f0: 40 00 00 cb call 4000b41c <_Heap_Block_allocate>
4000b0f4: 96 02 ff f8 add %o3, -8, %o3
current,
_Heap_Alloc_area_of_block( current ),
_Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE
);
current->next = blocks;
4000b0f8: f0 26 e0 08 st %i0, [ %i3 + 8 ]
4000b0fc: b0 10 00 1b mov %i3, %i0
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
4000b100: f6 07 60 08 ld [ %i5 + 8 ], %i3
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
4000b104: 80 a6 c0 1d cmp %i3, %i5
4000b108: 32 bf ff f6 bne,a 4000b0e0 <_Heap_Greedy_allocate+0x64>
4000b10c: d6 06 e0 04 ld [ %i3 + 4 ], %o3
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
4000b110: 10 80 00 07 b 4000b12c <_Heap_Greedy_allocate+0xb0>
4000b114: 80 a7 20 00 cmp %i4, 0
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
4000b118: 92 07 20 08 add %i4, 8, %o1
4000b11c: 90 10 00 1d mov %i5, %o0
4000b120: 40 00 1b c3 call 4001202c <_Heap_Free>
4000b124: b8 10 00 1b mov %i3, %i4
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
4000b128: 80 a7 20 00 cmp %i4, 0
4000b12c: 32 bf ff fb bne,a 4000b118 <_Heap_Greedy_allocate+0x9c>
4000b130: f6 07 20 08 ld [ %i4 + 8 ], %i3
allocated_blocks = allocated_blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
}
return blocks;
}
4000b134: 81 c7 e0 08 ret
4000b138: 81 e8 00 00 restore
40012e70 <_Heap_Iterate>:
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
40012e70: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
bool stop = false;
40012e74: 90 10 20 00 clr %o0 <== NOT EXECUTED
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
Heap_Block *current = heap->first_block;
40012e78: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 <== NOT EXECUTED
Heap_Block *end = heap->last_block;
bool stop = false;
while ( !stop && current != end ) {
40012e7c: 10 80 00 0a b 40012ea4 <_Heap_Iterate+0x34> <== NOT EXECUTED
40012e80: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 <== NOT EXECUTED
uintptr_t size = _Heap_Block_size( current );
Heap_Block *next = _Heap_Block_at( current, size );
bool used = _Heap_Is_prev_used( next );
stop = (*visitor)( current, size, used, visitor_arg );
40012e84: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED
40012e88: 92 0a 7f fe and %o1, -2, %o1 <== NOT EXECUTED
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
40012e8c: ba 00 40 09 add %g1, %o1, %i5 <== NOT EXECUTED
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
40012e90: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED
40012e94: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED
40012e98: 9f c6 40 00 call %i1 <== NOT EXECUTED
40012e9c: 94 0a a0 01 and %o2, 1, %o2 <== NOT EXECUTED
40012ea0: 82 10 00 1d mov %i5, %g1 <== NOT EXECUTED
{
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
bool stop = false;
while ( !stop && current != end ) {
40012ea4: 80 a0 40 1c cmp %g1, %i4 <== NOT EXECUTED
40012ea8: 02 80 00 05 be 40012ebc <_Heap_Iterate+0x4c> <== NOT EXECUTED
40012eac: 90 1a 20 01 xor %o0, 1, %o0 <== NOT EXECUTED
40012eb0: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED
40012eb4: 32 bf ff f4 bne,a 40012e84 <_Heap_Iterate+0x14> <== NOT EXECUTED
40012eb8: d2 00 60 04 ld [ %g1 + 4 ], %o1 <== NOT EXECUTED
40012ebc: 81 c7 e0 08 ret <== NOT EXECUTED
40012ec0: 81 e8 00 00 restore <== NOT EXECUTED
4001b1b0 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
4001b1b0: 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);
4001b1b4: d2 06 20 10 ld [ %i0 + 0x10 ], %o1
4001b1b8: 7f ff f3 fe call 400181b0 <.urem>
4001b1bc: 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
4001b1c0: 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);
4001b1c4: 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);
4001b1c8: 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;
4001b1cc: 80 a2 00 04 cmp %o0, %g4
4001b1d0: 0a 80 00 05 bcs 4001b1e4 <_Heap_Size_of_alloc_area+0x34>
4001b1d4: 82 10 20 00 clr %g1
4001b1d8: c2 06 20 24 ld [ %i0 + 0x24 ], %g1
4001b1dc: 80 a0 40 08 cmp %g1, %o0
4001b1e0: 82 60 3f ff subx %g0, -1, %g1
uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr;
Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size );
Heap_Block *next_block = NULL;
uintptr_t block_size = 0;
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
4001b1e4: 80 a0 60 00 cmp %g1, 0
4001b1e8: 02 80 00 15 be 4001b23c <_Heap_Size_of_alloc_area+0x8c>
4001b1ec: 86 10 20 00 clr %g3
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
4001b1f0: c2 02 20 04 ld [ %o0 + 4 ], %g1
4001b1f4: 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);
4001b1f8: 82 02 00 01 add %o0, %g1, %g1
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
4001b1fc: 80 a0 40 04 cmp %g1, %g4
4001b200: 0a 80 00 05 bcs 4001b214 <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN
4001b204: 84 10 20 00 clr %g2
4001b208: c4 06 20 24 ld [ %i0 + 0x24 ], %g2
4001b20c: 80 a0 80 01 cmp %g2, %g1
4001b210: 84 60 3f ff subx %g0, -1, %g2
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
4001b214: 80 a0 a0 00 cmp %g2, 0
4001b218: 02 80 00 09 be 4001b23c <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN
4001b21c: 86 10 20 00 clr %g3
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
4001b220: c4 00 60 04 ld [ %g1 + 4 ], %g2
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
4001b224: 80 88 a0 01 btst 1, %g2
4001b228: 02 80 00 05 be 4001b23c <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN
4001b22c: 82 20 40 19 sub %g1, %i1, %g1
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
return true;
4001b230: 86 10 20 01 mov 1, %g3
|| !_Heap_Is_prev_used( next_block )
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
4001b234: 82 00 60 04 add %g1, 4, %g1
4001b238: c2 26 80 00 st %g1, [ %i2 ]
return true;
}
4001b23c: b0 08 e0 01 and %g3, 1, %i0
4001b240: 81 c7 e0 08 ret
4001b244: 81 e8 00 00 restore
40009c74 <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
40009c74: 9d e3 bf 80 save %sp, -128, %sp
40009c78: ac 10 00 19 mov %i1, %l6
uintptr_t const page_size = heap->page_size;
40009c7c: f8 06 20 10 ld [ %i0 + 0x10 ], %i4
uintptr_t const min_block_size = heap->min_block_size;
40009c80: f6 06 20 14 ld [ %i0 + 0x14 ], %i3
Heap_Block *const first_block = heap->first_block;
40009c84: 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;
40009c88: 80 a6 a0 00 cmp %i2, 0
40009c8c: 02 80 00 05 be 40009ca0 <_Heap_Walk+0x2c>
40009c90: e0 06 20 24 ld [ %i0 + 0x24 ], %l0
40009c94: 3b 10 00 27 sethi %hi(0x40009c00), %i5
40009c98: 10 80 00 04 b 40009ca8 <_Heap_Walk+0x34>
40009c9c: ba 17 60 24 or %i5, 0x24, %i5 ! 40009c24 <_Heap_Walk_print>
40009ca0: 3b 10 00 27 sethi %hi(0x40009c00), %i5
40009ca4: ba 17 60 1c or %i5, 0x1c, %i5 ! 40009c1c <_Heap_Walk_print_nothing>
if ( !_System_state_Is_up( _System_state_Get() ) ) {
40009ca8: 05 10 00 61 sethi %hi(0x40018400), %g2
40009cac: c4 00 a2 ec ld [ %g2 + 0x2ec ], %g2 ! 400186ec <_System_state_Current>
40009cb0: 80 a0 a0 03 cmp %g2, 3
40009cb4: 22 80 00 04 be,a 40009cc4 <_Heap_Walk+0x50>
40009cb8: c4 06 20 1c ld [ %i0 + 0x1c ], %g2
return true;
40009cbc: 10 80 01 2a b 4000a164 <_Heap_Walk+0x4f0>
40009cc0: b0 10 20 01 mov 1, %i0
Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
(*printer)(
40009cc4: da 06 20 18 ld [ %i0 + 0x18 ], %o5
40009cc8: c4 23 a0 5c st %g2, [ %sp + 0x5c ]
40009ccc: f2 23 a0 60 st %i1, [ %sp + 0x60 ]
40009cd0: e0 23 a0 64 st %l0, [ %sp + 0x64 ]
40009cd4: c4 06 20 08 ld [ %i0 + 8 ], %g2
40009cd8: 90 10 00 16 mov %l6, %o0
40009cdc: c4 23 a0 68 st %g2, [ %sp + 0x68 ]
40009ce0: c4 06 20 0c ld [ %i0 + 0xc ], %g2
40009ce4: 92 10 20 00 clr %o1
40009ce8: c4 23 a0 6c st %g2, [ %sp + 0x6c ]
40009cec: 15 10 00 56 sethi %hi(0x40015800), %o2
40009cf0: 96 10 00 1c mov %i4, %o3
40009cf4: 94 12 a3 e8 or %o2, 0x3e8, %o2
40009cf8: 9f c7 40 00 call %i5
40009cfc: 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 ) {
40009d00: 80 a7 20 00 cmp %i4, 0
40009d04: 12 80 00 07 bne 40009d20 <_Heap_Walk+0xac>
40009d08: 80 8f 20 07 btst 7, %i4
(*printer)( source, true, "page size is zero\n" );
40009d0c: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009d10: 90 10 00 16 mov %l6, %o0
40009d14: 92 10 20 01 mov 1, %o1
40009d18: 10 80 00 37 b 40009df4 <_Heap_Walk+0x180>
40009d1c: 94 12 a0 80 or %o2, 0x80, %o2
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
40009d20: 22 80 00 08 be,a 40009d40 <_Heap_Walk+0xcc>
40009d24: 90 10 00 1b mov %i3, %o0
(*printer)(
40009d28: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009d2c: 90 10 00 16 mov %l6, %o0
40009d30: 92 10 20 01 mov 1, %o1
40009d34: 94 12 a0 98 or %o2, 0x98, %o2
40009d38: 10 80 01 12 b 4000a180 <_Heap_Walk+0x50c>
40009d3c: 96 10 00 1c mov %i4, %o3
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
40009d40: 7f ff df 91 call 40001b84 <.urem>
40009d44: 92 10 00 1c mov %i4, %o1
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
40009d48: 80 a2 20 00 cmp %o0, 0
40009d4c: 22 80 00 08 be,a 40009d6c <_Heap_Walk+0xf8>
40009d50: 90 06 60 08 add %i1, 8, %o0
(*printer)(
40009d54: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009d58: 90 10 00 16 mov %l6, %o0
40009d5c: 92 10 20 01 mov 1, %o1
40009d60: 94 12 a0 b8 or %o2, 0xb8, %o2
40009d64: 10 80 01 07 b 4000a180 <_Heap_Walk+0x50c>
40009d68: 96 10 00 1b mov %i3, %o3
40009d6c: 7f ff df 86 call 40001b84 <.urem>
40009d70: 92 10 00 1c mov %i4, %o1
);
return false;
}
if (
40009d74: 80 a2 20 00 cmp %o0, 0
40009d78: 22 80 00 07 be,a 40009d94 <_Heap_Walk+0x120>
40009d7c: c4 06 60 04 ld [ %i1 + 4 ], %g2
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
40009d80: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009d84: 90 10 00 16 mov %l6, %o0
40009d88: 92 10 20 01 mov 1, %o1
40009d8c: 10 80 00 fc b 4000a17c <_Heap_Walk+0x508>
40009d90: 94 12 a0 e0 or %o2, 0xe0, %o2
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
40009d94: 80 88 a0 01 btst 1, %g2
40009d98: 32 80 00 07 bne,a 40009db4 <_Heap_Walk+0x140>
40009d9c: f4 04 20 04 ld [ %l0 + 4 ], %i2
(*printer)(
40009da0: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009da4: 90 10 00 16 mov %l6, %o0
40009da8: 92 10 20 01 mov 1, %o1
40009dac: 10 80 00 12 b 40009df4 <_Heap_Walk+0x180>
40009db0: 94 12 a1 18 or %o2, 0x118, %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;
40009db4: 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);
40009db8: 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;
40009dbc: c4 06 a0 04 ld [ %i2 + 4 ], %g2
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
40009dc0: 80 88 a0 01 btst 1, %g2
40009dc4: 12 80 00 07 bne 40009de0 <_Heap_Walk+0x16c>
40009dc8: 80 a6 80 19 cmp %i2, %i1
(*printer)(
40009dcc: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009dd0: 90 10 00 16 mov %l6, %o0
40009dd4: 92 10 20 01 mov 1, %o1
40009dd8: 10 80 00 07 b 40009df4 <_Heap_Walk+0x180>
40009ddc: 94 12 a1 48 or %o2, 0x148, %o2
);
return false;
}
if (
40009de0: 02 80 00 0a be 40009e08 <_Heap_Walk+0x194>
40009de4: 15 10 00 57 sethi %hi(0x40015c00), %o2
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
40009de8: 90 10 00 16 mov %l6, %o0
40009dec: 92 10 20 01 mov 1, %o1
40009df0: 94 12 a1 60 or %o2, 0x160, %o2
40009df4: 9f c7 40 00 call %i5
40009df8: b0 10 20 00 clr %i0
40009dfc: b0 0e 20 ff and %i0, 0xff, %i0
40009e00: 81 c7 e0 08 ret
40009e04: 81 e8 00 00 restore
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
40009e08: 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;
40009e0c: d6 06 20 08 ld [ %i0 + 8 ], %o3
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
40009e10: 10 80 00 30 b 40009ed0 <_Heap_Walk+0x25c>
40009e14: b2 10 00 18 mov %i0, %i1
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
40009e18: 80 a0 c0 0b cmp %g3, %o3
40009e1c: 18 80 00 05 bgu 40009e30 <_Heap_Walk+0x1bc>
40009e20: 84 10 20 00 clr %g2
40009e24: c4 06 20 24 ld [ %i0 + 0x24 ], %g2
40009e28: 80 a0 80 0b cmp %g2, %o3
40009e2c: 84 60 3f ff subx %g0, -1, %g2
const Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
const Heap_Block *prev_block = free_list_tail;
const Heap_Block *free_block = first_free_block;
while ( free_block != free_list_tail ) {
if ( !_Heap_Is_block_in_heap( heap, free_block ) ) {
40009e30: 80 a0 a0 00 cmp %g2, 0
40009e34: 32 80 00 07 bne,a 40009e50 <_Heap_Walk+0x1dc>
40009e38: 90 02 e0 08 add %o3, 8, %o0
(*printer)(
40009e3c: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009e40: 90 10 00 16 mov %l6, %o0
40009e44: 92 10 20 01 mov 1, %o1
40009e48: 10 80 00 ce b 4000a180 <_Heap_Walk+0x50c>
40009e4c: 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;
40009e50: d6 27 bf fc st %o3, [ %fp + -4 ]
40009e54: 7f ff df 4c call 40001b84 <.urem>
40009e58: 92 10 00 11 mov %l1, %o1
);
return false;
}
if (
40009e5c: 80 a2 20 00 cmp %o0, 0
40009e60: 02 80 00 07 be 40009e7c <_Heap_Walk+0x208>
40009e64: d6 07 bf fc ld [ %fp + -4 ], %o3
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
40009e68: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009e6c: 90 10 00 16 mov %l6, %o0
40009e70: 92 10 20 01 mov 1, %o1
40009e74: 10 80 00 c3 b 4000a180 <_Heap_Walk+0x50c>
40009e78: 94 12 a1 b0 or %o2, 0x1b0, %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;
40009e7c: c4 02 e0 04 ld [ %o3 + 4 ], %g2
40009e80: 84 08 bf fe and %g2, -2, %g2
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
40009e84: 84 02 c0 02 add %o3, %g2, %g2
40009e88: c4 00 a0 04 ld [ %g2 + 4 ], %g2
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
40009e8c: 80 88 a0 01 btst 1, %g2
40009e90: 22 80 00 07 be,a 40009eac <_Heap_Walk+0x238>
40009e94: d8 02 e0 0c ld [ %o3 + 0xc ], %o4
(*printer)(
40009e98: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009e9c: 90 10 00 16 mov %l6, %o0
40009ea0: 92 10 20 01 mov 1, %o1
40009ea4: 10 80 00 b7 b 4000a180 <_Heap_Walk+0x50c>
40009ea8: 94 12 a1 e0 or %o2, 0x1e0, %o2
);
return false;
}
if ( free_block->prev != prev_block ) {
40009eac: 80 a3 00 19 cmp %o4, %i1
40009eb0: 02 80 00 07 be 40009ecc <_Heap_Walk+0x258>
40009eb4: b2 10 00 0b mov %o3, %i1
(*printer)(
40009eb8: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009ebc: 90 10 00 16 mov %l6, %o0
40009ec0: 92 10 20 01 mov 1, %o1
40009ec4: 10 80 00 4d b 40009ff8 <_Heap_Walk+0x384>
40009ec8: 94 12 a2 00 or %o2, 0x200, %o2
return false;
}
prev_block = free_block;
free_block = free_block->next;
40009ecc: 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 ) {
40009ed0: 80 a2 c0 18 cmp %o3, %i0
40009ed4: 32 bf ff d1 bne,a 40009e18 <_Heap_Walk+0x1a4>
40009ed8: c6 06 20 20 ld [ %i0 + 0x20 ], %g3
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
40009edc: 2b 10 00 57 sethi %hi(0x40015c00), %l5
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
const Heap_Block *prev_block = free_list_tail;
const Heap_Block *free_block = first_free_block;
while ( free_block != free_list_tail ) {
40009ee0: b2 10 00 1a mov %i2, %i1
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
40009ee4: aa 15 63 00 or %l5, 0x300, %l5
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
40009ee8: 23 10 00 57 sethi %hi(0x40015c00), %l1
40009eec: 2f 10 00 56 sethi %hi(0x40015800), %l7
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
40009ef0: 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;
40009ef4: d8 06 20 20 ld [ %i0 + 0x20 ], %o4
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
bool const prev_used = _Heap_Is_prev_used( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
uintptr_t const next_block_begin = (uintptr_t) next_block;
bool const is_not_last_block = block != last_block;
40009ef8: 9e 1e 40 10 xor %i1, %l0, %o7
40009efc: 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;
40009f00: a8 0c bf fe and %l2, -2, %l4
40009f04: 9a 40 20 00 addx %g0, 0, %o5
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
40009f08: a6 06 40 14 add %i1, %l4, %l3
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
40009f0c: 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;
40009f10: 80 a3 00 13 cmp %o4, %l3
40009f14: 18 80 00 05 bgu 40009f28 <_Heap_Walk+0x2b4> <== NEVER TAKEN
40009f18: 9e 10 20 00 clr %o7
40009f1c: de 06 20 24 ld [ %i0 + 0x24 ], %o7
40009f20: 80 a3 c0 13 cmp %o7, %l3
40009f24: 9e 60 3f ff subx %g0, -1, %o7
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
40009f28: 80 a3 e0 00 cmp %o7, 0
40009f2c: 32 80 00 07 bne,a 40009f48 <_Heap_Walk+0x2d4>
40009f30: da 27 bf f8 st %o5, [ %fp + -8 ]
(*printer)(
40009f34: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009f38: 90 10 00 16 mov %l6, %o0
40009f3c: 92 10 20 01 mov 1, %o1
40009f40: 10 80 00 2c b 40009ff0 <_Heap_Walk+0x37c>
40009f44: 94 12 a2 38 or %o2, 0x238, %o2
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
40009f48: 90 10 00 14 mov %l4, %o0
40009f4c: 7f ff df 0e call 40001b84 <.urem>
40009f50: 92 10 00 1c mov %i4, %o1
40009f54: da 07 bf f8 ld [ %fp + -8 ], %o5
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
40009f58: 80 a2 20 00 cmp %o0, 0
40009f5c: 02 80 00 0c be 40009f8c <_Heap_Walk+0x318>
40009f60: 9e 0b 60 ff and %o5, 0xff, %o7
40009f64: 80 a3 e0 00 cmp %o7, 0
40009f68: 02 80 00 19 be 40009fcc <_Heap_Walk+0x358>
40009f6c: 80 a6 40 13 cmp %i1, %l3
(*printer)(
40009f70: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009f74: 90 10 00 16 mov %l6, %o0
40009f78: 92 10 20 01 mov 1, %o1
40009f7c: 94 12 a2 68 or %o2, 0x268, %o2
40009f80: 96 10 00 19 mov %i1, %o3
40009f84: 10 80 00 1d b 40009ff8 <_Heap_Walk+0x384>
40009f88: 98 10 00 14 mov %l4, %o4
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
40009f8c: 80 a3 e0 00 cmp %o7, 0
40009f90: 02 80 00 0f be 40009fcc <_Heap_Walk+0x358>
40009f94: 80 a6 40 13 cmp %i1, %l3
40009f98: 80 a5 00 1b cmp %l4, %i3
40009f9c: 1a 80 00 0c bcc 40009fcc <_Heap_Walk+0x358>
40009fa0: 80 a6 40 13 cmp %i1, %l3
(*printer)(
40009fa4: 90 10 00 16 mov %l6, %o0
40009fa8: 92 10 20 01 mov 1, %o1
40009fac: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009fb0: 96 10 00 19 mov %i1, %o3
40009fb4: 94 12 a2 98 or %o2, 0x298, %o2
40009fb8: 98 10 00 14 mov %l4, %o4
40009fbc: 9f c7 40 00 call %i5
40009fc0: 9a 10 00 1b mov %i3, %o5
"block 0x%08x: next block 0x%08x is not a successor\n",
block,
next_block
);
return false;
40009fc4: 10 80 00 68 b 4000a164 <_Heap_Walk+0x4f0>
40009fc8: b0 10 20 00 clr %i0
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
40009fcc: 2a 80 00 10 bcs,a 4000a00c <_Heap_Walk+0x398>
40009fd0: de 04 e0 04 ld [ %l3 + 4 ], %o7
40009fd4: 80 8b 60 ff btst 0xff, %o5
40009fd8: 22 80 00 0d be,a 4000a00c <_Heap_Walk+0x398>
40009fdc: de 04 e0 04 ld [ %l3 + 4 ], %o7
(*printer)(
40009fe0: 15 10 00 57 sethi %hi(0x40015c00), %o2
40009fe4: 90 10 00 16 mov %l6, %o0
40009fe8: 92 10 20 01 mov 1, %o1
40009fec: 94 12 a2 c8 or %o2, 0x2c8, %o2
40009ff0: 96 10 00 19 mov %i1, %o3
40009ff4: 98 10 00 13 mov %l3, %o4
40009ff8: 9f c7 40 00 call %i5
40009ffc: b0 10 20 00 clr %i0
4000a000: b0 0e 20 ff and %i0, 0xff, %i0
4000a004: 81 c7 e0 08 ret
4000a008: 81 e8 00 00 restore
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
4000a00c: 80 8b e0 01 btst 1, %o7
4000a010: 12 80 00 3f bne 4000a10c <_Heap_Walk+0x498>
4000a014: 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 ?
4000a018: 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)(
4000a01c: d8 06 20 08 ld [ %i0 + 8 ], %o4
4000a020: 80 a3 40 0c cmp %o5, %o4
4000a024: 02 80 00 08 be 4000a044 <_Heap_Walk+0x3d0>
4000a028: 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)" : ""),
4000a02c: 80 a3 40 18 cmp %o5, %i0
4000a030: 12 80 00 07 bne 4000a04c <_Heap_Walk+0x3d8>
4000a034: 96 14 63 70 or %l1, 0x370, %o3
4000a038: 17 10 00 56 sethi %hi(0x40015800), %o3
4000a03c: 10 80 00 04 b 4000a04c <_Heap_Walk+0x3d8>
4000a040: 96 12 e3 b8 or %o3, 0x3b8, %o3 ! 40015bb8 <__log2table+0x130>
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
4000a044: 03 10 00 56 sethi %hi(0x40015800), %g1
4000a048: 96 10 63 a8 or %g1, 0x3a8, %o3 ! 40015ba8 <__log2table+0x120>
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
4000a04c: 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)(
4000a050: 80 a3 00 0f cmp %o4, %o7
4000a054: 02 80 00 06 be 4000a06c <_Heap_Walk+0x3f8>
4000a058: 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)" : "")
4000a05c: 12 80 00 06 bne 4000a074 <_Heap_Walk+0x400>
4000a060: 9e 14 63 70 or %l1, 0x370, %o7
4000a064: 10 80 00 04 b 4000a074 <_Heap_Walk+0x400>
4000a068: 9e 15 e3 d8 or %l7, 0x3d8, %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)(
4000a06c: 03 10 00 56 sethi %hi(0x40015800), %g1
4000a070: 9e 10 63 c8 or %g1, 0x3c8, %o7 ! 40015bc8 <__log2table+0x140>
4000a074: d6 23 a0 5c st %o3, [ %sp + 0x5c ]
4000a078: d8 23 a0 60 st %o4, [ %sp + 0x60 ]
4000a07c: de 23 a0 64 st %o7, [ %sp + 0x64 ]
4000a080: 90 10 00 16 mov %l6, %o0
4000a084: 92 10 20 00 clr %o1
4000a088: 94 10 00 15 mov %l5, %o2
4000a08c: 96 10 00 19 mov %i1, %o3
4000a090: 9f c7 40 00 call %i5
4000a094: 98 10 00 14 mov %l4, %o4
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
4000a098: da 04 c0 00 ld [ %l3 ], %o5
4000a09c: 80 a5 00 0d cmp %l4, %o5
4000a0a0: 02 80 00 0c be 4000a0d0 <_Heap_Walk+0x45c>
4000a0a4: 80 a4 a0 00 cmp %l2, 0
(*printer)(
4000a0a8: e6 23 a0 5c st %l3, [ %sp + 0x5c ]
4000a0ac: 90 10 00 16 mov %l6, %o0
4000a0b0: 92 10 20 01 mov 1, %o1
4000a0b4: 15 10 00 57 sethi %hi(0x40015c00), %o2
4000a0b8: 96 10 00 19 mov %i1, %o3
4000a0bc: 94 12 a3 38 or %o2, 0x338, %o2
4000a0c0: 9f c7 40 00 call %i5
4000a0c4: 98 10 00 14 mov %l4, %o4
"block 0x%08x: next block 0x%08x is not a successor\n",
block,
next_block
);
return false;
4000a0c8: 10 bf ff ce b 4000a000 <_Heap_Walk+0x38c>
4000a0cc: b0 10 20 00 clr %i0
);
return false;
}
if ( !prev_used ) {
4000a0d0: 32 80 00 0a bne,a 4000a0f8 <_Heap_Walk+0x484>
4000a0d4: c6 06 20 08 ld [ %i0 + 8 ], %g3
(*printer)(
4000a0d8: 15 10 00 57 sethi %hi(0x40015c00), %o2
4000a0dc: 90 10 00 16 mov %l6, %o0
4000a0e0: 92 10 20 01 mov 1, %o1
4000a0e4: 10 80 00 26 b 4000a17c <_Heap_Walk+0x508>
4000a0e8: 94 12 a3 78 or %o2, 0x378, %o2
{
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *free_block = _Heap_Free_list_first( heap );
while ( free_block != free_list_tail ) {
if ( free_block == block ) {
4000a0ec: 22 80 00 19 be,a 4000a150 <_Heap_Walk+0x4dc>
4000a0f0: b2 10 00 13 mov %l3, %i1
return true;
}
free_block = free_block->next;
4000a0f4: c6 00 e0 08 ld [ %g3 + 8 ], %g3
)
{
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *free_block = _Heap_Free_list_first( heap );
while ( free_block != free_list_tail ) {
4000a0f8: 80 a0 c0 18 cmp %g3, %i0
4000a0fc: 12 bf ff fc bne 4000a0ec <_Heap_Walk+0x478>
4000a100: 80 a0 c0 19 cmp %g3, %i1
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
4000a104: 10 80 00 1b b 4000a170 <_Heap_Walk+0x4fc>
4000a108: 15 10 00 57 sethi %hi(0x40015c00), %o2
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
4000a10c: 80 a4 a0 00 cmp %l2, 0
4000a110: 02 80 00 09 be 4000a134 <_Heap_Walk+0x4c0>
4000a114: 92 10 20 00 clr %o1
(*printer)(
4000a118: 15 10 00 57 sethi %hi(0x40015c00), %o2
4000a11c: 96 10 00 19 mov %i1, %o3
4000a120: 94 12 a3 a8 or %o2, 0x3a8, %o2
4000a124: 9f c7 40 00 call %i5
4000a128: 98 10 00 14 mov %l4, %o4
4000a12c: 10 80 00 09 b 4000a150 <_Heap_Walk+0x4dc>
4000a130: b2 10 00 13 mov %l3, %i1
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
4000a134: da 06 40 00 ld [ %i1 ], %o5
4000a138: 15 10 00 57 sethi %hi(0x40015c00), %o2
4000a13c: 96 10 00 19 mov %i1, %o3
4000a140: 94 12 a3 c0 or %o2, 0x3c0, %o2
4000a144: 9f c7 40 00 call %i5
4000a148: 98 10 00 14 mov %l4, %o4
4000a14c: b2 10 00 13 mov %l3, %i1
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
4000a150: 80 a4 c0 1a cmp %l3, %i2
4000a154: 32 bf ff 68 bne,a 40009ef4 <_Heap_Walk+0x280>
4000a158: e4 06 60 04 ld [ %i1 + 4 ], %l2
4000a15c: 10 80 00 02 b 4000a164 <_Heap_Walk+0x4f0>
4000a160: b0 10 20 01 mov 1, %i0
4000a164: b0 0e 20 ff and %i0, 0xff, %i0
4000a168: 81 c7 e0 08 ret
4000a16c: 81 e8 00 00 restore
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
4000a170: 90 10 00 16 mov %l6, %o0
4000a174: 92 10 20 01 mov 1, %o1
4000a178: 94 12 a3 e8 or %o2, 0x3e8, %o2
4000a17c: 96 10 00 19 mov %i1, %o3
4000a180: 9f c7 40 00 call %i5
4000a184: b0 10 20 00 clr %i0
4000a188: b0 0e 20 ff and %i0, 0xff, %i0
4000a18c: 81 c7 e0 08 ret
4000a190: 81 e8 00 00 restore
400093b0 <_Internal_error_Occurred>:
void _Internal_error_Occurred(
Internal_errors_Source the_source,
bool is_internal,
Internal_errors_t the_error
)
{
400093b0: 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 );
400093b4: 13 10 00 2c sethi %hi(0x4000b000), %o1
400093b8: 90 07 bf f4 add %fp, -12, %o0
400093bc: 92 12 62 d4 or %o1, 0x2d4, %o1
Internal_errors_Source source,
bool is_internal,
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
400093c0: f0 27 bf f4 st %i0, [ %fp + -12 ]
400093c4: f2 2f bf f8 stb %i1, [ %fp + -8 ]
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
400093c8: 40 00 07 ce call 4000b300 <_User_extensions_Iterate>
400093cc: 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;
400093d0: 05 10 00 78 sethi %hi(0x4001e000), %g2 <== NOT EXECUTED
400093d4: 82 10 a1 20 or %g2, 0x120, %g1 ! 4001e120 <_Internal_errors_What_happened><== NOT EXECUTED
400093d8: f0 20 a1 20 st %i0, [ %g2 + 0x120 ] <== NOT EXECUTED
_Internal_errors_What_happened.is_internal = is_internal;
400093dc: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED
_Internal_errors_What_happened.the_error = the_error;
400093e0: 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;
400093e4: 84 10 20 05 mov 5, %g2 <== NOT EXECUTED
400093e8: 03 10 00 78 sethi %hi(0x4001e000), %g1 <== NOT EXECUTED
_System_state_Set( SYSTEM_STATE_FAILED );
_CPU_Fatal_halt( the_error );
400093ec: 7f ff e4 17 call 40002448 <sparc_disable_interrupts> <== NOT EXECUTED
400093f0: c4 20 61 2c st %g2, [ %g1 + 0x12c ] ! 4001e12c <_System_state_Current><== NOT EXECUTED
400093f4: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED
400093f8: 30 80 00 00 b,a 400093f8 <_Internal_error_Occurred+0x48> <== NOT EXECUTED
40009464 <_Objects_Allocate>:
#endif
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
40009464: 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 )
40009468: c2 06 20 18 ld [ %i0 + 0x18 ], %g1
4000946c: 80 a0 60 00 cmp %g1, 0
40009470: 12 80 00 04 bne 40009480 <_Objects_Allocate+0x1c> <== ALWAYS TAKEN
40009474: ba 10 00 18 mov %i0, %i5
return NULL;
40009478: 81 c7 e0 08 ret
4000947c: 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 );
40009480: b8 06 20 20 add %i0, 0x20, %i4
40009484: 7f ff fd 85 call 40008a98 <_Chain_Get>
40009488: 90 10 00 1c mov %i4, %o0
if ( information->auto_extend ) {
4000948c: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1
40009490: 80 a0 60 00 cmp %g1, 0
40009494: 02 80 00 1d be 40009508 <_Objects_Allocate+0xa4>
40009498: 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 ) {
4000949c: 80 a2 20 00 cmp %o0, 0
400094a0: 32 80 00 0a bne,a 400094c8 <_Objects_Allocate+0x64>
400094a4: c4 07 60 08 ld [ %i5 + 8 ], %g2
_Objects_Extend_information( information );
400094a8: 40 00 00 21 call 4000952c <_Objects_Extend_information>
400094ac: 90 10 00 1d mov %i5, %o0
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
400094b0: 7f ff fd 7a call 40008a98 <_Chain_Get>
400094b4: 90 10 00 1c mov %i4, %o0
}
if ( the_object ) {
400094b8: b0 92 20 00 orcc %o0, 0, %i0
400094bc: 02 bf ff ef be 40009478 <_Objects_Allocate+0x14>
400094c0: 01 00 00 00 nop
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
400094c4: c4 07 60 08 ld [ %i5 + 8 ], %g2
400094c8: d0 06 20 08 ld [ %i0 + 8 ], %o0
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
400094cc: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1
}
if ( the_object ) {
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
400094d0: 03 00 00 3f sethi %hi(0xfc00), %g1
400094d4: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff <PROM_START+0xffff>
400094d8: 90 0a 00 01 and %o0, %g1, %o0
400094dc: 82 08 80 01 and %g2, %g1, %g1
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
400094e0: 40 00 3a 88 call 40017f00 <.udiv>
400094e4: 90 22 00 01 sub %o0, %g1, %o0
information->inactive_per_block[ block ]--;
400094e8: c2 07 60 30 ld [ %i5 + 0x30 ], %g1
400094ec: 91 2a 20 02 sll %o0, 2, %o0
400094f0: c4 00 40 08 ld [ %g1 + %o0 ], %g2
400094f4: 84 00 bf ff add %g2, -1, %g2
400094f8: c4 20 40 08 st %g2, [ %g1 + %o0 ]
information->inactive--;
400094fc: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1
40009500: 82 00 7f ff add %g1, -1, %g1
40009504: c2 37 60 2c sth %g1, [ %i5 + 0x2c ]
);
}
#endif
return the_object;
}
40009508: 81 c7 e0 08 ret
4000950c: 81 e8 00 00 restore
40009894 <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint16_t the_class
)
{
40009894: 9d e3 bf a0 save %sp, -96, %sp
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
40009898: 80 a6 60 00 cmp %i1, 0
4000989c: 12 80 00 04 bne 400098ac <_Objects_Get_information+0x18>
400098a0: 01 00 00 00 nop
return NULL;
400098a4: 81 c7 e0 08 ret
400098a8: 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 );
400098ac: 40 00 0f 57 call 4000d608 <_Objects_API_maximum_class>
400098b0: 90 10 00 18 mov %i0, %o0
if ( the_class_api_maximum == 0 )
400098b4: 80 a2 20 00 cmp %o0, 0
400098b8: 02 bf ff fb be 400098a4 <_Objects_Get_information+0x10>
400098bc: 80 a6 40 08 cmp %i1, %o0
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
400098c0: 18 bf ff f9 bgu 400098a4 <_Objects_Get_information+0x10>
400098c4: 03 10 00 77 sethi %hi(0x4001dc00), %g1
return NULL;
if ( !_Objects_Information_table[ the_api ] )
400098c8: b1 2e 20 02 sll %i0, 2, %i0
400098cc: 82 10 62 94 or %g1, 0x294, %g1
400098d0: c2 00 40 18 ld [ %g1 + %i0 ], %g1
400098d4: 80 a0 60 00 cmp %g1, 0
400098d8: 02 bf ff f3 be 400098a4 <_Objects_Get_information+0x10> <== NEVER TAKEN
400098dc: b3 2e 60 02 sll %i1, 2, %i1
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
400098e0: f0 00 40 19 ld [ %g1 + %i1 ], %i0
if ( !info )
400098e4: 80 a6 20 00 cmp %i0, 0
400098e8: 02 bf ff ef be 400098a4 <_Objects_Get_information+0x10> <== NEVER TAKEN
400098ec: 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 )
400098f0: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1
400098f4: 80 a0 60 00 cmp %g1, 0
400098f8: 02 bf ff eb be 400098a4 <_Objects_Get_information+0x10>
400098fc: 01 00 00 00 nop
return NULL;
#endif
return info;
}
40009900: 81 c7 e0 08 ret
40009904: 81 e8 00 00 restore
4001bbdc <_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;
4001bbdc: c2 02 20 08 ld [ %o0 + 8 ], %g1
4001bbe0: 92 22 40 01 sub %o1, %g1, %o1
if ( information->maximum >= index ) {
4001bbe4: 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;
4001bbe8: 92 02 60 01 inc %o1
if ( information->maximum >= index ) {
4001bbec: 80 a0 40 09 cmp %g1, %o1
4001bbf0: 0a 80 00 09 bcs 4001bc14 <_Objects_Get_no_protection+0x38>
4001bbf4: 93 2a 60 02 sll %o1, 2, %o1
if ( (the_object = information->local_table[ index ]) != NULL ) {
4001bbf8: c2 02 20 1c ld [ %o0 + 0x1c ], %g1
4001bbfc: d0 00 40 09 ld [ %g1 + %o1 ], %o0
4001bc00: 80 a2 20 00 cmp %o0, 0
4001bc04: 02 80 00 05 be 4001bc18 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN
4001bc08: 82 10 20 01 mov 1, %g1
*location = OBJECTS_LOCAL;
return the_object;
4001bc0c: 81 c3 e0 08 retl
4001bc10: 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;
4001bc14: 82 10 20 01 mov 1, %g1
return NULL;
4001bc18: 90 10 20 00 clr %o0
}
4001bc1c: 81 c3 e0 08 retl
4001bc20: c2 22 80 00 st %g1, [ %o2 ]
4000d9b8 <_Objects_Id_to_name>:
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
4000d9b8: 9d e3 bf 98 save %sp, -104, %sp
/*
* Caller is trusted for name != NULL.
*/
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
4000d9bc: 80 a6 20 00 cmp %i0, 0
4000d9c0: 12 80 00 06 bne 4000d9d8 <_Objects_Id_to_name+0x20>
4000d9c4: 83 36 20 18 srl %i0, 0x18, %g1
4000d9c8: 03 10 00 b9 sethi %hi(0x4002e400), %g1
4000d9cc: c2 00 60 60 ld [ %g1 + 0x60 ], %g1 ! 4002e460 <_Per_CPU_Information+0x10>
4000d9d0: f0 00 60 08 ld [ %g1 + 8 ], %i0
4000d9d4: 83 36 20 18 srl %i0, 0x18, %g1
4000d9d8: 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 )
4000d9dc: 84 00 7f ff add %g1, -1, %g2
4000d9e0: 80 a0 a0 02 cmp %g2, 2
4000d9e4: 08 80 00 14 bleu 4000da34 <_Objects_Id_to_name+0x7c>
4000d9e8: 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;
4000d9ec: 81 c7 e0 08 ret
4000d9f0: 91 e8 20 03 restore %g0, 3, %o0
if ( !_Objects_Information_table[ the_api ] )
return OBJECTS_INVALID_ID;
the_class = _Objects_Get_class( tmpId );
information = _Objects_Information_table[ the_api ][ the_class ];
4000d9f4: 85 28 a0 02 sll %g2, 2, %g2
4000d9f8: d0 00 40 02 ld [ %g1 + %g2 ], %o0
if ( !information )
4000d9fc: 80 a2 20 00 cmp %o0, 0
4000da00: 02 bf ff fb be 4000d9ec <_Objects_Id_to_name+0x34> <== NEVER TAKEN
4000da04: 92 10 00 18 mov %i0, %o1
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
return OBJECTS_INVALID_ID;
#endif
the_object = _Objects_Get( information, tmpId, &ignored_location );
4000da08: 7f ff ff cf call 4000d944 <_Objects_Get>
4000da0c: 94 07 bf fc add %fp, -4, %o2
if ( !the_object )
4000da10: 80 a2 20 00 cmp %o0, 0
4000da14: 02 bf ff f6 be 4000d9ec <_Objects_Id_to_name+0x34>
4000da18: 01 00 00 00 nop
return OBJECTS_INVALID_ID;
*name = the_object->name;
4000da1c: c2 02 20 0c ld [ %o0 + 0xc ], %g1
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
4000da20: b0 10 20 00 clr %i0
the_object = _Objects_Get( information, tmpId, &ignored_location );
if ( !the_object )
return OBJECTS_INVALID_ID;
*name = the_object->name;
_Thread_Enable_dispatch();
4000da24: 40 00 03 8e call 4000e85c <_Thread_Enable_dispatch>
4000da28: c2 26 40 00 st %g1, [ %i1 ]
4000da2c: 81 c7 e0 08 ret
4000da30: 81 e8 00 00 restore
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
if ( !_Objects_Information_table[ the_api ] )
4000da34: 05 10 00 b8 sethi %hi(0x4002e000), %g2
4000da38: 84 10 a1 74 or %g2, 0x174, %g2 ! 4002e174 <_Objects_Information_table>
4000da3c: c2 00 80 01 ld [ %g2 + %g1 ], %g1
4000da40: 80 a0 60 00 cmp %g1, 0
4000da44: 12 bf ff ec bne 4000d9f4 <_Objects_Id_to_name+0x3c>
4000da48: 85 36 20 1b srl %i0, 0x1b, %g2
4000da4c: 30 bf ff e8 b,a 4000d9ec <_Objects_Id_to_name+0x34>
4000a6bc <_RBTree_Extract_unprotected>:
*/
void _RBTree_Extract_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
4000a6bc: 9d e3 bf a0 save %sp, -96, %sp
RBTree_Node *leaf, *target;
RBTree_Color victim_color;
RBTree_Direction dir;
if (!the_node) return;
4000a6c0: 80 a6 60 00 cmp %i1, 0
4000a6c4: 02 80 00 69 be 4000a868 <_RBTree_Extract_unprotected+0x1ac>
4000a6c8: 01 00 00 00 nop
/* check if min needs to be updated */
if (the_node == the_rbtree->first[RBT_LEFT]) {
4000a6cc: c2 06 20 08 ld [ %i0 + 8 ], %g1
4000a6d0: 80 a6 40 01 cmp %i1, %g1
4000a6d4: 32 80 00 07 bne,a 4000a6f0 <_RBTree_Extract_unprotected+0x34>
4000a6d8: c2 06 20 0c ld [ %i0 + 0xc ], %g1
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected(
const RBTree_Node *node
)
{
return _RBTree_Next_unprotected( node, RBT_RIGHT );
4000a6dc: 90 10 00 19 mov %i1, %o0
4000a6e0: 40 00 01 31 call 4000aba4 <_RBTree_Next_unprotected>
4000a6e4: 92 10 20 01 mov 1, %o1
RBTree_Node *next;
next = _RBTree_Successor_unprotected(the_node);
the_rbtree->first[RBT_LEFT] = next;
4000a6e8: d0 26 20 08 st %o0, [ %i0 + 8 ]
}
/* Check if max needs to be updated. min=max for 1 element trees so
* do not use else if here. */
if (the_node == the_rbtree->first[RBT_RIGHT]) {
4000a6ec: c2 06 20 0c ld [ %i0 + 0xc ], %g1
4000a6f0: 80 a6 40 01 cmp %i1, %g1
4000a6f4: 32 80 00 07 bne,a 4000a710 <_RBTree_Extract_unprotected+0x54>
4000a6f8: fa 06 60 04 ld [ %i1 + 4 ], %i5
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected(
const RBTree_Node *node
)
{
return _RBTree_Next_unprotected( node, RBT_LEFT );
4000a6fc: 90 10 00 19 mov %i1, %o0
4000a700: 40 00 01 29 call 4000aba4 <_RBTree_Next_unprotected>
4000a704: 92 10 20 00 clr %o1
RBTree_Node *previous;
previous = _RBTree_Predecessor_unprotected(the_node);
the_rbtree->first[RBT_RIGHT] = previous;
4000a708: d0 26 20 0c st %o0, [ %i0 + 0xc ]
* either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT],
* and replace the_node with the target node. This maintains the binary
* search tree property, but may violate the red-black properties.
*/
if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) {
4000a70c: fa 06 60 04 ld [ %i1 + 4 ], %i5
4000a710: 80 a7 60 00 cmp %i5, 0
4000a714: 02 80 00 36 be 4000a7ec <_RBTree_Extract_unprotected+0x130>
4000a718: f8 06 60 08 ld [ %i1 + 8 ], %i4
4000a71c: 80 a7 20 00 cmp %i4, 0
4000a720: 32 80 00 05 bne,a 4000a734 <_RBTree_Extract_unprotected+0x78>
4000a724: c2 07 60 08 ld [ %i5 + 8 ], %g1
4000a728: 10 80 00 35 b 4000a7fc <_RBTree_Extract_unprotected+0x140>
4000a72c: b8 10 00 1d mov %i5, %i4
target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */
while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT];
4000a730: c2 07 60 08 ld [ %i5 + 8 ], %g1
4000a734: 80 a0 60 00 cmp %g1, 0
4000a738: 32 bf ff fe bne,a 4000a730 <_RBTree_Extract_unprotected+0x74>
4000a73c: ba 10 00 01 mov %g1, %i5
* target's position (target is the right child of target->parent)
* when target vacates it. if there is no child, then target->parent
* should become NULL. This may cause the coloring to be violated.
* For now we store the color of the node being deleted in victim_color.
*/
leaf = target->child[RBT_LEFT];
4000a740: f8 07 60 04 ld [ %i5 + 4 ], %i4
if(leaf) {
4000a744: 80 a7 20 00 cmp %i4, 0
4000a748: 02 80 00 05 be 4000a75c <_RBTree_Extract_unprotected+0xa0>
4000a74c: 01 00 00 00 nop
leaf->parent = target->parent;
4000a750: c2 07 40 00 ld [ %i5 ], %g1
4000a754: 10 80 00 04 b 4000a764 <_RBTree_Extract_unprotected+0xa8>
4000a758: c2 27 00 00 st %g1, [ %i4 ]
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
4000a75c: 7f ff ff 73 call 4000a528 <_RBTree_Extract_validate_unprotected>
4000a760: 90 10 00 1d mov %i5, %o0
}
victim_color = target->color;
dir = target != target->parent->child[0];
4000a764: c4 07 40 00 ld [ %i5 ], %g2
leaf->parent = target->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
}
victim_color = target->color;
4000a768: c2 07 60 0c ld [ %i5 + 0xc ], %g1
dir = target != target->parent->child[0];
4000a76c: c6 00 a0 04 ld [ %g2 + 4 ], %g3
4000a770: 86 1f 40 03 xor %i5, %g3, %g3
4000a774: 80 a0 00 03 cmp %g0, %g3
4000a778: 86 40 20 00 addx %g0, 0, %g3
target->parent->child[dir] = leaf;
4000a77c: 87 28 e0 02 sll %g3, 2, %g3
4000a780: 84 00 80 03 add %g2, %g3, %g2
4000a784: f8 20 a0 04 st %i4, [ %g2 + 4 ]
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
4000a788: c4 06 40 00 ld [ %i1 ], %g2
4000a78c: c6 00 a0 04 ld [ %g2 + 4 ], %g3
4000a790: 86 1e 40 03 xor %i1, %g3, %g3
4000a794: 80 a0 00 03 cmp %g0, %g3
4000a798: 86 40 20 00 addx %g0, 0, %g3
the_node->parent->child[dir] = target;
4000a79c: 87 28 e0 02 sll %g3, 2, %g3
4000a7a0: 84 00 80 03 add %g2, %g3, %g2
4000a7a4: fa 20 a0 04 st %i5, [ %g2 + 4 ]
/* set target's new children to the original node's children */
target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT];
4000a7a8: c4 06 60 08 ld [ %i1 + 8 ], %g2
4000a7ac: c4 27 60 08 st %g2, [ %i5 + 8 ]
if (the_node->child[RBT_RIGHT])
4000a7b0: c4 06 60 08 ld [ %i1 + 8 ], %g2
4000a7b4: 80 a0 a0 00 cmp %g2, 0
4000a7b8: 32 80 00 02 bne,a 4000a7c0 <_RBTree_Extract_unprotected+0x104><== ALWAYS TAKEN
4000a7bc: fa 20 80 00 st %i5, [ %g2 ]
the_node->child[RBT_RIGHT]->parent = target;
target->child[RBT_LEFT] = the_node->child[RBT_LEFT];
4000a7c0: c4 06 60 04 ld [ %i1 + 4 ], %g2
4000a7c4: c4 27 60 04 st %g2, [ %i5 + 4 ]
if (the_node->child[RBT_LEFT])
4000a7c8: c4 06 60 04 ld [ %i1 + 4 ], %g2
4000a7cc: 80 a0 a0 00 cmp %g2, 0
4000a7d0: 32 80 00 02 bne,a 4000a7d8 <_RBTree_Extract_unprotected+0x11c>
4000a7d4: fa 20 80 00 st %i5, [ %g2 ]
/* finally, update the parent node and recolor. target has completely
* replaced the_node, and target's child has moved up the tree if needed.
* the_node is no longer part of the tree, although it has valid pointers
* still.
*/
target->parent = the_node->parent;
4000a7d8: c4 06 40 00 ld [ %i1 ], %g2
4000a7dc: c4 27 40 00 st %g2, [ %i5 ]
target->color = the_node->color;
4000a7e0: c4 06 60 0c ld [ %i1 + 0xc ], %g2
4000a7e4: 10 80 00 14 b 4000a834 <_RBTree_Extract_unprotected+0x178>
4000a7e8: c4 27 60 0c st %g2, [ %i5 + 0xc ]
* violated. We will fix it later.
* For now we store the color of the node being deleted in victim_color.
*/
leaf = the_node->child[RBT_LEFT] ?
the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT];
if( leaf ) {
4000a7ec: 80 a7 20 00 cmp %i4, 0
4000a7f0: 32 80 00 04 bne,a 4000a800 <_RBTree_Extract_unprotected+0x144>
4000a7f4: c2 06 40 00 ld [ %i1 ], %g1
4000a7f8: 30 80 00 04 b,a 4000a808 <_RBTree_Extract_unprotected+0x14c>
leaf->parent = the_node->parent;
4000a7fc: c2 06 40 00 ld [ %i1 ], %g1
4000a800: 10 80 00 04 b 4000a810 <_RBTree_Extract_unprotected+0x154>
4000a804: c2 27 00 00 st %g1, [ %i4 ]
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
4000a808: 7f ff ff 48 call 4000a528 <_RBTree_Extract_validate_unprotected>
4000a80c: 90 10 00 19 mov %i1, %o0
}
victim_color = the_node->color;
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
4000a810: c4 06 40 00 ld [ %i1 ], %g2
leaf->parent = the_node->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
}
victim_color = the_node->color;
4000a814: c2 06 60 0c ld [ %i1 + 0xc ], %g1
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
4000a818: c6 00 a0 04 ld [ %g2 + 4 ], %g3
4000a81c: 86 1e 40 03 xor %i1, %g3, %g3
4000a820: 80 a0 00 03 cmp %g0, %g3
4000a824: 86 40 20 00 addx %g0, 0, %g3
the_node->parent->child[dir] = leaf;
4000a828: 87 28 e0 02 sll %g3, 2, %g3
4000a82c: 84 00 80 03 add %g2, %g3, %g2
4000a830: f8 20 a0 04 st %i4, [ %g2 + 4 ]
/* fix coloring. leaf has moved up the tree. The color of the deleted
* node is in victim_color. There are two cases:
* 1. Deleted a red node, its child must be black. Nothing must be done.
* 2. Deleted a black node, its child must be red. Paint child black.
*/
if (victim_color == RBT_BLACK) { /* eliminate case 1 */
4000a834: 80 a0 60 00 cmp %g1, 0
4000a838: 32 80 00 06 bne,a 4000a850 <_RBTree_Extract_unprotected+0x194>
4000a83c: c2 06 20 04 ld [ %i0 + 4 ], %g1
if (leaf) {
4000a840: 80 a7 20 00 cmp %i4, 0
4000a844: 32 80 00 02 bne,a 4000a84c <_RBTree_Extract_unprotected+0x190>
4000a848: c0 27 20 0c clr [ %i4 + 0xc ]
/* Wipe the_node */
_RBTree_Set_off_rbtree(the_node);
/* set root to black, if it exists */
if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK;
4000a84c: c2 06 20 04 ld [ %i0 + 4 ], %g1
*/
RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree(
RBTree_Node *node
)
{
node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL;
4000a850: c0 26 60 08 clr [ %i1 + 8 ]
4000a854: c0 26 60 04 clr [ %i1 + 4 ]
4000a858: 80 a0 60 00 cmp %g1, 0
4000a85c: 02 80 00 03 be 4000a868 <_RBTree_Extract_unprotected+0x1ac>
4000a860: c0 26 40 00 clr [ %i1 ]
4000a864: c0 20 60 0c clr [ %g1 + 0xc ]
4000a868: 81 c7 e0 08 ret
4000a86c: 81 e8 00 00 restore
4000bb3c <_RBTree_Initialize>:
void *starting_address,
size_t number_nodes,
size_t node_size,
bool is_unique
)
{
4000bb3c: 9d e3 bf a0 save %sp, -96, %sp
size_t count;
RBTree_Node *next;
/* TODO: Error message? */
if (!the_rbtree) return;
4000bb40: 80 a6 20 00 cmp %i0, 0
4000bb44: 02 80 00 10 be 4000bb84 <_RBTree_Initialize+0x48> <== NEVER TAKEN
4000bb48: 01 00 00 00 nop
RBTree_Control *the_rbtree,
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
4000bb4c: c0 26 00 00 clr [ %i0 ]
the_rbtree->root = NULL;
4000bb50: c0 26 20 04 clr [ %i0 + 4 ]
the_rbtree->first[0] = NULL;
4000bb54: c0 26 20 08 clr [ %i0 + 8 ]
the_rbtree->first[1] = NULL;
4000bb58: c0 26 20 0c clr [ %i0 + 0xc ]
the_rbtree->compare_function = compare_function;
4000bb5c: f2 26 20 10 st %i1, [ %i0 + 0x10 ]
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
while ( count-- ) {
4000bb60: 10 80 00 06 b 4000bb78 <_RBTree_Initialize+0x3c>
4000bb64: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ]
_RBTree_Insert_unprotected(the_rbtree, next);
4000bb68: 90 10 00 18 mov %i0, %o0
4000bb6c: 7f ff ff 2e call 4000b824 <_RBTree_Insert_unprotected>
4000bb70: b4 06 80 1c add %i2, %i4, %i2
4000bb74: b6 06 ff ff add %i3, -1, %i3
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
while ( count-- ) {
4000bb78: 80 a6 e0 00 cmp %i3, 0
4000bb7c: 12 bf ff fb bne 4000bb68 <_RBTree_Initialize+0x2c>
4000bb80: 92 10 00 1a mov %i2, %o1
4000bb84: 81 c7 e0 08 ret
4000bb88: 81 e8 00 00 restore
4000a910 <_RBTree_Insert_unprotected>:
*/
RBTree_Node *_RBTree_Insert_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
4000a910: 9d e3 bf a0 save %sp, -96, %sp
if(!the_node) return (RBTree_Node*)-1;
4000a914: 80 a6 60 00 cmp %i1, 0
4000a918: 02 80 00 7c be 4000ab08 <_RBTree_Insert_unprotected+0x1f8>
4000a91c: ba 10 00 18 mov %i0, %i5
RBTree_Node *iter_node = the_rbtree->root;
4000a920: f0 06 20 04 ld [ %i0 + 4 ], %i0
int compare_result;
if (!iter_node) { /* special case: first node inserted */
4000a924: b6 96 20 00 orcc %i0, 0, %i3
4000a928: 32 80 00 0c bne,a 4000a958 <_RBTree_Insert_unprotected+0x48>
4000a92c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
the_node->color = RBT_BLACK;
4000a930: c0 26 60 0c clr [ %i1 + 0xc ]
the_rbtree->root = the_node;
4000a934: f2 27 60 04 st %i1, [ %i5 + 4 ]
the_rbtree->first[0] = the_rbtree->first[1] = the_node;
4000a938: f2 27 60 0c st %i1, [ %i5 + 0xc ]
4000a93c: f2 27 60 08 st %i1, [ %i5 + 8 ]
the_node->parent = (RBTree_Node *) the_rbtree;
4000a940: fa 26 40 00 st %i5, [ %i1 ]
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
4000a944: c0 26 60 08 clr [ %i1 + 8 ]
4000a948: c0 26 60 04 clr [ %i1 + 4 ]
4000a94c: 81 c7 e0 08 ret
4000a950: 81 e8 00 00 restore
} else {
/* typical binary search tree insert, descend tree to leaf and insert */
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
4000a954: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
4000a958: 90 10 00 19 mov %i1, %o0
4000a95c: 9f c0 40 00 call %g1
4000a960: 92 10 00 18 mov %i0, %o1
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
4000a964: c2 0f 60 14 ldub [ %i5 + 0x14 ], %g1
4000a968: 80 a0 60 00 cmp %g1, 0
4000a96c: 02 80 00 05 be 4000a980 <_RBTree_Insert_unprotected+0x70>
4000a970: b8 38 00 08 xnor %g0, %o0, %i4
4000a974: 80 a2 20 00 cmp %o0, 0
4000a978: 02 80 00 65 be 4000ab0c <_RBTree_Insert_unprotected+0x1fc>
4000a97c: 01 00 00 00 nop
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
4000a980: b9 37 20 1f srl %i4, 0x1f, %i4
if (!iter_node->child[dir]) {
4000a984: 83 2f 20 02 sll %i4, 2, %g1
4000a988: 82 06 00 01 add %i0, %g1, %g1
4000a98c: f0 00 60 04 ld [ %g1 + 4 ], %i0
4000a990: 80 a6 20 00 cmp %i0, 0
4000a994: 32 bf ff f0 bne,a 4000a954 <_RBTree_Insert_unprotected+0x44>
4000a998: b6 10 00 18 mov %i0, %i3
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
4000a99c: c0 26 60 08 clr [ %i1 + 8 ]
4000a9a0: c0 26 60 04 clr [ %i1 + 4 ]
the_node->color = RBT_RED;
4000a9a4: 84 10 20 01 mov 1, %g2
iter_node->child[dir] = the_node;
4000a9a8: f2 20 60 04 st %i1, [ %g1 + 4 ]
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
if (!iter_node->child[dir]) {
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
the_node->color = RBT_RED;
4000a9ac: c4 26 60 0c st %g2, [ %i1 + 0xc ]
iter_node->child[dir] = the_node;
the_node->parent = iter_node;
4000a9b0: f6 26 40 00 st %i3, [ %i1 ]
/* update min/max */
compare_result = the_rbtree->compare_function(
4000a9b4: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
4000a9b8: b6 07 20 02 add %i4, 2, %i3
4000a9bc: 85 2e e0 02 sll %i3, 2, %g2
4000a9c0: d2 07 40 02 ld [ %i5 + %g2 ], %o1
4000a9c4: 9f c0 40 00 call %g1
4000a9c8: 90 10 00 19 mov %i1, %o0
the_node,
_RBTree_First(the_rbtree, dir)
);
if ( (!dir && _RBTree_Is_lesser(compare_result)) ||
4000a9cc: 80 a7 20 00 cmp %i4, 0
4000a9d0: 12 80 00 06 bne 4000a9e8 <_RBTree_Insert_unprotected+0xd8>
4000a9d4: 80 a2 20 00 cmp %o0, 0
4000a9d8: 36 80 00 3c bge,a 4000aac8 <_RBTree_Insert_unprotected+0x1b8>
4000a9dc: d0 06 40 00 ld [ %i1 ], %o0
(dir && _RBTree_Is_greater(compare_result)) ) {
the_rbtree->first[dir] = the_node;
4000a9e0: 10 80 00 04 b 4000a9f0 <_RBTree_Insert_unprotected+0xe0>
4000a9e4: b7 2e e0 02 sll %i3, 2, %i3
compare_result = the_rbtree->compare_function(
the_node,
_RBTree_First(the_rbtree, dir)
);
if ( (!dir && _RBTree_Is_lesser(compare_result)) ||
(dir && _RBTree_Is_greater(compare_result)) ) {
4000a9e8: 04 80 00 37 ble 4000aac4 <_RBTree_Insert_unprotected+0x1b4>
4000a9ec: b7 2e e0 02 sll %i3, 2, %i3
the_rbtree->first[dir] = the_node;
4000a9f0: 10 80 00 35 b 4000aac4 <_RBTree_Insert_unprotected+0x1b4>
4000a9f4: f2 27 40 1b st %i1, [ %i5 + %i3 ]
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
if(!(the_node->parent->parent)) return NULL;
4000a9f8: 02 80 00 13 be 4000aa44 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN
4000a9fc: 82 10 20 00 clr %g1
if(!(the_node->parent->parent->parent)) return NULL;
4000aa00: c2 07 40 00 ld [ %i5 ], %g1
4000aa04: 80 a0 60 00 cmp %g1, 0
4000aa08: 02 80 00 0f be 4000aa44 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN
4000aa0c: 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])
4000aa10: c2 07 60 04 ld [ %i5 + 4 ], %g1
4000aa14: 80 a2 00 01 cmp %o0, %g1
4000aa18: 22 80 00 02 be,a 4000aa20 <_RBTree_Insert_unprotected+0x110>
4000aa1c: 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);
4000aa20: 80 a0 60 00 cmp %g1, 0
4000aa24: 02 80 00 09 be 4000aa48 <_RBTree_Insert_unprotected+0x138>
4000aa28: 84 10 20 00 clr %g2
4000aa2c: c4 00 60 0c ld [ %g1 + 0xc ], %g2
4000aa30: 80 a0 a0 01 cmp %g2, 1
4000aa34: 32 80 00 05 bne,a 4000aa48 <_RBTree_Insert_unprotected+0x138>
4000aa38: 84 10 20 00 clr %g2
4000aa3c: 10 80 00 03 b 4000aa48 <_RBTree_Insert_unprotected+0x138>
4000aa40: 84 10 20 01 mov 1, %g2
4000aa44: 84 10 20 00 clr %g2 <== NOT EXECUTED
while (_RBTree_Is_red(_RBTree_Parent(the_node))) {
u = _RBTree_Parent_sibling(the_node);
g = the_node->parent->parent;
/* if uncle is red, repaint uncle/parent black and grandparent red */
if(_RBTree_Is_red(u)) {
4000aa48: 80 a0 a0 00 cmp %g2, 0
4000aa4c: 22 80 00 08 be,a 4000aa6c <_RBTree_Insert_unprotected+0x15c>
4000aa50: c2 07 60 04 ld [ %i5 + 4 ], %g1
the_node->parent->color = RBT_BLACK;
4000aa54: c0 22 20 0c clr [ %o0 + 0xc ]
u->color = RBT_BLACK;
4000aa58: c0 20 60 0c clr [ %g1 + 0xc ]
g->color = RBT_RED;
4000aa5c: b2 10 00 1d mov %i5, %i1
4000aa60: 82 10 20 01 mov 1, %g1
4000aa64: 10 80 00 18 b 4000aac4 <_RBTree_Insert_unprotected+0x1b4>
4000aa68: c2 27 60 0c st %g1, [ %i5 + 0xc ]
the_node = g;
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
RBTree_Direction pdir = the_node->parent != g->child[0];
4000aa6c: 82 1a 00 01 xor %o0, %g1, %g1
4000aa70: 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];
4000aa74: c2 02 20 04 ld [ %o0 + 4 ], %g1
RBTree_Direction pdir = the_node->parent != g->child[0];
4000aa78: 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];
4000aa7c: 82 1e 40 01 xor %i1, %g1, %g1
4000aa80: 80 a0 00 01 cmp %g0, %g1
4000aa84: 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) {
4000aa88: 80 a0 40 1c cmp %g1, %i4
4000aa8c: 22 80 00 08 be,a 4000aaac <_RBTree_Insert_unprotected+0x19c>
4000aa90: c2 06 40 00 ld [ %i1 ], %g1
_RBTree_Rotate(the_node->parent, pdir);
4000aa94: 7f ff ff 80 call 4000a894 <_RBTree_Rotate>
4000aa98: 92 10 00 1c mov %i4, %o1
the_node = the_node->child[pdir];
4000aa9c: 83 2f 20 02 sll %i4, 2, %g1
4000aaa0: b2 06 40 01 add %i1, %g1, %i1
4000aaa4: f2 06 60 04 ld [ %i1 + 4 ], %i1
}
the_node->parent->color = RBT_BLACK;
4000aaa8: c2 06 40 00 ld [ %i1 ], %g1
g->color = RBT_RED;
4000aaac: 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;
4000aab0: c0 20 60 0c clr [ %g1 + 0xc ]
g->color = RBT_RED;
4000aab4: d2 27 60 0c st %o1, [ %i5 + 0xc ]
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
4000aab8: 90 10 00 1d mov %i5, %o0
4000aabc: 7f ff ff 76 call 4000a894 <_RBTree_Rotate>
4000aac0: 92 22 40 1c sub %o1, %i4, %o1
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent(
const RBTree_Node *the_node
)
{
if (!the_node->parent->parent) return NULL;
4000aac4: d0 06 40 00 ld [ %i1 ], %o0
4000aac8: fa 02 00 00 ld [ %o0 ], %i5
4000aacc: 80 a7 60 00 cmp %i5, 0
4000aad0: 22 80 00 06 be,a 4000aae8 <_RBTree_Insert_unprotected+0x1d8>
4000aad4: 82 10 20 00 clr %g1
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
4000aad8: c2 02 20 0c ld [ %o0 + 0xc ], %g1
4000aadc: 82 18 60 01 xor %g1, 1, %g1
4000aae0: 80 a0 00 01 cmp %g0, %g1
4000aae4: 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))) {
4000aae8: 80 a0 60 00 cmp %g1, 0
4000aaec: 12 bf ff c3 bne 4000a9f8 <_RBTree_Insert_unprotected+0xe8>
4000aaf0: 80 a7 60 00 cmp %i5, 0
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
}
}
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
4000aaf4: 12 80 00 06 bne 4000ab0c <_RBTree_Insert_unprotected+0x1fc>
4000aaf8: 01 00 00 00 nop
4000aafc: c0 26 60 0c clr [ %i1 + 0xc ]
4000ab00: 81 c7 e0 08 ret
4000ab04: 81 e8 00 00 restore
RBTree_Node *_RBTree_Insert_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
if(!the_node) return (RBTree_Node*)-1;
4000ab08: b0 10 3f ff mov -1, %i0
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
}
4000ab0c: 81 c7 e0 08 ret
4000ab10: 81 e8 00 00 restore
4000ab44 <_RBTree_Iterate_unprotected>:
const RBTree_Control *rbtree,
RBTree_Direction dir,
RBTree_Visitor visitor,
void *visitor_arg
)
{
4000ab44: 9d e3 bf a0 save %sp, -96, %sp
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
4000ab48: b8 10 20 00 clr %i4
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
4000ab4c: 80 a0 00 19 cmp %g0, %i1
4000ab50: 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];
4000ab54: 82 00 60 02 add %g1, 2, %g1
4000ab58: 83 28 60 02 sll %g1, 2, %g1
while ( !stop && current != NULL ) {
4000ab5c: 10 80 00 0a b 4000ab84 <_RBTree_Iterate_unprotected+0x40>
4000ab60: fa 06 00 01 ld [ %i0 + %g1 ], %i5
stop = (*visitor)( current, dir, visitor_arg );
4000ab64: 92 10 00 19 mov %i1, %o1
4000ab68: 9f c6 80 00 call %i2
4000ab6c: 94 10 00 1b mov %i3, %o2
current = _RBTree_Next_unprotected( current, dir );
4000ab70: 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 );
4000ab74: b8 10 00 08 mov %o0, %i4
current = _RBTree_Next_unprotected( current, dir );
4000ab78: 40 00 00 0b call 4000aba4 <_RBTree_Next_unprotected>
4000ab7c: 90 10 00 1d mov %i5, %o0
4000ab80: ba 10 00 08 mov %o0, %i5
{
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
4000ab84: 80 a7 60 00 cmp %i5, 0
4000ab88: 02 80 00 05 be 4000ab9c <_RBTree_Iterate_unprotected+0x58>
4000ab8c: b8 1f 20 01 xor %i4, 1, %i4
4000ab90: 80 8f 20 ff btst 0xff, %i4
4000ab94: 12 bf ff f4 bne 4000ab64 <_RBTree_Iterate_unprotected+0x20><== ALWAYS TAKEN
4000ab98: 90 10 00 1d mov %i5, %o0
4000ab9c: 81 c7 e0 08 ret
4000aba0: 81 e8 00 00 restore
4000a4ac <_RBTree_Rotate>:
RBTree_Node *the_node,
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
4000a4ac: 80 a2 20 00 cmp %o0, 0
4000a4b0: 02 80 00 1c be 4000a520 <_RBTree_Rotate+0x74> <== NEVER TAKEN
4000a4b4: 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);
4000a4b8: 86 60 3f ff subx %g0, -1, %g3
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
4000a4bc: 87 28 e0 02 sll %g3, 2, %g3
4000a4c0: 86 02 00 03 add %o0, %g3, %g3
4000a4c4: c2 00 e0 04 ld [ %g3 + 4 ], %g1
4000a4c8: 80 a0 60 00 cmp %g1, 0
4000a4cc: 02 80 00 15 be 4000a520 <_RBTree_Rotate+0x74> <== NEVER TAKEN
4000a4d0: 93 2a 60 02 sll %o1, 2, %o1
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
4000a4d4: 84 00 40 09 add %g1, %o1, %g2
4000a4d8: c8 00 a0 04 ld [ %g2 + 4 ], %g4
4000a4dc: c8 20 e0 04 st %g4, [ %g3 + 4 ]
if (c->child[dir])
4000a4e0: c4 00 a0 04 ld [ %g2 + 4 ], %g2
4000a4e4: 80 a0 a0 00 cmp %g2, 0
4000a4e8: 32 80 00 02 bne,a 4000a4f0 <_RBTree_Rotate+0x44>
4000a4ec: d0 20 80 00 st %o0, [ %g2 ]
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
4000a4f0: c4 02 00 00 ld [ %o0 ], %g2
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
if (c->child[dir])
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
4000a4f4: 92 00 40 09 add %g1, %o1, %o1
4000a4f8: d0 22 60 04 st %o0, [ %o1 + 4 ]
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
4000a4fc: c6 00 a0 04 ld [ %g2 + 4 ], %g3
c->parent = the_node->parent;
4000a500: c4 20 40 00 st %g2, [ %g1 ]
if (c->child[dir])
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
4000a504: 86 1a 00 03 xor %o0, %g3, %g3
c->parent = the_node->parent;
the_node->parent = c;
4000a508: c2 22 00 00 st %g1, [ %o0 ]
if (c->child[dir])
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
4000a50c: 80 a0 00 03 cmp %g0, %g3
4000a510: 86 40 20 00 addx %g0, 0, %g3
4000a514: 87 28 e0 02 sll %g3, 2, %g3
4000a518: 86 00 80 03 add %g2, %g3, %g3
4000a51c: c2 20 e0 04 st %g1, [ %g3 + 4 ]
4000a520: 81 c3 e0 08 retl
4000a45c <_RBTree_Sibling>:
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
4000a45c: 80 a2 20 00 cmp %o0, 0
4000a460: 02 80 00 10 be 4000a4a0 <_RBTree_Sibling+0x44> <== NEVER TAKEN
4000a464: 82 10 20 00 clr %g1
if(!(the_node->parent)) return NULL;
4000a468: c4 02 00 00 ld [ %o0 ], %g2
4000a46c: 80 a0 a0 00 cmp %g2, 0
4000a470: 22 80 00 0d be,a 4000a4a4 <_RBTree_Sibling+0x48> <== NEVER TAKEN
4000a474: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED
if(!(the_node->parent->parent)) return NULL;
4000a478: c2 00 80 00 ld [ %g2 ], %g1
4000a47c: 80 a0 60 00 cmp %g1, 0
4000a480: 02 80 00 08 be 4000a4a0 <_RBTree_Sibling+0x44>
4000a484: 82 10 20 00 clr %g1
if(the_node == the_node->parent->child[RBT_LEFT])
4000a488: c2 00 a0 04 ld [ %g2 + 4 ], %g1
4000a48c: 80 a2 00 01 cmp %o0, %g1
4000a490: 22 80 00 04 be,a 4000a4a0 <_RBTree_Sibling+0x44>
4000a494: c2 00 a0 08 ld [ %g2 + 8 ], %g1
return the_node->parent->child[RBT_RIGHT];
4000a498: 81 c3 e0 08 retl
4000a49c: 90 10 00 01 mov %g1, %o0
else
return the_node->parent->child[RBT_LEFT];
}
4000a4a0: 90 10 00 01 mov %g1, %o0
4000a4a4: 81 c3 e0 08 retl
40009144 <_RTEMS_signal_Post_switch_hook>:
#include <rtems/score/thread.h>
#include <rtems/score/apiext.h>
#include <rtems/rtems/tasks.h>
static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing )
{
40009144: 9d e3 bf 98 save %sp, -104, %sp
RTEMS_API_Control *api;
ASR_Information *asr;
rtems_signal_set signal_set;
Modes_Control prev_mode;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
40009148: fa 06 21 4c ld [ %i0 + 0x14c ], %i5
if ( !api )
4000914c: 80 a7 60 00 cmp %i5, 0
40009150: 02 80 00 1c be 400091c0 <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN
40009154: 01 00 00 00 nop
* Signal Processing
*/
asr = &api->Signal;
_ISR_Disable( level );
40009158: 7f ff e8 9d call 400033cc <sparc_disable_interrupts>
4000915c: 01 00 00 00 nop
signal_set = asr->signals_posted;
40009160: f8 07 60 14 ld [ %i5 + 0x14 ], %i4
asr->signals_posted = 0;
40009164: c0 27 60 14 clr [ %i5 + 0x14 ]
_ISR_Enable( level );
40009168: 7f ff e8 9d call 400033dc <sparc_enable_interrupts>
4000916c: 01 00 00 00 nop
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
40009170: 80 a7 20 00 cmp %i4, 0
40009174: 02 80 00 13 be 400091c0 <_RTEMS_signal_Post_switch_hook+0x7c>
40009178: 94 07 bf fc add %fp, -4, %o2
return;
asr->nest_level += 1;
4000917c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
40009180: d0 07 60 10 ld [ %i5 + 0x10 ], %o0
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
return;
asr->nest_level += 1;
40009184: 82 00 60 01 inc %g1
40009188: c2 27 60 1c st %g1, [ %i5 + 0x1c ]
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
4000918c: 37 00 00 3f sethi %hi(0xfc00), %i3
40009190: 40 00 01 03 call 4000959c <rtems_task_mode>
40009194: 92 16 e3 ff or %i3, 0x3ff, %o1 ! ffff <PROM_START+0xffff>
(*asr->handler)( signal_set );
40009198: c2 07 60 0c ld [ %i5 + 0xc ], %g1
4000919c: 9f c0 40 00 call %g1
400091a0: 90 10 00 1c mov %i4, %o0
asr->nest_level -= 1;
400091a4: c2 07 60 1c ld [ %i5 + 0x1c ], %g1
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
400091a8: d0 07 bf fc ld [ %fp + -4 ], %o0
asr->nest_level += 1;
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
(*asr->handler)( signal_set );
asr->nest_level -= 1;
400091ac: 82 00 7f ff add %g1, -1, %g1
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
400091b0: 92 16 e3 ff or %i3, 0x3ff, %o1
asr->nest_level += 1;
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
(*asr->handler)( signal_set );
asr->nest_level -= 1;
400091b4: c2 27 60 1c st %g1, [ %i5 + 0x1c ]
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
400091b8: 40 00 00 f9 call 4000959c <rtems_task_mode>
400091bc: 94 07 bf fc add %fp, -4, %o2
400091c0: 81 c7 e0 08 ret
400091c4: 81 e8 00 00 restore
4003293c <_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
)
{
4003293c: 9d e3 bf 98 save %sp, -104, %sp
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
40032940: 13 10 01 8b sethi %hi(0x40062c00), %o1
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
Timestamp_Control uptime;
#endif
Thread_Control *owning_thread = the_period->owner;
40032944: f6 06 20 40 ld [ %i0 + 0x40 ], %i3
40032948: 90 07 bf f8 add %fp, -8, %o0
4003294c: 7f ff 57 de call 400088c4 <_TOD_Get_with_nanoseconds>
40032950: 92 12 61 d0 or %o1, 0x1d0, %o1
/*
* Determine elapsed wall time since period initiated.
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
40032954: c4 1f bf f8 ldd [ %fp + -8 ], %g2
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
40032958: 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) {
4003295c: 09 10 01 8c sethi %hi(0x40063000), %g4
40032960: ba a0 c0 1d subcc %g3, %i5, %i5
40032964: 88 11 20 80 or %g4, 0x80, %g4
40032968: b8 60 80 1c subx %g2, %i4, %i4
4003296c: f8 3e 40 00 std %i4, [ %i1 ]
40032970: fa 01 20 10 ld [ %g4 + 0x10 ], %i5
#endif
/*
* Determine cpu usage since period initiated.
*/
used = owning_thread->cpu_time_used;
40032974: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
if (owning_thread == _Thread_Executing) {
40032978: 80 a6 c0 1d cmp %i3, %i5
4003297c: 12 80 00 15 bne 400329d0 <_Rate_monotonic_Get_status+0x94>
40032980: 82 10 20 01 mov 1, %g1
40032984: f8 19 20 20 ldd [ %g4 + 0x20 ], %i4
40032988: 86 a0 c0 1d subcc %g3, %i5, %g3
4003298c: 84 60 80 1c subx %g2, %i4, %g2
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
40032990: ba 83 40 03 addcc %o5, %g3, %i5
40032994: b8 43 00 02 addx %o4, %g2, %i4
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
40032998: c4 1e 20 48 ldd [ %i0 + 0x48 ], %g2
/*
* The cpu usage info was reset while executing. Can't
* determine a status.
*/
if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated))
4003299c: 80 a0 80 1c cmp %g2, %i4
400329a0: 34 80 00 0c bg,a 400329d0 <_Rate_monotonic_Get_status+0x94><== NEVER TAKEN
400329a4: 82 10 20 00 clr %g1 <== NOT EXECUTED
400329a8: 32 80 00 06 bne,a 400329c0 <_Rate_monotonic_Get_status+0x84>
400329ac: 86 a7 40 03 subcc %i5, %g3, %g3
400329b0: 80 a0 c0 1d cmp %g3, %i5
400329b4: 18 80 00 06 bgu 400329cc <_Rate_monotonic_Get_status+0x90>
400329b8: 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;
400329bc: 82 10 20 01 mov 1, %g1
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
400329c0: 84 67 00 02 subx %i4, %g2, %g2
400329c4: 10 80 00 03 b 400329d0 <_Rate_monotonic_Get_status+0x94>
400329c8: 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;
400329cc: 82 10 20 00 clr %g1
return false;
*cpu_since_last_period = used - the_period->cpu_usage_period_initiated;
#endif
return true;
}
400329d0: b0 08 60 01 and %g1, 1, %i0
400329d4: 81 c7 e0 08 ret
400329d8: 81 e8 00 00 restore
40032d44 <_Rate_monotonic_Timeout>:
void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
)
{
40032d44: 9d e3 bf 98 save %sp, -104, %sp
40032d48: 11 10 01 8c sethi %hi(0x40063000), %o0
40032d4c: 92 10 00 18 mov %i0, %o1
40032d50: 90 12 22 a8 or %o0, 0x2a8, %o0
40032d54: 7f ff 59 83 call 40009360 <_Objects_Get>
40032d58: 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 ) {
40032d5c: c2 07 bf fc ld [ %fp + -4 ], %g1
40032d60: 80 a0 60 00 cmp %g1, 0
40032d64: 12 80 00 24 bne 40032df4 <_Rate_monotonic_Timeout+0xb0> <== NEVER TAKEN
40032d68: ba 10 00 08 mov %o0, %i5
case OBJECTS_LOCAL:
the_thread = the_period->owner;
40032d6c: d0 02 20 40 ld [ %o0 + 0x40 ], %o0
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
40032d70: 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);
40032d74: c4 02 20 10 ld [ %o0 + 0x10 ], %g2
40032d78: 80 88 80 01 btst %g2, %g1
40032d7c: 22 80 00 0b be,a 40032da8 <_Rate_monotonic_Timeout+0x64>
40032d80: c2 07 60 38 ld [ %i5 + 0x38 ], %g1
40032d84: c4 02 20 20 ld [ %o0 + 0x20 ], %g2
40032d88: c2 07 60 08 ld [ %i5 + 8 ], %g1
40032d8c: 80 a0 80 01 cmp %g2, %g1
40032d90: 32 80 00 06 bne,a 40032da8 <_Rate_monotonic_Timeout+0x64>
40032d94: 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 );
40032d98: 13 04 01 ff sethi %hi(0x1007fc00), %o1
40032d9c: 7f ff 5c 11 call 40009de0 <_Thread_Clear_state>
40032da0: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 <RAM_SIZE+0xfc7fff8>
40032da4: 30 80 00 06 b,a 40032dbc <_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 ) {
40032da8: 80 a0 60 01 cmp %g1, 1
40032dac: 12 80 00 0d bne 40032de0 <_Rate_monotonic_Timeout+0x9c>
40032db0: 82 10 20 04 mov 4, %g1
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
40032db4: 82 10 20 03 mov 3, %g1
40032db8: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
_Rate_monotonic_Initiate_statistics( the_period );
40032dbc: 7f ff ff 51 call 40032b00 <_Rate_monotonic_Initiate_statistics>
40032dc0: 90 10 00 1d mov %i5, %o0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40032dc4: c2 07 60 3c ld [ %i5 + 0x3c ], %g1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40032dc8: 11 10 01 8b sethi %hi(0x40062c00), %o0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40032dcc: c2 27 60 1c st %g1, [ %i5 + 0x1c ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40032dd0: 90 12 23 18 or %o0, 0x318, %o0
40032dd4: 7f ff 5f da call 4000ad3c <_Watchdog_Insert>
40032dd8: 92 07 60 10 add %i5, 0x10, %o1
40032ddc: 30 80 00 02 b,a 40032de4 <_Rate_monotonic_Timeout+0xa0>
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
40032de0: 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;
40032de4: 03 10 01 8b sethi %hi(0x40062c00), %g1
40032de8: c4 00 62 80 ld [ %g1 + 0x280 ], %g2 ! 40062e80 <_Thread_Dispatch_disable_level>
--level;
40032dec: 84 00 bf ff add %g2, -1, %g2
_Thread_Dispatch_disable_level = level;
40032df0: c4 20 62 80 st %g2, [ %g1 + 0x280 ]
40032df4: 81 c7 e0 08 ret
40032df8: 81 e8 00 00 restore
400329dc <_Rate_monotonic_Update_statistics>:
}
static void _Rate_monotonic_Update_statistics(
Rate_monotonic_Control *the_period
)
{
400329dc: 9d e3 bf 90 save %sp, -112, %sp
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
400329e0: c2 06 20 58 ld [ %i0 + 0x58 ], %g1
400329e4: 82 00 60 01 inc %g1
400329e8: c2 26 20 58 st %g1, [ %i0 + 0x58 ]
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
400329ec: c2 06 20 38 ld [ %i0 + 0x38 ], %g1
400329f0: 80 a0 60 04 cmp %g1, 4
400329f4: 12 80 00 05 bne 40032a08 <_Rate_monotonic_Update_statistics+0x2c>
400329f8: 90 10 00 18 mov %i0, %o0
stats->missed_count++;
400329fc: c2 06 20 5c ld [ %i0 + 0x5c ], %g1
40032a00: 82 00 60 01 inc %g1
40032a04: c2 26 20 5c st %g1, [ %i0 + 0x5c ]
/*
* Grab status for time statistics.
*/
valid_status =
40032a08: 92 07 bf f8 add %fp, -8, %o1
40032a0c: 7f ff ff cc call 4003293c <_Rate_monotonic_Get_status>
40032a10: 94 07 bf f0 add %fp, -16, %o2
_Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
if (!valid_status)
40032a14: 80 8a 20 ff btst 0xff, %o0
40032a18: 02 80 00 38 be 40032af8 <_Rate_monotonic_Update_statistics+0x11c>
40032a1c: c4 1f bf f0 ldd [ %fp + -16 ], %g2
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
40032a20: 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 ) )
40032a24: c2 06 20 60 ld [ %i0 + 0x60 ], %g1
40032a28: b6 87 40 03 addcc %i5, %g3, %i3
40032a2c: b4 47 00 02 addx %i4, %g2, %i2
40032a30: 80 a0 40 02 cmp %g1, %g2
40032a34: 14 80 00 09 bg 40032a58 <_Rate_monotonic_Update_statistics+0x7c>
40032a38: f4 3e 20 70 std %i2, [ %i0 + 0x70 ]
40032a3c: 80 a0 40 02 cmp %g1, %g2
40032a40: 32 80 00 08 bne,a 40032a60 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN
40032a44: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED
40032a48: c2 06 20 64 ld [ %i0 + 0x64 ], %g1
40032a4c: 80 a0 40 03 cmp %g1, %g3
40032a50: 28 80 00 04 bleu,a 40032a60 <_Rate_monotonic_Update_statistics+0x84>
40032a54: c2 06 20 68 ld [ %i0 + 0x68 ], %g1
stats->min_cpu_time = executed;
40032a58: c4 3e 20 60 std %g2, [ %i0 + 0x60 ]
if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
40032a5c: c2 06 20 68 ld [ %i0 + 0x68 ], %g1
40032a60: 80 a0 40 02 cmp %g1, %g2
40032a64: 26 80 00 0a bl,a 40032a8c <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN
40032a68: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED
40032a6c: 80 a0 40 02 cmp %g1, %g2
40032a70: 32 80 00 08 bne,a 40032a90 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN
40032a74: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED
40032a78: c2 06 20 6c ld [ %i0 + 0x6c ], %g1
40032a7c: 80 a0 40 03 cmp %g1, %g3
40032a80: 3a 80 00 04 bcc,a 40032a90 <_Rate_monotonic_Update_statistics+0xb4>
40032a84: c4 1f bf f8 ldd [ %fp + -8 ], %g2
stats->max_cpu_time = executed;
40032a88: 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 );
40032a8c: c4 1f bf f8 ldd [ %fp + -8 ], %g2
40032a90: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4
if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
40032a94: c2 06 20 78 ld [ %i0 + 0x78 ], %g1
40032a98: b6 87 40 03 addcc %i5, %g3, %i3
40032a9c: b4 47 00 02 addx %i4, %g2, %i2
40032aa0: 80 a0 40 02 cmp %g1, %g2
40032aa4: 14 80 00 09 bg 40032ac8 <_Rate_monotonic_Update_statistics+0xec>
40032aa8: f4 3e 20 88 std %i2, [ %i0 + 0x88 ]
40032aac: 80 a0 40 02 cmp %g1, %g2
40032ab0: 32 80 00 08 bne,a 40032ad0 <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN
40032ab4: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED
40032ab8: c2 06 20 7c ld [ %i0 + 0x7c ], %g1
40032abc: 80 a0 40 03 cmp %g1, %g3
40032ac0: 28 80 00 04 bleu,a 40032ad0 <_Rate_monotonic_Update_statistics+0xf4>
40032ac4: c2 06 20 80 ld [ %i0 + 0x80 ], %g1
stats->min_wall_time = since_last_period;
40032ac8: c4 3e 20 78 std %g2, [ %i0 + 0x78 ]
if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
40032acc: c2 06 20 80 ld [ %i0 + 0x80 ], %g1
40032ad0: 80 a0 40 02 cmp %g1, %g2
40032ad4: 26 80 00 09 bl,a 40032af8 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN
40032ad8: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED
40032adc: 80 a0 40 02 cmp %g1, %g2
40032ae0: 12 80 00 06 bne 40032af8 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN
40032ae4: 01 00 00 00 nop
40032ae8: c2 06 20 84 ld [ %i0 + 0x84 ], %g1
40032aec: 80 a0 40 03 cmp %g1, %g3
40032af0: 2a 80 00 02 bcs,a 40032af8 <_Rate_monotonic_Update_statistics+0x11c>
40032af4: c4 3e 20 80 std %g2, [ %i0 + 0x80 ]
40032af8: 81 c7 e0 08 ret
40032afc: 81 e8 00 00 restore
4000a80c <_Scheduler_CBS_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_CBS_Allocate(
Thread_Control *the_thread
)
{
4000a80c: 9d e3 bf a0 save %sp, -96, %sp
void *sched;
Scheduler_CBS_Per_thread *schinfo;
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
4000a810: 40 00 06 7d call 4000c204 <_Workspace_Allocate>
4000a814: 90 10 20 1c mov 0x1c, %o0
if ( sched ) {
4000a818: 80 a2 20 00 cmp %o0, 0
4000a81c: 02 80 00 06 be 4000a834 <_Scheduler_CBS_Allocate+0x28> <== NEVER TAKEN
4000a820: 82 10 20 02 mov 2, %g1
the_thread->scheduler_info = sched;
4000a824: d0 26 20 88 st %o0, [ %i0 + 0x88 ]
schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info);
schinfo->edf_per_thread.thread = the_thread;
4000a828: f0 22 00 00 st %i0, [ %o0 ]
schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
4000a82c: c2 22 20 14 st %g1, [ %o0 + 0x14 ]
schinfo->cbs_server = NULL;
4000a830: c0 22 20 18 clr [ %o0 + 0x18 ]
}
return sched;
}
4000a834: 81 c7 e0 08 ret
4000a838: 91 e8 00 08 restore %g0, %o0, %o0
4000bb4c <_Scheduler_CBS_Budget_callout>:
Scheduler_CBS_Server **_Scheduler_CBS_Server_list;
void _Scheduler_CBS_Budget_callout(
Thread_Control *the_thread
)
{
4000bb4c: 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;
4000bb50: d2 06 20 ac ld [ %i0 + 0xac ], %o1
if ( the_thread->real_priority != new_priority )
4000bb54: c2 06 20 18 ld [ %i0 + 0x18 ], %g1
4000bb58: 80 a0 40 09 cmp %g1, %o1
4000bb5c: 32 80 00 02 bne,a 4000bb64 <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN
4000bb60: d2 26 20 18 st %o1, [ %i0 + 0x18 ]
the_thread->real_priority = new_priority;
if ( the_thread->current_priority != new_priority )
4000bb64: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
4000bb68: 80 a0 40 09 cmp %g1, %o1
4000bb6c: 02 80 00 04 be 4000bb7c <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN
4000bb70: 90 10 00 18 mov %i0, %o0
_Thread_Change_priority(the_thread, new_priority, true);
4000bb74: 40 00 01 81 call 4000c178 <_Thread_Change_priority>
4000bb78: 94 10 20 01 mov 1, %o2
/* Invoke callback function if any. */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
4000bb7c: fa 06 20 88 ld [ %i0 + 0x88 ], %i5
if ( sched_info->cbs_server->cbs_budget_overrun ) {
4000bb80: c2 07 60 18 ld [ %i5 + 0x18 ], %g1
4000bb84: c4 00 60 0c ld [ %g1 + 0xc ], %g2
4000bb88: 80 a0 a0 00 cmp %g2, 0
4000bb8c: 02 80 00 09 be 4000bbb0 <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN
4000bb90: 01 00 00 00 nop
_Scheduler_CBS_Get_server_id(
4000bb94: d0 00 40 00 ld [ %g1 ], %o0
4000bb98: 7f ff ff d7 call 4000baf4 <_Scheduler_CBS_Get_server_id>
4000bb9c: 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 );
4000bba0: c2 07 60 18 ld [ %i5 + 0x18 ], %g1
4000bba4: c2 00 60 0c ld [ %g1 + 0xc ], %g1
4000bba8: 9f c0 40 00 call %g1
4000bbac: d0 07 bf fc ld [ %fp + -4 ], %o0
4000bbb0: 81 c7 e0 08 ret
4000bbb4: 81 e8 00 00 restore
4000b754 <_Scheduler_CBS_Create_server>:
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
4000b754: 9d e3 bf a0 save %sp, -96, %sp
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
4000b758: c2 06 20 04 ld [ %i0 + 4 ], %g1
4000b75c: 80 a0 60 00 cmp %g1, 0
4000b760: 04 80 00 1d ble 4000b7d4 <_Scheduler_CBS_Create_server+0x80>
4000b764: 01 00 00 00 nop
4000b768: c2 06 00 00 ld [ %i0 ], %g1
4000b76c: 80 a0 60 00 cmp %g1, 0
4000b770: 04 80 00 19 ble 4000b7d4 <_Scheduler_CBS_Create_server+0x80>
4000b774: 03 10 00 82 sethi %hi(0x40020800), %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++ ) {
4000b778: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 40020930 <_Scheduler_CBS_Maximum_servers>
if ( !_Scheduler_CBS_Server_list[i] )
4000b77c: 03 10 00 86 sethi %hi(0x40021800), %g1
4000b780: c6 00 60 98 ld [ %g1 + 0x98 ], %g3 ! 40021898 <_Scheduler_CBS_Server_list>
4000b784: 10 80 00 07 b 4000b7a0 <_Scheduler_CBS_Create_server+0x4c>
4000b788: 82 10 20 00 clr %g1
4000b78c: c8 00 c0 1c ld [ %g3 + %i4 ], %g4
4000b790: 80 a1 20 00 cmp %g4, 0
4000b794: 02 80 00 14 be 4000b7e4 <_Scheduler_CBS_Create_server+0x90>
4000b798: 3b 10 00 86 sethi %hi(0x40021800), %i5
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
4000b79c: 82 00 60 01 inc %g1
4000b7a0: 80 a0 40 02 cmp %g1, %g2
4000b7a4: 12 bf ff fa bne 4000b78c <_Scheduler_CBS_Create_server+0x38>
4000b7a8: b9 28 60 02 sll %g1, 2, %i4
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
4000b7ac: 81 c7 e0 08 ret
4000b7b0: 91 e8 3f e6 restore %g0, -26, %o0
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
4000b7b4: c4 20 60 04 st %g2, [ %g1 + 4 ]
4000b7b8: c4 06 20 04 ld [ %i0 + 4 ], %g2
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
4000b7bc: 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;
4000b7c0: c4 20 60 08 st %g2, [ %g1 + 8 ]
the_server->task_id = -1;
4000b7c4: 84 10 3f ff mov -1, %g2
4000b7c8: c4 20 40 00 st %g2, [ %g1 ]
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
4000b7cc: 81 c7 e0 08 ret
4000b7d0: 91 e8 20 00 restore %g0, 0, %o0
if ( params->budget <= 0 ||
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
4000b7d4: 81 c7 e0 08 ret
4000b7d8: 91 e8 3f ee restore %g0, -18, %o0
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
4000b7dc: 81 c7 e0 08 ret <== NOT EXECUTED
4000b7e0: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
4000b7e4: f6 07 60 98 ld [ %i5 + 0x98 ], %i3
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
4000b7e8: c2 26 80 00 st %g1, [ %i2 ]
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
4000b7ec: 40 00 07 6f call 4000d5a8 <_Workspace_Allocate>
4000b7f0: 90 10 20 10 mov 0x10, %o0
the_server = _Scheduler_CBS_Server_list[*server_id];
4000b7f4: 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 *)
4000b7f8: d0 26 c0 1c st %o0, [ %i3 + %i4 ]
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
4000b7fc: c4 07 60 98 ld [ %i5 + 0x98 ], %g2
4000b800: 83 28 60 02 sll %g1, 2, %g1
4000b804: c2 00 80 01 ld [ %g2 + %g1 ], %g1
if ( !the_server )
4000b808: 80 a0 60 00 cmp %g1, 0
4000b80c: 32 bf ff ea bne,a 4000b7b4 <_Scheduler_CBS_Create_server+0x60><== ALWAYS TAKEN
4000b810: c4 06 00 00 ld [ %i0 ], %g2
4000b814: 30 bf ff f2 b,a 4000b7dc <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED
4000b88c <_Scheduler_CBS_Detach_thread>:
int _Scheduler_CBS_Detach_thread (
Scheduler_CBS_Server_id server_id,
rtems_id task_id
)
{
4000b88c: 9d e3 bf 98 save %sp, -104, %sp
Objects_Locations location;
Thread_Control *the_thread;
Scheduler_CBS_Per_thread *sched_info;
the_thread = _Thread_Get(task_id, &location);
4000b890: 90 10 00 19 mov %i1, %o0
4000b894: 40 00 03 5f call 4000c610 <_Thread_Get>
4000b898: 92 07 bf fc add %fp, -4, %o1
/* The routine _Thread_Get may disable dispatch and not enable again. */
if ( the_thread ) {
4000b89c: ba 92 20 00 orcc %o0, 0, %i5
4000b8a0: 02 80 00 05 be 4000b8b4 <_Scheduler_CBS_Detach_thread+0x28>
4000b8a4: 03 10 00 82 sethi %hi(0x40020800), %g1
_Thread_Enable_dispatch();
4000b8a8: 40 00 03 4e call 4000c5e0 <_Thread_Enable_dispatch>
4000b8ac: 01 00 00 00 nop
}
if ( server_id >= _Scheduler_CBS_Maximum_servers )
4000b8b0: 03 10 00 82 sethi %hi(0x40020800), %g1
4000b8b4: c2 00 61 30 ld [ %g1 + 0x130 ], %g1 ! 40020930 <_Scheduler_CBS_Maximum_servers>
4000b8b8: 80 a6 00 01 cmp %i0, %g1
4000b8bc: 1a 80 00 1b bcc 4000b928 <_Scheduler_CBS_Detach_thread+0x9c>
4000b8c0: 80 a7 60 00 cmp %i5, 0
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
if ( !the_thread )
4000b8c4: 02 80 00 19 be 4000b928 <_Scheduler_CBS_Detach_thread+0x9c>
4000b8c8: 03 10 00 86 sethi %hi(0x40021800), %g1
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
4000b8cc: c2 00 60 98 ld [ %g1 + 0x98 ], %g1 ! 40021898 <_Scheduler_CBS_Server_list>
4000b8d0: b1 2e 20 02 sll %i0, 2, %i0
4000b8d4: c2 00 40 18 ld [ %g1 + %i0 ], %g1
4000b8d8: 80 a0 60 00 cmp %g1, 0
4000b8dc: 02 80 00 11 be 4000b920 <_Scheduler_CBS_Detach_thread+0x94>
4000b8e0: 01 00 00 00 nop
return SCHEDULER_CBS_ERROR_NOSERVER;
/* Thread and server are not attached. */
if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
4000b8e4: c4 00 40 00 ld [ %g1 ], %g2
4000b8e8: 80 a0 80 19 cmp %g2, %i1
4000b8ec: 12 80 00 0f bne 4000b928 <_Scheduler_CBS_Detach_thread+0x9c><== NEVER TAKEN
4000b8f0: 84 10 3f ff mov -1, %g2
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
_Scheduler_CBS_Server_list[server_id]->task_id = -1;
4000b8f4: c4 20 40 00 st %g2, [ %g1 ]
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
sched_info->cbs_server = NULL;
4000b8f8: c2 07 60 88 ld [ %i5 + 0x88 ], %g1
4000b8fc: c0 20 60 18 clr [ %g1 + 0x18 ]
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
4000b900: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1
4000b904: c2 27 60 78 st %g1, [ %i5 + 0x78 ]
the_thread->budget_callout = the_thread->Start.budget_callout;
4000b908: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1
4000b90c: c2 27 60 7c st %g1, [ %i5 + 0x7c ]
the_thread->is_preemptible = the_thread->Start.is_preemptible;
4000b910: c2 0f 60 9c ldub [ %i5 + 0x9c ], %g1
4000b914: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ]
return SCHEDULER_CBS_OK;
4000b918: 81 c7 e0 08 ret
4000b91c: 91 e8 20 00 restore %g0, 0, %o0
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
if ( !the_thread )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
return SCHEDULER_CBS_ERROR_NOSERVER;
4000b920: 81 c7 e0 08 ret
4000b924: 91 e8 3f e7 restore %g0, -25, %o0
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
the_thread->budget_callout = the_thread->Start.budget_callout;
the_thread->is_preemptible = the_thread->Start.is_preemptible;
return SCHEDULER_CBS_OK;
}
4000b928: 81 c7 e0 08 ret
4000b92c: 91 e8 3f ee restore %g0, -18, %o0
4000bbb8 <_Scheduler_CBS_Initialize>:
}
}
int _Scheduler_CBS_Initialize(void)
{
4000bbb8: 9d e3 bf a0 save %sp, -96, %sp
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
4000bbbc: 3b 10 00 82 sethi %hi(0x40020800), %i5
4000bbc0: d0 07 61 30 ld [ %i5 + 0x130 ], %o0 ! 40020930 <_Scheduler_CBS_Maximum_servers>
}
int _Scheduler_CBS_Initialize(void)
{
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
4000bbc4: 40 00 06 79 call 4000d5a8 <_Workspace_Allocate>
4000bbc8: 91 2a 20 02 sll %o0, 2, %o0
4000bbcc: 05 10 00 86 sethi %hi(0x40021800), %g2
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
4000bbd0: 80 a2 20 00 cmp %o0, 0
4000bbd4: 02 80 00 0d be 4000bc08 <_Scheduler_CBS_Initialize+0x50> <== NEVER TAKEN
4000bbd8: d0 20 a0 98 st %o0, [ %g2 + 0x98 ]
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
4000bbdc: c6 07 61 30 ld [ %i5 + 0x130 ], %g3
4000bbe0: 10 80 00 05 b 4000bbf4 <_Scheduler_CBS_Initialize+0x3c>
4000bbe4: 82 10 20 00 clr %g1
_Scheduler_CBS_Server_list[i] = NULL;
4000bbe8: 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++) {
4000bbec: 82 00 60 01 inc %g1
_Scheduler_CBS_Server_list[i] = NULL;
4000bbf0: c0 27 40 04 clr [ %i5 + %g4 ]
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
4000bbf4: 80 a0 40 03 cmp %g1, %g3
4000bbf8: 12 bf ff fc bne 4000bbe8 <_Scheduler_CBS_Initialize+0x30>
4000bbfc: fa 00 a0 98 ld [ %g2 + 0x98 ], %i5
_Scheduler_CBS_Server_list[i] = NULL;
}
return SCHEDULER_CBS_OK;
4000bc00: 81 c7 e0 08 ret
4000bc04: 91 e8 20 00 restore %g0, 0, %o0
}
4000bc08: 81 c7 e0 08 ret <== NOT EXECUTED
4000bc0c: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED
4000a83c <_Scheduler_CBS_Release_job>:
{
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info =
(Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
Scheduler_CBS_Server *serv_info =
(Scheduler_CBS_Server *) sched_info->cbs_server;
4000a83c: c2 02 20 88 ld [ %o0 + 0x88 ], %g1
if (deadline) {
4000a840: 80 a2 60 00 cmp %o1, 0
4000a844: 02 80 00 10 be 4000a884 <_Scheduler_CBS_Release_job+0x48>
4000a848: c2 00 60 18 ld [ %g1 + 0x18 ], %g1
/* Initializing or shifting deadline. */
if (serv_info)
4000a84c: 80 a0 60 00 cmp %g1, 0
4000a850: 02 80 00 08 be 4000a870 <_Scheduler_CBS_Release_job+0x34>
4000a854: 05 10 00 7f sethi %hi(0x4001fc00), %g2
new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline)
4000a858: d2 00 a0 08 ld [ %g2 + 8 ], %o1 ! 4001fc08 <_Watchdog_Ticks_since_boot>
4000a85c: c4 00 60 04 ld [ %g1 + 4 ], %g2
4000a860: 92 02 40 02 add %o1, %g2, %o1
4000a864: 05 20 00 00 sethi %hi(0x80000000), %g2
4000a868: 10 80 00 0a b 4000a890 <_Scheduler_CBS_Release_job+0x54>
4000a86c: 92 2a 40 02 andn %o1, %g2, %o1
& ~SCHEDULER_EDF_PRIO_MSB;
else
new_priority = (_Watchdog_Ticks_since_boot + deadline)
4000a870: c2 00 a0 08 ld [ %g2 + 8 ], %g1
4000a874: 92 02 40 01 add %o1, %g1, %o1
4000a878: 03 20 00 00 sethi %hi(0x80000000), %g1
4000a87c: 10 80 00 07 b 4000a898 <_Scheduler_CBS_Release_job+0x5c>
4000a880: 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)
4000a884: 80 a0 60 00 cmp %g1, 0
4000a888: 02 80 00 04 be 4000a898 <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN
4000a88c: d2 02 20 ac ld [ %o0 + 0xac ], %o1
the_thread->cpu_time_budget = serv_info->parameters.budget;
4000a890: c2 00 60 08 ld [ %g1 + 8 ], %g1
4000a894: c2 22 20 74 st %g1, [ %o0 + 0x74 ]
the_thread->real_priority = new_priority;
4000a898: d2 22 20 18 st %o1, [ %o0 + 0x18 ]
_Thread_Change_priority(the_thread, new_priority, true);
4000a89c: 94 10 20 01 mov 1, %o2
4000a8a0: 82 13 c0 00 mov %o7, %g1
4000a8a4: 40 00 01 24 call 4000ad34 <_Thread_Change_priority>
4000a8a8: 9e 10 40 00 mov %g1, %o7
4000a8ac <_Scheduler_CBS_Unblock>:
#include <rtems/score/schedulercbs.h>
void _Scheduler_CBS_Unblock(
Thread_Control *the_thread
)
{
4000a8ac: 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);
4000a8b0: 40 00 00 4c call 4000a9e0 <_Scheduler_EDF_Enqueue>
4000a8b4: 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;
4000a8b8: c2 06 20 88 ld [ %i0 + 0x88 ], %g1
4000a8bc: 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) {
4000a8c0: 80 a7 60 00 cmp %i5, 0
4000a8c4: 02 80 00 18 be 4000a924 <_Scheduler_CBS_Unblock+0x78>
4000a8c8: 03 10 00 7f sethi %hi(0x4001fc00), %g1
time_t budget = serv_info->parameters.budget;
time_t deadline_left = the_thread->cpu_time_budget;
time_t budget_left = the_thread->real_priority -
_Watchdog_Ticks_since_boot;
if ( deadline*budget_left > budget*deadline_left ) {
4000a8cc: 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 -
4000a8d0: d0 00 60 08 ld [ %g1 + 8 ], %o0
4000a8d4: f8 06 20 18 ld [ %i0 + 0x18 ], %i4
_Watchdog_Ticks_since_boot;
if ( deadline*budget_left > budget*deadline_left ) {
4000a8d8: 40 00 3b b7 call 400197b4 <.umul>
4000a8dc: 90 27 00 08 sub %i4, %o0, %o0
4000a8e0: d2 06 20 74 ld [ %i0 + 0x74 ], %o1
4000a8e4: b6 10 00 08 mov %o0, %i3
4000a8e8: 40 00 3b b3 call 400197b4 <.umul>
4000a8ec: d0 07 60 08 ld [ %i5 + 8 ], %o0
4000a8f0: 80 a6 c0 08 cmp %i3, %o0
4000a8f4: 24 80 00 0d ble,a 4000a928 <_Scheduler_CBS_Unblock+0x7c>
4000a8f8: 3b 10 00 7f sethi %hi(0x4001fc00), %i5
/* Put late unblocked task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
4000a8fc: d2 06 20 ac ld [ %i0 + 0xac ], %o1
if ( the_thread->real_priority != new_priority )
4000a900: 80 a7 00 09 cmp %i4, %o1
4000a904: 32 80 00 02 bne,a 4000a90c <_Scheduler_CBS_Unblock+0x60>
4000a908: d2 26 20 18 st %o1, [ %i0 + 0x18 ]
the_thread->real_priority = new_priority;
if ( the_thread->current_priority != new_priority )
4000a90c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
4000a910: 80 a0 40 09 cmp %g1, %o1
4000a914: 02 80 00 04 be 4000a924 <_Scheduler_CBS_Unblock+0x78>
4000a918: 90 10 00 18 mov %i0, %o0
_Thread_Change_priority(the_thread, new_priority, true);
4000a91c: 40 00 01 06 call 4000ad34 <_Thread_Change_priority>
4000a920: 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,
4000a924: 3b 10 00 7f sethi %hi(0x4001fc00), %i5
4000a928: ba 17 61 20 or %i5, 0x120, %i5 ! 4001fd20 <_Per_CPU_Information>
4000a92c: c4 07 60 14 ld [ %i5 + 0x14 ], %g2
4000a930: 03 10 00 7b sethi %hi(0x4001ec00), %g1
4000a934: d0 06 20 14 ld [ %i0 + 0x14 ], %o0
4000a938: c2 00 62 14 ld [ %g1 + 0x214 ], %g1
4000a93c: 9f c0 40 00 call %g1
4000a940: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1
4000a944: 80 a2 20 00 cmp %o0, 0
4000a948: 04 80 00 0f ble 4000a984 <_Scheduler_CBS_Unblock+0xd8>
4000a94c: 01 00 00 00 nop
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
4000a950: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
4000a954: f0 27 60 14 st %i0, [ %i5 + 0x14 ]
if ( _Thread_Executing->is_preemptible ||
4000a958: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1
4000a95c: 80 a0 60 00 cmp %g1, 0
4000a960: 12 80 00 06 bne 4000a978 <_Scheduler_CBS_Unblock+0xcc>
4000a964: 84 10 20 01 mov 1, %g2
4000a968: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
4000a96c: 80 a0 60 00 cmp %g1, 0
4000a970: 12 80 00 05 bne 4000a984 <_Scheduler_CBS_Unblock+0xd8> <== ALWAYS TAKEN
4000a974: 01 00 00 00 nop
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
4000a978: 03 10 00 7f sethi %hi(0x4001fc00), %g1
4000a97c: 82 10 61 20 or %g1, 0x120, %g1 ! 4001fd20 <_Per_CPU_Information>
4000a980: c4 28 60 0c stb %g2, [ %g1 + 0xc ]
4000a984: 81 c7 e0 08 ret
4000a988: 81 e8 00 00 restore
4000a80c <_Scheduler_EDF_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_EDF_Allocate(
Thread_Control *the_thread
)
{
4000a80c: 9d e3 bf a0 save %sp, -96, %sp
void *sched;
Scheduler_EDF_Per_thread *schinfo;
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
4000a810: 40 00 06 52 call 4000c158 <_Workspace_Allocate>
4000a814: 90 10 20 18 mov 0x18, %o0
if ( sched ) {
4000a818: 80 a2 20 00 cmp %o0, 0
4000a81c: 02 80 00 05 be 4000a830 <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN
4000a820: 82 10 20 02 mov 2, %g1
the_thread->scheduler_info = sched;
4000a824: d0 26 20 88 st %o0, [ %i0 + 0x88 ]
schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info);
schinfo->thread = the_thread;
4000a828: f0 22 00 00 st %i0, [ %o0 ]
schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
4000a82c: c2 22 20 14 st %g1, [ %o0 + 0x14 ]
}
return sched;
}
4000a830: 81 c7 e0 08 ret
4000a834: 91 e8 00 08 restore %g0, %o0, %o0
4000a9d4 <_Scheduler_EDF_Unblock>:
#include <rtems/score/scheduleredf.h>
void _Scheduler_EDF_Unblock(
Thread_Control *the_thread
)
{
4000a9d4: 9d e3 bf a0 save %sp, -96, %sp
_Scheduler_EDF_Enqueue(the_thread);
4000a9d8: 7f ff ff ad call 4000a88c <_Scheduler_EDF_Enqueue>
4000a9dc: 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(
4000a9e0: 3b 10 00 7f sethi %hi(0x4001fc00), %i5
4000a9e4: ba 17 60 70 or %i5, 0x70, %i5 ! 4001fc70 <_Per_CPU_Information>
4000a9e8: c4 07 60 14 ld [ %i5 + 0x14 ], %g2
4000a9ec: 03 10 00 7b sethi %hi(0x4001ec00), %g1
4000a9f0: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0
4000a9f4: c2 00 61 64 ld [ %g1 + 0x164 ], %g1
4000a9f8: 9f c0 40 00 call %g1
4000a9fc: d2 06 20 14 ld [ %i0 + 0x14 ], %o1
4000aa00: 80 a2 20 00 cmp %o0, 0
4000aa04: 16 80 00 0f bge 4000aa40 <_Scheduler_EDF_Unblock+0x6c>
4000aa08: 01 00 00 00 nop
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
4000aa0c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
4000aa10: f0 27 60 14 st %i0, [ %i5 + 0x14 ]
if ( _Thread_Executing->is_preemptible ||
4000aa14: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1
4000aa18: 80 a0 60 00 cmp %g1, 0
4000aa1c: 12 80 00 06 bne 4000aa34 <_Scheduler_EDF_Unblock+0x60>
4000aa20: 84 10 20 01 mov 1, %g2
4000aa24: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
4000aa28: 80 a0 60 00 cmp %g1, 0
4000aa2c: 12 80 00 05 bne 4000aa40 <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN
4000aa30: 01 00 00 00 nop
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
4000aa34: 03 10 00 7f sethi %hi(0x4001fc00), %g1
4000aa38: 82 10 60 70 or %g1, 0x70, %g1 ! 4001fc70 <_Per_CPU_Information>
4000aa3c: c4 28 60 0c stb %g2, [ %g1 + 0xc ]
4000aa40: 81 c7 e0 08 ret
4000aa44: 81 e8 00 00 restore
40008dc4 <_TOD_Validate>:
};
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
40008dc4: 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 /
40008dc8: 03 10 00 75 sethi %hi(0x4001d400), %g1
40008dcc: d2 00 63 4c ld [ %g1 + 0x34c ], %o1 ! 4001d74c <Configuration+0xc>
40008dd0: 11 00 03 d0 sethi %hi(0xf4000), %o0
40008dd4: 40 00 44 bf call 4001a0d0 <.udiv>
40008dd8: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 <PROM_START+0xf4240>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
40008ddc: 80 a6 20 00 cmp %i0, 0
40008de0: 02 80 00 28 be 40008e80 <_TOD_Validate+0xbc> <== NEVER TAKEN
40008de4: 84 10 20 00 clr %g2
40008de8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1
40008dec: 80 a0 40 08 cmp %g1, %o0
40008df0: 3a 80 00 25 bcc,a 40008e84 <_TOD_Validate+0xc0>
40008df4: b0 08 a0 01 and %g2, 1, %i0
(the_tod->ticks >= ticks_per_second) ||
40008df8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
40008dfc: 80 a0 60 3b cmp %g1, 0x3b
40008e00: 38 80 00 21 bgu,a 40008e84 <_TOD_Validate+0xc0>
40008e04: b0 08 a0 01 and %g2, 1, %i0
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
40008e08: c2 06 20 10 ld [ %i0 + 0x10 ], %g1
40008e0c: 80 a0 60 3b cmp %g1, 0x3b
40008e10: 38 80 00 1d bgu,a 40008e84 <_TOD_Validate+0xc0>
40008e14: b0 08 a0 01 and %g2, 1, %i0
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
40008e18: c2 06 20 0c ld [ %i0 + 0xc ], %g1
40008e1c: 80 a0 60 17 cmp %g1, 0x17
40008e20: 38 80 00 19 bgu,a 40008e84 <_TOD_Validate+0xc0>
40008e24: b0 08 a0 01 and %g2, 1, %i0
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
40008e28: c2 06 20 04 ld [ %i0 + 4 ], %g1
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
40008e2c: 80 a0 60 00 cmp %g1, 0
40008e30: 02 80 00 14 be 40008e80 <_TOD_Validate+0xbc> <== NEVER TAKEN
40008e34: 80 a0 60 0c cmp %g1, 0xc
(the_tod->month == 0) ||
40008e38: 38 80 00 13 bgu,a 40008e84 <_TOD_Validate+0xc0>
40008e3c: b0 08 a0 01 and %g2, 1, %i0
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
40008e40: c8 06 00 00 ld [ %i0 ], %g4
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
40008e44: 80 a1 27 c3 cmp %g4, 0x7c3
40008e48: 28 80 00 0f bleu,a 40008e84 <_TOD_Validate+0xc0>
40008e4c: b0 08 a0 01 and %g2, 1, %i0
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
40008e50: c6 06 20 08 ld [ %i0 + 8 ], %g3
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
40008e54: 80 a0 e0 00 cmp %g3, 0
40008e58: 02 80 00 0a be 40008e80 <_TOD_Validate+0xbc> <== NEVER TAKEN
40008e5c: 80 89 20 03 btst 3, %g4
40008e60: 05 10 00 7a sethi %hi(0x4001e800), %g2
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
40008e64: 12 80 00 03 bne 40008e70 <_TOD_Validate+0xac>
40008e68: 84 10 a0 48 or %g2, 0x48, %g2 ! 4001e848 <_TOD_Days_per_month>
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
40008e6c: 82 00 60 0d add %g1, 0xd, %g1
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
40008e70: 83 28 60 02 sll %g1, 2, %g1
40008e74: c2 00 80 01 ld [ %g2 + %g1 ], %g1
if ( the_tod->day > days_in_month )
40008e78: 80 a0 40 03 cmp %g1, %g3
40008e7c: 84 60 3f ff subx %g0, -1, %g2
return false;
return true;
}
40008e80: b0 08 a0 01 and %g2, 1, %i0
40008e84: 81 c7 e0 08 ret
40008e88: 81 e8 00 00 restore
4000a394 <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
4000a394: 9d e3 bf a0 save %sp, -96, %sp
4000a398: ba 10 00 18 mov %i0, %i5
States_Control state, original_state;
/*
* Save original state
*/
original_state = the_thread->current_state;
4000a39c: f0 06 20 10 ld [ %i0 + 0x10 ], %i0
/*
* Set a transient state for the thread so it is pulled off the Ready chains.
* This will prevent it from being scheduled no matter what happens in an
* ISR.
*/
_Thread_Set_transient( the_thread );
4000a3a0: 40 00 03 46 call 4000b0b8 <_Thread_Set_transient>
4000a3a4: 90 10 00 1d mov %i5, %o0
/*
* Do not bother recomputing all the priority related information if
* we are not REALLY changing priority.
*/
if ( the_thread->current_priority != new_priority )
4000a3a8: c2 07 60 14 ld [ %i5 + 0x14 ], %g1
4000a3ac: 80 a0 40 19 cmp %g1, %i1
4000a3b0: 02 80 00 04 be 4000a3c0 <_Thread_Change_priority+0x2c>
4000a3b4: 90 10 00 1d mov %i5, %o0
_Thread_Set_priority( the_thread, new_priority );
4000a3b8: 40 00 03 27 call 4000b054 <_Thread_Set_priority>
4000a3bc: 92 10 00 19 mov %i1, %o1
_ISR_Disable( level );
4000a3c0: 7f ff e0 22 call 40002448 <sparc_disable_interrupts>
4000a3c4: 01 00 00 00 nop
4000a3c8: b6 10 00 08 mov %o0, %i3
/*
* If the thread has more than STATES_TRANSIENT set, then it is blocked,
* If it is blocked on a thread queue, then we need to requeue it.
*/
state = the_thread->current_state;
4000a3cc: f8 07 60 10 ld [ %i5 + 0x10 ], %i4
if ( state != STATES_TRANSIENT ) {
4000a3d0: 80 a7 20 04 cmp %i4, 4
4000a3d4: 02 80 00 10 be 4000a414 <_Thread_Change_priority+0x80>
4000a3d8: 82 0e 20 04 and %i0, 4, %g1
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
4000a3dc: 80 a0 60 00 cmp %g1, 0
4000a3e0: 12 80 00 03 bne 4000a3ec <_Thread_Change_priority+0x58> <== NEVER TAKEN
4000a3e4: 82 0f 3f fb and %i4, -5, %g1
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
4000a3e8: c2 27 60 10 st %g1, [ %i5 + 0x10 ]
_ISR_Enable( level );
4000a3ec: 7f ff e0 1b call 40002458 <sparc_enable_interrupts>
4000a3f0: 90 10 00 1b mov %i3, %o0
if ( _States_Is_waiting_on_thread_queue( state ) ) {
4000a3f4: 03 00 00 ef sethi %hi(0x3bc00), %g1
4000a3f8: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <PROM_START+0x3bee0>
4000a3fc: 80 8f 00 01 btst %i4, %g1
4000a400: 02 80 00 27 be 4000a49c <_Thread_Change_priority+0x108>
4000a404: 01 00 00 00 nop
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
4000a408: f0 07 60 44 ld [ %i5 + 0x44 ], %i0
4000a40c: 40 00 02 e5 call 4000afa0 <_Thread_queue_Requeue>
4000a410: 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 ) ) {
4000a414: 80 a0 60 00 cmp %g1, 0
4000a418: 12 80 00 0b bne 4000a444 <_Thread_Change_priority+0xb0> <== NEVER TAKEN
4000a41c: 03 10 00 74 sethi %hi(0x4001d000), %g1
* Interrupts are STILL disabled.
* We now know the thread will be in the READY state when we remove
* the TRANSIENT state. So we have to place it on the appropriate
* Ready Queue with interrupts off.
*/
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
4000a420: c0 27 60 10 clr [ %i5 + 0x10 ]
if ( prepend_it )
4000a424: 80 a6 a0 00 cmp %i2, 0
4000a428: 02 80 00 04 be 4000a438 <_Thread_Change_priority+0xa4>
4000a42c: 82 10 62 64 or %g1, 0x264, %g1
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue_first( the_thread );
4000a430: 10 80 00 03 b 4000a43c <_Thread_Change_priority+0xa8>
4000a434: c2 00 60 28 ld [ %g1 + 0x28 ], %g1
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue( the_thread );
4000a438: c2 00 60 24 ld [ %g1 + 0x24 ], %g1
4000a43c: 9f c0 40 00 call %g1
4000a440: 90 10 00 1d mov %i5, %o0
_Scheduler_Enqueue_first( the_thread );
else
_Scheduler_Enqueue( the_thread );
}
_ISR_Flash( level );
4000a444: 7f ff e0 05 call 40002458 <sparc_enable_interrupts>
4000a448: 90 10 00 1b mov %i3, %o0
4000a44c: 7f ff df ff call 40002448 <sparc_disable_interrupts>
4000a450: 01 00 00 00 nop
4000a454: b0 10 00 08 mov %o0, %i0
* This kernel routine implements the scheduling decision logic for
* the scheduler. It does NOT dispatch.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void )
{
_Scheduler.Operations.schedule();
4000a458: 03 10 00 74 sethi %hi(0x4001d000), %g1
4000a45c: c2 00 62 6c ld [ %g1 + 0x26c ], %g1 ! 4001d26c <_Scheduler+0x8>
4000a460: 9f c0 40 00 call %g1
4000a464: 01 00 00 00 nop
* is also the heir thread, and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void )
{
return ( _Thread_Executing == _Thread_Heir );
4000a468: 03 10 00 78 sethi %hi(0x4001e000), %g1
4000a46c: 82 10 61 30 or %g1, 0x130, %g1 ! 4001e130 <_Per_CPU_Information>
* We altered the set of thread priorities. So let's figure out
* who is the heir and if we need to switch to them.
*/
_Scheduler_Schedule();
if ( !_Thread_Is_executing_also_the_heir() &&
4000a470: c4 18 60 10 ldd [ %g1 + 0x10 ], %g2
4000a474: 80 a0 80 03 cmp %g2, %g3
4000a478: 02 80 00 07 be 4000a494 <_Thread_Change_priority+0x100>
4000a47c: 01 00 00 00 nop
4000a480: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2
4000a484: 80 a0 a0 00 cmp %g2, 0
4000a488: 02 80 00 03 be 4000a494 <_Thread_Change_priority+0x100>
4000a48c: 84 10 20 01 mov 1, %g2
_Thread_Executing->is_preemptible )
_Thread_Dispatch_necessary = true;
4000a490: c4 28 60 0c stb %g2, [ %g1 + 0xc ]
_ISR_Enable( level );
4000a494: 7f ff df f1 call 40002458 <sparc_enable_interrupts>
4000a498: 81 e8 00 00 restore
4000a49c: 81 c7 e0 08 ret
4000a4a0: 81 e8 00 00 restore
4000a664 <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
4000a664: 9d e3 bf 98 save %sp, -104, %sp
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
4000a668: 90 10 00 18 mov %i0, %o0
4000a66c: 40 00 00 70 call 4000a82c <_Thread_Get>
4000a670: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
4000a674: c2 07 bf fc ld [ %fp + -4 ], %g1
4000a678: 80 a0 60 00 cmp %g1, 0
4000a67c: 12 80 00 08 bne 4000a69c <_Thread_Delay_ended+0x38> <== NEVER TAKEN
4000a680: 13 04 00 00 sethi %hi(0x10000000), %o1
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
4000a684: 7f ff ff 88 call 4000a4a4 <_Thread_Clear_state>
4000a688: 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;
4000a68c: 03 10 00 77 sethi %hi(0x4001dc00), %g1
4000a690: c4 00 63 30 ld [ %g1 + 0x330 ], %g2 ! 4001df30 <_Thread_Dispatch_disable_level>
--level;
4000a694: 84 00 bf ff add %g2, -1, %g2
_Thread_Dispatch_disable_level = level;
4000a698: c4 20 63 30 st %g2, [ %g1 + 0x330 ]
4000a69c: 81 c7 e0 08 ret
4000a6a0: 81 e8 00 00 restore
4000a6a4 <_Thread_Dispatch>:
#if defined(RTEMS_SMP)
#include <rtems/score/smp.h>
#endif
void _Thread_Dispatch( void )
{
4000a6a4: 9d e3 bf 98 save %sp, -104, %sp
#endif
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
4000a6a8: 35 10 00 78 sethi %hi(0x4001e000), %i2
4000a6ac: 82 16 a1 30 or %i2, 0x130, %g1 ! 4001e130 <_Per_CPU_Information>
_ISR_Disable( level );
4000a6b0: 7f ff df 66 call 40002448 <sparc_disable_interrupts>
4000a6b4: f6 00 60 10 ld [ %g1 + 0x10 ], %i3
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
4000a6b8: 21 10 00 77 sethi %hi(0x4001dc00), %l0
{
const Chain_Control *chain = &_User_extensions_Switches_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
4000a6bc: 27 10 00 74 sethi %hi(0x4001d000), %l3
* This routine sets thread dispatch level to the
* value passed in.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value)
{
_Thread_Dispatch_disable_level = value;
4000a6c0: 33 10 00 77 sethi %hi(0x4001dc00), %i1
#if __RTEMS_ADA__
executing->rtems_ada_self = rtems_ada_self;
rtems_ada_self = heir->rtems_ada_self;
#endif
if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
4000a6c4: 31 10 00 77 sethi %hi(0x4001dc00), %i0
4000a6c8: a0 14 22 80 or %l0, 0x280, %l0
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
4000a6cc: 23 10 00 77 sethi %hi(0x4001dc00), %l1
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
4000a6d0: 25 10 00 74 sethi %hi(0x4001d000), %l2
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
4000a6d4: 10 80 00 3b b 4000a7c0 <_Thread_Dispatch+0x11c>
4000a6d8: a6 14 e3 94 or %l3, 0x394, %l3
4000a6dc: 84 10 20 01 mov 1, %g2
4000a6e0: c4 26 63 30 st %g2, [ %i1 + 0x330 ]
heir = _Thread_Heir;
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 1 );
#endif
_Thread_Dispatch_necessary = false;
4000a6e4: c0 28 60 0c clrb [ %g1 + 0xc ]
/*
* When the heir and executing are the same, then we are being
* requested to do the post switch dispatching. This is normally
* done to dispatch signals.
*/
if ( heir == executing )
4000a6e8: 80 a5 00 1b cmp %l4, %i3
4000a6ec: 12 80 00 0a bne 4000a714 <_Thread_Dispatch+0x70>
4000a6f0: e8 20 60 10 st %l4, [ %g1 + 0x10 ]
4000a6f4: 03 10 00 77 sethi %hi(0x4001dc00), %g1
4000a6f8: c0 20 63 30 clr [ %g1 + 0x330 ] ! 4001df30 <_Thread_Dispatch_disable_level>
post_switch:
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 0 );
#endif
_ISR_Enable( level );
4000a6fc: 7f ff df 57 call 40002458 <sparc_enable_interrupts>
4000a700: 39 10 00 77 sethi %hi(0x4001dc00), %i4
4000a704: 03 10 00 77 sethi %hi(0x4001dc00), %g1
4000a708: fa 00 63 a0 ld [ %g1 + 0x3a0 ], %i5 ! 4001dfa0 <_API_extensions_Post_switch_list>
{
const Chain_Control *chain = &_API_extensions_Post_switch_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
4000a70c: 10 80 00 37 b 4000a7e8 <_Thread_Dispatch+0x144>
4000a710: b8 17 23 a4 or %i4, 0x3a4, %i4
*/
#if __RTEMS_ADA__
executing->rtems_ada_self = rtems_ada_self;
rtems_ada_self = heir->rtems_ada_self;
#endif
if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
4000a714: c2 05 20 78 ld [ %l4 + 0x78 ], %g1
4000a718: 80 a0 60 01 cmp %g1, 1
4000a71c: 12 80 00 03 bne 4000a728 <_Thread_Dispatch+0x84>
4000a720: c2 06 22 90 ld [ %i0 + 0x290 ], %g1
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
4000a724: c2 25 20 74 st %g1, [ %l4 + 0x74 ]
_ISR_Enable( level );
4000a728: 7f ff df 4c call 40002458 <sparc_enable_interrupts>
4000a72c: 01 00 00 00 nop
4000a730: 90 07 bf f8 add %fp, -8, %o0
4000a734: 7f ff f9 eb call 40008ee0 <_TOD_Get_with_nanoseconds>
4000a738: 92 10 00 10 mov %l0, %o1
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
4000a73c: c4 1f bf f8 ldd [ %fp + -8 ], %g2
4000a740: 82 16 a1 30 or %i2, 0x130, %g1
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
4000a744: f8 18 60 20 ldd [ %g1 + 0x20 ], %i4
4000a748: 96 a0 c0 1d subcc %g3, %i5, %o3
4000a74c: 94 60 80 1c subx %g2, %i4, %o2
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
4000a750: f8 1e e0 80 ldd [ %i3 + 0x80 ], %i4
4000a754: 9a 87 40 0b addcc %i5, %o3, %o5
4000a758: 98 47 00 0a addx %i4, %o2, %o4
4000a75c: d8 3e e0 80 std %o4, [ %i3 + 0x80 ]
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
_Thread_Time_of_last_context_switch = uptime;
4000a760: c4 38 60 20 std %g2, [ %g1 + 0x20 ]
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
4000a764: c2 04 63 9c ld [ %l1 + 0x39c ], %g1
4000a768: 80 a0 60 00 cmp %g1, 0
4000a76c: 22 80 00 0c be,a 4000a79c <_Thread_Dispatch+0xf8> <== NEVER TAKEN
4000a770: fa 04 a3 90 ld [ %l2 + 0x390 ], %i5 <== NOT EXECUTED
executing->libc_reent = *_Thread_libc_reent;
4000a774: c4 00 40 00 ld [ %g1 ], %g2
4000a778: c4 26 e1 48 st %g2, [ %i3 + 0x148 ]
*_Thread_libc_reent = heir->libc_reent;
4000a77c: c4 05 21 48 ld [ %l4 + 0x148 ], %g2
4000a780: c4 20 40 00 st %g2, [ %g1 ]
4000a784: 10 80 00 06 b 4000a79c <_Thread_Dispatch+0xf8>
4000a788: fa 04 a3 90 ld [ %l2 + 0x390 ], %i5
const User_extensions_Switch_control *extension =
(const User_extensions_Switch_control *) node;
(*extension->thread_switch)( executing, heir );
4000a78c: 90 10 00 1b mov %i3, %o0
4000a790: 9f c0 40 00 call %g1
4000a794: 92 10 00 14 mov %l4, %o1
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next(
const Chain_Node *the_node
)
{
return the_node->next;
4000a798: fa 07 40 00 ld [ %i5 ], %i5
{
const Chain_Control *chain = &_User_extensions_Switches_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
4000a79c: 80 a7 40 13 cmp %i5, %l3
4000a7a0: 32 bf ff fb bne,a 4000a78c <_Thread_Dispatch+0xe8>
4000a7a4: c2 07 60 08 ld [ %i5 + 8 ], %g1
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
4000a7a8: 90 06 e0 c0 add %i3, 0xc0, %o0
4000a7ac: 40 00 04 22 call 4000b834 <_CPU_Context_switch>
4000a7b0: 92 05 20 c0 add %l4, 0xc0, %o1
if ( executing->fp_context != NULL )
_Context_Restore_fp( &executing->fp_context );
#endif
#endif
executing = _Thread_Executing;
4000a7b4: 82 16 a1 30 or %i2, 0x130, %g1
_ISR_Disable( level );
4000a7b8: 7f ff df 24 call 40002448 <sparc_disable_interrupts>
4000a7bc: f6 00 60 10 ld [ %g1 + 0x10 ], %i3
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
4000a7c0: 82 16 a1 30 or %i2, 0x130, %g1
4000a7c4: c4 08 60 0c ldub [ %g1 + 0xc ], %g2
4000a7c8: 80 a0 a0 00 cmp %g2, 0
4000a7cc: 32 bf ff c4 bne,a 4000a6dc <_Thread_Dispatch+0x38>
4000a7d0: e8 00 60 14 ld [ %g1 + 0x14 ], %l4
4000a7d4: 10 bf ff c9 b 4000a6f8 <_Thread_Dispatch+0x54>
4000a7d8: 03 10 00 77 sethi %hi(0x4001dc00), %g1
const API_extensions_Post_switch_control *post_switch =
(const API_extensions_Post_switch_control *) node;
(*post_switch->hook)( executing );
4000a7dc: 9f c0 40 00 call %g1
4000a7e0: 90 10 00 1b mov %i3, %o0
4000a7e4: fa 07 40 00 ld [ %i5 ], %i5
{
const Chain_Control *chain = &_API_extensions_Post_switch_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
4000a7e8: 80 a7 40 1c cmp %i5, %i4
4000a7ec: 32 bf ff fc bne,a 4000a7dc <_Thread_Dispatch+0x138>
4000a7f0: c2 07 60 08 ld [ %i5 + 8 ], %g1
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
4000a7f4: 81 c7 e0 08 ret
4000a7f8: 81 e8 00 00 restore
4000eba8 <_Thread_Handler>:
#define INIT_NAME __main
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
void _Thread_Handler( void )
{
4000eba8: 9d e3 bf a0 save %sp, -96, %sp
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static bool doneConstructors;
bool doCons;
#endif
executing = _Thread_Executing;
4000ebac: 03 10 00 78 sethi %hi(0x4001e000), %g1
4000ebb0: fa 00 61 40 ld [ %g1 + 0x140 ], %i5 ! 4001e140 <_Per_CPU_Information+0x10>
/*
* Some CPUs need to tinker with the call frame or registers when the
* thread actually begins to execute for the first time. This is a
* hook point where the port gets a shot at doing whatever it requires.
*/
_Context_Initialization_at_thread_begin();
4000ebb4: 3f 10 00 3a sethi %hi(0x4000e800), %i7
4000ebb8: be 17 e3 a8 or %i7, 0x3a8, %i7 ! 4000eba8 <_Thread_Handler>
/*
* have to put level into a register for those cpu's that use
* inline asm here
*/
level = executing->Start.isr_level;
4000ebbc: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0
_ISR_Set_level(level);
4000ebc0: 7f ff ce 26 call 40002458 <sparc_enable_interrupts>
4000ebc4: 91 2a 20 08 sll %o0, 8, %o0
doCons = !doneConstructors
&& _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API;
if (doCons)
doneConstructors = true;
#else
doCons = !doneConstructors;
4000ebc8: 03 10 00 76 sethi %hi(0x4001d800), %g1
doneConstructors = true;
4000ebcc: 84 10 20 01 mov 1, %g2
doCons = !doneConstructors
&& _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API;
if (doCons)
doneConstructors = true;
#else
doCons = !doneConstructors;
4000ebd0: f8 08 62 c0 ldub [ %g1 + 0x2c0 ], %i4
);
}
static inline void _User_extensions_Thread_begin( Thread_Control *executing )
{
_User_extensions_Iterate(
4000ebd4: 90 10 00 1d mov %i5, %o0
4000ebd8: 13 10 00 2c sethi %hi(0x4000b000), %o1
4000ebdc: 92 12 62 8c or %o1, 0x28c, %o1 ! 4000b28c <_User_extensions_Thread_begin_visitor>
4000ebe0: 7f ff f1 c8 call 4000b300 <_User_extensions_Iterate>
4000ebe4: c4 28 62 c0 stb %g2, [ %g1 + 0x2c0 ]
_User_extensions_Thread_begin( executing );
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
4000ebe8: 7f ff ef 05 call 4000a7fc <_Thread_Enable_dispatch>
4000ebec: 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) */ {
4000ebf0: 80 8f 20 ff btst 0xff, %i4
4000ebf4: 32 80 00 05 bne,a 4000ec08 <_Thread_Handler+0x60>
4000ebf8: c2 07 60 90 ld [ %i5 + 0x90 ], %g1
INIT_NAME ();
4000ebfc: 40 00 39 65 call 4001d190 <_init>
4000ec00: 01 00 00 00 nop
_Thread_Enable_dispatch();
#endif
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
4000ec04: c2 07 60 90 ld [ %i5 + 0x90 ], %g1
4000ec08: 80 a0 60 00 cmp %g1, 0
4000ec0c: 12 80 00 07 bne 4000ec28 <_Thread_Handler+0x80> <== NEVER TAKEN
4000ec10: 90 10 00 1d mov %i5, %o0
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
4000ec14: c2 07 60 8c ld [ %i5 + 0x8c ], %g1
4000ec18: 9f c0 40 00 call %g1
4000ec1c: d0 07 60 98 ld [ %i5 + 0x98 ], %o0
#endif
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
executing->Wait.return_argument =
4000ec20: d0 27 60 28 st %o0, [ %i5 + 0x28 ]
}
}
static inline void _User_extensions_Thread_exitted( Thread_Control *executing )
{
_User_extensions_Iterate(
4000ec24: 90 10 00 1d mov %i5, %o0
4000ec28: 13 10 00 2c sethi %hi(0x4000b000), %o1
4000ec2c: 7f ff f1 b5 call 4000b300 <_User_extensions_Iterate>
4000ec30: 92 12 62 b0 or %o1, 0x2b0, %o1 ! 4000b2b0 <_User_extensions_Thread_exitted_visitor>
* able to fit in a (void *).
*/
_User_extensions_Thread_exitted( executing );
_Internal_error_Occurred(
4000ec34: 90 10 20 00 clr %o0
4000ec38: 92 10 20 01 mov 1, %o1
4000ec3c: 7f ff e9 dd call 400093b0 <_Internal_error_Occurred>
4000ec40: 94 10 20 05 mov 5, %o2
4000aa88 <_Thread_Handler_initialization>:
#if defined(RTEMS_SMP)
#include <rtems/bspsmp.h>
#endif
void _Thread_Handler_initialization(void)
{
4000aa88: 9d e3 bf 98 save %sp, -104, %sp
uint32_t ticks_per_timeslice =
4000aa8c: 03 10 00 6d sethi %hi(0x4001b400), %g1
4000aa90: 82 10 60 c8 or %g1, 0xc8, %g1 ! 4001b4c8 <Configuration>
#if defined(RTEMS_MULTIPROCESSING)
uint32_t maximum_proxies =
_Configuration_MP_table->maximum_proxies;
#endif
if ( rtems_configuration_get_stack_allocate_hook() == NULL ||
4000aa94: c6 00 60 28 ld [ %g1 + 0x28 ], %g3
#include <rtems/bspsmp.h>
#endif
void _Thread_Handler_initialization(void)
{
uint32_t ticks_per_timeslice =
4000aa98: fa 00 60 14 ld [ %g1 + 0x14 ], %i5
rtems_configuration_get_ticks_per_timeslice();
uint32_t maximum_extensions =
4000aa9c: 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 ||
4000aaa0: 80 a0 e0 00 cmp %g3, 0
4000aaa4: 02 80 00 06 be 4000aabc <_Thread_Handler_initialization+0x34><== NEVER TAKEN
4000aaa8: c4 00 60 24 ld [ %g1 + 0x24 ], %g2
4000aaac: c6 00 60 2c ld [ %g1 + 0x2c ], %g3
4000aab0: 80 a0 e0 00 cmp %g3, 0
4000aab4: 12 80 00 06 bne 4000aacc <_Thread_Handler_initialization+0x44>
4000aab8: 80 a0 a0 00 cmp %g2, 0
rtems_configuration_get_stack_free_hook() == NULL)
_Internal_error_Occurred(
4000aabc: 90 10 20 00 clr %o0
4000aac0: 92 10 20 01 mov 1, %o1
4000aac4: 7f ff fa 3b call 400093b0 <_Internal_error_Occurred>
4000aac8: 94 10 20 0e mov 0xe, %o2
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_BAD_STACK_HOOK
);
if ( stack_allocate_init_hook != NULL )
4000aacc: 22 80 00 05 be,a 4000aae0 <_Thread_Handler_initialization+0x58>
4000aad0: 03 10 00 78 sethi %hi(0x4001e000), %g1
(*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() );
4000aad4: 9f c0 80 00 call %g2
4000aad8: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 4001e004 <_API_Mutex_Information+0x30>
_Thread_Dispatch_necessary = false;
4000aadc: 03 10 00 78 sethi %hi(0x4001e000), %g1
4000aae0: 82 10 61 30 or %g1, 0x130, %g1 ! 4001e130 <_Per_CPU_Information>
4000aae4: c0 28 60 0c clrb [ %g1 + 0xc ]
_Thread_Executing = NULL;
4000aae8: c0 20 60 10 clr [ %g1 + 0x10 ]
_Thread_Heir = NULL;
4000aaec: c0 20 60 14 clr [ %g1 + 0x14 ]
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Thread_Allocated_fp = NULL;
#endif
_Thread_Maximum_extensions = maximum_extensions;
4000aaf0: 03 10 00 77 sethi %hi(0x4001dc00), %g1
4000aaf4: f8 20 63 ac st %i4, [ %g1 + 0x3ac ] ! 4001dfac <_Thread_Maximum_extensions>
_Thread_Ticks_per_timeslice = ticks_per_timeslice;
4000aaf8: 03 10 00 77 sethi %hi(0x4001dc00), %g1
4000aafc: fa 20 62 90 st %i5, [ %g1 + 0x290 ] ! 4001de90 <_Thread_Ticks_per_timeslice>
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing )
maximum_internal_threads += 1;
#endif
_Objects_Initialize_information(
4000ab00: 82 10 20 08 mov 8, %g1
4000ab04: 11 10 00 78 sethi %hi(0x4001e000), %o0
4000ab08: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
4000ab0c: 90 12 20 20 or %o0, 0x20, %o0
4000ab10: 92 10 20 01 mov 1, %o1
4000ab14: 94 10 20 01 mov 1, %o2
4000ab18: 96 10 20 01 mov 1, %o3
4000ab1c: 98 10 21 60 mov 0x160, %o4
4000ab20: 7f ff fb b4 call 400099f0 <_Objects_Initialize_information>
4000ab24: 9a 10 20 00 clr %o5
4000ab28: 81 c7 e0 08 ret
4000ab2c: 81 e8 00 00 restore
4000a8dc <_Thread_Initialize>:
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
4000a8dc: 9d e3 bf 98 save %sp, -104, %sp
4000a8e0: c2 07 a0 6c ld [ %fp + 0x6c ], %g1
4000a8e4: f4 0f a0 5f ldub [ %fp + 0x5f ], %i2
4000a8e8: e0 00 40 00 ld [ %g1 ], %l0
/*
* Zero out all the allocated memory fields
*/
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
the_thread->API_Extensions[i] = NULL;
4000a8ec: c0 26 61 4c clr [ %i1 + 0x14c ]
4000a8f0: c0 26 61 50 clr [ %i1 + 0x150 ]
extensions_area = NULL;
the_thread->libc_reent = NULL;
4000a8f4: c0 26 61 48 clr [ %i1 + 0x148 ]
/*
* Allocate and Initialize the stack for this thread.
*/
#if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
4000a8f8: 90 10 00 19 mov %i1, %o0
4000a8fc: 40 00 01 fe call 4000b0f4 <_Thread_Stack_Allocate>
4000a900: 92 10 00 1b mov %i3, %o1
if ( !actual_stack_size || actual_stack_size < stack_size )
4000a904: 80 a2 00 1b cmp %o0, %i3
4000a908: 0a 80 00 5c bcs 4000aa78 <_Thread_Initialize+0x19c>
4000a90c: 80 a2 20 00 cmp %o0, 0
4000a910: 22 80 00 5b be,a 4000aa7c <_Thread_Initialize+0x1a0> <== NEVER TAKEN
4000a914: b0 10 20 00 clr %i0 <== NOT EXECUTED
Stack_Control *the_stack,
void *starting_address,
size_t size
)
{
the_stack->area = starting_address;
4000a918: c2 06 60 b8 ld [ %i1 + 0xb8 ], %g1
the_stack->size = size;
4000a91c: d0 26 60 b0 st %o0, [ %i1 + 0xb0 ]
Stack_Control *the_stack,
void *starting_address,
size_t size
)
{
the_stack->area = starting_address;
4000a920: c2 26 60 b4 st %g1, [ %i1 + 0xb4 ]
#endif
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
4000a924: 03 10 00 77 sethi %hi(0x4001dc00), %g1
4000a928: d0 00 63 ac ld [ %g1 + 0x3ac ], %o0 ! 4001dfac <_Thread_Maximum_extensions>
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
4000a92c: c0 26 60 50 clr [ %i1 + 0x50 ]
the_watchdog->routine = routine;
4000a930: c0 26 60 64 clr [ %i1 + 0x64 ]
the_watchdog->id = id;
4000a934: c0 26 60 68 clr [ %i1 + 0x68 ]
the_watchdog->user_data = user_data;
4000a938: c0 26 60 6c clr [ %i1 + 0x6c ]
4000a93c: 80 a2 20 00 cmp %o0, 0
4000a940: 02 80 00 08 be 4000a960 <_Thread_Initialize+0x84>
4000a944: b8 10 20 00 clr %i4
extensions_area = _Workspace_Allocate(
4000a948: 90 02 20 01 inc %o0
4000a94c: 40 00 03 9e call 4000b7c4 <_Workspace_Allocate>
4000a950: 91 2a 20 02 sll %o0, 2, %o0
(_Thread_Maximum_extensions + 1) * sizeof( void * )
);
if ( !extensions_area )
4000a954: b8 92 20 00 orcc %o0, 0, %i4
4000a958: 02 80 00 3c be 4000aa48 <_Thread_Initialize+0x16c>
4000a95c: 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 ) {
4000a960: 80 a7 20 00 cmp %i4, 0
4000a964: 12 80 00 17 bne 4000a9c0 <_Thread_Initialize+0xe4>
4000a968: f8 26 61 54 st %i4, [ %i1 + 0x154 ]
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
4000a96c: c2 07 a0 60 ld [ %fp + 0x60 ], %g1
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
4000a970: f4 2e 60 9c stb %i2, [ %i1 + 0x9c ]
the_thread->Start.budget_algorithm = budget_algorithm;
4000a974: c2 26 60 a0 st %g1, [ %i1 + 0xa0 ]
the_thread->Start.budget_callout = budget_callout;
4000a978: c2 07 a0 64 ld [ %fp + 0x64 ], %g1
#endif
}
the_thread->Start.isr_level = isr_level;
the_thread->current_state = STATES_DORMANT;
4000a97c: b4 10 20 01 mov 1, %i2
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
the_thread->Start.budget_callout = budget_callout;
4000a980: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ]
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
4000a984: c2 07 a0 68 ld [ %fp + 0x68 ], %g1
the_thread->current_state = STATES_DORMANT;
4000a988: f4 26 60 10 st %i2, [ %i1 + 0x10 ]
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
4000a98c: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ]
*/
RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate(
Thread_Control *the_thread
)
{
return _Scheduler.Operations.allocate( the_thread );
4000a990: 03 10 00 74 sethi %hi(0x4001d000), %g1
4000a994: c2 00 62 7c ld [ %g1 + 0x27c ], %g1 ! 4001d27c <_Scheduler+0x18>
the_thread->current_state = STATES_DORMANT;
the_thread->Wait.queue = NULL;
4000a998: c0 26 60 44 clr [ %i1 + 0x44 ]
the_thread->resource_count = 0;
4000a99c: c0 26 60 1c clr [ %i1 + 0x1c ]
the_thread->real_priority = priority;
4000a9a0: fa 26 60 18 st %i5, [ %i1 + 0x18 ]
the_thread->Start.initial_priority = priority;
4000a9a4: fa 26 60 ac st %i5, [ %i1 + 0xac ]
4000a9a8: 9f c0 40 00 call %g1
4000a9ac: 90 10 00 19 mov %i1, %o0
sched =_Scheduler_Allocate( the_thread );
if ( !sched )
4000a9b0: b6 92 20 00 orcc %o0, 0, %i3
4000a9b4: 12 80 00 0f bne 4000a9f0 <_Thread_Initialize+0x114>
4000a9b8: 90 10 00 19 mov %i1, %o0
4000a9bc: 30 80 00 23 b,a 4000aa48 <_Thread_Initialize+0x16c>
* 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++ )
4000a9c0: 03 10 00 77 sethi %hi(0x4001dc00), %g1
4000a9c4: c4 00 63 ac ld [ %g1 + 0x3ac ], %g2 ! 4001dfac <_Thread_Maximum_extensions>
4000a9c8: 10 80 00 05 b 4000a9dc <_Thread_Initialize+0x100>
4000a9cc: 82 10 20 00 clr %g1
the_thread->extensions[i] = NULL;
4000a9d0: 87 28 60 02 sll %g1, 2, %g3
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
4000a9d4: 82 00 60 01 inc %g1
the_thread->extensions[i] = NULL;
4000a9d8: c0 21 00 03 clr [ %g4 + %g3 ]
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
4000a9dc: 80 a0 40 02 cmp %g1, %g2
4000a9e0: 28 bf ff fc bleu,a 4000a9d0 <_Thread_Initialize+0xf4>
4000a9e4: c8 06 61 54 ld [ %i1 + 0x154 ], %g4
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
4000a9e8: 10 bf ff e2 b 4000a970 <_Thread_Initialize+0x94>
4000a9ec: c2 07 a0 60 ld [ %fp + 0x60 ], %g1
the_thread->real_priority = priority;
the_thread->Start.initial_priority = priority;
sched =_Scheduler_Allocate( the_thread );
if ( !sched )
goto failed;
_Thread_Set_priority( the_thread, priority );
4000a9f0: 40 00 01 99 call 4000b054 <_Thread_Set_priority>
4000a9f4: 92 10 00 1d mov %i5, %o1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4000a9f8: c4 06 20 1c ld [ %i0 + 0x1c ], %g2
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
4000a9fc: c2 16 60 0a lduh [ %i1 + 0xa ], %g1
static inline void _Timestamp64_implementation_Set_to_zero(
Timestamp64_Control *_time
)
{
*_time = 0;
4000aa00: c0 26 60 80 clr [ %i1 + 0x80 ]
4000aa04: c0 26 60 84 clr [ %i1 + 0x84 ]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4000aa08: 83 28 60 02 sll %g1, 2, %g1
4000aa0c: f2 20 80 01 st %i1, [ %g2 + %g1 ]
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
4000aa10: e0 26 60 0c st %l0, [ %i1 + 0xc ]
* @{
*/
static inline bool _User_extensions_Thread_create( Thread_Control *created )
{
User_extensions_Thread_create_context ctx = { created, true };
4000aa14: f2 27 bf f8 st %i1, [ %fp + -8 ]
4000aa18: f4 2f bf fc stb %i2, [ %fp + -4 ]
_User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor );
4000aa1c: 90 07 bf f8 add %fp, -8, %o0
4000aa20: 13 10 00 2c sethi %hi(0x4000b000), %o1
4000aa24: 40 00 02 37 call 4000b300 <_User_extensions_Iterate>
4000aa28: 92 12 61 dc or %o1, 0x1dc, %o1 ! 4000b1dc <_User_extensions_Thread_create_visitor>
* user extensions with dispatching enabled. The Allocator
* Mutex provides sufficient protection to let the user extensions
* run safely.
*/
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
4000aa2c: c2 0f bf fc ldub [ %fp + -4 ], %g1
4000aa30: 80 a0 60 00 cmp %g1, 0
4000aa34: 02 80 00 05 be 4000aa48 <_Thread_Initialize+0x16c>
4000aa38: b0 10 20 01 mov 1, %i0
4000aa3c: b0 0e 20 01 and %i0, 1, %i0
4000aa40: 81 c7 e0 08 ret
4000aa44: 81 e8 00 00 restore
return true;
failed:
_Workspace_Free( the_thread->libc_reent );
4000aa48: 40 00 03 67 call 4000b7e4 <_Workspace_Free>
4000aa4c: d0 06 61 48 ld [ %i1 + 0x148 ], %o0
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
_Workspace_Free( the_thread->API_Extensions[i] );
4000aa50: 40 00 03 65 call 4000b7e4 <_Workspace_Free>
4000aa54: d0 06 61 4c ld [ %i1 + 0x14c ], %o0
4000aa58: 40 00 03 63 call 4000b7e4 <_Workspace_Free>
4000aa5c: d0 06 61 50 ld [ %i1 + 0x150 ], %o0
_Workspace_Free( extensions_area );
4000aa60: 40 00 03 61 call 4000b7e4 <_Workspace_Free>
4000aa64: 90 10 00 1c mov %i4, %o0
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Workspace_Free( fp_area );
#endif
_Workspace_Free( sched );
4000aa68: 40 00 03 5f call 4000b7e4 <_Workspace_Free>
4000aa6c: 90 10 00 1b mov %i3, %o0
_Thread_Stack_Free( the_thread );
4000aa70: 40 00 01 b1 call 4000b134 <_Thread_Stack_Free>
4000aa74: 90 10 00 19 mov %i1, %o0
* Allocate and Initialize the stack for this thread.
*/
#if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
if ( !actual_stack_size || actual_stack_size < stack_size )
return false; /* stack allocation failed */
4000aa78: b0 10 20 00 clr %i0
_Workspace_Free( sched );
_Thread_Stack_Free( the_thread );
return false;
}
4000aa7c: b0 0e 20 01 and %i0, 1, %i0
4000aa80: 81 c7 e0 08 ret
4000aa84: 81 e8 00 00 restore
4000ec48 <_Thread_queue_Extract_fifo>:
void _Thread_queue_Extract_fifo(
Thread_queue_Control *the_thread_queue __attribute__((unused)),
Thread_Control *the_thread
)
{
4000ec48: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED
ISR_Level level;
_ISR_Disable( level );
4000ec4c: 7f ff cd ff call 40002448 <sparc_disable_interrupts> <== NOT EXECUTED
4000ec50: 01 00 00 00 nop <== NOT EXECUTED
4000ec54: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED
4000ec58: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 <== NOT EXECUTED
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
4000ec5c: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED
4000ec60: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <PROM_START+0x3bee0><== NOT EXECUTED
4000ec64: 80 88 80 01 btst %g2, %g1 <== NOT EXECUTED
4000ec68: 32 80 00 04 bne,a 4000ec78 <_Thread_queue_Extract_fifo+0x30><== NOT EXECUTED
4000ec6c: c2 06 60 04 ld [ %i1 + 4 ], %g1 <== NOT EXECUTED
_ISR_Enable( level );
4000ec70: 7f ff cd fa call 40002458 <sparc_enable_interrupts> <== NOT EXECUTED
4000ec74: 81 e8 00 00 restore <== NOT EXECUTED
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
4000ec78: c4 06 40 00 ld [ %i1 ], %g2 <== NOT EXECUTED
previous = the_node->previous;
next->previous = previous;
4000ec7c: c2 20 a0 04 st %g1, [ %g2 + 4 ] <== NOT EXECUTED
previous->next = next;
4000ec80: 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 ) ) {
4000ec84: c2 06 60 50 ld [ %i1 + 0x50 ], %g1 <== NOT EXECUTED
4000ec88: 80 a0 60 02 cmp %g1, 2 <== NOT EXECUTED
4000ec8c: 02 80 00 06 be 4000eca4 <_Thread_queue_Extract_fifo+0x5c> <== NOT EXECUTED
4000ec90: c0 26 60 44 clr [ %i1 + 0x44 ] <== NOT EXECUTED
_ISR_Enable( level );
4000ec94: 7f ff cd f1 call 40002458 <sparc_enable_interrupts> <== NOT EXECUTED
4000ec98: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED
4000ec9c: 10 80 00 09 b 4000ecc0 <_Thread_queue_Extract_fifo+0x78> <== NOT EXECUTED
4000eca0: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED
4000eca4: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED
4000eca8: c2 26 60 50 st %g1, [ %i1 + 0x50 ] <== NOT EXECUTED
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
4000ecac: 7f ff cd eb call 40002458 <sparc_enable_interrupts> <== NOT EXECUTED
4000ecb0: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED
(void) _Watchdog_Remove( &the_thread->Timer );
4000ecb4: 7f ff f2 2b call 4000b560 <_Watchdog_Remove> <== NOT EXECUTED
4000ecb8: 90 06 60 48 add %i1, 0x48, %o0 <== NOT EXECUTED
4000ecbc: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED
4000ecc0: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 <RAM_SIZE+0xfc7fff8><== NOT EXECUTED
4000ecc4: 7f ff ed f8 call 4000a4a4 <_Thread_Clear_state> <== NOT EXECUTED
4000ecc8: 81 e8 00 00 restore <== NOT EXECUTED
4000afa0 <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
4000afa0: 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 )
4000afa4: 80 a6 20 00 cmp %i0, 0
4000afa8: 02 80 00 19 be 4000b00c <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN
4000afac: 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 ) {
4000afb0: fa 06 20 34 ld [ %i0 + 0x34 ], %i5
4000afb4: 80 a7 60 01 cmp %i5, 1
4000afb8: 12 80 00 15 bne 4000b00c <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN
4000afbc: 01 00 00 00 nop
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
4000afc0: 7f ff dd 22 call 40002448 <sparc_disable_interrupts>
4000afc4: 01 00 00 00 nop
4000afc8: b8 10 00 08 mov %o0, %i4
4000afcc: c4 06 60 10 ld [ %i1 + 0x10 ], %g2
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
4000afd0: 03 00 00 ef sethi %hi(0x3bc00), %g1
4000afd4: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <PROM_START+0x3bee0>
4000afd8: 80 88 80 01 btst %g2, %g1
4000afdc: 02 80 00 0a be 4000b004 <_Thread_queue_Requeue+0x64> <== NEVER TAKEN
4000afe0: 90 10 00 18 mov %i0, %o0
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
4000afe4: 92 10 00 19 mov %i1, %o1
4000afe8: 94 10 20 01 mov 1, %o2
4000afec: 40 00 09 e4 call 4000d77c <_Thread_queue_Extract_priority_helper>
4000aff0: fa 26 20 30 st %i5, [ %i0 + 0x30 ]
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
4000aff4: 90 10 00 18 mov %i0, %o0
4000aff8: 92 10 00 19 mov %i1, %o1
4000affc: 7f ff ff 50 call 4000ad3c <_Thread_queue_Enqueue_priority>
4000b000: 94 07 bf fc add %fp, -4, %o2
}
_ISR_Enable( level );
4000b004: 7f ff dd 15 call 40002458 <sparc_enable_interrupts>
4000b008: 90 10 00 1c mov %i4, %o0
4000b00c: 81 c7 e0 08 ret
4000b010: 81 e8 00 00 restore
4000b014 <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
4000b014: 9d e3 bf 98 save %sp, -104, %sp
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
4000b018: 90 10 00 18 mov %i0, %o0
4000b01c: 7f ff fe 04 call 4000a82c <_Thread_Get>
4000b020: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
4000b024: c2 07 bf fc ld [ %fp + -4 ], %g1
4000b028: 80 a0 60 00 cmp %g1, 0
4000b02c: 12 80 00 08 bne 4000b04c <_Thread_queue_Timeout+0x38> <== NEVER TAKEN
4000b030: 01 00 00 00 nop
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
4000b034: 40 00 0a 09 call 4000d858 <_Thread_queue_Process_timeout>
4000b038: 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;
4000b03c: 03 10 00 77 sethi %hi(0x4001dc00), %g1
4000b040: c4 00 63 30 ld [ %g1 + 0x330 ], %g2 ! 4001df30 <_Thread_Dispatch_disable_level>
--level;
4000b044: 84 00 bf ff add %g2, -1, %g2
_Thread_Dispatch_disable_level = level;
4000b048: c4 20 63 30 st %g2, [ %g1 + 0x330 ]
4000b04c: 81 c7 e0 08 ret
4000b050: 81 e8 00 00 restore
40019300 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
40019300: 9d e3 bf 88 save %sp, -120, %sp
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
40019304: 27 10 00 f4 sethi %hi(0x4003d000), %l3
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
40019308: a4 07 bf e8 add %fp, -24, %l2
4001930c: aa 07 bf ec add %fp, -20, %l5
40019310: b8 07 bf f4 add %fp, -12, %i4
40019314: b2 07 bf f8 add %fp, -8, %i1
40019318: ea 27 bf e8 st %l5, [ %fp + -24 ]
head->previous = NULL;
4001931c: c0 27 bf ec clr [ %fp + -20 ]
tail->previous = head;
40019320: e4 27 bf f0 st %l2, [ %fp + -16 ]
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
40019324: f2 27 bf f4 st %i1, [ %fp + -12 ]
head->previous = NULL;
40019328: c0 27 bf f8 clr [ %fp + -8 ]
tail->previous = head;
4001932c: f8 27 bf fc st %i4, [ %fp + -4 ]
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
40019330: b4 06 20 30 add %i0, 0x30, %i2
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
40019334: 29 10 00 f4 sethi %hi(0x4003d000), %l4
/*
* The current TOD is before the last TOD which indicates that
* TOD has been set backwards.
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
40019338: b6 06 20 68 add %i0, 0x68, %i3
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
4001933c: a2 06 20 08 add %i0, 8, %l1
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
40019340: a0 06 20 40 add %i0, 0x40, %l0
{
/*
* Afterwards all timer inserts are directed to this chain and the interval
* and TOD chains will be no more modified by other parties.
*/
ts->insert_chain = insert_chain;
40019344: e4 26 20 78 st %l2, [ %i0 + 0x78 ]
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
40019348: c2 04 e2 18 ld [ %l3 + 0x218 ], %g1
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
4001934c: d2 06 20 3c ld [ %i0 + 0x3c ], %o1
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
40019350: 90 10 00 1a mov %i2, %o0
40019354: 92 20 40 09 sub %g1, %o1, %o1
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
40019358: c2 26 20 3c st %g1, [ %i0 + 0x3c ]
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
4001935c: 40 00 11 18 call 4001d7bc <_Watchdog_Adjust_to_chain>
40019360: 94 10 00 1c mov %i4, %o2
40019364: d0 1d 20 78 ldd [ %l4 + 0x78 ], %o0
40019368: 94 10 20 00 clr %o2
4001936c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
40019370: 40 00 4b b1 call 4002c234 <__divdi3>
40019374: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
40019378: d4 06 20 74 ld [ %i0 + 0x74 ], %o2
/*
* Process the seconds chain. Start by checking that the Time
* of Day (TOD) has not been set backwards. If it has then
* we want to adjust the watchdogs->Chain to indicate this.
*/
if ( snapshot > last_snapshot ) {
4001937c: 80 a2 40 0a cmp %o1, %o2
40019380: 08 80 00 07 bleu 4001939c <_Timer_server_Body+0x9c>
40019384: ba 10 00 09 mov %o1, %i5
/*
* This path is for normal forward movement and cases where the
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
40019388: 92 22 40 0a sub %o1, %o2, %o1
4001938c: 90 10 00 1b mov %i3, %o0
40019390: 40 00 11 0b call 4001d7bc <_Watchdog_Adjust_to_chain>
40019394: 94 10 00 1c mov %i4, %o2
40019398: 30 80 00 06 b,a 400193b0 <_Timer_server_Body+0xb0>
} else if ( snapshot < last_snapshot ) {
4001939c: 1a 80 00 05 bcc 400193b0 <_Timer_server_Body+0xb0>
400193a0: 90 10 00 1b mov %i3, %o0
/*
* The current TOD is before the last TOD which indicates that
* TOD has been set backwards.
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
400193a4: 92 10 20 01 mov 1, %o1
400193a8: 40 00 10 dd call 4001d71c <_Watchdog_Adjust>
400193ac: 94 22 80 1d sub %o2, %i5, %o2
}
watchdogs->last_snapshot = snapshot;
400193b0: fa 26 20 74 st %i5, [ %i0 + 0x74 ]
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
400193b4: d0 06 20 78 ld [ %i0 + 0x78 ], %o0
400193b8: 40 00 02 d8 call 40019f18 <_Chain_Get>
400193bc: 01 00 00 00 nop
if ( timer == NULL ) {
400193c0: 92 92 20 00 orcc %o0, 0, %o1
400193c4: 02 80 00 0c be 400193f4 <_Timer_server_Body+0xf4>
400193c8: 01 00 00 00 nop
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
400193cc: c2 02 60 38 ld [ %o1 + 0x38 ], %g1
400193d0: 80 a0 60 01 cmp %g1, 1
400193d4: 02 80 00 05 be 400193e8 <_Timer_server_Body+0xe8>
400193d8: 90 10 00 1a mov %i2, %o0
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
400193dc: 80 a0 60 03 cmp %g1, 3
400193e0: 12 bf ff f5 bne 400193b4 <_Timer_server_Body+0xb4> <== NEVER TAKEN
400193e4: 90 10 00 1b mov %i3, %o0
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
400193e8: 40 00 11 1f call 4001d864 <_Watchdog_Insert>
400193ec: 92 02 60 10 add %o1, 0x10, %o1
400193f0: 30 bf ff f1 b,a 400193b4 <_Timer_server_Body+0xb4>
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
400193f4: 7f ff dc 70 call 400105b4 <sparc_disable_interrupts>
400193f8: 01 00 00 00 nop
if ( _Chain_Is_empty( insert_chain ) ) {
400193fc: c2 07 bf e8 ld [ %fp + -24 ], %g1
40019400: 80 a0 40 15 cmp %g1, %l5
40019404: 12 80 00 0a bne 4001942c <_Timer_server_Body+0x12c> <== NEVER TAKEN
40019408: 01 00 00 00 nop
ts->insert_chain = NULL;
4001940c: c0 26 20 78 clr [ %i0 + 0x78 ]
_ISR_Enable( level );
40019410: 7f ff dc 6d call 400105c4 <sparc_enable_interrupts>
40019414: 01 00 00 00 nop
_Chain_Initialize_empty( &fire_chain );
while ( true ) {
_Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain );
if ( !_Chain_Is_empty( &fire_chain ) ) {
40019418: c2 07 bf f4 ld [ %fp + -12 ], %g1
4001941c: 80 a0 40 19 cmp %g1, %i1
40019420: 12 80 00 06 bne 40019438 <_Timer_server_Body+0x138>
40019424: 01 00 00 00 nop
40019428: 30 80 00 18 b,a 40019488 <_Timer_server_Body+0x188>
ts->insert_chain = NULL;
_ISR_Enable( level );
break;
} else {
_ISR_Enable( level );
4001942c: 7f ff dc 66 call 400105c4 <sparc_enable_interrupts> <== NOT EXECUTED
40019430: 01 00 00 00 nop <== NOT EXECUTED
40019434: 30 bf ff c5 b,a 40019348 <_Timer_server_Body+0x48> <== NOT EXECUTED
/*
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
40019438: 7f ff dc 5f call 400105b4 <sparc_disable_interrupts>
4001943c: 01 00 00 00 nop
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
40019440: fa 07 bf f4 ld [ %fp + -12 ], %i5
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
40019444: 80 a7 40 19 cmp %i5, %i1
40019448: 02 80 00 0d be 4001947c <_Timer_server_Body+0x17c>
4001944c: 01 00 00 00 nop
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
40019450: c2 07 40 00 ld [ %i5 ], %g1
head->next = new_first;
new_first->previous = head;
40019454: f8 20 60 04 st %i4, [ %g1 + 4 ]
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
40019458: c2 27 bf f4 st %g1, [ %fp + -12 ]
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
4001945c: c0 27 60 08 clr [ %i5 + 8 ]
_ISR_Enable( level );
40019460: 7f ff dc 59 call 400105c4 <sparc_enable_interrupts>
40019464: 01 00 00 00 nop
/*
* The timer server may block here and wait for resources or time.
* The system watchdogs are inactive and will remain inactive since
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
40019468: c2 07 60 1c ld [ %i5 + 0x1c ], %g1
4001946c: d0 07 60 20 ld [ %i5 + 0x20 ], %o0
40019470: 9f c0 40 00 call %g1
40019474: d2 07 60 24 ld [ %i5 + 0x24 ], %o1
}
40019478: 30 bf ff f0 b,a 40019438 <_Timer_server_Body+0x138>
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
_ISR_Enable( level );
} else {
_ISR_Enable( level );
4001947c: 7f ff dc 52 call 400105c4 <sparc_enable_interrupts>
40019480: 01 00 00 00 nop
40019484: 30 bf ff b0 b,a 40019344 <_Timer_server_Body+0x44>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
40019488: c0 2e 20 7c clrb [ %i0 + 0x7c ]
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4001948c: 03 10 00 f4 sethi %hi(0x4003d000), %g1
40019490: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 4003d130 <_Thread_Dispatch_disable_level>
++level;
40019494: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40019498: c4 20 61 30 st %g2, [ %g1 + 0x130 ]
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
4001949c: d0 06 00 00 ld [ %i0 ], %o0
400194a0: 40 00 0f bc call 4001d390 <_Thread_Set_state>
400194a4: 92 10 20 08 mov 8, %o1
_Timer_server_Reset_interval_system_watchdog( ts );
400194a8: 7f ff ff 6e call 40019260 <_Timer_server_Reset_interval_system_watchdog>
400194ac: 90 10 00 18 mov %i0, %o0
_Timer_server_Reset_tod_system_watchdog( ts );
400194b0: 7f ff ff 80 call 400192b0 <_Timer_server_Reset_tod_system_watchdog>
400194b4: 90 10 00 18 mov %i0, %o0
_Thread_Enable_dispatch();
400194b8: 40 00 0d 7b call 4001caa4 <_Thread_Enable_dispatch>
400194bc: 01 00 00 00 nop
ts->active = true;
400194c0: 82 10 20 01 mov 1, %g1 ! 1 <PROM_START+0x1>
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
400194c4: 90 10 00 11 mov %l1, %o0
_Thread_Set_state( ts->thread, STATES_DELAYING );
_Timer_server_Reset_interval_system_watchdog( ts );
_Timer_server_Reset_tod_system_watchdog( ts );
_Thread_Enable_dispatch();
ts->active = true;
400194c8: c2 2e 20 7c stb %g1, [ %i0 + 0x7c ]
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
400194cc: 40 00 11 3e call 4001d9c4 <_Watchdog_Remove>
400194d0: 01 00 00 00 nop
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
400194d4: 40 00 11 3c call 4001d9c4 <_Watchdog_Remove>
400194d8: 90 10 00 10 mov %l0, %o0
400194dc: 30 bf ff 9a b,a 40019344 <_Timer_server_Body+0x44>
400194e0 <_Timer_server_Schedule_operation_method>:
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
400194e0: 9d e3 bf a0 save %sp, -96, %sp
if ( ts->insert_chain == NULL ) {
400194e4: c2 06 20 78 ld [ %i0 + 0x78 ], %g1
400194e8: 80 a0 60 00 cmp %g1, 0
400194ec: 12 80 00 51 bne 40019630 <_Timer_server_Schedule_operation_method+0x150>
400194f0: ba 10 00 19 mov %i1, %i5
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
400194f4: 03 10 00 f4 sethi %hi(0x4003d000), %g1
400194f8: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 4003d130 <_Thread_Dispatch_disable_level>
++level;
400194fc: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40019500: c4 20 61 30 st %g2, [ %g1 + 0x130 ]
* being inserted. This could result in an integer overflow.
*/
_Thread_Disable_dispatch();
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
40019504: c2 06 60 38 ld [ %i1 + 0x38 ], %g1
40019508: 80 a0 60 01 cmp %g1, 1
4001950c: 12 80 00 1f bne 40019588 <_Timer_server_Schedule_operation_method+0xa8>
40019510: 80 a0 60 03 cmp %g1, 3
/*
* We have to advance the last known ticks value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
40019514: 7f ff dc 28 call 400105b4 <sparc_disable_interrupts>
40019518: 01 00 00 00 nop
snapshot = _Watchdog_Ticks_since_boot;
4001951c: 03 10 00 f4 sethi %hi(0x4003d000), %g1
40019520: c4 00 62 18 ld [ %g1 + 0x218 ], %g2 ! 4003d218 <_Watchdog_Ticks_since_boot>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
40019524: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
last_snapshot = ts->Interval_watchdogs.last_snapshot;
40019528: c8 06 20 3c ld [ %i0 + 0x3c ], %g4
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
4001952c: 86 06 20 34 add %i0, 0x34, %g3
if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) {
40019530: 80 a0 40 03 cmp %g1, %g3
40019534: 02 80 00 08 be 40019554 <_Timer_server_Schedule_operation_method+0x74>
40019538: 88 20 80 04 sub %g2, %g4, %g4
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
4001953c: f8 00 60 10 ld [ %g1 + 0x10 ], %i4
if (delta_interval > delta) {
40019540: 80 a7 00 04 cmp %i4, %g4
40019544: 08 80 00 03 bleu 40019550 <_Timer_server_Schedule_operation_method+0x70>
40019548: 86 10 20 00 clr %g3
delta_interval -= delta;
4001954c: 86 27 00 04 sub %i4, %g4, %g3
} else {
delta_interval = 0;
}
first_watchdog->delta_interval = delta_interval;
40019550: c6 20 60 10 st %g3, [ %g1 + 0x10 ]
}
ts->Interval_watchdogs.last_snapshot = snapshot;
40019554: c4 26 20 3c st %g2, [ %i0 + 0x3c ]
_ISR_Enable( level );
40019558: 7f ff dc 1b call 400105c4 <sparc_enable_interrupts>
4001955c: 01 00 00 00 nop
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
40019560: 90 06 20 30 add %i0, 0x30, %o0
40019564: 40 00 10 c0 call 4001d864 <_Watchdog_Insert>
40019568: 92 07 60 10 add %i5, 0x10, %o1
if ( !ts->active ) {
4001956c: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1
40019570: 80 a0 60 00 cmp %g1, 0
40019574: 12 80 00 2d bne 40019628 <_Timer_server_Schedule_operation_method+0x148>
40019578: 01 00 00 00 nop
_Timer_server_Reset_interval_system_watchdog( ts );
4001957c: 7f ff ff 39 call 40019260 <_Timer_server_Reset_interval_system_watchdog>
40019580: 90 10 00 18 mov %i0, %o0
40019584: 30 80 00 29 b,a 40019628 <_Timer_server_Schedule_operation_method+0x148>
}
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
40019588: 12 80 00 28 bne 40019628 <_Timer_server_Schedule_operation_method+0x148>
4001958c: 01 00 00 00 nop
/*
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
40019590: 7f ff dc 09 call 400105b4 <sparc_disable_interrupts>
40019594: 01 00 00 00 nop
40019598: b8 10 00 08 mov %o0, %i4
4001959c: 03 10 00 f4 sethi %hi(0x4003d000), %g1
400195a0: d0 18 60 78 ldd [ %g1 + 0x78 ], %o0 ! 4003d078 <_TOD>
400195a4: 94 10 20 00 clr %o2
400195a8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
400195ac: 40 00 4b 22 call 4002c234 <__divdi3>
400195b0: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
400195b4: c2 06 20 68 ld [ %i0 + 0x68 ], %g1
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
last_snapshot = ts->TOD_watchdogs.last_snapshot;
400195b8: c4 06 20 74 ld [ %i0 + 0x74 ], %g2
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
400195bc: 86 06 20 6c add %i0, 0x6c, %g3
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
400195c0: 80 a0 40 03 cmp %g1, %g3
400195c4: 02 80 00 0d be 400195f8 <_Timer_server_Schedule_operation_method+0x118>
400195c8: 80 a2 40 02 cmp %o1, %g2
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
if ( snapshot > last_snapshot ) {
400195cc: 08 80 00 08 bleu 400195ec <_Timer_server_Schedule_operation_method+0x10c>
400195d0: c6 00 60 10 ld [ %g1 + 0x10 ], %g3
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
400195d4: 88 22 40 02 sub %o1, %g2, %g4
if (delta_interval > delta) {
400195d8: 80 a0 c0 04 cmp %g3, %g4
400195dc: 08 80 00 06 bleu 400195f4 <_Timer_server_Schedule_operation_method+0x114><== NEVER TAKEN
400195e0: 84 10 20 00 clr %g2
delta_interval -= delta;
400195e4: 10 80 00 04 b 400195f4 <_Timer_server_Schedule_operation_method+0x114>
400195e8: 84 20 c0 04 sub %g3, %g4, %g2
}
} else {
/*
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
400195ec: 84 00 c0 02 add %g3, %g2, %g2
delta_interval += delta;
400195f0: 84 20 80 09 sub %g2, %o1, %g2
}
first_watchdog->delta_interval = delta_interval;
400195f4: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
}
ts->TOD_watchdogs.last_snapshot = snapshot;
400195f8: d2 26 20 74 st %o1, [ %i0 + 0x74 ]
_ISR_Enable( level );
400195fc: 7f ff db f2 call 400105c4 <sparc_enable_interrupts>
40019600: 90 10 00 1c mov %i4, %o0
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
40019604: 90 06 20 68 add %i0, 0x68, %o0
40019608: 40 00 10 97 call 4001d864 <_Watchdog_Insert>
4001960c: 92 07 60 10 add %i5, 0x10, %o1
if ( !ts->active ) {
40019610: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1
40019614: 80 a0 60 00 cmp %g1, 0
40019618: 12 80 00 04 bne 40019628 <_Timer_server_Schedule_operation_method+0x148>
4001961c: 01 00 00 00 nop
_Timer_server_Reset_tod_system_watchdog( ts );
40019620: 7f ff ff 24 call 400192b0 <_Timer_server_Reset_tod_system_watchdog>
40019624: 90 10 00 18 mov %i0, %o0
}
}
_Thread_Enable_dispatch();
40019628: 40 00 0d 1f call 4001caa4 <_Thread_Enable_dispatch>
4001962c: 81 e8 00 00 restore
* server is not preemptible, so we must be in interrupt context here. No
* thread dispatch will happen until the timer server finishes its
* critical section. We have to use the protected chain methods because
* we may be interrupted by a higher priority interrupt.
*/
_Chain_Append( ts->insert_chain, &timer->Object.Node );
40019630: f0 06 20 78 ld [ %i0 + 0x78 ], %i0
40019634: 40 00 02 2d call 40019ee8 <_Chain_Append>
40019638: 81 e8 00 00 restore
4000cad0 <_Timestamp64_Divide>:
const Timestamp64_Control *_lhs,
const Timestamp64_Control *_rhs,
uint32_t *_ival_percentage,
uint32_t *_fval_percentage
)
{
4000cad0: 9d e3 bf a0 save %sp, -96, %sp
Timestamp64_Control answer;
if ( *_rhs == 0 ) {
4000cad4: d4 1e 40 00 ldd [ %i1 ], %o2
4000cad8: 80 92 80 0b orcc %o2, %o3, %g0
4000cadc: 32 80 00 06 bne,a 4000caf4 <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN
4000cae0: d8 1e 00 00 ldd [ %i0 ], %o4
*_ival_percentage = 0;
4000cae4: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED
*_fval_percentage = 0;
4000cae8: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED
return;
4000caec: 81 c7 e0 08 ret <== NOT EXECUTED
4000caf0: 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;
4000caf4: 83 2b 20 02 sll %o4, 2, %g1
4000caf8: 87 2b 60 02 sll %o5, 2, %g3
4000cafc: 89 33 60 1e srl %o5, 0x1e, %g4
4000cb00: bb 28 e0 05 sll %g3, 5, %i5
4000cb04: 84 11 00 01 or %g4, %g1, %g2
4000cb08: 83 30 e0 1b srl %g3, 0x1b, %g1
4000cb0c: b9 28 a0 05 sll %g2, 5, %i4
4000cb10: 86 a7 40 03 subcc %i5, %g3, %g3
4000cb14: b8 10 40 1c or %g1, %i4, %i4
4000cb18: 84 67 00 02 subx %i4, %g2, %g2
4000cb1c: b2 80 c0 0d addcc %g3, %o5, %i1
4000cb20: b0 40 80 0c addx %g2, %o4, %i0
4000cb24: 83 36 60 1e srl %i1, 0x1e, %g1
4000cb28: 87 2e 60 02 sll %i1, 2, %g3
4000cb2c: 85 2e 20 02 sll %i0, 2, %g2
4000cb30: 84 10 40 02 or %g1, %g2, %g2
4000cb34: ba 86 40 03 addcc %i1, %g3, %i5
4000cb38: b8 46 00 02 addx %i0, %g2, %i4
4000cb3c: 83 37 60 1e srl %i5, 0x1e, %g1
4000cb40: 87 2f 60 02 sll %i5, 2, %g3
4000cb44: 85 2f 20 02 sll %i4, 2, %g2
4000cb48: 84 10 40 02 or %g1, %g2, %g2
4000cb4c: 92 87 40 03 addcc %i5, %g3, %o1
4000cb50: 90 47 00 02 addx %i4, %g2, %o0
4000cb54: 87 32 60 1b srl %o1, 0x1b, %g3
4000cb58: 85 2a 20 05 sll %o0, 5, %g2
4000cb5c: 83 2a 60 05 sll %o1, 5, %g1
4000cb60: 90 10 c0 02 or %g3, %g2, %o0
4000cb64: 40 00 36 b3 call 4001a630 <__divdi3>
4000cb68: 92 10 00 01 mov %g1, %o1
*_ival_percentage = answer / 1000;
4000cb6c: 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;
4000cb70: b8 10 00 08 mov %o0, %i4
4000cb74: ba 10 00 09 mov %o1, %i5
*_ival_percentage = answer / 1000;
4000cb78: 40 00 36 ae call 4001a630 <__divdi3>
4000cb7c: 96 10 23 e8 mov 0x3e8, %o3
*_fval_percentage = answer % 1000;
4000cb80: 90 10 00 1c mov %i4, %o0
* TODO: Rounding on the last digit of the fval.
*/
answer = (*_lhs * 100000) / *_rhs;
*_ival_percentage = answer / 1000;
4000cb84: d2 26 80 00 st %o1, [ %i2 ]
*_fval_percentage = answer % 1000;
4000cb88: 94 10 20 00 clr %o2
4000cb8c: 92 10 00 1d mov %i5, %o1
4000cb90: 40 00 37 93 call 4001a9dc <__moddi3>
4000cb94: 96 10 23 e8 mov 0x3e8, %o3
4000cb98: d2 26 c0 00 st %o1, [ %i3 ]
4000cb9c: 81 c7 e0 08 ret
4000cba0: 81 e8 00 00 restore
4000b3c0 <_User_extensions_Handler_initialization>:
}
}
void _User_extensions_Handler_initialization(void)
{
4000b3c0: 9d e3 bf 98 save %sp, -104, %sp
uint32_t number_of_initial_extensions =
4000b3c4: 03 10 00 6d sethi %hi(0x4001b400), %g1
4000b3c8: c2 00 61 08 ld [ %g1 + 0x108 ], %g1 ! 4001b508 <Configuration+0x40>
rtems_configuration_get_number_of_initial_extensions();
if ( number_of_initial_extensions > 0 ) {
4000b3cc: 80 a0 60 00 cmp %g1, 0
4000b3d0: 02 80 00 0a be 4000b3f8 <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN
4000b3d4: 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 )
4000b3d8: 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 =
4000b3dc: 40 00 01 08 call 4000b7fc <_Workspace_Allocate_or_fatal_error>
4000b3e0: 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 );
4000b3e4: 13 10 00 2c sethi %hi(0x4000b000), %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 };
4000b3e8: d0 27 bf fc st %o0, [ %fp + -4 ]
_User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
4000b3ec: 92 12 63 7c or %o1, 0x37c, %o1
4000b3f0: 7f ff ff c4 call 4000b300 <_User_extensions_Iterate>
4000b3f4: 90 07 bf fc add %fp, -4, %o0
4000b3f8: 81 c7 e0 08 ret
4000b3fc: 81 e8 00 00 restore
4000ce08 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
4000ce08: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
_ISR_Disable( level );
4000ce0c: 7f ff d9 21 call 40003290 <sparc_disable_interrupts>
4000ce10: 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;
4000ce14: 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 );
4000ce18: 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 ) ) {
4000ce1c: 80 a0 40 1c cmp %g1, %i4
4000ce20: 02 80 00 20 be 4000cea0 <_Watchdog_Adjust+0x98>
4000ce24: 80 a6 60 00 cmp %i1, 0
switch ( direction ) {
4000ce28: 02 80 00 1b be 4000ce94 <_Watchdog_Adjust+0x8c>
4000ce2c: b6 10 20 01 mov 1, %i3
4000ce30: 80 a6 60 01 cmp %i1, 1
4000ce34: 12 80 00 1b bne 4000cea0 <_Watchdog_Adjust+0x98> <== NEVER TAKEN
4000ce38: 01 00 00 00 nop
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
4000ce3c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
4000ce40: 10 80 00 07 b 4000ce5c <_Watchdog_Adjust+0x54>
4000ce44: b4 00 80 1a add %g2, %i2, %i2
break;
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
4000ce48: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
4000ce4c: 80 a6 80 02 cmp %i2, %g2
4000ce50: 3a 80 00 05 bcc,a 4000ce64 <_Watchdog_Adjust+0x5c>
4000ce54: f6 20 60 10 st %i3, [ %g1 + 0x10 ]
_Watchdog_First( header )->delta_interval -= units;
4000ce58: b4 20 80 1a sub %g2, %i2, %i2
break;
4000ce5c: 10 80 00 11 b 4000cea0 <_Watchdog_Adjust+0x98>
4000ce60: f4 20 60 10 st %i2, [ %g1 + 0x10 ]
} else {
units -= _Watchdog_First( header )->delta_interval;
4000ce64: b4 26 80 02 sub %i2, %g2, %i2
_Watchdog_First( header )->delta_interval = 1;
_ISR_Enable( level );
4000ce68: 7f ff d9 0e call 400032a0 <sparc_enable_interrupts>
4000ce6c: 01 00 00 00 nop
_Watchdog_Tickle( header );
4000ce70: 40 00 00 90 call 4000d0b0 <_Watchdog_Tickle>
4000ce74: 90 10 00 18 mov %i0, %o0
_ISR_Disable( level );
4000ce78: 7f ff d9 06 call 40003290 <sparc_disable_interrupts>
4000ce7c: 01 00 00 00 nop
if ( _Chain_Is_empty( header ) )
4000ce80: c2 06 00 00 ld [ %i0 ], %g1
4000ce84: 80 a0 40 1c cmp %g1, %i4
4000ce88: 12 80 00 04 bne 4000ce98 <_Watchdog_Adjust+0x90>
4000ce8c: 80 a6 a0 00 cmp %i2, 0
4000ce90: 30 80 00 04 b,a 4000cea0 <_Watchdog_Adjust+0x98>
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
4000ce94: 80 a6 a0 00 cmp %i2, 0
4000ce98: 32 bf ff ec bne,a 4000ce48 <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN
4000ce9c: c2 06 00 00 ld [ %i0 ], %g1
}
break;
}
}
_ISR_Enable( level );
4000cea0: 7f ff d9 00 call 400032a0 <sparc_enable_interrupts>
4000cea4: 91 e8 00 08 restore %g0, %o0, %o0
4000b560 <_Watchdog_Remove>:
#include <rtems/score/watchdog.h>
Watchdog_States _Watchdog_Remove(
Watchdog_Control *the_watchdog
)
{
4000b560: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
4000b564: 7f ff db b9 call 40002448 <sparc_disable_interrupts>
4000b568: ba 10 00 18 mov %i0, %i5
previous_state = the_watchdog->state;
4000b56c: f0 06 20 08 ld [ %i0 + 8 ], %i0
switch ( previous_state ) {
4000b570: 80 a6 20 01 cmp %i0, 1
4000b574: 22 80 00 1e be,a 4000b5ec <_Watchdog_Remove+0x8c>
4000b578: c0 27 60 08 clr [ %i5 + 8 ]
4000b57c: 0a 80 00 1d bcs 4000b5f0 <_Watchdog_Remove+0x90>
4000b580: 03 10 00 78 sethi %hi(0x4001e000), %g1
4000b584: 80 a6 20 03 cmp %i0, 3
4000b588: 18 80 00 1a bgu 4000b5f0 <_Watchdog_Remove+0x90> <== NEVER TAKEN
4000b58c: 01 00 00 00 nop
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next(
Watchdog_Control *the_watchdog
)
{
return ( (Watchdog_Control *) the_watchdog->Node.next );
4000b590: 10 80 00 02 b 4000b598 <_Watchdog_Remove+0x38>
4000b594: c2 07 40 00 ld [ %i5 ], %g1
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
4000b598: c0 27 60 08 clr [ %i5 + 8 ]
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
4000b59c: c4 00 40 00 ld [ %g1 ], %g2
4000b5a0: 80 a0 a0 00 cmp %g2, 0
4000b5a4: 02 80 00 07 be 4000b5c0 <_Watchdog_Remove+0x60>
4000b5a8: 05 10 00 78 sethi %hi(0x4001e000), %g2
next_watchdog->delta_interval += the_watchdog->delta_interval;
4000b5ac: c6 00 60 10 ld [ %g1 + 0x10 ], %g3
4000b5b0: c4 07 60 10 ld [ %i5 + 0x10 ], %g2
4000b5b4: 84 00 c0 02 add %g3, %g2, %g2
4000b5b8: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
if ( _Watchdog_Sync_count )
4000b5bc: 05 10 00 78 sethi %hi(0x4001e000), %g2
4000b5c0: c4 00 a0 14 ld [ %g2 + 0x14 ], %g2 ! 4001e014 <_Watchdog_Sync_count>
4000b5c4: 80 a0 a0 00 cmp %g2, 0
4000b5c8: 22 80 00 07 be,a 4000b5e4 <_Watchdog_Remove+0x84>
4000b5cc: c4 07 60 04 ld [ %i5 + 4 ], %g2
_Watchdog_Sync_level = _ISR_Nest_level;
4000b5d0: 05 10 00 78 sethi %hi(0x4001e000), %g2
4000b5d4: c6 00 a1 38 ld [ %g2 + 0x138 ], %g3 ! 4001e138 <_Per_CPU_Information+0x8>
4000b5d8: 05 10 00 77 sethi %hi(0x4001dc00), %g2
4000b5dc: c6 20 a3 b4 st %g3, [ %g2 + 0x3b4 ] ! 4001dfb4 <_Watchdog_Sync_level>
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
4000b5e0: c4 07 60 04 ld [ %i5 + 4 ], %g2
next->previous = previous;
4000b5e4: c4 20 60 04 st %g2, [ %g1 + 4 ]
previous->next = next;
4000b5e8: c2 20 80 00 st %g1, [ %g2 ]
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
4000b5ec: 03 10 00 78 sethi %hi(0x4001e000), %g1
4000b5f0: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 ! 4001e018 <_Watchdog_Ticks_since_boot>
4000b5f4: c2 27 60 18 st %g1, [ %i5 + 0x18 ]
_ISR_Enable( level );
4000b5f8: 7f ff db 98 call 40002458 <sparc_enable_interrupts>
4000b5fc: 01 00 00 00 nop
return( previous_state );
}
4000b600: 81 c7 e0 08 ret
4000b604: 81 e8 00 00 restore
4000c7b4 <_Watchdog_Report_chain>:
void _Watchdog_Report_chain(
const char *name,
Chain_Control *header
)
{
4000c7b4: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
4000c7b8: 7f ff d9 93 call 40002e04 <sparc_disable_interrupts>
4000c7bc: b8 10 00 18 mov %i0, %i4
4000c7c0: b0 10 00 08 mov %o0, %i0
printk( "Watchdog Chain: %s %p\n", name, header );
4000c7c4: 11 10 00 78 sethi %hi(0x4001e000), %o0
4000c7c8: 94 10 00 19 mov %i1, %o2
4000c7cc: 90 12 20 c8 or %o0, 0xc8, %o0
4000c7d0: 7f ff e4 12 call 40005818 <printk>
4000c7d4: 92 10 00 1c mov %i4, %o1
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
4000c7d8: 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 );
4000c7dc: b2 06 60 04 add %i1, 4, %i1
if ( !_Chain_Is_empty( header ) ) {
4000c7e0: 80 a7 40 19 cmp %i5, %i1
4000c7e4: 12 80 00 04 bne 4000c7f4 <_Watchdog_Report_chain+0x40>
4000c7e8: 92 10 00 1d mov %i5, %o1
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
} else {
printk( "Chain is empty\n" );
4000c7ec: 10 80 00 0d b 4000c820 <_Watchdog_Report_chain+0x6c>
4000c7f0: 11 10 00 78 sethi %hi(0x4001e000), %o0
node != _Chain_Tail(header) ;
node = node->next )
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
4000c7f4: 40 00 00 0f call 4000c830 <_Watchdog_Report>
4000c7f8: 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 )
4000c7fc: fa 07 40 00 ld [ %i5 ], %i5
Chain_Node *node;
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = _Chain_First( header ) ;
4000c800: 80 a7 40 19 cmp %i5, %i1
4000c804: 12 bf ff fc bne 4000c7f4 <_Watchdog_Report_chain+0x40> <== NEVER TAKEN
4000c808: 92 10 00 1d mov %i5, %o1
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
4000c80c: 11 10 00 78 sethi %hi(0x4001e000), %o0
4000c810: 92 10 00 1c mov %i4, %o1
4000c814: 7f ff e4 01 call 40005818 <printk>
4000c818: 90 12 20 e0 or %o0, 0xe0, %o0
4000c81c: 30 80 00 03 b,a 4000c828 <_Watchdog_Report_chain+0x74>
} else {
printk( "Chain is empty\n" );
4000c820: 7f ff e3 fe call 40005818 <printk>
4000c824: 90 12 20 f0 or %o0, 0xf0, %o0
}
_ISR_Enable( level );
4000c828: 7f ff d9 7b call 40002e14 <sparc_enable_interrupts>
4000c82c: 81 e8 00 00 restore
4000b608 <_Watchdog_Tickle>:
#include <rtems/score/watchdog.h>
void _Watchdog_Tickle(
Chain_Control *header
)
{
4000b608: 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 );
4000b60c: 7f ff db 8f call 40002448 <sparc_disable_interrupts>
4000b610: b8 10 00 18 mov %i0, %i4
4000b614: 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;
4000b618: 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 );
4000b61c: b6 07 20 04 add %i4, 4, %i3
if ( _Chain_Is_empty( header ) )
4000b620: 80 a7 40 1b cmp %i5, %i3
4000b624: 02 80 00 1f be 4000b6a0 <_Watchdog_Tickle+0x98>
4000b628: 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) {
4000b62c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
4000b630: 80 a0 60 00 cmp %g1, 0
4000b634: 02 80 00 06 be 4000b64c <_Watchdog_Tickle+0x44> <== NEVER TAKEN
4000b638: 82 00 7f ff add %g1, -1, %g1
the_watchdog->delta_interval--;
4000b63c: c2 27 60 10 st %g1, [ %i5 + 0x10 ]
if ( the_watchdog->delta_interval != 0 )
4000b640: 80 a0 60 00 cmp %g1, 0
4000b644: 12 80 00 17 bne 4000b6a0 <_Watchdog_Tickle+0x98>
4000b648: 01 00 00 00 nop
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
4000b64c: 7f ff ff c5 call 4000b560 <_Watchdog_Remove>
4000b650: 90 10 00 1d mov %i5, %o0
4000b654: b4 10 00 08 mov %o0, %i2
_ISR_Enable( level );
4000b658: 7f ff db 80 call 40002458 <sparc_enable_interrupts>
4000b65c: 90 10 00 18 mov %i0, %o0
switch( watchdog_state ) {
4000b660: 80 a6 a0 02 cmp %i2, 2
4000b664: 12 80 00 06 bne 4000b67c <_Watchdog_Tickle+0x74>
4000b668: 01 00 00 00 nop
case WATCHDOG_ACTIVE:
(*the_watchdog->routine)(
4000b66c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1
4000b670: d0 07 60 20 ld [ %i5 + 0x20 ], %o0
4000b674: 9f c0 40 00 call %g1
4000b678: d2 07 60 24 ld [ %i5 + 0x24 ], %o1
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
4000b67c: 7f ff db 73 call 40002448 <sparc_disable_interrupts>
4000b680: 01 00 00 00 nop
4000b684: b0 10 00 08 mov %o0, %i0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4000b688: fa 07 00 00 ld [ %i4 ], %i5
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
4000b68c: 80 a7 40 1b cmp %i5, %i3
4000b690: 02 80 00 04 be 4000b6a0 <_Watchdog_Tickle+0x98>
4000b694: 01 00 00 00 nop
}
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
4000b698: 10 bf ff ea b 4000b640 <_Watchdog_Tickle+0x38>
4000b69c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
4000b6a0: 7f ff db 6e call 40002458 <sparc_enable_interrupts>
4000b6a4: 81 e8 00 00 restore
4000b6a8 <_Workspace_Handler_initialization>:
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
4000b6a8: 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();
4000b6ac: 05 10 00 6d sethi %hi(0x4001b400), %g2
4000b6b0: 82 10 a0 c8 or %g2, 0xc8, %g1 ! 4001b4c8 <Configuration>
4000b6b4: c6 08 60 32 ldub [ %g1 + 0x32 ], %g3
4000b6b8: fa 00 a0 c8 ld [ %g2 + 0xc8 ], %i5
4000b6bc: 80 a0 e0 00 cmp %g3, 0
4000b6c0: 12 80 00 03 bne 4000b6cc <_Workspace_Handler_initialization+0x24>
4000b6c4: 84 10 20 00 clr %g2
4000b6c8: c4 00 60 04 ld [ %g1 + 4 ], %g2
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
4000b6cc: 21 10 00 24 sethi %hi(0x40009000), %l0
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
4000b6d0: 27 10 00 77 sethi %hi(0x4001dc00), %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();
4000b6d4: 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) {
4000b6d8: 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;
4000b6dc: a0 14 21 64 or %l0, 0x164, %l0
size_t i;
for (i = 0; i < area_count; ++i) {
Heap_Area *area = &areas [i];
if ( do_zero ) {
4000b6e0: e2 08 60 30 ldub [ %g1 + 0x30 ], %l1
if ( area->size > overhead ) {
uintptr_t space_available;
uintptr_t size;
if ( unified ) {
4000b6e4: e4 08 60 31 ldub [ %g1 + 0x31 ], %l2
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
4000b6e8: 10 80 00 2c b 4000b798 <_Workspace_Handler_initialization+0xf0>
4000b6ec: a6 14 e3 40 or %l3, 0x340, %l3
Heap_Area *area = &areas [i];
if ( do_zero ) {
4000b6f0: 22 80 00 07 be,a 4000b70c <_Workspace_Handler_initialization+0x64>
4000b6f4: f8 06 20 04 ld [ %i0 + 4 ], %i4
memset( area->begin, 0, area->size );
4000b6f8: d0 06 00 00 ld [ %i0 ], %o0
4000b6fc: d4 06 20 04 ld [ %i0 + 4 ], %o2
4000b700: 40 00 10 1f call 4000f77c <memset>
4000b704: 92 10 20 00 clr %o1
}
if ( area->size > overhead ) {
4000b708: f8 06 20 04 ld [ %i0 + 4 ], %i4
4000b70c: 80 a7 20 16 cmp %i4, 0x16
4000b710: 28 80 00 21 bleu,a 4000b794 <_Workspace_Handler_initialization+0xec>
4000b714: b6 06 e0 01 inc %i3
uintptr_t space_available;
uintptr_t size;
if ( unified ) {
4000b718: 80 a4 a0 00 cmp %l2, 0
4000b71c: 32 80 00 0c bne,a 4000b74c <_Workspace_Handler_initialization+0xa4>
4000b720: d2 06 00 00 ld [ %i0 ], %o1
size = area->size;
} else {
if ( remaining > 0 ) {
4000b724: 80 a7 60 00 cmp %i5, 0
4000b728: 22 80 00 08 be,a 4000b748 <_Workspace_Handler_initialization+0xa0><== NEVER TAKEN
4000b72c: b8 10 20 00 clr %i4 <== NOT EXECUTED
size = remaining < area->size - overhead ?
4000b730: 82 07 3f ea add %i4, -22, %g1
remaining + overhead : area->size;
4000b734: 80 a7 40 01 cmp %i5, %g1
4000b738: 2a 80 00 04 bcs,a 4000b748 <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN
4000b73c: b8 07 60 16 add %i5, 0x16, %i4
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
4000b740: 10 80 00 03 b 4000b74c <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED
4000b744: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED
4000b748: d2 06 00 00 ld [ %i0 ], %o1
4000b74c: 94 10 00 1c mov %i4, %o2
4000b750: 90 10 00 13 mov %l3, %o0
4000b754: 9f c4 00 00 call %l0
4000b758: 96 10 20 08 mov 8, %o3
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
4000b75c: c2 06 00 00 ld [ %i0 ], %g1
area->size -= size;
if ( space_available < remaining ) {
4000b760: 80 a2 00 1d cmp %o0, %i5
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
4000b764: 82 00 40 1c add %g1, %i4, %g1
4000b768: c2 26 00 00 st %g1, [ %i0 ]
area->size -= size;
4000b76c: c2 06 20 04 ld [ %i0 + 4 ], %g1
4000b770: b8 20 40 1c sub %g1, %i4, %i4
if ( space_available < remaining ) {
4000b774: 1a 80 00 05 bcc 4000b788 <_Workspace_Handler_initialization+0xe0><== ALWAYS TAKEN
4000b778: f8 26 20 04 st %i4, [ %i0 + 4 ]
remaining -= space_available;
4000b77c: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED
} else {
remaining = 0;
}
init_or_extend = extend;
4000b780: 10 80 00 04 b 4000b790 <_Workspace_Handler_initialization+0xe8><== NOT EXECUTED
4000b784: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED
4000b788: a0 10 00 1a mov %i2, %l0
area->size -= size;
if ( space_available < remaining ) {
remaining -= space_available;
} else {
remaining = 0;
4000b78c: 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) {
4000b790: b6 06 e0 01 inc %i3
4000b794: b0 06 20 08 add %i0, 8, %i0
4000b798: 80 a6 c0 19 cmp %i3, %i1
4000b79c: 12 bf ff d5 bne 4000b6f0 <_Workspace_Handler_initialization+0x48>
4000b7a0: 80 a4 60 00 cmp %l1, 0
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
4000b7a4: 80 a7 60 00 cmp %i5, 0
4000b7a8: 02 80 00 05 be 4000b7bc <_Workspace_Handler_initialization+0x114>
4000b7ac: 90 10 20 00 clr %o0
_Internal_error_Occurred(
4000b7b0: 92 10 20 01 mov 1, %o1
4000b7b4: 7f ff f6 ff call 400093b0 <_Internal_error_Occurred>
4000b7b8: 94 10 20 02 mov 2, %o2
4000b7bc: 81 c7 e0 08 ret
4000b7c0: 81 e8 00 00 restore
4000b730 <_Workspace_String_duplicate>:
char *_Workspace_String_duplicate(
const char *string,
size_t len
)
{
4000b730: 9d e3 bf a0 save %sp, -96, %sp
char *dup = _Workspace_Allocate(len + 1);
4000b734: 7f ff ff e3 call 4000b6c0 <_Workspace_Allocate>
4000b738: 90 06 60 01 add %i1, 1, %o0
if (dup != NULL) {
4000b73c: ba 92 20 00 orcc %o0, 0, %i5
4000b740: 02 80 00 05 be 4000b754 <_Workspace_String_duplicate+0x24><== NEVER TAKEN
4000b744: 92 10 00 18 mov %i0, %o1
dup [len] = '\0';
4000b748: c0 2f 40 19 clrb [ %i5 + %i1 ]
memcpy(dup, string, len);
4000b74c: 40 00 0f 7e call 4000f544 <memcpy>
4000b750: 94 10 00 19 mov %i1, %o2
}
return dup;
}
4000b754: 81 c7 e0 08 ret
4000b758: 91 e8 00 1d restore %g0, %i5, %o0
4000895c <rtems_chain_get_with_wait>:
rtems_chain_control *chain,
rtems_event_set events,
rtems_interval timeout,
rtems_chain_node **node_ptr
)
{
4000895c: 9d e3 bf 98 save %sp, -104, %sp
40008960: 30 80 00 08 b,a 40008980 <rtems_chain_get_with_wait+0x24>
while (
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
) {
rtems_event_set out;
sc = rtems_event_receive(
40008964: 92 10 20 00 clr %o1
40008968: 94 10 00 1a mov %i2, %o2
4000896c: 7f ff fc fb call 40007d58 <rtems_event_receive>
40008970: 96 07 bf fc add %fp, -4, %o3
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
40008974: 80 a2 20 00 cmp %o0, 0
40008978: 32 80 00 09 bne,a 4000899c <rtems_chain_get_with_wait+0x40><== ALWAYS TAKEN
4000897c: fa 26 c0 00 st %i5, [ %i3 ]
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
40008980: 40 00 01 67 call 40008f1c <_Chain_Get>
40008984: 90 10 00 18 mov %i0, %o0
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
40008988: ba 92 20 00 orcc %o0, 0, %i5
4000898c: 02 bf ff f6 be 40008964 <rtems_chain_get_with_wait+0x8>
40008990: 90 10 00 19 mov %i1, %o0
40008994: 90 10 20 00 clr %o0
timeout,
&out
);
}
*node_ptr = node;
40008998: fa 26 c0 00 st %i5, [ %i3 ]
return sc;
}
4000899c: 81 c7 e0 08 ret
400089a0: 91 e8 00 08 restore %g0, %o0, %o0
40011144 <rtems_event_system_receive>:
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
40011144: 9d e3 bf 98 save %sp, -104, %sp
rtems_status_code sc;
if ( event_out != NULL ) {
40011148: 80 a6 e0 00 cmp %i3, 0
4001114c: 02 80 00 1e be 400111c4 <rtems_event_system_receive+0x80> <== NEVER TAKEN
40011150: 82 10 20 09 mov 9, %g1
Thread_Control *executing = _Thread_Executing;
40011154: 03 10 00 6a sethi %hi(0x4001a800), %g1
40011158: fa 00 63 50 ld [ %g1 + 0x350 ], %i5 ! 4001ab50 <_Per_CPU_Information+0x10>
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
4001115c: 80 a6 20 00 cmp %i0, 0
40011160: 02 80 00 16 be 400111b8 <rtems_event_system_receive+0x74> <== NEVER TAKEN
40011164: da 07 61 4c ld [ %i5 + 0x14c ], %o5
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
40011168: 03 10 00 6a sethi %hi(0x4001a800), %g1
4001116c: c4 00 61 40 ld [ %g1 + 0x140 ], %g2 ! 4001a940 <_Thread_Dispatch_disable_level>
++level;
40011170: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40011174: c4 20 61 40 st %g2, [ %g1 + 0x140 ]
_Thread_Disable_dispatch();
_Event_Seize(
40011178: 03 10 00 6a sethi %hi(0x4001a800), %g1
4001117c: 82 10 63 a0 or %g1, 0x3a0, %g1 ! 4001aba0 <_System_event_Sync_state>
40011180: 90 10 00 18 mov %i0, %o0
40011184: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
40011188: 92 10 00 19 mov %i1, %o1
4001118c: 03 00 01 00 sethi %hi(0x40000), %g1
40011190: 94 10 00 1a mov %i2, %o2
40011194: 96 10 00 1b mov %i3, %o3
40011198: 98 10 00 1d mov %i5, %o4
4001119c: 9a 03 60 04 add %o5, 4, %o5
400111a0: 7f ff df 3f call 40008e9c <_Event_Seize>
400111a4: c2 23 a0 60 st %g1, [ %sp + 0x60 ]
executing,
event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
400111a8: 7f ff ea f7 call 4000bd84 <_Thread_Enable_dispatch>
400111ac: 01 00 00 00 nop
sc = executing->Wait.return_code;
400111b0: 10 80 00 05 b 400111c4 <rtems_event_system_receive+0x80>
400111b4: c2 07 60 34 ld [ %i5 + 0x34 ], %g1
} else {
*event_out = event->pending_events;
400111b8: c2 03 60 04 ld [ %o5 + 4 ], %g1 <== NOT EXECUTED
400111bc: c2 26 c0 00 st %g1, [ %i3 ] <== NOT EXECUTED
sc = RTEMS_SUCCESSFUL;
400111c0: 82 10 20 00 clr %g1 <== NOT EXECUTED
} else {
sc = RTEMS_INVALID_ADDRESS;
}
return sc;
}
400111c4: 81 c7 e0 08 ret
400111c8: 91 e8 00 01 restore %g0, %g1, %o0
400081c0 <rtems_event_system_send>:
rtems_status_code rtems_event_system_send(
rtems_id id,
rtems_event_set event_in
)
{
400081c0: 9d e3 bf 98 save %sp, -104, %sp
rtems_status_code sc;
Thread_Control *thread;
Objects_Locations location;
RTEMS_API_Control *api;
thread = _Thread_Get( id, &location );
400081c4: 90 10 00 18 mov %i0, %o0
400081c8: 40 00 09 99 call 4000a82c <_Thread_Get>
400081cc: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
400081d0: c4 07 bf fc ld [ %fp + -4 ], %g2
400081d4: 80 a0 a0 00 cmp %g2, 0
400081d8: 12 80 00 0d bne 4000820c <rtems_event_system_send+0x4c> <== NEVER TAKEN
400081dc: 92 10 00 19 mov %i1, %o1
case OBJECTS_LOCAL:
api = thread->API_Extensions[ THREAD_API_RTEMS ];
_Event_Surrender(
400081e0: d4 02 21 4c ld [ %o0 + 0x14c ], %o2
400081e4: 94 02 a0 04 add %o2, 4, %o2
400081e8: 19 00 01 00 sethi %hi(0x40000), %o4
400081ec: 17 10 00 78 sethi %hi(0x4001e000), %o3
400081f0: 96 12 e1 90 or %o3, 0x190, %o3 ! 4001e190 <_System_event_Sync_state>
400081f4: 7f ff fe 64 call 40007b84 <_Event_Surrender>
400081f8: b0 10 20 00 clr %i0
event_in,
&api->System_event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
400081fc: 40 00 09 80 call 4000a7fc <_Thread_Enable_dispatch>
40008200: 01 00 00 00 nop
sc = RTEMS_SUCCESSFUL;
break;
40008204: 81 c7 e0 08 ret
40008208: 81 e8 00 00 restore
sc = RTEMS_INVALID_ID;
break;
}
return sc;
}
4000820c: 81 c7 e0 08 ret <== NOT EXECUTED
40008210: 91 e8 20 04 restore %g0, 4, %o0 <== NOT EXECUTED
4000ac7c <rtems_iterate_over_all_threads>:
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
{
4000ac7c: 9d e3 bf a0 save %sp, -96, %sp
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
4000ac80: ba 10 20 01 mov 1, %i5
4000ac84: 80 a6 20 00 cmp %i0, 0
4000ac88: 02 80 00 0c be 4000acb8 <rtems_iterate_over_all_threads+0x3c><== NEVER TAKEN
4000ac8c: 35 10 00 82 sethi %hi(0x40020800), %i2
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
4000ac90: 83 2f 60 02 sll %i5, 2, %g1
if ( !routine )
return;
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
4000ac94: 84 16 a2 d4 or %i2, 0x2d4, %g2
4000ac98: c2 00 80 01 ld [ %g2 + %g1 ], %g1
4000ac9c: 80 a0 60 00 cmp %g1, 0
4000aca0: 32 80 00 08 bne,a 4000acc0 <rtems_iterate_over_all_threads+0x44>
4000aca4: f6 00 60 04 ld [ %g1 + 4 ], %i3
Objects_Information *information;
if ( !routine )
return;
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
4000aca8: ba 07 60 01 inc %i5
4000acac: 80 a7 60 04 cmp %i5, 4
4000acb0: 12 bf ff f9 bne 4000ac94 <rtems_iterate_over_all_threads+0x18>
4000acb4: 83 2f 60 02 sll %i5, 2, %g1
4000acb8: 81 c7 e0 08 ret
4000acbc: 81 e8 00 00 restore
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
4000acc0: 80 a6 e0 00 cmp %i3, 0
4000acc4: 02 bf ff f9 be 4000aca8 <rtems_iterate_over_all_threads+0x2c>
4000acc8: b8 10 20 01 mov 1, %i4
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
4000accc: 10 80 00 0a b 4000acf4 <rtems_iterate_over_all_threads+0x78>
4000acd0: c2 16 e0 10 lduh [ %i3 + 0x10 ], %g1
the_thread = (Thread_Control *)information->local_table[ i ];
4000acd4: 83 2f 20 02 sll %i4, 2, %g1
4000acd8: d0 00 80 01 ld [ %g2 + %g1 ], %o0
if ( !the_thread )
4000acdc: 80 a2 20 00 cmp %o0, 0
4000ace0: 02 80 00 04 be 4000acf0 <rtems_iterate_over_all_threads+0x74><== NEVER TAKEN
4000ace4: b8 07 20 01 inc %i4
continue;
(*routine)(the_thread);
4000ace8: 9f c6 00 00 call %i0
4000acec: 01 00 00 00 nop
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
4000acf0: c2 16 e0 10 lduh [ %i3 + 0x10 ], %g1
4000acf4: 80 a7 00 01 cmp %i4, %g1
4000acf8: 28 bf ff f7 bleu,a 4000acd4 <rtems_iterate_over_all_threads+0x58>
4000acfc: 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++ ) {
4000ad00: 10 bf ff eb b 4000acac <rtems_iterate_over_all_threads+0x30>
4000ad04: ba 07 60 01 inc %i5
40016a6c <rtems_partition_create>:
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
40016a6c: 9d e3 bf a0 save %sp, -96, %sp
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
40016a70: 80 a6 20 00 cmp %i0, 0
40016a74: 02 80 00 38 be 40016b54 <rtems_partition_create+0xe8>
40016a78: 82 10 20 03 mov 3, %g1
return RTEMS_INVALID_NAME;
if ( !starting_address )
40016a7c: 80 a6 60 00 cmp %i1, 0
40016a80: 02 80 00 35 be 40016b54 <rtems_partition_create+0xe8>
40016a84: 82 10 20 09 mov 9, %g1
return RTEMS_INVALID_ADDRESS;
if ( !id )
40016a88: 80 a7 60 00 cmp %i5, 0
40016a8c: 02 80 00 32 be 40016b54 <rtems_partition_create+0xe8> <== NEVER TAKEN
40016a90: 80 a6 e0 00 cmp %i3, 0
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
40016a94: 02 80 00 30 be 40016b54 <rtems_partition_create+0xe8>
40016a98: 82 10 20 08 mov 8, %g1
40016a9c: 80 a6 a0 00 cmp %i2, 0
40016aa0: 02 80 00 2d be 40016b54 <rtems_partition_create+0xe8>
40016aa4: 80 a6 80 1b cmp %i2, %i3
40016aa8: 0a 80 00 2b bcs 40016b54 <rtems_partition_create+0xe8>
40016aac: 80 8e e0 07 btst 7, %i3
40016ab0: 12 80 00 29 bne 40016b54 <rtems_partition_create+0xe8>
40016ab4: 80 8e 60 07 btst 7, %i1
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
40016ab8: 12 80 00 27 bne 40016b54 <rtems_partition_create+0xe8>
40016abc: 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;
40016ac0: 03 10 00 f4 sethi %hi(0x4003d000), %g1
40016ac4: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 4003d130 <_Thread_Dispatch_disable_level>
++level;
40016ac8: 84 00 a0 01 inc %g2
_Thread_Dispatch_disable_level = level;
40016acc: c4 20 61 30 st %g2, [ %g1 + 0x130 ]
* 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 );
40016ad0: 23 10 00 f3 sethi %hi(0x4003cc00), %l1
40016ad4: 40 00 12 fc call 4001b6c4 <_Objects_Allocate>
40016ad8: 90 14 63 2c or %l1, 0x32c, %o0 ! 4003cf2c <_Partition_Information>
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
40016adc: a0 92 20 00 orcc %o0, 0, %l0
40016ae0: 32 80 00 06 bne,a 40016af8 <rtems_partition_create+0x8c>
40016ae4: f8 24 20 1c st %i4, [ %l0 + 0x1c ]
_Thread_Enable_dispatch();
40016ae8: 40 00 17 ef call 4001caa4 <_Thread_Enable_dispatch>
40016aec: 01 00 00 00 nop
return RTEMS_TOO_MANY;
40016af0: 10 80 00 19 b 40016b54 <rtems_partition_create+0xe8>
40016af4: 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 );
40016af8: 92 10 00 1b mov %i3, %o1
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
40016afc: f2 24 20 10 st %i1, [ %l0 + 0x10 ]
the_partition->length = length;
40016b00: f4 24 20 14 st %i2, [ %l0 + 0x14 ]
the_partition->buffer_size = buffer_size;
40016b04: f6 24 20 18 st %i3, [ %l0 + 0x18 ]
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
40016b08: c0 24 20 20 clr [ %l0 + 0x20 ]
_Chain_Initialize( &the_partition->Memory, starting_address,
length / buffer_size, buffer_size );
40016b0c: 40 00 54 40 call 4002bc0c <.udiv>
40016b10: 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,
40016b14: 92 10 00 19 mov %i1, %o1
length / buffer_size, buffer_size );
40016b18: 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,
40016b1c: 96 10 00 1b mov %i3, %o3
40016b20: b8 04 20 24 add %l0, 0x24, %i4
40016b24: 40 00 0d 0c call 40019f54 <_Chain_Initialize>
40016b28: 90 10 00 1c mov %i4, %o0
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
40016b2c: c4 14 20 0a lduh [ %l0 + 0xa ], %g2
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40016b30: a2 14 63 2c or %l1, 0x32c, %l1
40016b34: c6 04 60 1c ld [ %l1 + 0x1c ], %g3
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
40016b38: c2 04 20 08 ld [ %l0 + 8 ], %g1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40016b3c: 85 28 a0 02 sll %g2, 2, %g2
40016b40: e0 20 c0 02 st %l0, [ %g3 + %g2 ]
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
40016b44: f0 24 20 0c st %i0, [ %l0 + 0xc ]
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
40016b48: 40 00 17 d7 call 4001caa4 <_Thread_Enable_dispatch>
40016b4c: c2 27 40 00 st %g1, [ %i5 ]
return RTEMS_SUCCESSFUL;
40016b50: 82 10 20 00 clr %g1
}
40016b54: 81 c7 e0 08 ret
40016b58: 91 e8 00 01 restore %g0, %g1, %o0
40016c88 <rtems_partition_return_buffer>:
rtems_status_code rtems_partition_return_buffer(
rtems_id id,
void *buffer
)
{
40016c88: 9d e3 bf 98 save %sp, -104, %sp
RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Partition_Control *)
40016c8c: 11 10 00 f3 sethi %hi(0x4003cc00), %o0
40016c90: 92 10 00 18 mov %i0, %o1
40016c94: 90 12 23 2c or %o0, 0x32c, %o0
40016c98: 40 00 13 e3 call 4001bc24 <_Objects_Get>
40016c9c: 94 07 bf fc add %fp, -4, %o2
register Partition_Control *the_partition;
Objects_Locations location;
the_partition = _Partition_Get( id, &location );
switch ( location ) {
40016ca0: c2 07 bf fc ld [ %fp + -4 ], %g1
40016ca4: 80 a0 60 00 cmp %g1, 0
40016ca8: 12 80 00 21 bne 40016d2c <rtems_partition_return_buffer+0xa4>
40016cac: ba 10 00 08 mov %o0, %i5
)
{
void *starting;
void *ending;
starting = the_partition->starting_address;
40016cb0: d0 02 20 10 ld [ %o0 + 0x10 ], %o0
40016cb4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1
40016cb8: 82 02 00 01 add %o0, %g1, %g1
ending = _Addresses_Add_offset( starting, the_partition->length );
return (
_Addresses_Is_in_range( the_buffer, starting, ending ) &&
40016cbc: 80 a6 40 01 cmp %i1, %g1
40016cc0: 18 80 00 0b bgu 40016cec <rtems_partition_return_buffer+0x64><== NEVER TAKEN
40016cc4: 82 10 20 00 clr %g1
40016cc8: 80 a6 40 08 cmp %i1, %o0
40016ccc: 0a 80 00 09 bcs 40016cf0 <rtems_partition_return_buffer+0x68>
40016cd0: 80 a0 60 00 cmp %g1, 0
offset = (uint32_t) _Addresses_Subtract(
the_buffer,
the_partition->starting_address
);
return ((offset % the_partition->buffer_size) == 0);
40016cd4: d2 07 60 18 ld [ %i5 + 0x18 ], %o1
40016cd8: 40 00 54 79 call 4002bebc <.urem>
40016cdc: 90 26 40 08 sub %i1, %o0, %o0
starting = the_partition->starting_address;
ending = _Addresses_Add_offset( starting, the_partition->length );
return (
_Addresses_Is_in_range( the_buffer, starting, ending ) &&
40016ce0: 80 a0 00 08 cmp %g0, %o0
40016ce4: 10 80 00 02 b 40016cec <rtems_partition_return_buffer+0x64>
40016ce8: 82 60 3f ff subx %g0, -1, %g1
case OBJECTS_LOCAL:
if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) {
40016cec: 80 a0 60 00 cmp %g1, 0
40016cf0: 02 80 00 0b be 40016d1c <rtems_partition_return_buffer+0x94>
40016cf4: 90 07 60 24 add %i5, 0x24, %o0
RTEMS_INLINE_ROUTINE void _Partition_Free_buffer (
Partition_Control *the_partition,
Chain_Node *the_buffer
)
{
_Chain_Append( &the_partition->Memory, the_buffer );
40016cf8: 40 00 0c 7c call 40019ee8 <_Chain_Append>
40016cfc: 92 10 00 19 mov %i1, %o1
_Partition_Free_buffer( the_partition, buffer );
the_partition->number_of_used_blocks -= 1;
40016d00: c2 07 60 20 ld [ %i5 + 0x20 ], %g1
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
40016d04: b0 10 20 00 clr %i0
switch ( location ) {
case OBJECTS_LOCAL:
if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) {
_Partition_Free_buffer( the_partition, buffer );
the_partition->number_of_used_blocks -= 1;
40016d08: 82 00 7f ff add %g1, -1, %g1
_Thread_Enable_dispatch();
40016d0c: 40 00 17 66 call 4001caa4 <_Thread_Enable_dispatch>
40016d10: c2 27 60 20 st %g1, [ %i5 + 0x20 ]
40016d14: 81 c7 e0 08 ret
40016d18: 81 e8 00 00 restore
return RTEMS_SUCCESSFUL;
}
_Thread_Enable_dispatch();
40016d1c: 40 00 17 62 call 4001caa4 <_Thread_Enable_dispatch>
40016d20: b0 10 20 09 mov 9, %i0
40016d24: 81 c7 e0 08 ret
40016d28: 81 e8 00 00 restore
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
40016d2c: 81 c7 e0 08 ret
40016d30: 91 e8 20 04 restore %g0, 4, %o0
40032b70 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
40032b70: 9d e3 bf 98 save %sp, -104, %sp
40032b74: 11 10 01 8c sethi %hi(0x40063000), %o0
40032b78: 92 10 00 18 mov %i0, %o1
40032b7c: 90 12 22 a8 or %o0, 0x2a8, %o0
40032b80: 7f ff 59 f8 call 40009360 <_Objects_Get>
40032b84: 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 ) {
40032b88: c2 07 bf fc ld [ %fp + -4 ], %g1
40032b8c: 80 a0 60 00 cmp %g1, 0
40032b90: 12 80 00 6a bne 40032d38 <rtems_rate_monotonic_period+0x1c8>
40032b94: ba 10 00 08 mov %o0, %i5
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
40032b98: 37 10 01 8c sethi %hi(0x40063000), %i3
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
40032b9c: c4 02 20 40 ld [ %o0 + 0x40 ], %g2
40032ba0: b6 16 e0 80 or %i3, 0x80, %i3
40032ba4: c2 06 e0 10 ld [ %i3 + 0x10 ], %g1
40032ba8: 80 a0 80 01 cmp %g2, %g1
40032bac: 02 80 00 06 be 40032bc4 <rtems_rate_monotonic_period+0x54>
40032bb0: 80 a6 60 00 cmp %i1, 0
_Thread_Enable_dispatch();
40032bb4: 7f ff 5d 61 call 4000a138 <_Thread_Enable_dispatch>
40032bb8: b0 10 20 17 mov 0x17, %i0
40032bbc: 81 c7 e0 08 ret
40032bc0: 81 e8 00 00 restore
return RTEMS_NOT_OWNER_OF_RESOURCE;
}
if ( length == RTEMS_PERIOD_STATUS ) {
40032bc4: 12 80 00 0d bne 40032bf8 <rtems_rate_monotonic_period+0x88>
40032bc8: 01 00 00 00 nop
switch ( the_period->state ) {
40032bcc: c2 02 20 38 ld [ %o0 + 0x38 ], %g1
40032bd0: 80 a0 60 04 cmp %g1, 4
40032bd4: 18 80 00 05 bgu 40032be8 <rtems_rate_monotonic_period+0x78><== NEVER TAKEN
40032bd8: b0 10 20 00 clr %i0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
40032bdc: 05 10 01 72 sethi %hi(0x4005c800), %g2
40032be0: 84 10 a3 d0 or %g2, 0x3d0, %g2 ! 4005cbd0 <CSWTCH.24>
40032be4: f0 08 80 01 ldub [ %g2 + %g1 ], %i0
case RATE_MONOTONIC_ACTIVE:
default: /* unreached -- only to remove warnings */
return_value = RTEMS_SUCCESSFUL;
break;
}
_Thread_Enable_dispatch();
40032be8: 7f ff 5d 54 call 4000a138 <_Thread_Enable_dispatch>
40032bec: 01 00 00 00 nop
40032bf0: 81 c7 e0 08 ret
40032bf4: 81 e8 00 00 restore
return( return_value );
}
_ISR_Disable( level );
40032bf8: 7f ff 3d 77 call 400021d4 <sparc_disable_interrupts>
40032bfc: 01 00 00 00 nop
40032c00: b4 10 00 08 mov %o0, %i2
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
40032c04: f8 07 60 38 ld [ %i5 + 0x38 ], %i4
40032c08: 80 a7 20 00 cmp %i4, 0
40032c0c: 12 80 00 15 bne 40032c60 <rtems_rate_monotonic_period+0xf0>
40032c10: 80 a7 20 02 cmp %i4, 2
_ISR_Enable( level );
40032c14: 7f ff 3d 74 call 400021e4 <sparc_enable_interrupts>
40032c18: 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 );
40032c1c: 90 10 00 1d mov %i5, %o0
40032c20: 7f ff ff b8 call 40032b00 <_Rate_monotonic_Initiate_statistics>
40032c24: f2 27 60 3c st %i1, [ %i5 + 0x3c ]
the_period->state = RATE_MONOTONIC_ACTIVE;
40032c28: 82 10 20 02 mov 2, %g1
40032c2c: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
40032c30: 03 10 00 cb sethi %hi(0x40032c00), %g1
40032c34: 82 10 61 44 or %g1, 0x144, %g1 ! 40032d44 <_Rate_monotonic_Timeout>
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
40032c38: c0 27 60 18 clr [ %i5 + 0x18 ]
the_watchdog->routine = routine;
40032c3c: c2 27 60 2c st %g1, [ %i5 + 0x2c ]
the_watchdog->id = id;
40032c40: f0 27 60 30 st %i0, [ %i5 + 0x30 ]
the_watchdog->user_data = user_data;
40032c44: c0 27 60 34 clr [ %i5 + 0x34 ]
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40032c48: f2 27 60 1c st %i1, [ %i5 + 0x1c ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40032c4c: 11 10 01 8b sethi %hi(0x40062c00), %o0
40032c50: 92 07 60 10 add %i5, 0x10, %o1
40032c54: 7f ff 60 3a call 4000ad3c <_Watchdog_Insert>
40032c58: 90 12 23 18 or %o0, 0x318, %o0
40032c5c: 30 80 00 1b b,a 40032cc8 <rtems_rate_monotonic_period+0x158>
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_ACTIVE ) {
40032c60: 12 80 00 1e bne 40032cd8 <rtems_rate_monotonic_period+0x168>
40032c64: 80 a7 20 04 cmp %i4, 4
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
40032c68: 7f ff ff 5d call 400329dc <_Rate_monotonic_Update_statistics>
40032c6c: 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;
40032c70: 82 10 20 01 mov 1, %g1
the_period->next_length = length;
40032c74: 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;
40032c78: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
the_period->next_length = length;
_ISR_Enable( level );
40032c7c: 7f ff 3d 5a call 400021e4 <sparc_enable_interrupts>
40032c80: 90 10 00 1a mov %i2, %o0
_Thread_Executing->Wait.id = the_period->Object.id;
40032c84: d0 06 e0 10 ld [ %i3 + 0x10 ], %o0
40032c88: c2 07 60 08 ld [ %i5 + 8 ], %g1
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
40032c8c: 13 00 00 10 sethi %hi(0x4000), %o1
40032c90: 7f ff 5f 48 call 4000a9b0 <_Thread_Set_state>
40032c94: c2 22 20 20 st %g1, [ %o0 + 0x20 ]
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
40032c98: 7f ff 3d 4f call 400021d4 <sparc_disable_interrupts>
40032c9c: 01 00 00 00 nop
local_state = the_period->state;
40032ca0: f4 07 60 38 ld [ %i5 + 0x38 ], %i2
the_period->state = RATE_MONOTONIC_ACTIVE;
40032ca4: f8 27 60 38 st %i4, [ %i5 + 0x38 ]
_ISR_Enable( level );
40032ca8: 7f ff 3d 4f call 400021e4 <sparc_enable_interrupts>
40032cac: 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 )
40032cb0: 80 a6 a0 03 cmp %i2, 3
40032cb4: 12 80 00 05 bne 40032cc8 <rtems_rate_monotonic_period+0x158>
40032cb8: 01 00 00 00 nop
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
40032cbc: d0 06 e0 10 ld [ %i3 + 0x10 ], %o0
40032cc0: 7f ff 5c 48 call 40009de0 <_Thread_Clear_state>
40032cc4: 13 00 00 10 sethi %hi(0x4000), %o1
_Thread_Enable_dispatch();
40032cc8: 7f ff 5d 1c call 4000a138 <_Thread_Enable_dispatch>
40032ccc: b0 10 20 00 clr %i0
40032cd0: 81 c7 e0 08 ret
40032cd4: 81 e8 00 00 restore
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_EXPIRED ) {
40032cd8: 12 bf ff b9 bne 40032bbc <rtems_rate_monotonic_period+0x4c><== NEVER TAKEN
40032cdc: b0 10 20 04 mov 4, %i0
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
40032ce0: 7f ff ff 3f call 400329dc <_Rate_monotonic_Update_statistics>
40032ce4: 90 10 00 1d mov %i5, %o0
_ISR_Enable( level );
40032ce8: 7f ff 3d 3f call 400021e4 <sparc_enable_interrupts>
40032cec: 90 10 00 1a mov %i2, %o0
the_period->state = RATE_MONOTONIC_ACTIVE;
40032cf0: 82 10 20 02 mov 2, %g1
40032cf4: 92 07 60 10 add %i5, 0x10, %o1
40032cf8: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
the_period->next_length = length;
40032cfc: f2 27 60 3c st %i1, [ %i5 + 0x3c ]
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40032d00: f2 27 60 1c st %i1, [ %i5 + 0x1c ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40032d04: 11 10 01 8b sethi %hi(0x40062c00), %o0
40032d08: 7f ff 60 0d call 4000ad3c <_Watchdog_Insert>
40032d0c: 90 12 23 18 or %o0, 0x318, %o0 ! 40062f18 <_Watchdog_Ticks_chain>
40032d10: d0 07 60 40 ld [ %i5 + 0x40 ], %o0
40032d14: d2 07 60 3c ld [ %i5 + 0x3c ], %o1
40032d18: 03 10 01 7a sethi %hi(0x4005e800), %g1
40032d1c: c2 00 62 94 ld [ %g1 + 0x294 ], %g1 ! 4005ea94 <_Scheduler+0x34>
40032d20: 9f c0 40 00 call %g1
40032d24: b0 10 20 06 mov 6, %i0
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Scheduler_Release_job(the_period->owner, the_period->next_length);
_Thread_Enable_dispatch();
40032d28: 7f ff 5d 04 call 4000a138 <_Thread_Enable_dispatch>
40032d2c: 01 00 00 00 nop
40032d30: 81 c7 e0 08 ret
40032d34: 81 e8 00 00 restore
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
40032d38: b0 10 20 04 mov 4, %i0
}
40032d3c: 81 c7 e0 08 ret
40032d40: 81 e8 00 00 restore
40025c30 <rtems_rate_monotonic_report_statistics_with_plugin>:
void rtems_rate_monotonic_report_statistics_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
40025c30: 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 )
40025c34: 80 a6 60 00 cmp %i1, 0
40025c38: 02 80 00 75 be 40025e0c <rtems_rate_monotonic_report_statistics_with_plugin+0x1dc><== NEVER TAKEN
40025c3c: 90 10 00 18 mov %i0, %o0
return;
(*print)( context, "Period information by period\n" );
40025c40: 13 10 01 67 sethi %hi(0x40059c00), %o1
40025c44: 9f c6 40 00 call %i1
40025c48: 92 12 62 20 or %o1, 0x220, %o1 ! 40059e20 <_TOD_Days_per_month+0x68>
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)( context, "--- CPU times are in seconds ---\n" );
40025c4c: 90 10 00 18 mov %i0, %o0
40025c50: 13 10 01 67 sethi %hi(0x40059c00), %o1
40025c54: 9f c6 40 00 call %i1
40025c58: 92 12 62 40 or %o1, 0x240, %o1 ! 40059e40 <_TOD_Days_per_month+0x88>
(*print)( context, "--- Wall times are in seconds ---\n" );
40025c5c: 90 10 00 18 mov %i0, %o0
40025c60: 13 10 01 67 sethi %hi(0x40059c00), %o1
40025c64: 9f c6 40 00 call %i1
40025c68: 92 12 62 68 or %o1, 0x268, %o1 ! 40059e68 <_TOD_Days_per_month+0xb0>
Be sure to test the various cases.
(*print)( context,"\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
*/
(*print)( context, " ID OWNER COUNT MISSED "
40025c6c: 90 10 00 18 mov %i0, %o0
40025c70: 13 10 01 67 sethi %hi(0x40059c00), %o1
40025c74: 9f c6 40 00 call %i1
40025c78: 92 12 62 90 or %o1, 0x290, %o1 ! 40059e90 <_TOD_Days_per_month+0xd8>
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
" "
#endif
" WALL TIME\n"
);
(*print)( context, " "
40025c7c: 90 10 00 18 mov %i0, %o0
40025c80: 13 10 01 67 sethi %hi(0x40059c00), %o1
40025c84: 9f c6 40 00 call %i1
40025c88: 92 12 62 e0 or %o1, 0x2e0, %o1 ! 40059ee0 <_TOD_Days_per_month+0x128>
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
40025c8c: 03 10 01 8c sethi %hi(0x40063000), %g1
rtems_object_get_name( the_status.owner, sizeof(name), name );
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
40025c90: 39 10 01 67 sethi %hi(0x40059c00), %i4
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
(*print)( context,
40025c94: 37 10 01 67 sethi %hi(0x40059c00), %i3
struct timespec *min_wall = &the_stats.min_wall_time;
struct timespec *max_wall = &the_stats.max_wall_time;
struct timespec *total_wall = &the_stats.total_wall_time;
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
40025c98: 35 10 01 67 sethi %hi(0x40059c00), %i2
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
40025c9c: 21 10 01 6c sethi %hi(0x4005b000), %l0
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
40025ca0: fa 00 62 b0 ld [ %g1 + 0x2b0 ], %i5
rtems_object_get_name( the_status.owner, sizeof(name), name );
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
40025ca4: b8 17 23 30 or %i4, 0x330, %i4
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
(*print)( context,
40025ca8: b6 16 e3 48 or %i3, 0x348, %i3
struct timespec *min_wall = &the_stats.min_wall_time;
struct timespec *max_wall = &the_stats.max_wall_time;
struct timespec *total_wall = &the_stats.total_wall_time;
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
40025cac: b4 16 a3 68 or %i2, 0x368, %i2
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
40025cb0: 10 80 00 52 b 40025df8 <rtems_rate_monotonic_report_statistics_with_plugin+0x1c8>
40025cb4: a0 14 23 f8 or %l0, 0x3f8, %l0
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
40025cb8: 40 00 32 6b call 40032664 <rtems_rate_monotonic_get_statistics>
40025cbc: 92 07 bf c8 add %fp, -56, %o1
if ( status != RTEMS_SUCCESSFUL )
40025cc0: 80 a2 20 00 cmp %o0, 0
40025cc4: 32 80 00 4d bne,a 40025df8 <rtems_rate_monotonic_report_statistics_with_plugin+0x1c8>
40025cc8: 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 );
40025ccc: 92 07 bf b0 add %fp, -80, %o1
40025cd0: 40 00 32 d6 call 40032828 <rtems_rate_monotonic_get_status>
40025cd4: 90 10 00 1d mov %i5, %o0
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
40025cd8: d0 07 bf b0 ld [ %fp + -80 ], %o0
40025cdc: 92 10 20 05 mov 5, %o1
40025ce0: 7f ff a3 9a call 4000eb48 <rtems_object_get_name>
40025ce4: 94 07 bf a0 add %fp, -96, %o2
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
40025ce8: d8 1f bf c8 ldd [ %fp + -56 ], %o4
40025cec: 92 10 00 1c mov %i4, %o1
40025cf0: 90 10 00 18 mov %i0, %o0
40025cf4: 94 10 00 1d mov %i5, %o2
40025cf8: 9f c6 40 00 call %i1
40025cfc: 96 07 bf a0 add %fp, -96, %o3
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
40025d00: d2 07 bf c8 ld [ %fp + -56 ], %o1
40025d04: 80 a2 60 00 cmp %o1, 0
40025d08: 12 80 00 07 bne 40025d24 <rtems_rate_monotonic_report_statistics_with_plugin+0xf4>
40025d0c: 94 07 bf a8 add %fp, -88, %o2
(*print)( context, "\n" );
40025d10: 90 10 00 18 mov %i0, %o0
40025d14: 9f c6 40 00 call %i1
40025d18: 92 10 00 10 mov %l0, %o1
continue;
40025d1c: 10 80 00 37 b 40025df8 <rtems_rate_monotonic_report_statistics_with_plugin+0x1c8>
40025d20: 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 );
40025d24: 40 00 03 21 call 400269a8 <_Timespec_Divide_by_integer>
40025d28: 90 07 bf e0 add %fp, -32, %o0
(*print)( context,
40025d2c: d0 07 bf d4 ld [ %fp + -44 ], %o0
40025d30: 40 00 a8 c6 call 40050048 <.div>
40025d34: 92 10 23 e8 mov 0x3e8, %o1
40025d38: a6 10 00 08 mov %o0, %l3
40025d3c: d0 07 bf dc ld [ %fp + -36 ], %o0
40025d40: 40 00 a8 c2 call 40050048 <.div>
40025d44: 92 10 23 e8 mov 0x3e8, %o1
40025d48: c2 07 bf a8 ld [ %fp + -88 ], %g1
40025d4c: a2 10 00 08 mov %o0, %l1
40025d50: d0 07 bf ac ld [ %fp + -84 ], %o0
40025d54: e8 07 bf d0 ld [ %fp + -48 ], %l4
40025d58: e4 07 bf d8 ld [ %fp + -40 ], %l2
40025d5c: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
40025d60: 40 00 a8 ba call 40050048 <.div>
40025d64: 92 10 23 e8 mov 0x3e8, %o1
40025d68: 96 10 00 13 mov %l3, %o3
40025d6c: 98 10 00 12 mov %l2, %o4
40025d70: 9a 10 00 11 mov %l1, %o5
40025d74: 94 10 00 14 mov %l4, %o2
40025d78: d0 23 a0 60 st %o0, [ %sp + 0x60 ]
40025d7c: 92 10 00 1b mov %i3, %o1
40025d80: 9f c6 40 00 call %i1
40025d84: 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);
40025d88: d2 07 bf c8 ld [ %fp + -56 ], %o1
40025d8c: 94 07 bf a8 add %fp, -88, %o2
40025d90: 40 00 03 06 call 400269a8 <_Timespec_Divide_by_integer>
40025d94: 90 07 bf f8 add %fp, -8, %o0
(*print)( context,
40025d98: d0 07 bf ec ld [ %fp + -20 ], %o0
40025d9c: 40 00 a8 ab call 40050048 <.div>
40025da0: 92 10 23 e8 mov 0x3e8, %o1
40025da4: a6 10 00 08 mov %o0, %l3
40025da8: d0 07 bf f4 ld [ %fp + -12 ], %o0
40025dac: 40 00 a8 a7 call 40050048 <.div>
40025db0: 92 10 23 e8 mov 0x3e8, %o1
40025db4: c2 07 bf a8 ld [ %fp + -88 ], %g1
40025db8: a2 10 00 08 mov %o0, %l1
40025dbc: d0 07 bf ac ld [ %fp + -84 ], %o0
40025dc0: e8 07 bf e8 ld [ %fp + -24 ], %l4
40025dc4: e4 07 bf f0 ld [ %fp + -16 ], %l2
40025dc8: 92 10 23 e8 mov 0x3e8, %o1
40025dcc: 40 00 a8 9f call 40050048 <.div>
40025dd0: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
40025dd4: 92 10 00 1a mov %i2, %o1
40025dd8: d0 23 a0 60 st %o0, [ %sp + 0x60 ]
40025ddc: 94 10 00 14 mov %l4, %o2
40025de0: 90 10 00 18 mov %i0, %o0
40025de4: 96 10 00 13 mov %l3, %o3
40025de8: 98 10 00 12 mov %l2, %o4
40025dec: 9f c6 40 00 call %i1
40025df0: 9a 10 00 11 mov %l1, %o5
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
40025df4: ba 07 60 01 inc %i5
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
id <= _Rate_monotonic_Information.maximum_id ;
40025df8: 03 10 01 8c sethi %hi(0x40063000), %g1
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
40025dfc: c2 00 62 b4 ld [ %g1 + 0x2b4 ], %g1 ! 400632b4 <_Rate_monotonic_Information+0xc>
40025e00: 80 a7 40 01 cmp %i5, %g1
40025e04: 08 bf ff ad bleu 40025cb8 <rtems_rate_monotonic_report_statistics_with_plugin+0x88>
40025e08: 90 10 00 1d mov %i5, %o0
40025e0c: 81 c7 e0 08 ret
40025e10: 81 e8 00 00 restore
40008e10 <rtems_rbheap_allocate>:
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
40008e10: 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;
40008e14: 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;
40008e18: 90 10 00 19 mov %i1, %o0
40008e1c: 92 10 00 1d mov %i5, %o1
40008e20: 40 00 2a 1f call 4001369c <.urem>
40008e24: b6 10 00 19 mov %i1, %i3
if (excess > 0) {
40008e28: 80 a2 20 00 cmp %o0, 0
40008e2c: 02 80 00 05 be 40008e40 <rtems_rbheap_allocate+0x30> <== ALWAYS TAKEN
40008e30: 80 a6 c0 19 cmp %i3, %i1
value += alignment - excess;
40008e34: b6 06 40 1d add %i1, %i5, %i3 <== NOT EXECUTED
40008e38: b6 26 c0 08 sub %i3, %o0, %i3 <== NOT EXECUTED
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
40008e3c: 80 a6 c0 19 cmp %i3, %i1 <== NOT EXECUTED
40008e40: 0a 80 00 04 bcs 40008e50 <rtems_rbheap_allocate+0x40> <== NEVER TAKEN
40008e44: 80 a6 60 00 cmp %i1, 0
40008e48: 32 80 00 04 bne,a 40008e58 <rtems_rbheap_allocate+0x48>
40008e4c: c2 06 00 00 ld [ %i0 ], %g1
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
40008e50: 81 c7 e0 08 ret
40008e54: 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);
40008e58: 84 06 20 04 add %i0, 4, %g2
rtems_rbheap_chunk *big_enough = NULL;
40008e5c: 10 80 00 06 b 40008e74 <rtems_rbheap_allocate+0x64>
40008e60: ba 10 20 00 clr %i5
while (current != tail && big_enough == NULL) {
rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current;
if (free_chunk->size >= size) {
40008e64: 80 a0 c0 1b cmp %g3, %i3
40008e68: ba 40 3f ff addx %g0, -1, %i5
40008e6c: ba 08 40 1d and %g1, %i5, %i5
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
40008e70: c2 00 40 00 ld [ %g1 ], %g1
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
rtems_rbheap_chunk *big_enough = NULL;
while (current != tail && big_enough == NULL) {
40008e74: 80 a7 60 00 cmp %i5, 0
40008e78: 12 80 00 04 bne 40008e88 <rtems_rbheap_allocate+0x78>
40008e7c: 80 a0 40 02 cmp %g1, %g2
40008e80: 32 bf ff f9 bne,a 40008e64 <rtems_rbheap_allocate+0x54>
40008e84: c6 00 60 1c ld [ %g1 + 0x1c ], %g3
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size);
if (free_chunk != NULL) {
40008e88: 80 a7 60 00 cmp %i5, 0
40008e8c: 02 bf ff f1 be 40008e50 <rtems_rbheap_allocate+0x40>
40008e90: 01 00 00 00 nop
uintptr_t free_size = free_chunk->size;
40008e94: f4 07 60 1c ld [ %i5 + 0x1c ], %i2
if (free_size > aligned_size) {
40008e98: 80 a6 80 1b cmp %i2, %i3
40008e9c: 28 80 00 14 bleu,a 40008eec <rtems_rbheap_allocate+0xdc>
40008ea0: c4 07 40 00 ld [ %i5 ], %g2
rtems_rbheap_chunk *new_chunk = get_chunk(control);
40008ea4: 7f ff ff 80 call 40008ca4 <get_chunk>
40008ea8: 90 10 00 18 mov %i0, %o0
if (new_chunk != NULL) {
40008eac: b8 92 20 00 orcc %o0, 0, %i4
40008eb0: 02 bf ff e8 be 40008e50 <rtems_rbheap_allocate+0x40> <== NEVER TAKEN
40008eb4: 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;
40008eb8: 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;
40008ebc: f4 27 60 1c st %i2, [ %i5 + 0x1c ]
new_chunk->begin = free_chunk->begin + new_free_size;
new_chunk->size = aligned_size;
40008ec0: 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;
40008ec4: b4 06 80 01 add %i2, %g1, %i2
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
40008ec8: c0 27 20 04 clr [ %i4 + 4 ]
40008ecc: f4 27 20 18 st %i2, [ %i4 + 0x18 ]
40008ed0: c0 27 00 00 clr [ %i4 ]
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
40008ed4: 90 06 20 18 add %i0, 0x18, %o0
40008ed8: 40 00 06 8e call 4000a910 <_RBTree_Insert_unprotected>
40008edc: 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;
40008ee0: f0 07 20 18 ld [ %i4 + 0x18 ], %i0
40008ee4: 81 c7 e0 08 ret
40008ee8: 81 e8 00 00 restore
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
40008eec: 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;
40008ef0: f0 07 60 18 ld [ %i5 + 0x18 ], %i0
next->previous = previous;
40008ef4: c2 20 a0 04 st %g1, [ %g2 + 4 ]
previous->next = next;
40008ef8: c4 20 40 00 st %g2, [ %g1 ]
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
40008efc: c0 27 60 04 clr [ %i5 + 4 ]
40008f00: c0 27 40 00 clr [ %i5 ]
}
}
}
return ptr;
}
40008f04: 81 c7 e0 08 ret
40008f08: 81 e8 00 00 restore
4000903c <rtems_rbheap_extend_descriptors_with_malloc>:
/* Do nothing */
}
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
4000903c: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
40009040: 7f ff ee 03 call 4000484c <malloc> <== NOT EXECUTED
40009044: 90 10 20 20 mov 0x20, %o0 <== NOT EXECUTED
if (chunk != NULL) {
40009048: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED
4000904c: 02 80 00 07 be 40009068 <rtems_rbheap_extend_descriptors_with_malloc+0x2c><== NOT EXECUTED
40009050: 82 06 20 0c add %i0, 0xc, %g1 <== NOT EXECUTED
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
40009054: c2 22 20 04 st %g1, [ %o0 + 4 ] <== NOT EXECUTED
before_node = after_node->next;
40009058: c2 06 20 0c ld [ %i0 + 0xc ], %g1 <== NOT EXECUTED
after_node->next = the_node;
4000905c: d0 26 20 0c st %o0, [ %i0 + 0xc ] <== NOT EXECUTED
the_node->next = before_node;
40009060: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED
before_node->previous = the_node;
40009064: d0 20 60 04 st %o0, [ %g1 + 4 ] <== NOT EXECUTED
40009068: 81 c7 e0 08 ret <== NOT EXECUTED
4000906c: 81 e8 00 00 restore <== NOT EXECUTED
40008f0c <rtems_rbheap_free>:
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
40008f0c: 9d e3 bf 80 save %sp, -128, %sp
40008f10: b6 10 00 18 mov %i0, %i3
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
40008f14: 80 a6 60 00 cmp %i1, 0
40008f18: 02 80 00 45 be 4000902c <rtems_rbheap_free+0x120>
40008f1c: b0 10 20 00 clr %i0
#define NULL_PAGE rtems_rbheap_chunk_of_node(NULL)
static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)
{
rtems_rbheap_chunk chunk = { .begin = key };
40008f20: 90 07 bf e0 add %fp, -32, %o0
40008f24: 92 10 20 00 clr %o1
40008f28: 94 10 20 20 mov 0x20, %o2
40008f2c: 40 00 1d bf call 40010628 <memset>
40008f30: b4 06 e0 18 add %i3, 0x18, %i2
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
40008f34: ba 10 20 00 clr %i5
40008f38: f2 27 bf f8 st %i1, [ %fp + -8 ]
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
40008f3c: 10 80 00 12 b 40008f84 <rtems_rbheap_free+0x78>
40008f40: f8 06 e0 1c ld [ %i3 + 0x1c ], %i4
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
40008f44: 90 07 bf e8 add %fp, -24, %o0
40008f48: 9f c0 40 00 call %g1
40008f4c: 92 10 00 1c mov %i4, %o1
if ( _RBTree_Is_equal( compare_result ) ) {
40008f50: 80 a2 20 00 cmp %o0, 0
40008f54: 12 80 00 07 bne 40008f70 <rtems_rbheap_free+0x64>
40008f58: 83 3a 20 1f sra %o0, 0x1f, %g1
found = iter_node;
if ( the_rbtree->is_unique )
40008f5c: c2 0e a0 14 ldub [ %i2 + 0x14 ], %g1
40008f60: 80 a0 60 00 cmp %g1, 0
40008f64: 12 80 00 0c bne 40008f94 <rtems_rbheap_free+0x88> <== ALWAYS TAKEN
40008f68: ba 10 00 1c mov %i4, %i5
RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater(
int compare_result
)
{
return compare_result > 0;
40008f6c: 83 3a 20 1f sra %o0, 0x1f, %g1 <== NOT EXECUTED
40008f70: 90 20 40 08 sub %g1, %o0, %o0
40008f74: 91 32 20 1f srl %o0, 0x1f, %o0
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
40008f78: 91 2a 20 02 sll %o0, 2, %o0
40008f7c: b8 07 00 08 add %i4, %o0, %i4
40008f80: f8 07 20 04 ld [ %i4 + 4 ], %i4
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
40008f84: 80 a7 20 00 cmp %i4, 0
40008f88: 32 bf ff ef bne,a 40008f44 <rtems_rbheap_free+0x38>
40008f8c: c2 06 a0 10 ld [ %i2 + 0x10 ], %g1
40008f90: b8 10 00 1d mov %i5, %i4
return rtems_rbheap_chunk_of_node(
40008f94: ba 07 3f f8 add %i4, -8, %i5
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
40008f98: 80 a7 7f f8 cmp %i5, -8
40008f9c: 02 80 00 24 be 4000902c <rtems_rbheap_free+0x120>
40008fa0: b0 10 20 04 mov 4, %i0
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
40008fa4: c4 07 3f f8 ld [ %i4 + -8 ], %g2
40008fa8: 80 a0 a0 00 cmp %g2, 0
40008fac: 12 80 00 05 bne 40008fc0 <rtems_rbheap_free+0xb4>
40008fb0: 82 10 20 00 clr %g1
40008fb4: c2 07 60 04 ld [ %i5 + 4 ], %g1
40008fb8: 80 a0 00 01 cmp %g0, %g1
40008fbc: 82 60 3f ff subx %g0, -1, %g1
if (!rtems_rbheap_is_chunk_free(chunk)) {
40008fc0: 80 a0 60 00 cmp %g1, 0
40008fc4: 02 80 00 1a be 4000902c <rtems_rbheap_free+0x120>
40008fc8: b0 10 20 0e mov 0xe, %i0
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
40008fcc: b8 07 60 08 add %i5, 8, %i4
40008fd0: 92 10 20 00 clr %o1
40008fd4: 40 00 06 f4 call 4000aba4 <_RBTree_Next_unprotected>
40008fd8: 90 10 00 1c mov %i4, %o0
40008fdc: 92 10 20 01 mov 1, %o1
40008fe0: b2 10 00 08 mov %o0, %i1
40008fe4: 40 00 06 f0 call 4000aba4 <_RBTree_Next_unprotected>
40008fe8: 90 10 00 1c mov %i4, %o0
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT);
rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT);
check_and_merge(free_chain, chunk_tree, chunk, succ);
40008fec: 92 10 00 1a mov %i2, %o1
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
40008ff0: 96 02 3f f8 add %o0, -8, %o3
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT);
rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT);
check_and_merge(free_chain, chunk_tree, chunk, succ);
40008ff4: 94 10 00 1d mov %i5, %o2
40008ff8: 7f ff ff 02 call 40008c00 <check_and_merge>
40008ffc: 90 10 00 1b mov %i3, %o0
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
40009000: c2 06 c0 00 ld [ %i3 ], %g1
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
40009004: f6 27 60 04 st %i3, [ %i5 + 4 ]
before_node = after_node->next;
after_node->next = the_node;
40009008: fa 26 c0 00 st %i5, [ %i3 ]
the_node->next = before_node;
4000900c: c2 27 40 00 st %g1, [ %i5 ]
before_node->previous = the_node;
40009010: fa 20 60 04 st %i5, [ %g1 + 4 ]
add_to_chain(free_chain, chunk);
check_and_merge(free_chain, chunk_tree, chunk, pred);
40009014: 90 10 00 1b mov %i3, %o0
40009018: 92 10 00 1a mov %i2, %o1
4000901c: 94 10 00 1d mov %i5, %o2
40009020: 96 06 7f f8 add %i1, -8, %o3
40009024: 7f ff fe f7 call 40008c00 <check_and_merge>
40009028: b0 10 20 00 clr %i0
sc = RTEMS_INVALID_ID;
}
}
return sc;
}
4000902c: 81 c7 e0 08 ret
40009030: 81 e8 00 00 restore
400181c0 <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
400181c0: 9d e3 bf 98 save %sp, -104, %sp
register Thread_Control *the_thread;
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
400181c4: 80 a6 60 00 cmp %i1, 0
400181c8: 02 80 00 35 be 4001829c <rtems_signal_send+0xdc>
400181cc: 82 10 20 0a mov 0xa, %g1
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
400181d0: 90 10 00 18 mov %i0, %o0
400181d4: 40 00 12 40 call 4001cad4 <_Thread_Get>
400181d8: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
400181dc: c2 07 bf fc ld [ %fp + -4 ], %g1
400181e0: 80 a0 60 00 cmp %g1, 0
400181e4: 12 80 00 2d bne 40018298 <rtems_signal_send+0xd8>
400181e8: b8 10 00 08 mov %o0, %i4
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
400181ec: fa 02 21 4c ld [ %o0 + 0x14c ], %i5
asr = &api->Signal;
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
400181f0: c2 07 60 0c ld [ %i5 + 0xc ], %g1
400181f4: 80 a0 60 00 cmp %g1, 0
400181f8: 02 80 00 24 be 40018288 <rtems_signal_send+0xc8>
400181fc: 01 00 00 00 nop
if ( asr->is_enabled ) {
40018200: c2 0f 60 08 ldub [ %i5 + 8 ], %g1
40018204: 80 a0 60 00 cmp %g1, 0
40018208: 02 80 00 15 be 4001825c <rtems_signal_send+0x9c>
4001820c: 01 00 00 00 nop
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
40018210: 7f ff e0 e9 call 400105b4 <sparc_disable_interrupts>
40018214: 01 00 00 00 nop
*signal_set |= signals;
40018218: c2 07 60 14 ld [ %i5 + 0x14 ], %g1
4001821c: b2 10 40 19 or %g1, %i1, %i1
40018220: f2 27 60 14 st %i1, [ %i5 + 0x14 ]
_ISR_Enable( _level );
40018224: 7f ff e0 e8 call 400105c4 <sparc_enable_interrupts>
40018228: 01 00 00 00 nop
_ASR_Post_signals( signal_set, &asr->signals_posted );
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
4001822c: 03 10 00 f4 sethi %hi(0x4003d000), %g1
40018230: 82 10 63 40 or %g1, 0x340, %g1 ! 4003d340 <_Per_CPU_Information>
40018234: c4 00 60 08 ld [ %g1 + 8 ], %g2
40018238: 80 a0 a0 00 cmp %g2, 0
4001823c: 02 80 00 0f be 40018278 <rtems_signal_send+0xb8>
40018240: 01 00 00 00 nop
40018244: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
40018248: 80 a7 00 02 cmp %i4, %g2
4001824c: 12 80 00 0b bne 40018278 <rtems_signal_send+0xb8> <== NEVER TAKEN
40018250: 84 10 20 01 mov 1, %g2
_Thread_Dispatch_necessary = true;
40018254: c4 28 60 0c stb %g2, [ %g1 + 0xc ]
40018258: 30 80 00 08 b,a 40018278 <rtems_signal_send+0xb8>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
4001825c: 7f ff e0 d6 call 400105b4 <sparc_disable_interrupts>
40018260: 01 00 00 00 nop
*signal_set |= signals;
40018264: c2 07 60 18 ld [ %i5 + 0x18 ], %g1
40018268: b2 10 40 19 or %g1, %i1, %i1
4001826c: f2 27 60 18 st %i1, [ %i5 + 0x18 ]
_ISR_Enable( _level );
40018270: 7f ff e0 d5 call 400105c4 <sparc_enable_interrupts>
40018274: 01 00 00 00 nop
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
40018278: 40 00 12 0b call 4001caa4 <_Thread_Enable_dispatch>
4001827c: 01 00 00 00 nop
return RTEMS_SUCCESSFUL;
40018280: 10 80 00 07 b 4001829c <rtems_signal_send+0xdc>
40018284: 82 10 20 00 clr %g1 ! 0 <PROM_START>
}
_Thread_Enable_dispatch();
40018288: 40 00 12 07 call 4001caa4 <_Thread_Enable_dispatch>
4001828c: 01 00 00 00 nop
return RTEMS_NOT_DEFINED;
40018290: 10 80 00 03 b 4001829c <rtems_signal_send+0xdc>
40018294: 82 10 20 0b mov 0xb, %g1 ! b <PROM_START+0xb>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
40018298: 82 10 20 04 mov 4, %g1
}
4001829c: 81 c7 e0 08 ret
400182a0: 91 e8 00 01 restore %g0, %g1, %o0
400111cc <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
400111cc: 9d e3 bf a0 save %sp, -96, %sp
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
400111d0: 80 a6 a0 00 cmp %i2, 0
400111d4: 02 80 00 5a be 4001133c <rtems_task_mode+0x170>
400111d8: 82 10 20 09 mov 9, %g1
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
400111dc: 03 10 00 6a sethi %hi(0x4001a800), %g1
400111e0: f8 00 63 50 ld [ %g1 + 0x350 ], %i4 ! 4001ab50 <_Per_CPU_Information+0x10>
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
400111e4: c2 0f 20 70 ldub [ %i4 + 0x70 ], %g1
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
400111e8: fa 07 21 4c ld [ %i4 + 0x14c ], %i5
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
400111ec: 80 a0 00 01 cmp %g0, %g1
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
400111f0: c2 07 20 78 ld [ %i4 + 0x78 ], %g1
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
400111f4: b6 60 3f ff subx %g0, -1, %i3
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
400111f8: 80 a0 60 00 cmp %g1, 0
400111fc: 02 80 00 03 be 40011208 <rtems_task_mode+0x3c>
40011200: b7 2e e0 08 sll %i3, 8, %i3
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
40011204: b6 16 e2 00 or %i3, 0x200, %i3
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
40011208: c2 0f 60 08 ldub [ %i5 + 8 ], %g1
4001120c: 80 a0 00 01 cmp %g0, %g1
old_mode |= _ISR_Get_level();
40011210: 7f ff ef 40 call 4000cf10 <_CPU_ISR_Get_level>
40011214: a0 60 3f ff subx %g0, -1, %l0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
40011218: a1 2c 20 0a sll %l0, 0xa, %l0
4001121c: 90 14 00 08 or %l0, %o0, %o0
old_mode |= _ISR_Get_level();
40011220: b6 12 00 1b or %o0, %i3, %i3
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
40011224: 80 8e 61 00 btst 0x100, %i1
40011228: 02 80 00 06 be 40011240 <rtems_task_mode+0x74>
4001122c: f6 26 80 00 st %i3, [ %i2 ]
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
40011230: 83 36 20 08 srl %i0, 8, %g1
40011234: 82 18 60 01 xor %g1, 1, %g1
40011238: 82 08 60 01 and %g1, 1, %g1
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
4001123c: c2 2f 20 70 stb %g1, [ %i4 + 0x70 ]
if ( mask & RTEMS_TIMESLICE_MASK ) {
40011240: 80 8e 62 00 btst 0x200, %i1
40011244: 02 80 00 0b be 40011270 <rtems_task_mode+0xa4>
40011248: 80 8e 60 0f btst 0xf, %i1
if ( _Modes_Is_timeslice(mode_set) ) {
4001124c: 80 8e 22 00 btst 0x200, %i0
40011250: 22 80 00 07 be,a 4001126c <rtems_task_mode+0xa0>
40011254: c0 27 20 78 clr [ %i4 + 0x78 ]
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
40011258: 82 10 20 01 mov 1, %g1
4001125c: c2 27 20 78 st %g1, [ %i4 + 0x78 ]
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
40011260: 03 10 00 6a sethi %hi(0x4001a800), %g1
40011264: c2 00 60 a0 ld [ %g1 + 0xa0 ], %g1 ! 4001a8a0 <_Thread_Ticks_per_timeslice>
40011268: c2 27 20 74 st %g1, [ %i4 + 0x74 ]
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
4001126c: 80 8e 60 0f btst 0xf, %i1
40011270: 02 80 00 06 be 40011288 <rtems_task_mode+0xbc>
40011274: 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 );
40011278: 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 ) );
4001127c: 7f ff c6 7a call 40002c64 <sparc_enable_interrupts>
40011280: 91 2a 20 08 sll %o0, 8, %o0
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
40011284: 80 8e 64 00 btst 0x400, %i1
40011288: 02 80 00 14 be 400112d8 <rtems_task_mode+0x10c>
4001128c: 88 10 20 00 clr %g4
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
40011290: c2 0f 60 08 ldub [ %i5 + 8 ], %g1
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
40011294: b1 36 20 0a srl %i0, 0xa, %i0
40011298: b0 1e 20 01 xor %i0, 1, %i0
4001129c: b0 0e 20 01 and %i0, 1, %i0
if ( is_asr_enabled != asr->is_enabled ) {
400112a0: 80 a6 00 01 cmp %i0, %g1
400112a4: 22 80 00 0e be,a 400112dc <rtems_task_mode+0x110>
400112a8: 03 10 00 6a sethi %hi(0x4001a800), %g1
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
400112ac: 7f ff c6 6a call 40002c54 <sparc_disable_interrupts>
400112b0: f0 2f 60 08 stb %i0, [ %i5 + 8 ]
_signals = information->signals_pending;
400112b4: c2 07 60 18 ld [ %i5 + 0x18 ], %g1
information->signals_pending = information->signals_posted;
400112b8: c4 07 60 14 ld [ %i5 + 0x14 ], %g2
information->signals_posted = _signals;
400112bc: c2 27 60 14 st %g1, [ %i5 + 0x14 ]
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
information->signals_pending = information->signals_posted;
400112c0: c4 27 60 18 st %g2, [ %i5 + 0x18 ]
information->signals_posted = _signals;
_ISR_Enable( _level );
400112c4: 7f ff c6 68 call 40002c64 <sparc_enable_interrupts>
400112c8: 01 00 00 00 nop
asr->is_enabled = is_asr_enabled;
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
400112cc: c2 07 60 14 ld [ %i5 + 0x14 ], %g1
400112d0: 80 a0 00 01 cmp %g0, %g1
400112d4: 88 40 20 00 addx %g0, 0, %g4
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
400112d8: 03 10 00 6a sethi %hi(0x4001a800), %g1
400112dc: c4 00 63 3c ld [ %g1 + 0x33c ], %g2 ! 4001ab3c <_System_state_Current>
400112e0: 80 a0 a0 03 cmp %g2, 3
400112e4: 12 80 00 16 bne 4001133c <rtems_task_mode+0x170>
400112e8: 82 10 20 00 clr %g1
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
400112ec: 07 10 00 6a sethi %hi(0x4001a800), %g3
if ( are_signals_pending ||
400112f0: 80 89 20 ff btst 0xff, %g4
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
400112f4: 86 10 e3 40 or %g3, 0x340, %g3
if ( are_signals_pending ||
400112f8: 12 80 00 0a bne 40011320 <rtems_task_mode+0x154>
400112fc: c4 00 e0 10 ld [ %g3 + 0x10 ], %g2
40011300: c6 00 e0 14 ld [ %g3 + 0x14 ], %g3
40011304: 80 a0 80 03 cmp %g2, %g3
40011308: 02 80 00 0d be 4001133c <rtems_task_mode+0x170>
4001130c: 01 00 00 00 nop
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
40011310: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2
40011314: 80 a0 a0 00 cmp %g2, 0
40011318: 02 80 00 09 be 4001133c <rtems_task_mode+0x170> <== NEVER TAKEN
4001131c: 01 00 00 00 nop
_Thread_Dispatch_necessary = true;
40011320: 84 10 20 01 mov 1, %g2 ! 1 <PROM_START+0x1>
40011324: 03 10 00 6a sethi %hi(0x4001a800), %g1
40011328: 82 10 63 40 or %g1, 0x340, %g1 ! 4001ab40 <_Per_CPU_Information>
4001132c: c4 28 60 0c stb %g2, [ %g1 + 0xc ]
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
40011330: 7f ff ea 3f call 4000bc2c <_Thread_Dispatch>
40011334: 01 00 00 00 nop
}
return RTEMS_SUCCESSFUL;
40011338: 82 10 20 00 clr %g1 ! 0 <PROM_START>
}
4001133c: 81 c7 e0 08 ret
40011340: 91 e8 00 01 restore %g0, %g1, %o0
4000c548 <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
4000c548: 9d e3 bf 98 save %sp, -104, %sp
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
4000c54c: 80 a6 60 00 cmp %i1, 0
4000c550: 02 80 00 08 be 4000c570 <rtems_task_set_priority+0x28>
4000c554: 80 a6 a0 00 cmp %i2, 0
RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid (
rtems_task_priority the_priority
)
{
return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) &&
( the_priority <= RTEMS_MAXIMUM_PRIORITY ) );
4000c558: 03 10 00 66 sethi %hi(0x40019800), %g1
4000c55c: c4 08 62 2c ldub [ %g1 + 0x22c ], %g2 ! 40019a2c <rtems_maximum_priority>
4000c560: 80 a6 40 02 cmp %i1, %g2
4000c564: 18 80 00 1e bgu 4000c5dc <rtems_task_set_priority+0x94>
4000c568: 82 10 20 13 mov 0x13, %g1
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
4000c56c: 80 a6 a0 00 cmp %i2, 0
4000c570: 02 80 00 1b be 4000c5dc <rtems_task_set_priority+0x94>
4000c574: 82 10 20 09 mov 9, %g1
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
4000c578: 90 10 00 18 mov %i0, %o0
4000c57c: 40 00 09 55 call 4000ead0 <_Thread_Get>
4000c580: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
4000c584: c2 07 bf fc ld [ %fp + -4 ], %g1
4000c588: 80 a0 60 00 cmp %g1, 0
4000c58c: 12 80 00 14 bne 4000c5dc <rtems_task_set_priority+0x94>
4000c590: 82 10 20 04 mov 4, %g1
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
4000c594: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
4000c598: 80 a6 60 00 cmp %i1, 0
4000c59c: 02 80 00 0d be 4000c5d0 <rtems_task_set_priority+0x88>
4000c5a0: c2 26 80 00 st %g1, [ %i2 ]
the_thread->real_priority = new_priority;
if ( the_thread->resource_count == 0 ||
4000c5a4: c2 02 20 1c ld [ %o0 + 0x1c ], %g1
4000c5a8: 80 a0 60 00 cmp %g1, 0
4000c5ac: 02 80 00 06 be 4000c5c4 <rtems_task_set_priority+0x7c>
4000c5b0: f2 22 20 18 st %i1, [ %o0 + 0x18 ]
4000c5b4: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
4000c5b8: 80 a0 40 19 cmp %g1, %i1
4000c5bc: 08 80 00 05 bleu 4000c5d0 <rtems_task_set_priority+0x88> <== ALWAYS TAKEN
4000c5c0: 01 00 00 00 nop
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
4000c5c4: 92 10 00 19 mov %i1, %o1
4000c5c8: 40 00 08 1c call 4000e638 <_Thread_Change_priority>
4000c5cc: 94 10 20 00 clr %o2
}
_Thread_Enable_dispatch();
4000c5d0: 40 00 09 34 call 4000eaa0 <_Thread_Enable_dispatch>
4000c5d4: 01 00 00 00 nop
4000c5d8: 82 10 20 00 clr %g1 ! 0 <PROM_START>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4000c5dc: 81 c7 e0 08 ret
4000c5e0: 91 e8 00 01 restore %g0, %g1, %o0
40018c48 <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
40018c48: 9d e3 bf 98 save %sp, -104, %sp
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
40018c4c: 11 10 00 f4 sethi %hi(0x4003d000), %o0
40018c50: 92 10 00 18 mov %i0, %o1
40018c54: 90 12 23 e8 or %o0, 0x3e8, %o0
40018c58: 40 00 0b f3 call 4001bc24 <_Objects_Get>
40018c5c: 94 07 bf fc add %fp, -4, %o2
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
40018c60: c2 07 bf fc ld [ %fp + -4 ], %g1
40018c64: 80 a0 60 00 cmp %g1, 0
40018c68: 12 80 00 0c bne 40018c98 <rtems_timer_cancel+0x50>
40018c6c: 01 00 00 00 nop
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
40018c70: c2 02 20 38 ld [ %o0 + 0x38 ], %g1
40018c74: 80 a0 60 04 cmp %g1, 4
40018c78: 02 80 00 04 be 40018c88 <rtems_timer_cancel+0x40> <== NEVER TAKEN
40018c7c: 01 00 00 00 nop
(void) _Watchdog_Remove( &the_timer->Ticker );
40018c80: 40 00 13 51 call 4001d9c4 <_Watchdog_Remove>
40018c84: 90 02 20 10 add %o0, 0x10, %o0
_Thread_Enable_dispatch();
40018c88: 40 00 0f 87 call 4001caa4 <_Thread_Enable_dispatch>
40018c8c: b0 10 20 00 clr %i0
40018c90: 81 c7 e0 08 ret
40018c94: 81 e8 00 00 restore
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
40018c98: 81 c7 e0 08 ret
40018c9c: 91 e8 20 04 restore %g0, 4, %o0
40019158 <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
40019158: 9d e3 bf 98 save %sp, -104, %sp
Timer_Control *the_timer;
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
4001915c: 03 10 00 f5 sethi %hi(0x4003d400), %g1
40019160: f8 00 60 28 ld [ %g1 + 0x28 ], %i4 ! 4003d428 <_Timer_server>
if ( !timer_server )
40019164: 80 a7 20 00 cmp %i4, 0
40019168: 02 80 00 3c be 40019258 <rtems_timer_server_fire_when+0x100>
4001916c: 82 10 20 0e mov 0xe, %g1
return RTEMS_INCORRECT_STATE;
if ( !_TOD.is_set )
40019170: 21 10 00 f4 sethi %hi(0x4003d000), %l0
40019174: 82 14 20 78 or %l0, 0x78, %g1 ! 4003d078 <_TOD>
40019178: c4 08 60 14 ldub [ %g1 + 0x14 ], %g2
4001917c: 80 a0 a0 00 cmp %g2, 0
40019180: 02 80 00 36 be 40019258 <rtems_timer_server_fire_when+0x100><== NEVER TAKEN
40019184: 82 10 20 0b mov 0xb, %g1
return RTEMS_NOT_DEFINED;
if ( !routine )
40019188: 80 a6 a0 00 cmp %i2, 0
4001918c: 02 80 00 33 be 40019258 <rtems_timer_server_fire_when+0x100>
40019190: 82 10 20 09 mov 9, %g1
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
40019194: 7f ff f3 7f call 40015f90 <_TOD_Validate>
40019198: 90 10 00 19 mov %i1, %o0
4001919c: 80 8a 20 ff btst 0xff, %o0
400191a0: 02 80 00 2e be 40019258 <rtems_timer_server_fire_when+0x100>
400191a4: 82 10 20 14 mov 0x14, %g1
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
400191a8: 7f ff f3 40 call 40015ea8 <_TOD_To_seconds>
400191ac: 90 10 00 19 mov %i1, %o0
400191b0: b2 10 00 08 mov %o0, %i1
400191b4: d0 1c 20 78 ldd [ %l0 + 0x78 ], %o0
400191b8: 94 10 20 00 clr %o2
400191bc: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
400191c0: 40 00 4c 1d call 4002c234 <__divdi3>
400191c4: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
if ( seconds <= _TOD_Seconds_since_epoch() )
400191c8: 80 a6 40 09 cmp %i1, %o1
400191cc: 08 80 00 23 bleu 40019258 <rtems_timer_server_fire_when+0x100>
400191d0: 82 10 20 14 mov 0x14, %g1
400191d4: 11 10 00 f4 sethi %hi(0x4003d000), %o0
400191d8: 92 10 00 18 mov %i0, %o1
400191dc: 90 12 23 e8 or %o0, 0x3e8, %o0
400191e0: 40 00 0a 91 call 4001bc24 <_Objects_Get>
400191e4: 94 07 bf fc add %fp, -4, %o2
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
400191e8: c2 07 bf fc ld [ %fp + -4 ], %g1
400191ec: 80 a0 60 00 cmp %g1, 0
400191f0: 12 80 00 19 bne 40019254 <rtems_timer_server_fire_when+0xfc>
400191f4: ba 10 00 08 mov %o0, %i5
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
400191f8: 40 00 11 f3 call 4001d9c4 <_Watchdog_Remove>
400191fc: 90 02 20 10 add %o0, 0x10, %o0
40019200: d0 1c 20 78 ldd [ %l0 + 0x78 ], %o0
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
40019204: 82 10 20 03 mov 3, %g1
40019208: 94 10 20 00 clr %o2
4001920c: c2 27 60 38 st %g1, [ %i5 + 0x38 ]
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
40019210: c0 27 60 18 clr [ %i5 + 0x18 ]
the_watchdog->routine = routine;
40019214: f4 27 60 2c st %i2, [ %i5 + 0x2c ]
the_watchdog->id = id;
40019218: f0 27 60 30 st %i0, [ %i5 + 0x30 ]
the_watchdog->user_data = user_data;
4001921c: f6 27 60 34 st %i3, [ %i5 + 0x34 ]
40019220: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3
40019224: 40 00 4c 04 call 4002c234 <__divdi3>
40019228: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 <RAM_SIZE+0x3b5aca00>
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
(*timer_server->schedule_operation)( timer_server, the_timer );
4001922c: c2 07 20 04 ld [ %i4 + 4 ], %g1
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
40019230: 92 26 40 09 sub %i1, %o1, %o1
(*timer_server->schedule_operation)( timer_server, the_timer );
40019234: 90 10 00 1c mov %i4, %o0
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
40019238: d2 27 60 1c st %o1, [ %i5 + 0x1c ]
(*timer_server->schedule_operation)( timer_server, the_timer );
4001923c: 9f c0 40 00 call %g1
40019240: 92 10 00 1d mov %i5, %o1
_Thread_Enable_dispatch();
40019244: 40 00 0e 18 call 4001caa4 <_Thread_Enable_dispatch>
40019248: 01 00 00 00 nop
return RTEMS_SUCCESSFUL;
4001924c: 10 80 00 03 b 40019258 <rtems_timer_server_fire_when+0x100>
40019250: 82 10 20 00 clr %g1 ! 0 <PROM_START>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
40019254: 82 10 20 04 mov 4, %g1
}
40019258: 81 c7 e0 08 ret
4001925c: 91 e8 00 01 restore %g0, %g1, %o0