RTEMS 4.10Annotated Report
Thu May 27 17:54:03 2010
40008498 <_CORE_RWLock_Obtain_for_reading>:
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_RWLock_API_mp_support_callout api_rwlock_mp_support
)
{
40008498: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
4000849c: 03 10 00 7e sethi %hi(0x4001f800), %g1
* If unlocked, then OK to read.
* If locked for reading and no waiters, then OK to read.
* If any thread is waiting, then we wait.
*/
_ISR_Disable( level );
400084a0: 7f ff eb 96 call 400032f8 <sparc_disable_interrupts>
400084a4: e0 00 62 cc ld [ %g1 + 0x2cc ], %l0 ! 4001facc <_Thread_Executing>
400084a8: a2 10 00 08 mov %o0, %l1
switch ( the_rwlock->current_state ) {
400084ac: c2 06 20 44 ld [ %i0 + 0x44 ], %g1
400084b0: 80 a0 60 00 cmp %g1, 0
400084b4: 22 80 00 06 be,a 400084cc <_CORE_RWLock_Obtain_for_reading+0x34>
400084b8: c2 06 20 48 ld [ %i0 + 0x48 ], %g1
400084bc: 80 a0 60 01 cmp %g1, 1
400084c0: 12 80 00 16 bne 40008518 <_CORE_RWLock_Obtain_for_reading+0x80>
400084c4: 80 8e a0 ff btst 0xff, %i2
400084c8: 30 80 00 06 b,a 400084e0 <_CORE_RWLock_Obtain_for_reading+0x48>
case CORE_RWLOCK_UNLOCKED:
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
400084cc: 84 10 20 01 mov 1, %g2
the_rwlock->number_of_readers += 1;
400084d0: 82 00 60 01 inc %g1
*/
_ISR_Disable( level );
switch ( the_rwlock->current_state ) {
case CORE_RWLOCK_UNLOCKED:
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
400084d4: c4 26 20 44 st %g2, [ %i0 + 0x44 ]
the_rwlock->number_of_readers += 1;
400084d8: c2 26 20 48 st %g1, [ %i0 + 0x48 ]
_ISR_Enable( level );
400084dc: 30 80 00 0a b,a 40008504 <_CORE_RWLock_Obtain_for_reading+0x6c>
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
return;
case CORE_RWLOCK_LOCKED_FOR_READING: {
Thread_Control *waiter;
waiter = _Thread_queue_First( &the_rwlock->Wait_queue );
400084e0: 40 00 07 b7 call 4000a3bc <_Thread_queue_First>
400084e4: 90 10 00 18 mov %i0, %o0
if ( !waiter ) {
400084e8: 80 a2 20 00 cmp %o0, 0
400084ec: 12 80 00 0b bne 40008518 <_CORE_RWLock_Obtain_for_reading+0x80><== NEVER TAKEN
400084f0: 80 8e a0 ff btst 0xff, %i2
the_rwlock->number_of_readers += 1;
400084f4: c2 06 20 48 ld [ %i0 + 0x48 ], %g1
400084f8: 82 00 60 01 inc %g1
400084fc: c2 26 20 48 st %g1, [ %i0 + 0x48 ]
_ISR_Enable( level );
40008500: 90 10 00 11 mov %l1, %o0
40008504: 7f ff eb 81 call 40003308 <sparc_enable_interrupts>
40008508: 01 00 00 00 nop
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
4000850c: c0 24 20 34 clr [ %l0 + 0x34 ]
return;
40008510: 81 c7 e0 08 ret
40008514: 81 e8 00 00 restore
/*
* If the thread is not willing to wait, then return immediately.
*/
if ( !wait ) {
40008518: 32 80 00 08 bne,a 40008538 <_CORE_RWLock_Obtain_for_reading+0xa0>
4000851c: f2 24 20 20 st %i1, [ %l0 + 0x20 ]
_ISR_Enable( level );
40008520: 7f ff eb 7a call 40003308 <sparc_enable_interrupts>
40008524: 90 10 00 11 mov %l1, %o0
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
40008528: 82 10 20 02 mov 2, %g1
4000852c: c2 24 20 34 st %g1, [ %l0 + 0x34 ]
40008530: 81 c7 e0 08 ret
40008534: 81 e8 00 00 restore
_Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue );
executing->Wait.queue = &the_rwlock->Wait_queue;
executing->Wait.id = id;
executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ;
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
40008538: c0 24 20 34 clr [ %l0 + 0x34 ]
/*
* We need to wait to enter this critical section
*/
_Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue );
executing->Wait.queue = &the_rwlock->Wait_queue;
4000853c: f0 24 20 44 st %i0, [ %l0 + 0x44 ]
executing->Wait.id = id;
executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ;
40008540: c0 24 20 30 clr [ %l0 + 0x30 ]
40008544: 82 10 20 01 mov 1, %g1
40008548: c2 26 20 30 st %g1, [ %i0 + 0x30 ]
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
_ISR_Enable( level );
4000854c: 90 10 00 11 mov %l1, %o0
40008550: 7f ff eb 6e call 40003308 <sparc_enable_interrupts>
40008554: 35 10 00 21 sethi %hi(0x40008400), %i2
_Thread_queue_Enqueue_with_handler(
40008558: b2 10 00 1b mov %i3, %i1
4000855c: 40 00 06 b8 call 4000a03c <_Thread_queue_Enqueue_with_handler>
40008560: 95 ee a2 e8 restore %i2, 0x2e8, %o2
400085f0 <_CORE_RWLock_Release>:
*/
CORE_RWLock_Status _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock
)
{
400085f0: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
400085f4: 03 10 00 7e sethi %hi(0x4001f800), %g1
* Otherwise, we have to block.
* If locked for reading and no waiters, then OK to read.
* If any thread is waiting, then we wait.
*/
_ISR_Disable( level );
400085f8: 7f ff eb 40 call 400032f8 <sparc_disable_interrupts>
400085fc: e0 00 62 cc ld [ %g1 + 0x2cc ], %l0 ! 4001facc <_Thread_Executing>
40008600: 84 10 00 08 mov %o0, %g2
if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){
40008604: c2 06 20 44 ld [ %i0 + 0x44 ], %g1
40008608: 80 a0 60 00 cmp %g1, 0
4000860c: 12 80 00 08 bne 4000862c <_CORE_RWLock_Release+0x3c>
40008610: 80 a0 60 01 cmp %g1, 1
_ISR_Enable( level );
40008614: 7f ff eb 3d call 40003308 <sparc_enable_interrupts>
40008618: b0 10 20 00 clr %i0
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
4000861c: 82 10 20 02 mov 2, %g1
40008620: c2 24 20 34 st %g1, [ %l0 + 0x34 ]
40008624: 81 c7 e0 08 ret
40008628: 81 e8 00 00 restore
return CORE_RWLOCK_SUCCESSFUL;
}
if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) {
4000862c: 32 80 00 0b bne,a 40008658 <_CORE_RWLock_Release+0x68>
40008630: c0 24 20 34 clr [ %l0 + 0x34 ]
the_rwlock->number_of_readers -= 1;
40008634: c2 06 20 48 ld [ %i0 + 0x48 ], %g1
40008638: 82 00 7f ff add %g1, -1, %g1
if ( the_rwlock->number_of_readers != 0 ) {
4000863c: 80 a0 60 00 cmp %g1, 0
40008640: 02 80 00 05 be 40008654 <_CORE_RWLock_Release+0x64>
40008644: c2 26 20 48 st %g1, [ %i0 + 0x48 ]
/* must be unlocked again */
_ISR_Enable( level );
40008648: 7f ff eb 30 call 40003308 <sparc_enable_interrupts>
4000864c: b0 10 20 00 clr %i0
return CORE_RWLOCK_SUCCESSFUL;
40008650: 30 80 00 24 b,a 400086e0 <_CORE_RWLock_Release+0xf0>
}
}
/* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
40008654: c0 24 20 34 clr [ %l0 + 0x34 ]
/*
* Implicitly transition to "unlocked" and find another thread interested
* in obtaining this rwlock.
*/
the_rwlock->current_state = CORE_RWLOCK_UNLOCKED;
40008658: c0 26 20 44 clr [ %i0 + 0x44 ]
_ISR_Enable( level );
4000865c: 7f ff eb 2b call 40003308 <sparc_enable_interrupts>
40008660: 90 10 00 02 mov %g2, %o0
next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue );
40008664: 40 00 06 13 call 40009eb0 <_Thread_queue_Dequeue>
40008668: 90 10 00 18 mov %i0, %o0
if ( next ) {
4000866c: 80 a2 20 00 cmp %o0, 0
40008670: 22 80 00 1c be,a 400086e0 <_CORE_RWLock_Release+0xf0>
40008674: b0 10 20 00 clr %i0
if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
40008678: c2 02 20 30 ld [ %o0 + 0x30 ], %g1
4000867c: 80 a0 60 01 cmp %g1, 1
40008680: 32 80 00 05 bne,a 40008694 <_CORE_RWLock_Release+0xa4>
40008684: c2 06 20 48 ld [ %i0 + 0x48 ], %g1
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
40008688: 82 10 20 02 mov 2, %g1
return CORE_RWLOCK_SUCCESSFUL;
4000868c: 10 80 00 14 b 400086dc <_CORE_RWLock_Release+0xec>
40008690: c2 26 20 44 st %g1, [ %i0 + 0x44 ]
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
40008694: 84 10 20 01 mov 1, %g2
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
40008698: 82 00 60 01 inc %g1
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
4000869c: c4 26 20 44 st %g2, [ %i0 + 0x44 ]
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
400086a0: c2 26 20 48 st %g1, [ %i0 + 0x48 ]
/*
* Now see if more readers can be let go.
*/
while ( 1 ) {
next = _Thread_queue_First( &the_rwlock->Wait_queue );
400086a4: 40 00 07 46 call 4000a3bc <_Thread_queue_First>
400086a8: 90 10 00 18 mov %i0, %o0
if ( !next ||
400086ac: 92 92 20 00 orcc %o0, 0, %o1
400086b0: 22 80 00 0c be,a 400086e0 <_CORE_RWLock_Release+0xf0>
400086b4: b0 10 20 00 clr %i0
next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE )
400086b8: c2 02 60 30 ld [ %o1 + 0x30 ], %g1
400086bc: 80 a0 60 01 cmp %g1, 1
400086c0: 02 80 00 07 be 400086dc <_CORE_RWLock_Release+0xec> <== NEVER TAKEN
400086c4: 90 10 00 18 mov %i0, %o0
return CORE_RWLOCK_SUCCESSFUL;
the_rwlock->number_of_readers += 1;
400086c8: c2 06 20 48 ld [ %i0 + 0x48 ], %g1
400086cc: 82 00 60 01 inc %g1
_Thread_queue_Extract( &the_rwlock->Wait_queue, next );
400086d0: 40 00 06 eb call 4000a27c <_Thread_queue_Extract>
400086d4: c2 26 20 48 st %g1, [ %i0 + 0x48 ]
}
400086d8: 30 bf ff f3 b,a 400086a4 <_CORE_RWLock_Release+0xb4>
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
400086dc: b0 10 20 00 clr %i0
400086e0: 81 c7 e0 08 ret
400086e4: 81 e8 00 00 restore
400086e8 <_CORE_RWLock_Timeout>:
void _CORE_RWLock_Timeout(
Objects_Id id,
void *ignored
)
{
400086e8: 9d e3 bf 98 save %sp, -104, %sp
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
400086ec: 90 10 00 18 mov %i0, %o0
400086f0: 40 00 05 0d call 40009b24 <_Thread_Get>
400086f4: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
400086f8: c2 07 bf fc ld [ %fp + -4 ], %g1
400086fc: 80 a0 60 00 cmp %g1, 0
40008700: 12 80 00 08 bne 40008720 <_CORE_RWLock_Timeout+0x38> <== NEVER TAKEN
40008704: 01 00 00 00 nop
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
40008708: 40 00 07 69 call 4000a4ac <_Thread_queue_Process_timeout>
4000870c: 01 00 00 00 nop
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
40008710: 03 10 00 7e sethi %hi(0x4001f800), %g1
40008714: c4 00 62 10 ld [ %g1 + 0x210 ], %g2 ! 4001fa10 <_Thread_Dispatch_disable_level>
40008718: 84 00 bf ff add %g2, -1, %g2
4000871c: c4 20 62 10 st %g2, [ %g1 + 0x210 ]
40008720: 81 c7 e0 08 ret
40008724: 81 e8 00 00 restore
40015b70 <_CORE_message_queue_Broadcast>:
Objects_Id id __attribute__((unused)),
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)),
#endif
uint32_t *count
)
{
40015b70: 9d e3 bf a0 save %sp, -96, %sp
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
40015b74: c2 06 20 4c ld [ %i0 + 0x4c ], %g1
Objects_Id id __attribute__((unused)),
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)),
#endif
uint32_t *count
)
{
40015b78: a0 10 00 18 mov %i0, %l0
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
40015b7c: 80 a6 80 01 cmp %i2, %g1
40015b80: 18 80 00 17 bgu 40015bdc <_CORE_message_queue_Broadcast+0x6c><== NEVER TAKEN
40015b84: b0 10 20 01 mov 1, %i0
* NOTE: This check is critical because threads can block on
* send and receive and this ensures that we are broadcasting
* the message to threads waiting to receive -- not to send.
*/
if ( the_message_queue->number_of_pending_messages != 0 ) {
40015b88: c2 04 20 48 ld [ %l0 + 0x48 ], %g1
40015b8c: 80 a0 60 00 cmp %g1, 0
40015b90: 02 80 00 0a be 40015bb8 <_CORE_message_queue_Broadcast+0x48>
40015b94: a2 10 20 00 clr %l1
*count = 0;
40015b98: c0 27 40 00 clr [ %i5 ]
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
40015b9c: 81 c7 e0 08 ret
40015ba0: 91 e8 20 00 restore %g0, 0, %o0
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
40015ba4: d0 04 a0 2c ld [ %l2 + 0x2c ], %o0
40015ba8: 40 00 27 11 call 4001f7ec <memcpy>
40015bac: a2 04 60 01 inc %l1
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
40015bb0: c2 04 a0 28 ld [ %l2 + 0x28 ], %g1
40015bb4: f4 20 40 00 st %i2, [ %g1 ]
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
_Thread_queue_Dequeue(&the_message_queue->Wait_queue))) {
40015bb8: 40 00 0a 30 call 40018478 <_Thread_queue_Dequeue>
40015bbc: 90 10 00 10 mov %l0, %o0
40015bc0: 92 10 00 19 mov %i1, %o1
40015bc4: a4 10 00 08 mov %o0, %l2
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
40015bc8: 80 a2 20 00 cmp %o0, 0
40015bcc: 12 bf ff f6 bne 40015ba4 <_CORE_message_queue_Broadcast+0x34>
40015bd0: 94 10 00 1a mov %i2, %o2
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_message_queue_mp_support) ( the_thread, id );
#endif
}
*count = number_broadcasted;
40015bd4: e2 27 40 00 st %l1, [ %i5 ]
40015bd8: b0 10 20 00 clr %i0
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
}
40015bdc: 81 c7 e0 08 ret
40015be0: 81 e8 00 00 restore
4000f6c0 <_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
)
{
4000f6c0: 9d e3 bf a0 save %sp, -96, %sp
size_t message_buffering_required;
size_t allocated_message_size;
the_message_queue->maximum_pending_messages = maximum_pending_messages;
the_message_queue->number_of_pending_messages = 0;
4000f6c4: c0 26 20 48 clr [ %i0 + 0x48 ]
)
{
size_t message_buffering_required;
size_t allocated_message_size;
the_message_queue->maximum_pending_messages = maximum_pending_messages;
4000f6c8: f4 26 20 44 st %i2, [ %i0 + 0x44 ]
the_message_queue->number_of_pending_messages = 0;
the_message_queue->maximum_message_size = maximum_message_size;
4000f6cc: f6 26 20 4c st %i3, [ %i0 + 0x4c ]
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Notify_Handler the_handler,
void *the_argument
)
{
the_message_queue->notify_handler = the_handler;
4000f6d0: c0 26 20 60 clr [ %i0 + 0x60 ]
the_message_queue->notify_argument = the_argument;
4000f6d4: c0 26 20 64 clr [ %i0 + 0x64 ]
/*
* Round size up to multiple of a pointer for chain init and
* check for overflow on adding overhead to each message.
*/
allocated_message_size = maximum_message_size;
if (allocated_message_size & (sizeof(uint32_t) - 1)) {
4000f6d8: 80 8e e0 03 btst 3, %i3
4000f6dc: 02 80 00 07 be 4000f6f8 <_CORE_message_queue_Initialize+0x38>
4000f6e0: a2 10 00 1b mov %i3, %l1
allocated_message_size += sizeof(uint32_t);
4000f6e4: a2 06 e0 04 add %i3, 4, %l1
allocated_message_size &= ~(sizeof(uint32_t) - 1);
4000f6e8: a2 0c 7f fc and %l1, -4, %l1
}
if (allocated_message_size < maximum_message_size)
4000f6ec: 80 a4 40 1b cmp %l1, %i3
4000f6f0: 0a 80 00 23 bcs 4000f77c <_CORE_message_queue_Initialize+0xbc><== NEVER TAKEN
4000f6f4: 01 00 00 00 nop
/*
* Calculate how much total memory is required for message buffering and
* check for overflow on the multiplication.
*/
message_buffering_required = (size_t) maximum_pending_messages *
(allocated_message_size + sizeof(CORE_message_queue_Buffer_control));
4000f6f8: a0 04 60 14 add %l1, 0x14, %l0
/*
* Calculate how much total memory is required for message buffering and
* check for overflow on the multiplication.
*/
message_buffering_required = (size_t) maximum_pending_messages *
4000f6fc: 92 10 00 1a mov %i2, %o1
4000f700: 40 00 4f df call 4002367c <.umul>
4000f704: 90 10 00 10 mov %l0, %o0
(allocated_message_size + sizeof(CORE_message_queue_Buffer_control));
if (message_buffering_required < allocated_message_size)
4000f708: 80 a2 00 11 cmp %o0, %l1
4000f70c: 0a 80 00 1c bcs 4000f77c <_CORE_message_queue_Initialize+0xbc><== NEVER TAKEN
4000f710: 01 00 00 00 nop
return false;
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
4000f714: 40 00 0b d3 call 40012660 <_Workspace_Allocate>
4000f718: 01 00 00 00 nop
4000f71c: d0 26 20 5c st %o0, [ %i0 + 0x5c ]
_Workspace_Allocate( message_buffering_required );
if (the_message_queue->message_buffers == 0)
4000f720: 80 a2 20 00 cmp %o0, 0
4000f724: 02 80 00 16 be 4000f77c <_CORE_message_queue_Initialize+0xbc>
4000f728: 92 10 00 08 mov %o0, %o1
/*
* Initialize the pool of inactive messages, pending messages,
* and set of waiting threads.
*/
_Chain_Initialize (
4000f72c: 90 06 20 68 add %i0, 0x68, %o0
4000f730: 94 10 00 1a mov %i2, %o2
4000f734: 40 00 15 80 call 40014d34 <_Chain_Initialize>
4000f738: 96 10 00 10 mov %l0, %o3
allocated_message_size + sizeof( CORE_message_queue_Buffer_control )
);
_Chain_Initialize_empty( &the_message_queue->Pending_messages );
_Thread_queue_Initialize(
4000f73c: c2 06 40 00 ld [ %i1 ], %g1
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
the_chain->permanent_null = NULL;
4000f740: c0 26 20 54 clr [ %i0 + 0x54 ]
4000f744: 82 18 60 01 xor %g1, 1, %g1
4000f748: 80 a0 00 01 cmp %g0, %g1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
4000f74c: 82 06 20 54 add %i0, 0x54, %g1
4000f750: c2 26 20 50 st %g1, [ %i0 + 0x50 ]
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
4000f754: 82 06 20 50 add %i0, 0x50, %g1
4000f758: 90 10 00 18 mov %i0, %o0
4000f75c: c2 26 20 58 st %g1, [ %i0 + 0x58 ]
4000f760: 92 60 3f ff subx %g0, -1, %o1
4000f764: 94 10 20 80 mov 0x80, %o2
4000f768: 96 10 20 06 mov 6, %o3
4000f76c: 40 00 08 9e call 400119e4 <_Thread_queue_Initialize>
4000f770: b0 10 20 01 mov 1, %i0
THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
STATES_WAITING_FOR_MESSAGE,
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
);
return true;
4000f774: 81 c7 e0 08 ret
4000f778: 81 e8 00 00 restore
}
4000f77c: 81 c7 e0 08 ret
4000f780: 91 e8 20 00 restore %g0, 0, %o0
4000f784 <_CORE_message_queue_Seize>:
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
4000f784: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
4000f788: 23 10 00 ad sethi %hi(0x4002b400), %l1
4000f78c: e0 04 61 2c ld [ %l1 + 0x12c ], %l0 ! 4002b52c <_Thread_Executing>
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
4000f790: a4 10 00 19 mov %i1, %l2
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
4000f794: c0 24 20 34 clr [ %l0 + 0x34 ]
_ISR_Disable( level );
4000f798: 7f ff de b4 call 40007268 <sparc_disable_interrupts>
4000f79c: a6 10 00 18 mov %i0, %l3
4000f7a0: 82 10 00 08 mov %o0, %g1
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
4000f7a4: f2 06 20 50 ld [ %i0 + 0x50 ], %i1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
4000f7a8: 84 06 20 54 add %i0, 0x54, %g2
4000f7ac: 80 a6 40 02 cmp %i1, %g2
4000f7b0: 02 80 00 24 be 4000f840 <_CORE_message_queue_Seize+0xbc>
4000f7b4: 86 06 20 50 add %i0, 0x50, %g3
{
Chain_Node *return_node;
Chain_Node *new_first;
return_node = the_chain->first;
new_first = return_node->next;
4000f7b8: c4 06 40 00 ld [ %i1 ], %g2
the_chain->first = new_first;
4000f7bc: c4 26 20 50 st %g2, [ %i0 + 0x50 ]
the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
if ( the_message != NULL ) {
4000f7c0: 80 a6 60 00 cmp %i1, 0
4000f7c4: 02 80 00 1f be 4000f840 <_CORE_message_queue_Seize+0xbc> <== NEVER TAKEN
4000f7c8: c6 20 a0 04 st %g3, [ %g2 + 4 ]
the_message_queue->number_of_pending_messages -= 1;
4000f7cc: c2 06 20 48 ld [ %i0 + 0x48 ], %g1
4000f7d0: 82 00 7f ff add %g1, -1, %g1
4000f7d4: c2 26 20 48 st %g1, [ %i0 + 0x48 ]
_ISR_Enable( level );
4000f7d8: 7f ff de a8 call 40007278 <sparc_enable_interrupts>
4000f7dc: a0 06 60 10 add %i1, 0x10, %l0
*size_p = the_message->Contents.size;
4000f7e0: d4 06 60 0c ld [ %i1 + 0xc ], %o2
_Thread_Executing->Wait.count =
4000f7e4: c2 04 61 2c ld [ %l1 + 0x12c ], %g1
the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
if ( the_message != NULL ) {
the_message_queue->number_of_pending_messages -= 1;
_ISR_Enable( level );
*size_p = the_message->Contents.size;
4000f7e8: d4 26 c0 00 st %o2, [ %i3 ]
_Thread_Executing->Wait.count =
4000f7ec: c4 06 60 08 ld [ %i1 + 8 ], %g2
4000f7f0: c4 20 60 24 st %g2, [ %g1 + 0x24 ]
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
4000f7f4: 92 10 00 10 mov %l0, %o1
4000f7f8: 40 00 23 07 call 40018414 <memcpy>
4000f7fc: 90 10 00 1a mov %i2, %o0
* is not, then we can go ahead and free the buffer.
*
* NOTE: If we note that the queue was not full before this receive,
* then we can avoid this dequeue.
*/
the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
4000f800: 40 00 07 71 call 400115c4 <_Thread_queue_Dequeue>
4000f804: 90 10 00 18 mov %i0, %o0
if ( !the_thread ) {
4000f808: 80 a2 20 00 cmp %o0, 0
4000f80c: 32 80 00 04 bne,a 4000f81c <_CORE_message_queue_Seize+0x98>
4000f810: d4 02 20 30 ld [ %o0 + 0x30 ], %o2
RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Buffer_control *the_message
)
{
_Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
4000f814: 7f ff ff 7a call 4000f5fc <_Chain_Append>
4000f818: 91 ee 20 68 restore %i0, 0x68, %o0
CORE_message_queue_Buffer_control *the_message,
int priority
)
{
#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
the_message->priority = priority;
4000f81c: c2 02 20 24 ld [ %o0 + 0x24 ], %g1
*/
_CORE_message_queue_Set_message_priority(
the_message,
the_thread->Wait.count
);
the_message->Contents.size = (size_t) the_thread->Wait.option;
4000f820: d4 26 60 0c st %o2, [ %i1 + 0xc ]
4000f824: c2 26 60 08 st %g1, [ %i1 + 8 ]
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
4000f828: d2 02 20 2c ld [ %o0 + 0x2c ], %o1
4000f82c: 40 00 22 fa call 40018414 <memcpy>
4000f830: 90 10 00 10 mov %l0, %o0
the_thread->Wait.return_argument_second.immutable_object,
the_message->Contents.buffer,
the_message->Contents.size
);
_CORE_message_queue_Insert_message(
4000f834: f4 06 60 08 ld [ %i1 + 8 ], %i2
4000f838: 40 00 15 4d call 40014d6c <_CORE_message_queue_Insert_message>
4000f83c: 81 e8 00 00 restore
return;
}
#endif
}
if ( !wait ) {
4000f840: 80 8f 20 ff btst 0xff, %i4
4000f844: 12 80 00 08 bne 4000f864 <_CORE_message_queue_Seize+0xe0>
4000f848: 84 10 20 01 mov 1, %g2
_ISR_Enable( level );
4000f84c: 7f ff de 8b call 40007278 <sparc_enable_interrupts>
4000f850: 90 10 00 01 mov %g1, %o0
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
4000f854: 82 10 20 04 mov 4, %g1
4000f858: c2 24 20 34 st %g1, [ %l0 + 0x34 ]
executing->Wait.return_argument = size_p;
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
}
4000f85c: 81 c7 e0 08 ret
4000f860: 81 e8 00 00 restore
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
4000f864: c4 24 e0 30 st %g2, [ %l3 + 0x30 ]
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
executing->Wait.queue = &the_message_queue->Wait_queue;
executing->Wait.id = id;
executing->Wait.return_argument_second.mutable_object = buffer;
executing->Wait.return_argument = size_p;
4000f868: f6 24 20 28 st %i3, [ %l0 + 0x28 ]
return;
}
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
executing->Wait.queue = &the_message_queue->Wait_queue;
executing->Wait.id = id;
4000f86c: e4 24 20 20 st %l2, [ %l0 + 0x20 ]
executing->Wait.return_argument_second.mutable_object = buffer;
4000f870: f4 24 20 2c st %i2, [ %l0 + 0x2c ]
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
return;
}
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
executing->Wait.queue = &the_message_queue->Wait_queue;
4000f874: e6 24 20 44 st %l3, [ %l0 + 0x44 ]
executing->Wait.id = id;
executing->Wait.return_argument_second.mutable_object = buffer;
executing->Wait.return_argument = size_p;
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
4000f878: 90 10 00 01 mov %g1, %o0
4000f87c: 7f ff de 7f call 40007278 <sparc_enable_interrupts>
4000f880: 35 10 00 46 sethi %hi(0x40011800), %i2
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
4000f884: b0 10 00 13 mov %l3, %i0
4000f888: b2 10 00 1d mov %i5, %i1
4000f88c: 40 00 07 b1 call 40011750 <_Thread_queue_Enqueue_with_handler>
4000f890: 95 ee a2 b0 restore %i2, 0x2b0, %o2
400060d0 <_CORE_mutex_Seize>:
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
400060d0: 9d e3 bf a0 save %sp, -96, %sp
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
400060d4: 03 10 00 72 sethi %hi(0x4001c800), %g1
400060d8: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 ! 4001c8e0 <_Thread_Dispatch_disable_level>
400060dc: 80 a0 60 00 cmp %g1, 0
400060e0: 02 80 00 0d be 40006114 <_CORE_mutex_Seize+0x44>
400060e4: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
400060e8: 80 8e a0 ff btst 0xff, %i2
400060ec: 02 80 00 0b be 40006118 <_CORE_mutex_Seize+0x48> <== NEVER TAKEN
400060f0: 90 10 00 18 mov %i0, %o0
400060f4: 03 10 00 72 sethi %hi(0x4001c800), %g1
400060f8: c2 00 62 80 ld [ %g1 + 0x280 ], %g1 ! 4001ca80 <_System_state_Current>
400060fc: 80 a0 60 01 cmp %g1, 1
40006100: 08 80 00 05 bleu 40006114 <_CORE_mutex_Seize+0x44>
40006104: 90 10 20 00 clr %o0
40006108: 92 10 20 00 clr %o1
4000610c: 40 00 01 b4 call 400067dc <_Internal_error_Occurred>
40006110: 94 10 20 13 mov 0x13, %o2
40006114: 90 10 00 18 mov %i0, %o0
40006118: 40 00 15 03 call 4000b524 <_CORE_mutex_Seize_interrupt_trylock>
4000611c: 92 07 a0 54 add %fp, 0x54, %o1
40006120: 80 a2 20 00 cmp %o0, 0
40006124: 02 80 00 09 be 40006148 <_CORE_mutex_Seize+0x78>
40006128: 80 8e a0 ff btst 0xff, %i2
4000612c: 12 80 00 09 bne 40006150 <_CORE_mutex_Seize+0x80>
40006130: 35 10 00 72 sethi %hi(0x4001c800), %i2
40006134: 7f ff ee dd call 40001ca8 <sparc_enable_interrupts>
40006138: d0 07 a0 54 ld [ %fp + 0x54 ], %o0
4000613c: c2 06 a1 9c ld [ %i2 + 0x19c ], %g1
40006140: 84 10 20 01 mov 1, %g2
40006144: c4 20 60 34 st %g2, [ %g1 + 0x34 ]
40006148: 81 c7 e0 08 ret
4000614c: 81 e8 00 00 restore
40006150: c4 06 a1 9c ld [ %i2 + 0x19c ], %g2
40006154: 03 10 00 72 sethi %hi(0x4001c800), %g1
40006158: c6 00 60 e0 ld [ %g1 + 0xe0 ], %g3 ! 4001c8e0 <_Thread_Dispatch_disable_level>
4000615c: f2 20 a0 20 st %i1, [ %g2 + 0x20 ]
40006160: f0 20 a0 44 st %i0, [ %g2 + 0x44 ]
40006164: 84 00 e0 01 add %g3, 1, %g2
40006168: c4 20 60 e0 st %g2, [ %g1 + 0xe0 ]
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
4000616c: 82 10 20 01 mov 1, %g1
40006170: c2 26 20 30 st %g1, [ %i0 + 0x30 ]
40006174: 7f ff ee cd call 40001ca8 <sparc_enable_interrupts>
40006178: d0 07 a0 54 ld [ %fp + 0x54 ], %o0
4000617c: 90 10 00 18 mov %i0, %o0
40006180: 7f ff ff bb call 4000606c <_CORE_mutex_Seize_interrupt_blocking>
40006184: 92 10 00 1b mov %i3, %o1
40006188: 81 c7 e0 08 ret
4000618c: 81 e8 00 00 restore
40006334 <_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
)
{
40006334: 9d e3 bf a0 save %sp, -96, %sp
40006338: a0 10 00 18 mov %i0, %l0
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
4000633c: b0 10 20 00 clr %i0
40006340: 40 00 05 d2 call 40007a88 <_Thread_queue_Dequeue>
40006344: 90 10 00 10 mov %l0, %o0
40006348: 80 a2 20 00 cmp %o0, 0
4000634c: 12 80 00 0e bne 40006384 <_CORE_semaphore_Surrender+0x50>
40006350: 01 00 00 00 nop
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_semaphore_mp_support) ( the_thread, id );
#endif
} else {
_ISR_Disable( level );
40006354: 7f ff ee 51 call 40001c98 <sparc_disable_interrupts>
40006358: 01 00 00 00 nop
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
4000635c: c2 04 20 48 ld [ %l0 + 0x48 ], %g1
40006360: c4 04 20 40 ld [ %l0 + 0x40 ], %g2
40006364: 80 a0 40 02 cmp %g1, %g2
40006368: 1a 80 00 05 bcc 4000637c <_CORE_semaphore_Surrender+0x48> <== NEVER TAKEN
4000636c: b0 10 20 04 mov 4, %i0
the_semaphore->count += 1;
40006370: 82 00 60 01 inc %g1
40006374: b0 10 20 00 clr %i0
40006378: c2 24 20 48 st %g1, [ %l0 + 0x48 ]
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
_ISR_Enable( level );
4000637c: 7f ff ee 4b call 40001ca8 <sparc_enable_interrupts>
40006380: 01 00 00 00 nop
}
return status;
}
40006384: 81 c7 e0 08 ret
40006388: 81 e8 00 00 restore
40004f58 <_Event_Seize>:
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
40004f58: 9d e3 bf a0 save %sp, -96, %sp
rtems_event_set pending_events;
ISR_Level level;
RTEMS_API_Control *api;
Thread_blocking_operation_States sync_state;
executing = _Thread_Executing;
40004f5c: 03 10 00 72 sethi %hi(0x4001c800), %g1
40004f60: e0 00 61 9c ld [ %g1 + 0x19c ], %l0 ! 4001c99c <_Thread_Executing>
executing->Wait.return_code = RTEMS_SUCCESSFUL;
40004f64: c0 24 20 34 clr [ %l0 + 0x34 ]
api = executing->API_Extensions[ THREAD_API_RTEMS ];
_ISR_Disable( level );
40004f68: 7f ff f3 4c call 40001c98 <sparc_disable_interrupts>
40004f6c: e4 04 21 5c ld [ %l0 + 0x15c ], %l2
pending_events = api->pending_events;
40004f70: c2 04 80 00 ld [ %l2 ], %g1
seized_events = _Event_sets_Get( pending_events, event_in );
if ( !_Event_sets_Is_empty( seized_events ) &&
40004f74: a2 8e 00 01 andcc %i0, %g1, %l1
40004f78: 02 80 00 0e be 40004fb0 <_Event_Seize+0x58>
40004f7c: 80 8e 60 01 btst 1, %i1
40004f80: 80 a4 40 18 cmp %l1, %i0
40004f84: 02 80 00 04 be 40004f94 <_Event_Seize+0x3c>
40004f88: 80 8e 60 02 btst 2, %i1
40004f8c: 02 80 00 09 be 40004fb0 <_Event_Seize+0x58> <== NEVER TAKEN
40004f90: 80 8e 60 01 btst 1, %i1
(seized_events == event_in || _Options_Is_any( option_set )) ) {
api->pending_events =
40004f94: 82 28 40 11 andn %g1, %l1, %g1
40004f98: c2 24 80 00 st %g1, [ %l2 ]
_Event_sets_Clear( pending_events, seized_events );
_ISR_Enable( level );
40004f9c: 7f ff f3 43 call 40001ca8 <sparc_enable_interrupts>
40004fa0: 01 00 00 00 nop
40004fa4: e2 26 c0 00 st %l1, [ %i3 ]
40004fa8: 81 c7 e0 08 ret
40004fac: 81 e8 00 00 restore
*event_out = seized_events;
return;
}
if ( _Options_Is_no_wait( option_set ) ) {
40004fb0: 22 80 00 09 be,a 40004fd4 <_Event_Seize+0x7c>
40004fb4: f2 24 20 30 st %i1, [ %l0 + 0x30 ]
_ISR_Enable( level );
40004fb8: 7f ff f3 3c call 40001ca8 <sparc_enable_interrupts>
40004fbc: 01 00 00 00 nop
executing->Wait.return_code = RTEMS_UNSATISFIED;
40004fc0: 82 10 20 0d mov 0xd, %g1 ! d <PROM_START+0xd>
40004fc4: c2 24 20 34 st %g1, [ %l0 + 0x34 ]
*event_out = seized_events;
40004fc8: e2 26 c0 00 st %l1, [ %i3 ]
40004fcc: 81 c7 e0 08 ret
40004fd0: 81 e8 00 00 restore
*
* NOTE: Since interrupts are disabled, this isn't that much of an
* issue but better safe than sorry.
*/
executing->Wait.option = (uint32_t) option_set;
executing->Wait.count = (uint32_t) event_in;
40004fd4: f0 24 20 24 st %i0, [ %l0 + 0x24 ]
executing->Wait.return_argument = event_out;
40004fd8: f6 24 20 28 st %i3, [ %l0 + 0x28 ]
_Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
40004fdc: 84 10 20 01 mov 1, %g2
40004fe0: 03 10 00 74 sethi %hi(0x4001d000), %g1
40004fe4: c4 20 62 14 st %g2, [ %g1 + 0x214 ] ! 4001d214 <_Event_Sync_state>
_ISR_Enable( level );
40004fe8: 7f ff f3 30 call 40001ca8 <sparc_enable_interrupts>
40004fec: 01 00 00 00 nop
if ( ticks ) {
40004ff0: 80 a6 a0 00 cmp %i2, 0
40004ff4: 02 80 00 0f be 40005030 <_Event_Seize+0xd8>
40004ff8: 90 10 00 10 mov %l0, %o0
_Watchdog_Initialize(
40004ffc: c2 04 20 08 ld [ %l0 + 8 ], %g1
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40005000: 11 10 00 72 sethi %hi(0x4001c800), %o0
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
the_watchdog->id = id;
40005004: c2 24 20 68 st %g1, [ %l0 + 0x68 ]
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
40005008: 03 10 00 14 sethi %hi(0x40005000), %g1
4000500c: 82 10 62 04 or %g1, 0x204, %g1 ! 40005204 <_Event_Timeout>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40005010: f4 24 20 54 st %i2, [ %l0 + 0x54 ]
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
40005014: c0 24 20 50 clr [ %l0 + 0x50 ]
the_watchdog->routine = routine;
the_watchdog->id = id;
the_watchdog->user_data = user_data;
40005018: c0 24 20 6c clr [ %l0 + 0x6c ]
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
4000501c: c2 24 20 64 st %g1, [ %l0 + 0x64 ]
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40005020: 90 12 21 bc or %o0, 0x1bc, %o0
40005024: 40 00 0e 02 call 4000882c <_Watchdog_Insert>
40005028: 92 04 20 48 add %l0, 0x48, %o1
NULL
);
_Watchdog_Insert_ticks( &executing->Timer, ticks );
}
_Thread_Set_state( executing, STATES_WAITING_FOR_EVENT );
4000502c: 90 10 00 10 mov %l0, %o0
40005030: 40 00 0b fb call 4000801c <_Thread_Set_state>
40005034: 92 10 21 00 mov 0x100, %o1
_ISR_Disable( level );
40005038: 7f ff f3 18 call 40001c98 <sparc_disable_interrupts>
4000503c: 01 00 00 00 nop
sync_state = _Event_Sync_state;
40005040: 03 10 00 74 sethi %hi(0x4001d000), %g1
40005044: f0 00 62 14 ld [ %g1 + 0x214 ], %i0 ! 4001d214 <_Event_Sync_state>
_Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
40005048: c0 20 62 14 clr [ %g1 + 0x214 ]
if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) {
4000504c: 80 a6 20 01 cmp %i0, 1
40005050: 12 80 00 04 bne 40005060 <_Event_Seize+0x108>
40005054: b2 10 00 10 mov %l0, %i1
_ISR_Enable( level );
40005058: 7f ff f3 14 call 40001ca8 <sparc_enable_interrupts>
4000505c: 91 e8 00 08 restore %g0, %o0, %o0
* An interrupt completed the thread's blocking request.
* The blocking thread was satisfied by an ISR or timed out.
*
* WARNING! Returning with interrupts disabled!
*/
_Thread_blocking_operation_Cancel( sync_state, executing, level );
40005060: 40 00 08 15 call 400070b4 <_Thread_blocking_operation_Cancel>
40005064: 95 e8 00 08 restore %g0, %o0, %o2
400050c4 <_Event_Surrender>:
*/
void _Event_Surrender(
Thread_Control *the_thread
)
{
400050c4: 9d e3 bf a0 save %sp, -96, %sp
rtems_event_set event_condition;
rtems_event_set seized_events;
rtems_option option_set;
RTEMS_API_Control *api;
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
400050c8: e2 06 21 5c ld [ %i0 + 0x15c ], %l1
option_set = (rtems_option) the_thread->Wait.option;
400050cc: e4 06 20 30 ld [ %i0 + 0x30 ], %l2
_ISR_Disable( level );
400050d0: 7f ff f2 f2 call 40001c98 <sparc_disable_interrupts>
400050d4: a0 10 00 18 mov %i0, %l0
400050d8: b0 10 00 08 mov %o0, %i0
pending_events = api->pending_events;
400050dc: c4 04 40 00 ld [ %l1 ], %g2
event_condition = (rtems_event_set) the_thread->Wait.count;
400050e0: c6 04 20 24 ld [ %l0 + 0x24 ], %g3
seized_events = _Event_sets_Get( pending_events, event_condition );
/*
* No events were seized in this operation
*/
if ( _Event_sets_Is_empty( seized_events ) ) {
400050e4: 82 88 c0 02 andcc %g3, %g2, %g1
400050e8: 12 80 00 03 bne 400050f4 <_Event_Surrender+0x30>
400050ec: 09 10 00 72 sethi %hi(0x4001c800), %g4
_ISR_Enable( level );
400050f0: 30 80 00 42 b,a 400051f8 <_Event_Surrender+0x134>
/*
* 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() &&
400050f4: c8 01 21 78 ld [ %g4 + 0x178 ], %g4 ! 4001c978 <_ISR_Nest_level>
400050f8: 80 a1 20 00 cmp %g4, 0
400050fc: 22 80 00 1e be,a 40005174 <_Event_Surrender+0xb0>
40005100: c8 04 20 10 ld [ %l0 + 0x10 ], %g4
40005104: 09 10 00 72 sethi %hi(0x4001c800), %g4
40005108: c8 01 21 9c ld [ %g4 + 0x19c ], %g4 ! 4001c99c <_Thread_Executing>
4000510c: 80 a4 00 04 cmp %l0, %g4
40005110: 32 80 00 19 bne,a 40005174 <_Event_Surrender+0xb0>
40005114: c8 04 20 10 ld [ %l0 + 0x10 ], %g4
_Thread_Is_executing( the_thread ) &&
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
40005118: 09 10 00 74 sethi %hi(0x4001d000), %g4
4000511c: da 01 22 14 ld [ %g4 + 0x214 ], %o5 ! 4001d214 <_Event_Sync_state>
/*
* 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() &&
40005120: 80 a3 60 02 cmp %o5, 2
40005124: 02 80 00 07 be 40005140 <_Event_Surrender+0x7c> <== NEVER TAKEN
40005128: 80 a0 40 03 cmp %g1, %g3
_Thread_Is_executing( the_thread ) &&
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
4000512c: c8 01 22 14 ld [ %g4 + 0x214 ], %g4
/*
* 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() &&
40005130: 80 a1 20 01 cmp %g4, 1
40005134: 32 80 00 10 bne,a 40005174 <_Event_Surrender+0xb0>
40005138: c8 04 20 10 ld [ %l0 + 0x10 ], %g4
_Thread_Is_executing( the_thread ) &&
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
4000513c: 80 a0 40 03 cmp %g1, %g3
40005140: 02 80 00 04 be 40005150 <_Event_Surrender+0x8c>
40005144: 80 8c a0 02 btst 2, %l2
40005148: 02 80 00 0a be 40005170 <_Event_Surrender+0xac> <== NEVER TAKEN
4000514c: 01 00 00 00 nop
api->pending_events = _Event_sets_Clear( pending_events,seized_events );
40005150: 84 28 80 01 andn %g2, %g1, %g2
40005154: c4 24 40 00 st %g2, [ %l1 ]
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
40005158: c4 04 20 28 ld [ %l0 + 0x28 ], %g2
_Thread_Is_executing( the_thread ) &&
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
api->pending_events = _Event_sets_Clear( pending_events,seized_events );
the_thread->Wait.count = 0;
4000515c: c0 24 20 24 clr [ %l0 + 0x24 ]
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
40005160: c2 20 80 00 st %g1, [ %g2 ]
_Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
40005164: 84 10 20 03 mov 3, %g2
40005168: 03 10 00 74 sethi %hi(0x4001d000), %g1
4000516c: c4 20 62 14 st %g2, [ %g1 + 0x214 ] ! 4001d214 <_Event_Sync_state>
}
_ISR_Enable( level );
40005170: 30 80 00 22 b,a 400051f8 <_Event_Surrender+0x134>
}
/*
* Otherwise, this is a normal send to another thread
*/
if ( _States_Is_waiting_for_event( the_thread->current_state ) ) {
40005174: 80 89 21 00 btst 0x100, %g4
40005178: 02 80 00 20 be 400051f8 <_Event_Surrender+0x134>
4000517c: 80 a0 40 03 cmp %g1, %g3
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
40005180: 02 80 00 04 be 40005190 <_Event_Surrender+0xcc>
40005184: 80 8c a0 02 btst 2, %l2
40005188: 02 80 00 1c be 400051f8 <_Event_Surrender+0x134> <== NEVER TAKEN
4000518c: 01 00 00 00 nop
api->pending_events = _Event_sets_Clear( pending_events, seized_events );
40005190: 84 28 80 01 andn %g2, %g1, %g2
40005194: c4 24 40 00 st %g2, [ %l1 ]
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
40005198: c4 04 20 28 ld [ %l0 + 0x28 ], %g2
* Otherwise, this is a normal send to another thread
*/
if ( _States_Is_waiting_for_event( the_thread->current_state ) ) {
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
api->pending_events = _Event_sets_Clear( pending_events, seized_events );
the_thread->Wait.count = 0;
4000519c: c0 24 20 24 clr [ %l0 + 0x24 ]
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
400051a0: c2 20 80 00 st %g1, [ %g2 ]
_ISR_Flash( level );
400051a4: 7f ff f2 c1 call 40001ca8 <sparc_enable_interrupts>
400051a8: 90 10 00 18 mov %i0, %o0
400051ac: 7f ff f2 bb call 40001c98 <sparc_disable_interrupts>
400051b0: 01 00 00 00 nop
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
400051b4: c2 04 20 50 ld [ %l0 + 0x50 ], %g1
400051b8: 80 a0 60 02 cmp %g1, 2
400051bc: 02 80 00 06 be 400051d4 <_Event_Surrender+0x110>
400051c0: 82 10 20 03 mov 3, %g1
_ISR_Enable( level );
400051c4: 7f ff f2 b9 call 40001ca8 <sparc_enable_interrupts>
400051c8: 90 10 00 18 mov %i0, %o0
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
400051cc: 10 80 00 08 b 400051ec <_Event_Surrender+0x128>
400051d0: 33 04 00 ff sethi %hi(0x1003fc00), %i1
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
400051d4: c2 24 20 50 st %g1, [ %l0 + 0x50 ]
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
400051d8: 7f ff f2 b4 call 40001ca8 <sparc_enable_interrupts>
400051dc: 90 10 00 18 mov %i0, %o0
(void) _Watchdog_Remove( &the_thread->Timer );
400051e0: 40 00 0d f0 call 400089a0 <_Watchdog_Remove>
400051e4: 90 04 20 48 add %l0, 0x48, %o0
400051e8: 33 04 00 ff sethi %hi(0x1003fc00), %i1
400051ec: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1003fff8 <RAM_SIZE+0xfc3fff8>
400051f0: 40 00 08 3f call 400072ec <_Thread_Clear_state>
400051f4: 91 e8 00 10 restore %g0, %l0, %o0
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
400051f8: 7f ff f2 ac call 40001ca8 <sparc_enable_interrupts>
400051fc: 81 e8 00 00 restore
40005204 <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *ignored
)
{
40005204: 9d e3 bf 98 save %sp, -104, %sp
Thread_Control *the_thread;
Objects_Locations location;
ISR_Level level;
the_thread = _Thread_Get( id, &location );
40005208: 90 10 00 18 mov %i0, %o0
4000520c: 40 00 09 3c call 400076fc <_Thread_Get>
40005210: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
40005214: c2 07 bf fc ld [ %fp + -4 ], %g1
40005218: 80 a0 60 00 cmp %g1, 0
4000521c: 12 80 00 1c bne 4000528c <_Event_Timeout+0x88> <== NEVER TAKEN
40005220: a0 10 00 08 mov %o0, %l0
*
* 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 );
40005224: 7f ff f2 9d call 40001c98 <sparc_disable_interrupts>
40005228: 01 00 00 00 nop
return;
}
#endif
the_thread->Wait.count = 0;
if ( _Thread_Is_executing( the_thread ) ) {
4000522c: 03 10 00 72 sethi %hi(0x4001c800), %g1
40005230: c2 00 61 9c ld [ %g1 + 0x19c ], %g1 ! 4001c99c <_Thread_Executing>
40005234: 80 a4 00 01 cmp %l0, %g1
40005238: 12 80 00 09 bne 4000525c <_Event_Timeout+0x58>
4000523c: c0 24 20 24 clr [ %l0 + 0x24 ]
if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
40005240: 03 10 00 74 sethi %hi(0x4001d000), %g1
40005244: c4 00 62 14 ld [ %g1 + 0x214 ], %g2 ! 4001d214 <_Event_Sync_state>
40005248: 80 a0 a0 01 cmp %g2, 1
4000524c: 32 80 00 05 bne,a 40005260 <_Event_Timeout+0x5c>
40005250: 82 10 20 06 mov 6, %g1
_Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
40005254: 84 10 20 02 mov 2, %g2
40005258: c4 20 62 14 st %g2, [ %g1 + 0x214 ]
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
4000525c: 82 10 20 06 mov 6, %g1
40005260: c2 24 20 34 st %g1, [ %l0 + 0x34 ]
_ISR_Enable( level );
40005264: 7f ff f2 91 call 40001ca8 <sparc_enable_interrupts>
40005268: 01 00 00 00 nop
4000526c: 90 10 00 10 mov %l0, %o0
40005270: 13 04 00 ff sethi %hi(0x1003fc00), %o1
40005274: 40 00 08 1e call 400072ec <_Thread_Clear_state>
40005278: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1003fff8 <RAM_SIZE+0xfc3fff8>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
4000527c: 03 10 00 72 sethi %hi(0x4001c800), %g1
40005280: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2 ! 4001c8e0 <_Thread_Dispatch_disable_level>
40005284: 84 00 bf ff add %g2, -1, %g2
40005288: c4 20 60 e0 st %g2, [ %g1 + 0xe0 ]
4000528c: 81 c7 e0 08 ret
40005290: 81 e8 00 00 restore
4000b750 <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
4000b750: 9d e3 bf 90 save %sp, -112, %sp
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *block = _Heap_Free_list_first( heap );
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_BLOCK_SIZE_OFFSET;
4000b754: ac 06 60 04 add %i1, 4, %l6
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
4000b758: e4 06 20 08 ld [ %i0 + 8 ], %l2
uintptr_t const page_size = heap->page_size;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
4000b75c: 80 a5 80 19 cmp %l6, %i1
4000b760: 0a 80 00 6d bcs 4000b914 <_Heap_Allocate_aligned_with_boundary+0x1c4>
4000b764: e8 06 20 10 ld [ %i0 + 0x10 ], %l4
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
4000b768: 80 a6 e0 00 cmp %i3, 0
4000b76c: 02 80 00 08 be 4000b78c <_Heap_Allocate_aligned_with_boundary+0x3c>
4000b770: 82 10 20 04 mov 4, %g1
if ( boundary < alloc_size ) {
4000b774: 80 a6 c0 19 cmp %i3, %i1
4000b778: 0a 80 00 67 bcs 4000b914 <_Heap_Allocate_aligned_with_boundary+0x1c4>
4000b77c: 80 a6 a0 00 cmp %i2, 0
return NULL;
}
if ( alignment == 0 ) {
4000b780: 22 80 00 03 be,a 4000b78c <_Heap_Allocate_aligned_with_boundary+0x3c>
4000b784: b4 10 00 14 mov %l4, %i2
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
4000b788: 82 10 20 04 mov 4, %g1
4000b78c: 82 20 40 19 sub %g1, %i1, %g1
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
return NULL;
}
if ( alignment == 0 ) {
4000b790: a2 10 20 00 clr %l1
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
4000b794: c2 27 bf f4 st %g1, [ %fp + -12 ]
/* Ensure that the we have a valid new block at the beginning */
if ( alloc_begin >= alloc_begin_floor ) {
uintptr_t const alloc_block_begin =
(uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size );
uintptr_t const free_size = alloc_block_begin - block_begin;
4000b798: b8 10 3f f8 mov -8, %i4
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
4000b79c: 82 05 20 07 add %l4, 7, %g1
4000b7a0: 10 80 00 4b b 4000b8cc <_Heap_Allocate_aligned_with_boundary+0x17c>
4000b7a4: c2 27 bf f8 st %g1, [ %fp + -8 ]
/*
* The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag
* field. Thus the value is about one unit larger than the real block
* size. The greater than operator takes this into account.
*/
if ( block->size_and_flag > block_size_floor ) {
4000b7a8: 80 a4 c0 16 cmp %l3, %l6
4000b7ac: 08 80 00 47 bleu 4000b8c8 <_Heap_Allocate_aligned_with_boundary+0x178>
4000b7b0: a2 04 60 01 inc %l1
if ( alignment == 0 ) {
4000b7b4: 80 a6 a0 00 cmp %i2, 0
4000b7b8: 12 80 00 04 bne 4000b7c8 <_Heap_Allocate_aligned_with_boundary+0x78>
4000b7bc: aa 04 a0 08 add %l2, 8, %l5
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
4000b7c0: 10 80 00 3f b 4000b8bc <_Heap_Allocate_aligned_with_boundary+0x16c>
4000b7c4: a0 10 00 15 mov %l5, %l0
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
4000b7c8: c4 07 bf f4 ld [ %fp + -12 ], %g2
uintptr_t alignment,
uintptr_t boundary
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
4000b7cc: ee 06 20 14 ld [ %i0 + 0x14 ], %l7
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
4000b7d0: a6 0c ff fe and %l3, -2, %l3
4000b7d4: a6 04 80 13 add %l2, %l3, %l3
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
4000b7d8: a0 00 80 13 add %g2, %l3, %l0
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
4000b7dc: c4 07 bf f8 ld [ %fp + -8 ], %g2
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
4000b7e0: 90 10 00 10 mov %l0, %o0
4000b7e4: 82 20 80 17 sub %g2, %l7, %g1
4000b7e8: 92 10 00 1a mov %i2, %o1
4000b7ec: 40 00 31 9f call 40017e68 <.urem>
4000b7f0: a6 00 40 13 add %g1, %l3, %l3
4000b7f4: a0 24 00 08 sub %l0, %o0, %l0
uintptr_t alloc_begin = alloc_end - alloc_size;
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
/* Ensure that the we have a valid new block at the end */
if ( alloc_begin > alloc_begin_ceiling ) {
4000b7f8: 80 a4 00 13 cmp %l0, %l3
4000b7fc: 08 80 00 07 bleu 4000b818 <_Heap_Allocate_aligned_with_boundary+0xc8>
4000b800: 80 a6 e0 00 cmp %i3, 0
4000b804: 90 10 00 13 mov %l3, %o0
4000b808: 40 00 31 98 call 40017e68 <.urem>
4000b80c: 92 10 00 1a mov %i2, %o1
4000b810: a0 24 c0 08 sub %l3, %o0, %l0
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
4000b814: 80 a6 e0 00 cmp %i3, 0
4000b818: 02 80 00 1d be 4000b88c <_Heap_Allocate_aligned_with_boundary+0x13c>
4000b81c: 80 a4 00 15 cmp %l0, %l5
/* Ensure that the we have a valid new block at the end */
if ( alloc_begin > alloc_begin_ceiling ) {
alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment );
}
alloc_end = alloc_begin + alloc_size;
4000b820: a6 04 00 19 add %l0, %i1, %l3
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
4000b824: 82 05 40 19 add %l5, %i1, %g1
4000b828: 92 10 00 1b mov %i3, %o1
4000b82c: 90 10 00 13 mov %l3, %o0
4000b830: 10 80 00 0b b 4000b85c <_Heap_Allocate_aligned_with_boundary+0x10c>
4000b834: c2 27 bf fc st %g1, [ %fp + -4 ]
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
4000b838: 80 a0 40 02 cmp %g1, %g2
4000b83c: 2a 80 00 24 bcs,a 4000b8cc <_Heap_Allocate_aligned_with_boundary+0x17c>
4000b840: e4 04 a0 08 ld [ %l2 + 8 ], %l2
4000b844: 40 00 31 89 call 40017e68 <.urem>
4000b848: 01 00 00 00 nop
4000b84c: 92 10 00 1b mov %i3, %o1
4000b850: a0 27 40 08 sub %i5, %o0, %l0
return 0;
}
alloc_begin = boundary_line - alloc_size;
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
4000b854: a6 04 00 19 add %l0, %i1, %l3
4000b858: 90 10 00 13 mov %l3, %o0
4000b85c: 40 00 31 83 call 40017e68 <.urem>
4000b860: 01 00 00 00 nop
4000b864: 92 10 00 1a mov %i2, %o1
4000b868: 82 24 c0 08 sub %l3, %o0, %g1
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
return 0;
}
alloc_begin = boundary_line - alloc_size;
4000b86c: ba 20 40 19 sub %g1, %i1, %i5
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
4000b870: 80 a0 40 13 cmp %g1, %l3
4000b874: 1a 80 00 05 bcc 4000b888 <_Heap_Allocate_aligned_with_boundary+0x138>
4000b878: 90 10 00 1d mov %i5, %o0
4000b87c: 80 a4 00 01 cmp %l0, %g1
4000b880: 0a bf ff ee bcs 4000b838 <_Heap_Allocate_aligned_with_boundary+0xe8>
4000b884: c4 07 bf fc ld [ %fp + -4 ], %g2
boundary_line = _Heap_Align_down( alloc_end, boundary );
}
}
/* Ensure that the we have a valid new block at the beginning */
if ( alloc_begin >= alloc_begin_floor ) {
4000b888: 80 a4 00 15 cmp %l0, %l5
4000b88c: 0a 80 00 0f bcs 4000b8c8 <_Heap_Allocate_aligned_with_boundary+0x178>
4000b890: a6 27 00 12 sub %i4, %l2, %l3
uintptr_t const alloc_block_begin =
(uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size );
uintptr_t const free_size = alloc_block_begin - block_begin;
4000b894: 90 10 00 10 mov %l0, %o0
4000b898: a6 04 c0 10 add %l3, %l0, %l3
4000b89c: 40 00 31 73 call 40017e68 <.urem>
4000b8a0: 92 10 00 14 mov %l4, %o1
if ( free_size >= min_block_size || free_size == 0 ) {
4000b8a4: 90 a4 c0 08 subcc %l3, %o0, %o0
4000b8a8: 02 80 00 06 be 4000b8c0 <_Heap_Allocate_aligned_with_boundary+0x170>
4000b8ac: 80 a4 20 00 cmp %l0, 0
4000b8b0: 80 a2 00 17 cmp %o0, %l7
4000b8b4: 2a 80 00 06 bcs,a 4000b8cc <_Heap_Allocate_aligned_with_boundary+0x17c>
4000b8b8: e4 04 a0 08 ld [ %l2 + 8 ], %l2
boundary
);
}
}
if ( alloc_begin != 0 ) {
4000b8bc: 80 a4 20 00 cmp %l0, 0
4000b8c0: 32 80 00 08 bne,a 4000b8e0 <_Heap_Allocate_aligned_with_boundary+0x190><== ALWAYS TAKEN
4000b8c4: c2 06 20 4c ld [ %i0 + 0x4c ], %g1
break;
}
block = block->next;
4000b8c8: e4 04 a0 08 ld [ %l2 + 8 ], %l2
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
4000b8cc: 80 a4 80 18 cmp %l2, %i0
4000b8d0: 32 bf ff b6 bne,a 4000b7a8 <_Heap_Allocate_aligned_with_boundary+0x58>
4000b8d4: e6 04 a0 04 ld [ %l2 + 4 ], %l3
4000b8d8: 10 80 00 09 b 4000b8fc <_Heap_Allocate_aligned_with_boundary+0x1ac>
4000b8dc: a0 10 20 00 clr %l0
if ( alloc_begin != 0 ) {
/* Statistics */
stats->searches += search_count;
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
4000b8e0: 92 10 00 12 mov %l2, %o1
block = block->next;
}
if ( alloc_begin != 0 ) {
/* Statistics */
stats->searches += search_count;
4000b8e4: 82 00 40 11 add %g1, %l1, %g1
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
4000b8e8: 96 10 00 19 mov %i1, %o3
block = block->next;
}
if ( alloc_begin != 0 ) {
/* Statistics */
stats->searches += search_count;
4000b8ec: c2 26 20 4c st %g1, [ %i0 + 0x4c ]
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
4000b8f0: 90 10 00 18 mov %i0, %o0
4000b8f4: 7f ff eb 69 call 40006698 <_Heap_Block_allocate>
4000b8f8: 94 10 00 10 mov %l0, %o2
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
Heap_Statistics *const stats = &heap->stats;
4000b8fc: c2 06 20 44 ld [ %i0 + 0x44 ], %g1
4000b900: 80 a0 40 11 cmp %g1, %l1
4000b904: 2a 80 00 02 bcs,a 4000b90c <_Heap_Allocate_aligned_with_boundary+0x1bc>
4000b908: e2 26 20 44 st %l1, [ %i0 + 0x44 ]
/* Statistics */
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
4000b90c: 81 c7 e0 08 ret
4000b910: 91 e8 00 10 restore %g0, %l0, %o0
}
4000b914: 81 c7 e0 08 ret
4000b918: 91 e8 20 00 restore %g0, 0, %o0
40010d4c <_Heap_Extend>:
Heap_Control *heap,
void *area_begin_ptr,
uintptr_t area_size,
uintptr_t *amount_extended
)
{
40010d4c: 9d e3 bf a0 save %sp, -96, %sp
Heap_Statistics *const stats = &heap->stats;
uintptr_t const area_begin = (uintptr_t) area_begin_ptr;
uintptr_t const heap_area_begin = heap->area_begin;
uintptr_t const heap_area_end = heap->area_end;
40010d50: c2 06 20 1c ld [ %i0 + 0x1c ], %g1
Heap_Control *heap,
void *area_begin_ptr,
uintptr_t area_size,
uintptr_t *amount_extended
)
{
40010d54: a0 10 00 18 mov %i0, %l0
* 5. non-contiguous higher address (NOT SUPPORTED)
*
* As noted, this code only supports (4).
*/
if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) {
40010d58: 80 a6 40 01 cmp %i1, %g1
40010d5c: 1a 80 00 07 bcc 40010d78 <_Heap_Extend+0x2c>
40010d60: e2 06 20 24 ld [ %i0 + 0x24 ], %l1
uintptr_t *amount_extended
)
{
Heap_Statistics *const stats = &heap->stats;
uintptr_t const area_begin = (uintptr_t) area_begin_ptr;
uintptr_t const heap_area_begin = heap->area_begin;
40010d64: c4 06 20 18 ld [ %i0 + 0x18 ], %g2
40010d68: 80 a6 40 02 cmp %i1, %g2
40010d6c: 1a 80 00 28 bcc 40010e0c <_Heap_Extend+0xc0>
40010d70: b0 10 20 01 mov 1, %i0
* As noted, this code only supports (4).
*/
if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) {
return HEAP_EXTEND_ERROR; /* case 3 */
} else if ( area_begin != heap_area_end ) {
40010d74: 80 a6 40 01 cmp %i1, %g1
40010d78: 12 80 00 25 bne 40010e0c <_Heap_Extend+0xc0>
40010d7c: b0 10 20 02 mov 2, %i0
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
40010d80: d2 04 20 10 ld [ %l0 + 0x10 ], %o1
{
Heap_Statistics *const stats = &heap->stats;
uintptr_t const area_begin = (uintptr_t) area_begin_ptr;
uintptr_t const heap_area_begin = heap->area_begin;
uintptr_t const heap_area_end = heap->area_end;
uintptr_t const new_heap_area_end = heap_area_end + area_size;
40010d84: b4 06 40 1a add %i1, %i2, %i2
* block and free it.
*/
heap->area_end = new_heap_area_end;
extend_size = new_heap_area_end
40010d88: b2 26 80 11 sub %i2, %l1, %i1
* Currently only case 4 should make it to this point.
* The basic trick is to make the extend area look like a used
* block and free it.
*/
heap->area_end = new_heap_area_end;
40010d8c: f4 24 20 1c st %i2, [ %l0 + 0x1c ]
extend_size = new_heap_area_end
40010d90: b2 06 7f f8 add %i1, -8, %i1
40010d94: 7f ff cc ed call 40004148 <.urem>
40010d98: 90 10 00 19 mov %i1, %o0
40010d9c: 90 26 40 08 sub %i1, %o0, %o0
- (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE;
extend_size = _Heap_Align_down( extend_size, heap->page_size );
*amount_extended = extend_size;
40010da0: d0 26 c0 00 st %o0, [ %i3 ]
if( extend_size >= heap->min_block_size ) {
40010da4: c2 04 20 14 ld [ %l0 + 0x14 ], %g1
40010da8: 80 a2 00 01 cmp %o0, %g1
40010dac: 0a 80 00 18 bcs 40010e0c <_Heap_Extend+0xc0> <== NEVER TAKEN
40010db0: b0 10 20 00 clr %i0
uintptr_t size
)
{
uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED;
block->size_and_flag = size | flag;
40010db4: c2 04 60 04 ld [ %l1 + 4 ], %g1
Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size );
_Heap_Block_set_size( last_block, extend_size );
new_last_block->size_and_flag =
40010db8: c4 04 20 20 ld [ %l0 + 0x20 ], %g2
40010dbc: 82 08 60 01 and %g1, 1, %g1
40010dc0: 82 12 00 01 or %o0, %g1, %g1
40010dc4: c2 24 60 04 st %g1, [ %l1 + 4 ]
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
40010dc8: 82 02 00 11 add %o0, %l1, %g1
40010dcc: 84 20 80 01 sub %g2, %g1, %g2
40010dd0: 84 10 a0 01 or %g2, 1, %g2
40010dd4: c4 20 60 04 st %g2, [ %g1 + 4 ]
heap->last_block = new_last_block;
/* Statistics */
stats->size += extend_size;
++stats->used_blocks;
40010dd8: c6 04 20 40 ld [ %l0 + 0x40 ], %g3
| HEAP_PREV_BLOCK_USED;
heap->last_block = new_last_block;
/* Statistics */
stats->size += extend_size;
40010ddc: f2 04 20 2c ld [ %l0 + 0x2c ], %i1
++stats->used_blocks;
--stats->frees; /* Do not count subsequent call as actual free() */
40010de0: c4 04 20 50 ld [ %l0 + 0x50 ], %g2
new_last_block->size_and_flag =
((uintptr_t) heap->first_block - (uintptr_t) new_last_block)
| HEAP_PREV_BLOCK_USED;
heap->last_block = new_last_block;
40010de4: c2 24 20 24 st %g1, [ %l0 + 0x24 ]
/* Statistics */
stats->size += extend_size;
++stats->used_blocks;
40010de8: 82 00 e0 01 add %g3, 1, %g1
| HEAP_PREV_BLOCK_USED;
heap->last_block = new_last_block;
/* Statistics */
stats->size += extend_size;
40010dec: 90 06 40 08 add %i1, %o0, %o0
++stats->used_blocks;
40010df0: c2 24 20 40 st %g1, [ %l0 + 0x40 ]
--stats->frees; /* Do not count subsequent call as actual free() */
40010df4: 82 00 bf ff add %g2, -1, %g1
| HEAP_PREV_BLOCK_USED;
heap->last_block = new_last_block;
/* Statistics */
stats->size += extend_size;
40010df8: d0 24 20 2c st %o0, [ %l0 + 0x2c ]
++stats->used_blocks;
--stats->frees; /* Do not count subsequent call as actual free() */
40010dfc: c2 24 20 50 st %g1, [ %l0 + 0x50 ]
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block ));
40010e00: 90 10 00 10 mov %l0, %o0
40010e04: 7f ff e8 fb call 4000b1f0 <_Heap_Free>
40010e08: 92 04 60 08 add %l1, 8, %o1
}
return HEAP_EXTEND_SUCCESSFUL;
}
40010e0c: 81 c7 e0 08 ret
40010e10: 81 e8 00 00 restore
4000b91c <_Heap_Free>:
#include <rtems/system.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/heap.h>
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
4000b91c: 9d e3 bf a0 save %sp, -96, %sp
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area(
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
4000b920: d2 06 20 10 ld [ %i0 + 0x10 ], %o1
4000b924: 40 00 31 51 call 40017e68 <.urem>
4000b928: 90 10 00 19 mov %i1, %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;
4000b92c: c2 06 20 20 ld [ %i0 + 0x20 ], %g1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area(
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
4000b930: b2 06 7f f8 add %i1, -8, %i1
4000b934: 90 26 40 08 sub %i1, %o0, %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
4000b938: 80 a2 00 01 cmp %o0, %g1
4000b93c: 0a 80 00 05 bcs 4000b950 <_Heap_Free+0x34>
4000b940: 84 10 20 00 clr %g2
4000b944: c4 06 20 24 ld [ %i0 + 0x24 ], %g2
4000b948: 80 a0 80 08 cmp %g2, %o0
4000b94c: 84 60 3f ff subx %g0, -1, %g2
Heap_Block *next_block = NULL;
uintptr_t block_size = 0;
uintptr_t next_block_size = 0;
bool next_is_free = false;
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
4000b950: 80 a0 a0 00 cmp %g2, 0
4000b954: 02 80 00 6a be 4000bafc <_Heap_Free+0x1e0>
4000b958: 01 00 00 00 nop
- 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;
4000b95c: c8 02 20 04 ld [ %o0 + 4 ], %g4
4000b960: 86 09 3f fe and %g4, -2, %g3
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
4000b964: 84 02 00 03 add %o0, %g3, %g2
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
4000b968: 80 a0 80 01 cmp %g2, %g1
4000b96c: 0a 80 00 05 bcs 4000b980 <_Heap_Free+0x64> <== NEVER TAKEN
4000b970: 9a 10 20 00 clr %o5
4000b974: da 06 20 24 ld [ %i0 + 0x24 ], %o5
4000b978: 80 a3 40 02 cmp %o5, %g2
4000b97c: 9a 60 3f ff subx %g0, -1, %o5
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
4000b980: 80 a3 60 00 cmp %o5, 0
4000b984: 02 80 00 5e be 4000bafc <_Heap_Free+0x1e0> <== NEVER TAKEN
4000b988: 01 00 00 00 nop
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;
4000b98c: da 00 a0 04 ld [ %g2 + 4 ], %o5
_HAssert( false );
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
4000b990: 80 8b 60 01 btst 1, %o5
4000b994: 02 80 00 5a be 4000bafc <_Heap_Free+0x1e0> <== NEVER TAKEN
4000b998: 9a 0b 7f fe and %o5, -2, %o5
return false;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
4000b99c: d2 06 20 24 ld [ %i0 + 0x24 ], %o1
_HAssert( false );
return false;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
4000b9a0: 80 a0 80 09 cmp %g2, %o1
4000b9a4: 02 80 00 06 be 4000b9bc <_Heap_Free+0xa0>
4000b9a8: 96 10 20 00 clr %o3
4000b9ac: 98 00 80 0d add %g2, %o5, %o4
4000b9b0: d6 03 20 04 ld [ %o4 + 4 ], %o3
4000b9b4: 96 0a e0 01 and %o3, 1, %o3
4000b9b8: 96 1a e0 01 xor %o3, 1, %o3
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
if ( !_Heap_Is_prev_used( block ) ) {
4000b9bc: 80 89 20 01 btst 1, %g4
4000b9c0: 12 80 00 26 bne 4000ba58 <_Heap_Free+0x13c>
4000b9c4: 80 a2 e0 00 cmp %o3, 0
uintptr_t const prev_size = block->prev_size;
4000b9c8: d8 02 00 00 ld [ %o0 ], %o4
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
4000b9cc: 88 22 00 0c sub %o0, %o4, %g4
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
4000b9d0: 80 a1 00 01 cmp %g4, %g1
4000b9d4: 0a 80 00 04 bcs 4000b9e4 <_Heap_Free+0xc8> <== NEVER TAKEN
4000b9d8: 94 10 20 00 clr %o2
4000b9dc: 80 a2 40 04 cmp %o1, %g4
4000b9e0: 94 60 3f ff subx %g0, -1, %o2
Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size );
if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) {
4000b9e4: 80 a2 a0 00 cmp %o2, 0
4000b9e8: 02 80 00 45 be 4000bafc <_Heap_Free+0x1e0> <== NEVER TAKEN
4000b9ec: 01 00 00 00 nop
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) ) {
4000b9f0: c2 01 20 04 ld [ %g4 + 4 ], %g1
4000b9f4: 80 88 60 01 btst 1, %g1
4000b9f8: 02 80 00 41 be 4000bafc <_Heap_Free+0x1e0> <== NEVER TAKEN
4000b9fc: 80 a2 e0 00 cmp %o3, 0
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
4000ba00: 22 80 00 0f be,a 4000ba3c <_Heap_Free+0x120>
4000ba04: 98 00 c0 0c add %g3, %o4, %o4
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
4000ba08: c2 06 20 38 ld [ %i0 + 0x38 ], %g1
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
Heap_Block *prev = block->prev;
4000ba0c: d6 00 a0 0c ld [ %g2 + 0xc ], %o3
return _Heap_Free_list_tail(heap)->prev;
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
4000ba10: c4 00 a0 08 ld [ %g2 + 8 ], %g2
4000ba14: 82 00 7f ff add %g1, -1, %g1
4000ba18: c2 26 20 38 st %g1, [ %i0 + 0x38 ]
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
4000ba1c: 9a 00 c0 0d add %g3, %o5, %o5
Heap_Block *prev = block->prev;
prev->next = next;
next->prev = prev;
4000ba20: d6 20 a0 0c st %o3, [ %g2 + 0xc ]
4000ba24: 98 03 40 0c add %o5, %o4, %o4
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
Heap_Block *prev = block->prev;
prev->next = next;
4000ba28: c4 22 e0 08 st %g2, [ %o3 + 8 ]
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
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;
4000ba2c: d8 21 00 0c st %o4, [ %g4 + %o4 ]
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;
4000ba30: 98 13 20 01 or %o4, 1, %o4
4000ba34: 10 80 00 27 b 4000bad0 <_Heap_Free+0x1b4>
4000ba38: d8 21 20 04 st %o4, [ %g4 + 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;
4000ba3c: 82 13 20 01 or %o4, 1, %g1
4000ba40: c2 21 20 04 st %g1, [ %g4 + 4 ]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4000ba44: c2 00 a0 04 ld [ %g2 + 4 ], %g1
next_block->prev_size = size;
4000ba48: d8 22 00 03 st %o4, [ %o0 + %g3 ]
_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;
4000ba4c: 82 08 7f fe and %g1, -2, %g1
4000ba50: 10 80 00 20 b 4000bad0 <_Heap_Free+0x1b4>
4000ba54: c2 20 a0 04 st %g1, [ %g2 + 4 ]
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
4000ba58: 02 80 00 0d be 4000ba8c <_Heap_Free+0x170>
4000ba5c: 82 10 e0 01 or %g3, 1, %g1
Heap_Block *old_block,
Heap_Block *new_block
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
4000ba60: c2 00 a0 0c ld [ %g2 + 0xc ], %g1
RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace(
Heap_Block *old_block,
Heap_Block *new_block
)
{
Heap_Block *next = old_block->next;
4000ba64: c4 00 a0 08 ld [ %g2 + 8 ], %g2
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
4000ba68: c2 22 20 0c st %g1, [ %o0 + 0xc ]
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
new_block->next = next;
4000ba6c: c4 22 20 08 st %g2, [ %o0 + 8 ]
new_block->prev = prev;
next->prev = new_block;
prev->next = new_block;
4000ba70: 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;
4000ba74: d0 20 a0 0c st %o0, [ %g2 + 0xc ]
uintptr_t const size = block_size + next_block_size;
4000ba78: 82 03 40 03 add %o5, %g3, %g1
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
4000ba7c: c2 22 00 01 st %g1, [ %o0 + %g1 ]
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;
4000ba80: 82 10 60 01 or %g1, 1, %g1
4000ba84: 10 80 00 13 b 4000bad0 <_Heap_Free+0x1b4>
4000ba88: c2 22 20 04 st %g1, [ %o0 + 4 ]
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;
4000ba8c: c2 22 20 04 st %g1, [ %o0 + 4 ]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4000ba90: c2 00 a0 04 ld [ %g2 + 4 ], %g1
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
4000ba94: c8 06 20 08 ld [ %i0 + 8 ], %g4
4000ba98: 82 08 7f fe and %g1, -2, %g1
next_block->prev_size = block_size;
4000ba9c: c6 22 00 03 st %g3, [ %o0 + %g3 ]
} 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;
4000baa0: c2 20 a0 04 st %g1, [ %g2 + 4 ]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
4000baa4: c2 06 20 38 ld [ %i0 + 0x38 ], %g1
new_block->next = next;
4000baa8: c8 22 20 08 st %g4, [ %o0 + 8 ]
new_block->prev = block_before;
4000baac: f0 22 20 0c st %i0, [ %o0 + 0xc ]
#include <rtems/score/sysstate.h>
#include <rtems/score/heap.h>
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
Heap_Statistics *const stats = &heap->stats;
4000bab0: c4 06 20 3c ld [ %i0 + 0x3c ], %g2
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;
4000bab4: 82 00 60 01 inc %g1
block_before->next = new_block;
next->prev = new_block;
4000bab8: d0 21 20 0c st %o0, [ %g4 + 0xc ]
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
4000babc: d0 26 20 08 st %o0, [ %i0 + 8 ]
#include <rtems/score/sysstate.h>
#include <rtems/score/heap.h>
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
Heap_Statistics *const stats = &heap->stats;
4000bac0: 80 a0 80 01 cmp %g2, %g1
4000bac4: 1a 80 00 03 bcc 4000bad0 <_Heap_Free+0x1b4>
4000bac8: c2 26 20 38 st %g1, [ %i0 + 0x38 ]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
stats->max_free_blocks = stats->free_blocks;
4000bacc: c2 26 20 3c st %g1, [ %i0 + 0x3c ]
}
}
/* Statistics */
--stats->used_blocks;
4000bad0: c4 06 20 40 ld [ %i0 + 0x40 ], %g2
++stats->frees;
4000bad4: c2 06 20 50 ld [ %i0 + 0x50 ], %g1
stats->free_size += block_size;
4000bad8: c8 06 20 30 ld [ %i0 + 0x30 ], %g4
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
4000badc: 84 00 bf ff add %g2, -1, %g2
++stats->frees;
stats->free_size += block_size;
4000bae0: 86 01 00 03 add %g4, %g3, %g3
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
4000bae4: c4 26 20 40 st %g2, [ %i0 + 0x40 ]
++stats->frees;
stats->free_size += block_size;
4000bae8: c6 26 20 30 st %g3, [ %i0 + 0x30 ]
}
}
/* Statistics */
--stats->used_blocks;
++stats->frees;
4000baec: 82 00 60 01 inc %g1
4000baf0: c2 26 20 50 st %g1, [ %i0 + 0x50 ]
stats->free_size += block_size;
return( true );
4000baf4: 81 c7 e0 08 ret
4000baf8: 91 e8 20 01 restore %g0, 1, %o0
}
4000bafc: 81 c7 e0 08 ret
4000bb00: 91 e8 20 00 restore %g0, 0, %o0
4001a664 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
4001a664: 9d e3 bf a0 save %sp, -96, %sp
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area(
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
4001a668: d2 06 20 10 ld [ %i0 + 0x10 ], %o1
4001a66c: 7f ff f5 ff call 40017e68 <.urem>
4001a670: 90 10 00 19 mov %i1, %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;
4001a674: c2 06 20 20 ld [ %i0 + 0x20 ], %g1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area(
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
4001a678: 84 06 7f f8 add %i1, -8, %g2
4001a67c: 90 20 80 08 sub %g2, %o0, %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
4001a680: 80 a2 00 01 cmp %o0, %g1
4001a684: 0a 80 00 05 bcs 4001a698 <_Heap_Size_of_alloc_area+0x34>
4001a688: 84 10 20 00 clr %g2
4001a68c: c4 06 20 24 ld [ %i0 + 0x24 ], %g2
4001a690: 80 a0 80 08 cmp %g2, %o0
4001a694: 84 60 3f ff subx %g0, -1, %g2
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 ) ) {
4001a698: 80 a0 a0 00 cmp %g2, 0
4001a69c: 02 80 00 16 be 4001a6f4 <_Heap_Size_of_alloc_area+0x90>
4001a6a0: 01 00 00 00 nop
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
4001a6a4: c4 02 20 04 ld [ %o0 + 4 ], %g2
4001a6a8: 84 08 bf fe and %g2, -2, %g2
4001a6ac: 84 02 00 02 add %o0, %g2, %g2
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
4001a6b0: 80 a0 80 01 cmp %g2, %g1
4001a6b4: 0a 80 00 05 bcs 4001a6c8 <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN
4001a6b8: 86 10 20 00 clr %g3
4001a6bc: c2 06 20 24 ld [ %i0 + 0x24 ], %g1
4001a6c0: 80 a0 40 02 cmp %g1, %g2
4001a6c4: 86 60 3f ff subx %g0, -1, %g3
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
4001a6c8: 80 a0 e0 00 cmp %g3, 0
4001a6cc: 02 80 00 0a be 4001a6f4 <_Heap_Size_of_alloc_area+0x90> <== NEVER TAKEN
4001a6d0: 01 00 00 00 nop
4001a6d4: c2 00 a0 04 ld [ %g2 + 4 ], %g1
4001a6d8: 80 88 60 01 btst 1, %g1
4001a6dc: 02 80 00 06 be 4001a6f4 <_Heap_Size_of_alloc_area+0x90> <== NEVER TAKEN
4001a6e0: 84 20 80 19 sub %g2, %i1, %g2
|| !_Heap_Is_prev_used( next_block )
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin;
4001a6e4: 84 00 a0 04 add %g2, 4, %g2
4001a6e8: c4 26 80 00 st %g2, [ %i2 ]
return true;
4001a6ec: 81 c7 e0 08 ret
4001a6f0: 91 e8 20 01 restore %g0, 1, %o0
}
4001a6f4: 81 c7 e0 08 ret
4001a6f8: 91 e8 20 00 restore %g0, 0, %o0
40007618 <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
40007618: 9d e3 bf 88 save %sp, -120, %sp
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = heap->first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
4000761c: 23 10 00 1e sethi %hi(0x40007800), %l1
40007620: 80 8e a0 ff btst 0xff, %i2
40007624: a2 14 62 f0 or %l1, 0x2f0, %l1
Heap_Control *heap,
int source,
bool dump
)
{
uintptr_t const page_size = heap->page_size;
40007628: e4 06 20 10 ld [ %i0 + 0x10 ], %l2
uintptr_t const min_block_size = heap->min_block_size;
4000762c: e6 06 20 14 ld [ %i0 + 0x14 ], %l3
Heap_Block *const last_block = heap->last_block;
40007630: e8 06 20 24 ld [ %i0 + 0x24 ], %l4
Heap_Block *block = heap->first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
40007634: 12 80 00 04 bne 40007644 <_Heap_Walk+0x2c>
40007638: e0 06 20 20 ld [ %i0 + 0x20 ], %l0
4000763c: 23 10 00 1d sethi %hi(0x40007400), %l1
40007640: a2 14 62 10 or %l1, 0x210, %l1 ! 40007610 <_Heap_Walk_print_nothing>
if ( !_System_state_Is_up( _System_state_Get() ) ) {
40007644: 03 10 00 7c sethi %hi(0x4001f000), %g1
40007648: c2 00 61 40 ld [ %g1 + 0x140 ], %g1 ! 4001f140 <_System_state_Current>
4000764c: 80 a0 60 03 cmp %g1, 3
40007650: 12 80 01 1e bne 40007ac8 <_Heap_Walk+0x4b0>
40007654: 90 10 00 19 mov %i1, %o0
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)(
40007658: da 06 20 18 ld [ %i0 + 0x18 ], %o5
4000765c: c6 06 20 1c ld [ %i0 + 0x1c ], %g3
40007660: c4 06 20 08 ld [ %i0 + 8 ], %g2
40007664: c2 06 20 0c ld [ %i0 + 0xc ], %g1
40007668: c6 23 a0 5c st %g3, [ %sp + 0x5c ]
4000766c: c4 23 a0 68 st %g2, [ %sp + 0x68 ]
40007670: c2 23 a0 6c st %g1, [ %sp + 0x6c ]
40007674: e0 23 a0 60 st %l0, [ %sp + 0x60 ]
40007678: e8 23 a0 64 st %l4, [ %sp + 0x64 ]
4000767c: 92 10 20 00 clr %o1
40007680: 15 10 00 70 sethi %hi(0x4001c000), %o2
40007684: 96 10 00 12 mov %l2, %o3
40007688: 94 12 a2 80 or %o2, 0x280, %o2
4000768c: 9f c4 40 00 call %l1
40007690: 98 10 00 13 mov %l3, %o4
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
40007694: 80 a4 a0 00 cmp %l2, 0
40007698: 12 80 00 07 bne 400076b4 <_Heap_Walk+0x9c>
4000769c: 80 8c a0 07 btst 7, %l2
(*printer)( source, true, "page size is zero\n" );
400076a0: 15 10 00 70 sethi %hi(0x4001c000), %o2
400076a4: 90 10 00 19 mov %i1, %o0
400076a8: 92 10 20 01 mov 1, %o1
400076ac: 10 80 00 27 b 40007748 <_Heap_Walk+0x130>
400076b0: 94 12 a3 18 or %o2, 0x318, %o2
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
400076b4: 22 80 00 08 be,a 400076d4 <_Heap_Walk+0xbc>
400076b8: 90 10 00 13 mov %l3, %o0
(*printer)(
400076bc: 15 10 00 70 sethi %hi(0x4001c000), %o2
400076c0: 90 10 00 19 mov %i1, %o0
400076c4: 96 10 00 12 mov %l2, %o3
400076c8: 92 10 20 01 mov 1, %o1
400076cc: 10 80 01 05 b 40007ae0 <_Heap_Walk+0x4c8>
400076d0: 94 12 a3 30 or %o2, 0x330, %o2
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
400076d4: 7f ff e9 01 call 40001ad8 <.urem>
400076d8: 92 10 00 12 mov %l2, %o1
400076dc: 80 a2 20 00 cmp %o0, 0
400076e0: 22 80 00 08 be,a 40007700 <_Heap_Walk+0xe8>
400076e4: 90 04 20 08 add %l0, 8, %o0
(*printer)(
400076e8: 15 10 00 70 sethi %hi(0x4001c000), %o2
400076ec: 90 10 00 19 mov %i1, %o0
400076f0: 96 10 00 13 mov %l3, %o3
400076f4: 92 10 20 01 mov 1, %o1
400076f8: 10 80 00 fa b 40007ae0 <_Heap_Walk+0x4c8>
400076fc: 94 12 a3 50 or %o2, 0x350, %o2
);
return false;
}
if (
40007700: 7f ff e8 f6 call 40001ad8 <.urem>
40007704: 92 10 00 12 mov %l2, %o1
40007708: 80 a2 20 00 cmp %o0, 0
4000770c: 22 80 00 08 be,a 4000772c <_Heap_Walk+0x114>
40007710: c2 04 20 04 ld [ %l0 + 4 ], %g1
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
40007714: 15 10 00 70 sethi %hi(0x4001c000), %o2
40007718: 90 10 00 19 mov %i1, %o0
4000771c: 96 10 00 10 mov %l0, %o3
40007720: 92 10 20 01 mov 1, %o1
40007724: 10 80 00 ef b 40007ae0 <_Heap_Walk+0x4c8>
40007728: 94 12 a3 78 or %o2, 0x378, %o2
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
4000772c: 80 88 60 01 btst 1, %g1
40007730: 32 80 00 09 bne,a 40007754 <_Heap_Walk+0x13c>
40007734: ea 04 00 00 ld [ %l0 ], %l5
(*printer)(
40007738: 15 10 00 70 sethi %hi(0x4001c000), %o2
4000773c: 90 10 00 19 mov %i1, %o0
40007740: 92 10 20 01 mov 1, %o1
40007744: 94 12 a3 b0 or %o2, 0x3b0, %o2
40007748: 9f c4 40 00 call %l1
4000774c: b0 10 20 00 clr %i0
40007750: 30 80 00 e6 b,a 40007ae8 <_Heap_Walk+0x4d0>
);
return false;
}
if ( first_block->prev_size != page_size ) {
40007754: 80 a5 40 12 cmp %l5, %l2
40007758: 22 80 00 09 be,a 4000777c <_Heap_Walk+0x164>
4000775c: c2 05 20 04 ld [ %l4 + 4 ], %g1
(*printer)(
40007760: 15 10 00 70 sethi %hi(0x4001c000), %o2
40007764: 90 10 00 19 mov %i1, %o0
40007768: 96 10 00 15 mov %l5, %o3
4000776c: 98 10 00 12 mov %l2, %o4
40007770: 92 10 20 01 mov 1, %o1
40007774: 10 80 00 88 b 40007994 <_Heap_Walk+0x37c>
40007778: 94 12 a3 e0 or %o2, 0x3e0, %o2
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
4000777c: 82 08 7f fe and %g1, -2, %g1
40007780: 82 05 00 01 add %l4, %g1, %g1
40007784: c2 00 60 04 ld [ %g1 + 4 ], %g1
40007788: 80 88 60 01 btst 1, %g1
4000778c: 32 80 00 07 bne,a 400077a8 <_Heap_Walk+0x190>
40007790: d6 06 20 08 ld [ %i0 + 8 ], %o3
(*printer)(
40007794: 15 10 00 71 sethi %hi(0x4001c400), %o2
40007798: 90 10 00 19 mov %i1, %o0
4000779c: 92 10 20 01 mov 1, %o1
400077a0: 10 bf ff ea b 40007748 <_Heap_Walk+0x130>
400077a4: 94 12 a0 10 or %o2, 0x10, %o2
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
400077a8: ec 06 20 10 ld [ %i0 + 0x10 ], %l6
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
400077ac: a4 10 00 18 mov %i0, %l2
400077b0: 10 80 00 32 b 40007878 <_Heap_Walk+0x260>
400077b4: ae 10 00 0b mov %o3, %l7
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
400077b8: 80 a0 80 17 cmp %g2, %l7
400077bc: 18 80 00 05 bgu 400077d0 <_Heap_Walk+0x1b8>
400077c0: 82 10 20 00 clr %g1
400077c4: c2 06 20 24 ld [ %i0 + 0x24 ], %g1
400077c8: 80 a0 40 17 cmp %g1, %l7
400077cc: 82 60 3f ff subx %g0, -1, %g1
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 ) ) {
400077d0: 80 a0 60 00 cmp %g1, 0
400077d4: 32 80 00 08 bne,a 400077f4 <_Heap_Walk+0x1dc>
400077d8: 90 05 e0 08 add %l7, 8, %o0
(*printer)(
400077dc: 15 10 00 71 sethi %hi(0x4001c400), %o2
400077e0: 96 10 00 17 mov %l7, %o3
400077e4: 90 10 00 19 mov %i1, %o0
400077e8: 92 10 20 01 mov 1, %o1
400077ec: 10 80 00 bd b 40007ae0 <_Heap_Walk+0x4c8>
400077f0: 94 12 a0 28 or %o2, 0x28, %o2
);
return false;
}
if (
400077f4: 7f ff e8 b9 call 40001ad8 <.urem>
400077f8: 92 10 00 16 mov %l6, %o1
400077fc: 80 a2 20 00 cmp %o0, 0
40007800: 22 80 00 08 be,a 40007820 <_Heap_Walk+0x208>
40007804: c2 05 e0 04 ld [ %l7 + 4 ], %g1
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
40007808: 15 10 00 71 sethi %hi(0x4001c400), %o2
4000780c: 96 10 00 17 mov %l7, %o3
40007810: 90 10 00 19 mov %i1, %o0
40007814: 92 10 20 01 mov 1, %o1
40007818: 10 80 00 b2 b 40007ae0 <_Heap_Walk+0x4c8>
4000781c: 94 12 a0 48 or %o2, 0x48, %o2
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
40007820: 82 08 7f fe and %g1, -2, %g1
40007824: 82 05 c0 01 add %l7, %g1, %g1
40007828: c2 00 60 04 ld [ %g1 + 4 ], %g1
4000782c: 80 88 60 01 btst 1, %g1
40007830: 22 80 00 08 be,a 40007850 <_Heap_Walk+0x238>
40007834: d8 05 e0 0c ld [ %l7 + 0xc ], %o4
(*printer)(
40007838: 15 10 00 71 sethi %hi(0x4001c400), %o2
4000783c: 96 10 00 17 mov %l7, %o3
40007840: 90 10 00 19 mov %i1, %o0
40007844: 92 10 20 01 mov 1, %o1
40007848: 10 80 00 a6 b 40007ae0 <_Heap_Walk+0x4c8>
4000784c: 94 12 a0 78 or %o2, 0x78, %o2
);
return false;
}
if ( free_block->prev != prev_block ) {
40007850: 80 a3 00 12 cmp %o4, %l2
40007854: 02 80 00 08 be 40007874 <_Heap_Walk+0x25c>
40007858: a4 10 00 17 mov %l7, %l2
(*printer)(
4000785c: 15 10 00 71 sethi %hi(0x4001c400), %o2
40007860: 96 10 00 17 mov %l7, %o3
40007864: 90 10 00 19 mov %i1, %o0
40007868: 92 10 20 01 mov 1, %o1
4000786c: 10 80 00 4a b 40007994 <_Heap_Walk+0x37c>
40007870: 94 12 a0 98 or %o2, 0x98, %o2
return false;
}
prev_block = free_block;
free_block = free_block->next;
40007874: ee 05 e0 08 ld [ %l7 + 8 ], %l7
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 ) {
40007878: 80 a5 c0 18 cmp %l7, %i0
4000787c: 32 bf ff cf bne,a 400077b8 <_Heap_Walk+0x1a0>
40007880: c4 06 20 20 ld [ %i0 + 0x20 ], %g2
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
40007884: 10 80 00 89 b 40007aa8 <_Heap_Walk+0x490>
40007888: 37 10 00 71 sethi %hi(0x4001c400), %i3
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;
if ( prev_used ) {
4000788c: 80 8d a0 01 btst 1, %l6
- 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;
40007890: ac 0d bf fe and %l6, -2, %l6
40007894: 02 80 00 0a be 400078bc <_Heap_Walk+0x2a4>
40007898: a4 04 00 16 add %l0, %l6, %l2
(*printer)(
4000789c: 90 10 00 19 mov %i1, %o0
400078a0: 92 10 20 00 clr %o1
400078a4: 94 10 00 1a mov %i2, %o2
400078a8: 96 10 00 10 mov %l0, %o3
400078ac: 9f c4 40 00 call %l1
400078b0: 98 10 00 16 mov %l6, %o4
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
400078b4: 10 80 00 0a b 400078dc <_Heap_Walk+0x2c4>
400078b8: c4 06 20 20 ld [ %i0 + 0x20 ], %g2
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
400078bc: da 04 00 00 ld [ %l0 ], %o5
400078c0: 90 10 00 19 mov %i1, %o0
400078c4: 92 10 20 00 clr %o1
400078c8: 94 10 00 1b mov %i3, %o2
400078cc: 96 10 00 10 mov %l0, %o3
400078d0: 9f c4 40 00 call %l1
400078d4: 98 10 00 16 mov %l6, %o4
400078d8: c4 06 20 20 ld [ %i0 + 0x20 ], %g2
400078dc: 80 a0 80 12 cmp %g2, %l2
400078e0: 18 80 00 05 bgu 400078f4 <_Heap_Walk+0x2dc> <== NEVER TAKEN
400078e4: 82 10 20 00 clr %g1
400078e8: c2 06 20 24 ld [ %i0 + 0x24 ], %g1
400078ec: 80 a0 40 12 cmp %g1, %l2
400078f0: 82 60 3f ff subx %g0, -1, %g1
block_size,
block->prev_size
);
}
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
400078f4: 80 a0 60 00 cmp %g1, 0
400078f8: 32 80 00 09 bne,a 4000791c <_Heap_Walk+0x304>
400078fc: 90 10 00 16 mov %l6, %o0
(*printer)(
40007900: 15 10 00 71 sethi %hi(0x4001c400), %o2
40007904: 90 10 00 19 mov %i1, %o0
40007908: 96 10 00 10 mov %l0, %o3
4000790c: 98 10 00 12 mov %l2, %o4
40007910: 92 10 20 01 mov 1, %o1
40007914: 10 80 00 20 b 40007994 <_Heap_Walk+0x37c>
40007918: 94 12 a1 10 or %o2, 0x110, %o2
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) ) {
4000791c: 7f ff e8 6f call 40001ad8 <.urem>
40007920: 92 10 00 15 mov %l5, %o1
40007924: 80 a2 20 00 cmp %o0, 0
40007928: 02 80 00 09 be 4000794c <_Heap_Walk+0x334>
4000792c: 80 a5 80 13 cmp %l6, %l3
(*printer)(
40007930: 15 10 00 71 sethi %hi(0x4001c400), %o2
40007934: 90 10 00 19 mov %i1, %o0
40007938: 96 10 00 10 mov %l0, %o3
4000793c: 98 10 00 16 mov %l6, %o4
40007940: 92 10 20 01 mov 1, %o1
40007944: 10 80 00 14 b 40007994 <_Heap_Walk+0x37c>
40007948: 94 12 a1 40 or %o2, 0x140, %o2
);
return false;
}
if ( block_size < min_block_size ) {
4000794c: 1a 80 00 0a bcc 40007974 <_Heap_Walk+0x35c>
40007950: 80 a4 80 10 cmp %l2, %l0
(*printer)(
40007954: 15 10 00 71 sethi %hi(0x4001c400), %o2
40007958: 90 10 00 19 mov %i1, %o0
4000795c: 96 10 00 10 mov %l0, %o3
40007960: 98 10 00 16 mov %l6, %o4
40007964: 9a 10 00 13 mov %l3, %o5
40007968: 92 10 20 01 mov 1, %o1
4000796c: 10 80 00 3b b 40007a58 <_Heap_Walk+0x440>
40007970: 94 12 a1 70 or %o2, 0x170, %o2
);
return false;
}
if ( next_block_begin <= block_begin ) {
40007974: 38 80 00 0b bgu,a 400079a0 <_Heap_Walk+0x388>
40007978: c2 04 a0 04 ld [ %l2 + 4 ], %g1
(*printer)(
4000797c: 15 10 00 71 sethi %hi(0x4001c400), %o2
40007980: 90 10 00 19 mov %i1, %o0
40007984: 96 10 00 10 mov %l0, %o3
40007988: 98 10 00 12 mov %l2, %o4
4000798c: 92 10 20 01 mov 1, %o1
40007990: 94 12 a1 a0 or %o2, 0x1a0, %o2
40007994: 9f c4 40 00 call %l1
40007998: b0 10 20 00 clr %i0
4000799c: 30 80 00 53 b,a 40007ae8 <_Heap_Walk+0x4d0>
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
400079a0: 80 88 60 01 btst 1, %g1
400079a4: 32 80 00 46 bne,a 40007abc <_Heap_Walk+0x4a4>
400079a8: a0 10 00 12 mov %l2, %l0
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;
400079ac: fa 04 20 04 ld [ %l0 + 4 ], %i5
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)(
400079b0: d8 04 20 0c ld [ %l0 + 0xc ], %o4
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
400079b4: c2 06 20 08 ld [ %i0 + 8 ], %g1
- 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;
400079b8: ac 0f 7f fe and %i5, -2, %l6
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
400079bc: 1b 10 00 71 sethi %hi(0x4001c400), %o5
400079c0: 80 a3 00 01 cmp %o4, %g1
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap )
{
return _Heap_Free_list_tail(heap)->prev;
400079c4: c6 06 20 0c ld [ %i0 + 0xc ], %g3
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
400079c8: ae 04 00 16 add %l0, %l6, %l7
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
400079cc: 02 80 00 07 be 400079e8 <_Heap_Walk+0x3d0>
400079d0: 9a 13 61 d8 or %o5, 0x1d8, %o5
"block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n",
block,
block->prev,
block->prev == first_free_block ?
" (= first)"
: (block->prev == free_list_head ? " (= head)" : ""),
400079d4: 1b 10 00 71 sethi %hi(0x4001c400), %o5
400079d8: 80 a3 00 18 cmp %o4, %i0
400079dc: 02 80 00 03 be 400079e8 <_Heap_Walk+0x3d0>
400079e0: 9a 13 61 f0 or %o5, 0x1f0, %o5
400079e4: 9a 10 00 1c mov %i4, %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)(
400079e8: c4 04 20 08 ld [ %l0 + 8 ], %g2
400079ec: 03 10 00 71 sethi %hi(0x4001c400), %g1
400079f0: 80 a0 80 03 cmp %g2, %g3
400079f4: 02 80 00 07 be 40007a10 <_Heap_Walk+0x3f8>
400079f8: 82 10 62 00 or %g1, 0x200, %g1
" (= first)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last)"
: (block->next == free_list_tail ? " (= tail)" : "")
400079fc: 03 10 00 71 sethi %hi(0x4001c400), %g1
40007a00: 80 a0 80 18 cmp %g2, %i0
40007a04: 02 80 00 03 be 40007a10 <_Heap_Walk+0x3f8>
40007a08: 82 10 62 10 or %g1, 0x210, %g1
40007a0c: 82 10 00 1c mov %i4, %g1
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)(
40007a10: c4 23 a0 5c st %g2, [ %sp + 0x5c ]
40007a14: c2 23 a0 60 st %g1, [ %sp + 0x60 ]
40007a18: 90 10 00 19 mov %i1, %o0
40007a1c: 92 10 20 00 clr %o1
40007a20: 15 10 00 71 sethi %hi(0x4001c400), %o2
40007a24: 96 10 00 10 mov %l0, %o3
40007a28: 9f c4 40 00 call %l1
40007a2c: 94 12 a2 20 or %o2, 0x220, %o2
block->next == last_free_block ?
" (= last)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
40007a30: da 05 c0 00 ld [ %l7 ], %o5
40007a34: 80 a5 80 0d cmp %l6, %o5
40007a38: 02 80 00 0b be 40007a64 <_Heap_Walk+0x44c>
40007a3c: 15 10 00 71 sethi %hi(0x4001c400), %o2
(*printer)(
40007a40: ee 23 a0 5c st %l7, [ %sp + 0x5c ]
40007a44: 90 10 00 19 mov %i1, %o0
40007a48: 96 10 00 10 mov %l0, %o3
40007a4c: 98 10 00 16 mov %l6, %o4
40007a50: 92 10 20 01 mov 1, %o1
40007a54: 94 12 a2 50 or %o2, 0x250, %o2
40007a58: 9f c4 40 00 call %l1
40007a5c: b0 10 20 00 clr %i0
40007a60: 30 80 00 22 b,a 40007ae8 <_Heap_Walk+0x4d0>
);
return false;
}
if ( !prev_used ) {
40007a64: 80 8f 60 01 btst 1, %i5
40007a68: 32 80 00 0b bne,a 40007a94 <_Heap_Walk+0x47c>
40007a6c: c2 06 20 08 ld [ %i0 + 8 ], %g1
(*printer)(
40007a70: 15 10 00 71 sethi %hi(0x4001c400), %o2
40007a74: 90 10 00 19 mov %i1, %o0
40007a78: 96 10 00 10 mov %l0, %o3
40007a7c: 92 10 20 01 mov 1, %o1
40007a80: 10 80 00 18 b 40007ae0 <_Heap_Walk+0x4c8>
40007a84: 94 12 a2 90 or %o2, 0x290, %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 ) {
40007a88: 22 80 00 0d be,a 40007abc <_Heap_Walk+0x4a4>
40007a8c: a0 10 00 12 mov %l2, %l0
return true;
}
free_block = free_block->next;
40007a90: c2 00 60 08 ld [ %g1 + 8 ], %g1
)
{
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 ) {
40007a94: 80 a0 40 18 cmp %g1, %i0
40007a98: 12 bf ff fc bne 40007a88 <_Heap_Walk+0x470>
40007a9c: 80 a0 40 10 cmp %g1, %l0
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
40007aa0: 10 80 00 0c b 40007ad0 <_Heap_Walk+0x4b8>
40007aa4: 15 10 00 71 sethi %hi(0x4001c400), %o2
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;
if ( prev_used ) {
(*printer)(
40007aa8: 35 10 00 71 sethi %hi(0x4001c400), %i2
" (= first)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last)"
: (block->next == free_list_tail ? " (= tail)" : "")
40007aac: 39 10 00 71 sethi %hi(0x4001c400), %i4
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
40007ab0: b6 16 e0 e8 or %i3, 0xe8, %i3
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;
if ( prev_used ) {
(*printer)(
40007ab4: b4 16 a0 d0 or %i2, 0xd0, %i2
" (= first)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last)"
: (block->next == free_list_tail ? " (= tail)" : "")
40007ab8: b8 17 21 e8 or %i4, 0x1e8, %i4
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
}
while ( block != last_block ) {
40007abc: 80 a4 00 14 cmp %l0, %l4
40007ac0: 32 bf ff 73 bne,a 4000788c <_Heap_Walk+0x274>
40007ac4: ec 04 20 04 ld [ %l0 + 4 ], %l6
block = next_block;
}
return true;
}
40007ac8: 81 c7 e0 08 ret
40007acc: 91 e8 20 01 restore %g0, 1, %o0
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
40007ad0: 90 10 00 19 mov %i1, %o0
40007ad4: 96 10 00 10 mov %l0, %o3
40007ad8: 92 10 20 01 mov 1, %o1
40007adc: 94 12 a2 c0 or %o2, 0x2c0, %o2
40007ae0: 9f c4 40 00 call %l1
40007ae4: b0 10 20 00 clr %i0
40007ae8: 81 c7 e0 08 ret
40007aec: 81 e8 00 00 restore
40006894 <_Objects_Allocate>:
*/
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
40006894: 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 )
40006898: c2 06 20 18 ld [ %i0 + 0x18 ], %g1
*/
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
4000689c: a0 10 00 18 mov %i0, %l0
* 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 )
400068a0: 80 a0 60 00 cmp %g1, 0
400068a4: 02 80 00 20 be 40006924 <_Objects_Allocate+0x90> <== NEVER TAKEN
400068a8: b0 10 20 00 clr %i0
/*
* 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 );
400068ac: a2 04 20 20 add %l0, 0x20, %l1
400068b0: 40 00 12 ff call 4000b4ac <_Chain_Get>
400068b4: 90 10 00 11 mov %l1, %o0
if ( information->auto_extend ) {
400068b8: c2 0c 20 12 ldub [ %l0 + 0x12 ], %g1
400068bc: 80 a0 60 00 cmp %g1, 0
400068c0: 02 80 00 19 be 40006924 <_Objects_Allocate+0x90>
400068c4: 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 ) {
400068c8: 80 a2 20 00 cmp %o0, 0
400068cc: 32 80 00 0a bne,a 400068f4 <_Objects_Allocate+0x60>
400068d0: c2 14 20 0a lduh [ %l0 + 0xa ], %g1
_Objects_Extend_information( information );
400068d4: 40 00 00 1e call 4000694c <_Objects_Extend_information>
400068d8: 90 10 00 10 mov %l0, %o0
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
400068dc: 40 00 12 f4 call 4000b4ac <_Chain_Get>
400068e0: 90 10 00 11 mov %l1, %o0
}
if ( the_object ) {
400068e4: b0 92 20 00 orcc %o0, 0, %i0
400068e8: 02 80 00 0f be 40006924 <_Objects_Allocate+0x90>
400068ec: 01 00 00 00 nop
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
400068f0: c2 14 20 0a lduh [ %l0 + 0xa ], %g1
400068f4: d0 16 20 0a lduh [ %i0 + 0xa ], %o0
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
information->inactive_per_block[ block ]--;
400068f8: d2 14 20 14 lduh [ %l0 + 0x14 ], %o1
400068fc: 40 00 44 af call 40017bb8 <.udiv>
40006900: 90 22 00 01 sub %o0, %g1, %o0
40006904: c2 04 20 30 ld [ %l0 + 0x30 ], %g1
40006908: 91 2a 20 02 sll %o0, 2, %o0
information->inactive--;
4000690c: c6 14 20 2c lduh [ %l0 + 0x2c ], %g3
block = (uint32_t) _Objects_Get_index( the_object->id ) -
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
information->inactive_per_block[ block ]--;
40006910: c4 00 40 08 ld [ %g1 + %o0 ], %g2
information->inactive--;
40006914: 86 00 ff ff add %g3, -1, %g3
block = (uint32_t) _Objects_Get_index( the_object->id ) -
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
information->inactive_per_block[ block ]--;
40006918: 84 00 bf ff add %g2, -1, %g2
information->inactive--;
4000691c: c6 34 20 2c sth %g3, [ %l0 + 0x2c ]
block = (uint32_t) _Objects_Get_index( the_object->id ) -
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
information->inactive_per_block[ block ]--;
40006920: c4 20 40 08 st %g2, [ %g1 + %o0 ]
information->inactive--;
}
}
return the_object;
}
40006924: 81 c7 e0 08 ret
40006928: 81 e8 00 00 restore
4000694c <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
4000694c: 9d e3 bf 90 save %sp, -112, %sp
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
40006950: e4 06 20 34 ld [ %i0 + 0x34 ], %l2
40006954: 80 a4 a0 00 cmp %l2, 0
40006958: 12 80 00 06 bne 40006970 <_Objects_Extend_information+0x24>
4000695c: e6 16 20 0a lduh [ %i0 + 0xa ], %l3
40006960: a0 10 00 13 mov %l3, %l0
40006964: a2 10 20 00 clr %l1
40006968: 10 80 00 15 b 400069bc <_Objects_Extend_information+0x70>
4000696c: a8 10 20 00 clr %l4
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
40006970: e2 16 20 14 lduh [ %i0 + 0x14 ], %l1
40006974: d0 16 20 10 lduh [ %i0 + 0x10 ], %o0
40006978: 40 00 44 90 call 40017bb8 <.udiv>
4000697c: 92 10 00 11 mov %l1, %o1
for ( ; block < block_count; block++ ) {
if ( information->object_blocks[ block ] == NULL )
40006980: 82 10 00 11 mov %l1, %g1
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
40006984: 91 2a 20 10 sll %o0, 0x10, %o0
40006988: a0 10 00 13 mov %l3, %l0
4000698c: a9 32 20 10 srl %o0, 0x10, %l4
for ( ; block < block_count; block++ ) {
40006990: 10 80 00 08 b 400069b0 <_Objects_Extend_information+0x64>
40006994: a2 10 20 00 clr %l1
if ( information->object_blocks[ block ] == NULL )
40006998: c4 04 80 02 ld [ %l2 + %g2 ], %g2
4000699c: 80 a0 a0 00 cmp %g2, 0
400069a0: 22 80 00 08 be,a 400069c0 <_Objects_Extend_information+0x74>
400069a4: d0 16 20 14 lduh [ %i0 + 0x14 ], %o0
400069a8: a0 04 00 01 add %l0, %g1, %l0
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
400069ac: a2 04 60 01 inc %l1
400069b0: 80 a4 40 14 cmp %l1, %l4
400069b4: 0a bf ff f9 bcs 40006998 <_Objects_Extend_information+0x4c>
400069b8: 85 2c 60 02 sll %l1, 2, %g2
else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
400069bc: d0 16 20 14 lduh [ %i0 + 0x14 ], %o0
400069c0: ec 16 20 10 lduh [ %i0 + 0x10 ], %l6
/*
* We need to limit the number of objects to the maximum number
* representable in the index portion of the object Id. In the
* case of 16-bit Ids, this is only 256 object instances.
*/
if ( maximum > OBJECTS_ID_FINAL_INDEX ) {
400069c4: 03 00 00 3f sethi %hi(0xfc00), %g1
else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
400069c8: ac 02 00 16 add %o0, %l6, %l6
/*
* We need to limit the number of objects to the maximum number
* representable in the index portion of the object Id. In the
* case of 16-bit Ids, this is only 256 object instances.
*/
if ( maximum > OBJECTS_ID_FINAL_INDEX ) {
400069cc: 82 10 63 ff or %g1, 0x3ff, %g1
400069d0: 80 a5 80 01 cmp %l6, %g1
400069d4: 18 80 00 88 bgu 40006bf4 <_Objects_Extend_information+0x2a8><== NEVER TAKEN
400069d8: 01 00 00 00 nop
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
400069dc: 40 00 44 3d call 40017ad0 <.umul>
400069e0: d2 06 20 18 ld [ %i0 + 0x18 ], %o1
if ( information->auto_extend ) {
400069e4: c2 0e 20 12 ldub [ %i0 + 0x12 ], %g1
400069e8: 80 a0 60 00 cmp %g1, 0
400069ec: 02 80 00 09 be 40006a10 <_Objects_Extend_information+0xc4>
400069f0: 01 00 00 00 nop
new_object_block = _Workspace_Allocate( block_size );
400069f4: 40 00 08 4c call 40008b24 <_Workspace_Allocate>
400069f8: 01 00 00 00 nop
if ( !new_object_block )
400069fc: a4 92 20 00 orcc %o0, 0, %l2
40006a00: 32 80 00 08 bne,a 40006a20 <_Objects_Extend_information+0xd4>
40006a04: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1
40006a08: 81 c7 e0 08 ret
40006a0c: 81 e8 00 00 restore
return;
} else {
new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
40006a10: 40 00 08 37 call 40008aec <_Workspace_Allocate_or_fatal_error>
40006a14: 01 00 00 00 nop
40006a18: a4 10 00 08 mov %o0, %l2
}
/*
* If the index_base is the maximum we need to grow the tables.
*/
if (index_base >= information->maximum ) {
40006a1c: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1
40006a20: 80 a4 00 01 cmp %l0, %g1
40006a24: 2a 80 00 53 bcs,a 40006b70 <_Objects_Extend_information+0x224>
40006a28: c2 06 20 34 ld [ %i0 + 0x34 ], %g1
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
object_blocks = (void**) _Workspace_Allocate( block_size );
40006a2c: 82 05 80 13 add %l6, %l3, %g1
*/
/*
* Up the block count and maximum
*/
block_count++;
40006a30: ae 05 20 01 add %l4, 1, %l7
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
object_blocks = (void**) _Workspace_Allocate( block_size );
40006a34: 91 2d e0 01 sll %l7, 1, %o0
40006a38: 90 02 00 17 add %o0, %l7, %o0
40006a3c: 90 00 40 08 add %g1, %o0, %o0
40006a40: 40 00 08 39 call 40008b24 <_Workspace_Allocate>
40006a44: 91 2a 20 02 sll %o0, 2, %o0
if ( !object_blocks ) {
40006a48: aa 92 20 00 orcc %o0, 0, %l5
40006a4c: 32 80 00 06 bne,a 40006a64 <_Objects_Extend_information+0x118>
40006a50: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1
_Workspace_Free( new_object_block );
40006a54: 40 00 08 3d call 40008b48 <_Workspace_Free>
40006a58: 90 10 00 12 mov %l2, %o0
return;
40006a5c: 81 c7 e0 08 ret
40006a60: 81 e8 00 00 restore
}
/*
* Break the block into the various sections.
*/
inactive_per_block = (uint32_t *) _Addresses_Add_offset(
40006a64: af 2d e0 02 sll %l7, 2, %l7
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
40006a68: 80 a0 40 13 cmp %g1, %l3
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
40006a6c: ba 05 40 17 add %l5, %l7, %i5
40006a70: 82 10 20 00 clr %g1
40006a74: 08 80 00 14 bleu 40006ac4 <_Objects_Extend_information+0x178>
40006a78: ae 07 40 17 add %i5, %l7, %l7
/*
* Copy each section of the table over. This has to be performed as
* separate parts as size of each block has changed.
*/
memcpy( object_blocks,
40006a7c: d2 06 20 34 ld [ %i0 + 0x34 ], %o1
information->object_blocks,
block_count * sizeof(void*) );
40006a80: b9 2d 20 02 sll %l4, 2, %i4
/*
* Copy each section of the table over. This has to be performed as
* separate parts as size of each block has changed.
*/
memcpy( object_blocks,
40006a84: 40 00 20 f1 call 4000ee48 <memcpy>
40006a88: 94 10 00 1c mov %i4, %o2
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
40006a8c: d2 06 20 30 ld [ %i0 + 0x30 ], %o1
40006a90: 94 10 00 1c mov %i4, %o2
40006a94: 40 00 20 ed call 4000ee48 <memcpy>
40006a98: 90 10 00 1d mov %i5, %o0
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
40006a9c: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1
40006aa0: d2 06 20 1c ld [ %i0 + 0x1c ], %o1
40006aa4: a6 04 c0 01 add %l3, %g1, %l3
40006aa8: 90 10 00 17 mov %l7, %o0
40006aac: 40 00 20 e7 call 4000ee48 <memcpy>
40006ab0: 95 2c e0 02 sll %l3, 2, %o2
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
40006ab4: 10 80 00 08 b 40006ad4 <_Objects_Extend_information+0x188>
40006ab8: c6 16 20 14 lduh [ %i0 + 0x14 ], %g3
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
40006abc: 82 00 60 01 inc %g1
local_table[ index ] = NULL;
40006ac0: c0 20 80 17 clr [ %g2 + %l7 ]
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
40006ac4: 80 a0 40 13 cmp %g1, %l3
40006ac8: 2a bf ff fd bcs,a 40006abc <_Objects_Extend_information+0x170>
40006acc: 85 28 60 02 sll %g1, 2, %g2
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
40006ad0: c6 16 20 14 lduh [ %i0 + 0x14 ], %g3
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
40006ad4: a9 2d 20 02 sll %l4, 2, %l4
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
40006ad8: 85 2c 20 02 sll %l0, 2, %g2
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
40006adc: c0 27 40 14 clr [ %i5 + %l4 ]
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
40006ae0: c0 25 40 14 clr [ %l5 + %l4 ]
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
40006ae4: 86 04 00 03 add %l0, %g3, %g3
40006ae8: 84 05 c0 02 add %l7, %g2, %g2
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
40006aec: 10 80 00 04 b 40006afc <_Objects_Extend_information+0x1b0>
40006af0: 82 10 00 10 mov %l0, %g1
index < ( information->allocation_size + index_base );
index++ ) {
40006af4: 82 00 60 01 inc %g1
40006af8: 84 00 a0 04 add %g2, 4, %g2
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
40006afc: 80 a0 40 03 cmp %g1, %g3
40006b00: 2a bf ff fd bcs,a 40006af4 <_Objects_Extend_information+0x1a8>
40006b04: c0 20 80 00 clr [ %g2 ]
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
}
_ISR_Disable( level );
40006b08: 7f ff ec 64 call 40001c98 <sparc_disable_interrupts>
40006b0c: 01 00 00 00 nop
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
40006b10: c8 06 00 00 ld [ %i0 ], %g4
40006b14: c4 16 20 04 lduh [ %i0 + 4 ], %g2
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
40006b18: ec 36 20 10 sth %l6, [ %i0 + 0x10 ]
information->maximum_id = _Objects_Build_id(
40006b1c: ad 2d a0 10 sll %l6, 0x10, %l6
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
40006b20: e6 06 20 34 ld [ %i0 + 0x34 ], %l3
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
40006b24: 83 35 a0 10 srl %l6, 0x10, %g1
_ISR_Disable( level );
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
40006b28: fa 26 20 30 st %i5, [ %i0 + 0x30 ]
information->local_table = local_table;
40006b2c: ee 26 20 1c st %l7, [ %i0 + 0x1c ]
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
40006b30: 89 29 20 18 sll %g4, 0x18, %g4
40006b34: 85 28 a0 1b sll %g2, 0x1b, %g2
_ISR_Disable( level );
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
40006b38: ea 26 20 34 st %l5, [ %i0 + 0x34 ]
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
40006b3c: 07 00 00 40 sethi %hi(0x10000), %g3
40006b40: ac 11 00 03 or %g4, %g3, %l6
40006b44: ac 15 80 02 or %l6, %g2, %l6
40006b48: ac 15 80 01 or %l6, %g1, %l6
40006b4c: ec 26 20 0c st %l6, [ %i0 + 0xc ]
information->the_class,
_Objects_Local_node,
information->maximum
);
_ISR_Enable( level );
40006b50: 7f ff ec 56 call 40001ca8 <sparc_enable_interrupts>
40006b54: 01 00 00 00 nop
if ( old_tables )
40006b58: 80 a4 e0 00 cmp %l3, 0
40006b5c: 22 80 00 05 be,a 40006b70 <_Objects_Extend_information+0x224>
40006b60: c2 06 20 34 ld [ %i0 + 0x34 ], %g1
_Workspace_Free( old_tables );
40006b64: 40 00 07 f9 call 40008b48 <_Workspace_Free>
40006b68: 90 10 00 13 mov %l3, %o0
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
40006b6c: c2 06 20 34 ld [ %i0 + 0x34 ], %g1
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
40006b70: d4 16 20 14 lduh [ %i0 + 0x14 ], %o2
40006b74: d6 06 20 18 ld [ %i0 + 0x18 ], %o3
40006b78: 92 10 00 12 mov %l2, %o1
40006b7c: 90 07 bf f4 add %fp, -12, %o0
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
40006b80: a3 2c 60 02 sll %l1, 2, %l1
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
40006b84: a8 06 20 20 add %i0, 0x20, %l4
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
40006b88: e4 20 40 11 st %l2, [ %g1 + %l1 ]
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
the_object->id = _Objects_Build_id(
40006b8c: 27 00 00 40 sethi %hi(0x10000), %l3
information->object_blocks[ block ] = new_object_block;
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
40006b90: 40 00 12 57 call 4000b4ec <_Chain_Initialize>
40006b94: a4 10 00 08 mov %o0, %l2
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
40006b98: 30 80 00 0c b,a 40006bc8 <_Objects_Extend_information+0x27c>
the_object->id = _Objects_Build_id(
40006b9c: c4 16 20 04 lduh [ %i0 + 4 ], %g2
40006ba0: 83 28 60 18 sll %g1, 0x18, %g1
40006ba4: 85 28 a0 1b sll %g2, 0x1b, %g2
40006ba8: 82 10 40 13 or %g1, %l3, %g1
40006bac: 82 10 40 02 or %g1, %g2, %g1
40006bb0: 82 10 40 10 or %g1, %l0, %g1
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
40006bb4: 92 10 00 08 mov %o0, %o1
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
the_object->id = _Objects_Build_id(
40006bb8: c2 22 20 08 st %g1, [ %o0 + 8 ]
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
40006bbc: a0 04 20 01 inc %l0
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
40006bc0: 7f ff fc ee call 40005f78 <_Chain_Append>
40006bc4: 90 10 00 14 mov %l4, %o0
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
40006bc8: 40 00 12 39 call 4000b4ac <_Chain_Get>
40006bcc: 90 10 00 12 mov %l2, %o0
40006bd0: 80 a2 20 00 cmp %o0, 0
40006bd4: 32 bf ff f2 bne,a 40006b9c <_Objects_Extend_information+0x250>
40006bd8: c2 06 00 00 ld [ %i0 ], %g1
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
information->inactive =
40006bdc: c2 16 20 2c lduh [ %i0 + 0x2c ], %g1
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
40006be0: c8 16 20 14 lduh [ %i0 + 0x14 ], %g4
40006be4: c4 06 20 30 ld [ %i0 + 0x30 ], %g2
information->inactive =
40006be8: 82 01 00 01 add %g4, %g1, %g1
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
40006bec: c8 20 80 11 st %g4, [ %g2 + %l1 ]
information->inactive =
40006bf0: c2 36 20 2c sth %g1, [ %i0 + 0x2c ]
40006bf4: 81 c7 e0 08 ret
40006bf8: 81 e8 00 00 restore
40006ca4 <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint32_t the_class
)
{
40006ca4: 9d e3 bf a0 save %sp, -96, %sp
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
40006ca8: 80 a6 60 00 cmp %i1, 0
40006cac: 22 80 00 1a be,a 40006d14 <_Objects_Get_information+0x70>
40006cb0: b0 10 20 00 clr %i0
/*
* 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 );
40006cb4: 40 00 13 94 call 4000bb04 <_Objects_API_maximum_class>
40006cb8: 90 10 00 18 mov %i0, %o0
if ( the_class_api_maximum == 0 )
40006cbc: 80 a2 20 00 cmp %o0, 0
40006cc0: 22 80 00 15 be,a 40006d14 <_Objects_Get_information+0x70>
40006cc4: b0 10 20 00 clr %i0
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
40006cc8: 80 a6 40 08 cmp %i1, %o0
40006ccc: 38 80 00 12 bgu,a 40006d14 <_Objects_Get_information+0x70>
40006cd0: b0 10 20 00 clr %i0
return NULL;
if ( !_Objects_Information_table[ the_api ] )
40006cd4: b1 2e 20 02 sll %i0, 2, %i0
40006cd8: 03 10 00 72 sethi %hi(0x4001c800), %g1
40006cdc: 82 10 60 40 or %g1, 0x40, %g1 ! 4001c840 <_Objects_Information_table>
40006ce0: c2 00 40 18 ld [ %g1 + %i0 ], %g1
40006ce4: 80 a0 60 00 cmp %g1, 0
40006ce8: 02 80 00 0b be 40006d14 <_Objects_Get_information+0x70> <== NEVER TAKEN
40006cec: b0 10 20 00 clr %i0
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
40006cf0: b3 2e 60 02 sll %i1, 2, %i1
40006cf4: f0 00 40 19 ld [ %g1 + %i1 ], %i0
if ( !info )
40006cf8: 80 a6 20 00 cmp %i0, 0
40006cfc: 02 80 00 06 be 40006d14 <_Objects_Get_information+0x70> <== NEVER TAKEN
40006d00: 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 )
40006d04: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1
40006d08: 80 a0 60 00 cmp %g1, 0
40006d0c: 22 80 00 02 be,a 40006d14 <_Objects_Get_information+0x70>
40006d10: b0 10 20 00 clr %i0
return NULL;
#endif
return info;
}
40006d14: 81 c7 e0 08 ret
40006d18: 81 e8 00 00 restore
40017634 <_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;
40017634: c4 02 20 08 ld [ %o0 + 8 ], %g2
if ( information->maximum >= index ) {
40017638: 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;
4001763c: 84 22 40 02 sub %o1, %g2, %g2
40017640: 84 00 a0 01 inc %g2
if ( information->maximum >= index ) {
40017644: 80 a0 40 02 cmp %g1, %g2
40017648: 0a 80 00 09 bcs 4001766c <_Objects_Get_no_protection+0x38>
4001764c: 85 28 a0 02 sll %g2, 2, %g2
if ( (the_object = information->local_table[ index ]) != NULL ) {
40017650: c2 02 20 1c ld [ %o0 + 0x1c ], %g1
40017654: d0 00 40 02 ld [ %g1 + %g2 ], %o0
40017658: 80 a2 20 00 cmp %o0, 0
4001765c: 02 80 00 05 be 40017670 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN
40017660: 82 10 20 01 mov 1, %g1
*location = OBJECTS_LOCAL;
return the_object;
40017664: 81 c3 e0 08 retl
40017668: 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;
4001766c: 82 10 20 01 mov 1, %g1
40017670: 90 10 20 00 clr %o0
return NULL;
}
40017674: 81 c3 e0 08 retl
40017678: c2 22 80 00 st %g1, [ %o2 ]
40008418 <_Objects_Id_to_name>:
*/
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
40008418: 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;
4000841c: 92 96 20 00 orcc %i0, 0, %o1
40008420: 12 80 00 06 bne 40008438 <_Objects_Id_to_name+0x20>
40008424: 83 32 60 18 srl %o1, 0x18, %g1
40008428: 03 10 00 88 sethi %hi(0x40022000), %g1
4000842c: c2 00 62 1c ld [ %g1 + 0x21c ], %g1 ! 4002221c <_Thread_Executing>
40008430: d2 00 60 08 ld [ %g1 + 8 ], %o1
*/
RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API(
Objects_Id id
)
{
return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS);
40008434: 83 32 60 18 srl %o1, 0x18, %g1
40008438: 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 )
4000843c: 84 00 7f ff add %g1, -1, %g2
40008440: 80 a0 a0 03 cmp %g2, 3
40008444: 18 80 00 18 bgu 400084a4 <_Objects_Id_to_name+0x8c>
40008448: 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;
if ( !_Objects_Information_table[ the_api ] )
4000844c: 10 80 00 18 b 400084ac <_Objects_Id_to_name+0x94>
40008450: 05 10 00 88 sethi %hi(0x40022000), %g2
return OBJECTS_INVALID_ID;
the_class = _Objects_Get_class( tmpId );
information = _Objects_Information_table[ the_api ][ the_class ];
40008454: 85 28 a0 02 sll %g2, 2, %g2
40008458: d0 00 40 02 ld [ %g1 + %g2 ], %o0
if ( !information )
4000845c: 80 a2 20 00 cmp %o0, 0
40008460: 02 80 00 11 be 400084a4 <_Objects_Id_to_name+0x8c> <== NEVER TAKEN
40008464: 01 00 00 00 nop
return OBJECTS_INVALID_ID;
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
40008468: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1
4000846c: 80 a0 60 00 cmp %g1, 0
40008470: 12 80 00 0d bne 400084a4 <_Objects_Id_to_name+0x8c> <== NEVER TAKEN
40008474: 01 00 00 00 nop
return OBJECTS_INVALID_ID;
#endif
the_object = _Objects_Get( information, tmpId, &ignored_location );
40008478: 7f ff ff cb call 400083a4 <_Objects_Get>
4000847c: 94 07 bf fc add %fp, -4, %o2
if ( !the_object )
40008480: 80 a2 20 00 cmp %o0, 0
40008484: 02 80 00 08 be 400084a4 <_Objects_Id_to_name+0x8c>
40008488: 01 00 00 00 nop
return OBJECTS_INVALID_ID;
*name = the_object->name;
4000848c: c2 02 20 0c ld [ %o0 + 0xc ], %g1
_Thread_Enable_dispatch();
40008490: b0 10 20 00 clr %i0
40008494: 40 00 02 3d call 40008d88 <_Thread_Enable_dispatch>
40008498: c2 26 40 00 st %g1, [ %i1 ]
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
4000849c: 81 c7 e0 08 ret
400084a0: 81 e8 00 00 restore
}
400084a4: 81 c7 e0 08 ret
400084a8: 91 e8 20 03 restore %g0, 3, %o0
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
if ( !_Objects_Information_table[ the_api ] )
400084ac: 84 10 a0 c0 or %g2, 0xc0, %g2
400084b0: c2 00 80 01 ld [ %g2 + %g1 ], %g1
400084b4: 80 a0 60 00 cmp %g1, 0
400084b8: 12 bf ff e7 bne 40008454 <_Objects_Id_to_name+0x3c>
400084bc: 85 32 60 1b srl %o1, 0x1b, %g2
400084c0: 30 bf ff f9 b,a 400084a4 <_Objects_Id_to_name+0x8c>
40007640 <_Objects_Set_name>:
bool _Objects_Set_name(
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
40007640: 9d e3 bf a0 save %sp, -96, %sp
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
40007644: d2 16 20 3a lduh [ %i0 + 0x3a ], %o1
40007648: 40 00 24 b0 call 40010908 <strnlen>
4000764c: 90 10 00 1a mov %i2, %o0
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
40007650: c2 0e 20 38 ldub [ %i0 + 0x38 ], %g1
40007654: 80 a0 60 00 cmp %g1, 0
40007658: 02 80 00 17 be 400076b4 <_Objects_Set_name+0x74>
4000765c: a0 10 00 08 mov %o0, %l0
char *d;
d = _Workspace_Allocate( length + 1 );
40007660: 90 02 20 01 inc %o0
40007664: 40 00 06 fb call 40009250 <_Workspace_Allocate>
40007668: b0 10 20 00 clr %i0
if ( !d )
4000766c: a2 92 20 00 orcc %o0, 0, %l1
40007670: 02 80 00 24 be 40007700 <_Objects_Set_name+0xc0> <== NEVER TAKEN
40007674: 01 00 00 00 nop
return false;
if ( the_object->name.name_p ) {
40007678: d0 06 60 0c ld [ %i1 + 0xc ], %o0
4000767c: 80 a2 20 00 cmp %o0, 0
40007680: 02 80 00 06 be 40007698 <_Objects_Set_name+0x58>
40007684: 92 10 00 1a mov %i2, %o1
_Workspace_Free( (void *)the_object->name.name_p );
40007688: 40 00 06 fb call 40009274 <_Workspace_Free>
4000768c: 01 00 00 00 nop
the_object->name.name_p = NULL;
40007690: c0 26 60 0c clr [ %i1 + 0xc ]
}
strncpy( d, name, length );
40007694: 92 10 00 1a mov %i2, %o1
40007698: 90 10 00 11 mov %l1, %o0
4000769c: 40 00 24 60 call 4001081c <strncpy>
400076a0: 94 10 00 10 mov %l0, %o2
d[length] = '\0';
400076a4: c0 2c 40 10 clrb [ %l1 + %l0 ]
the_object->name.name_p = d;
400076a8: e2 26 60 0c st %l1, [ %i1 + 0xc ]
400076ac: 81 c7 e0 08 ret
400076b0: 91 e8 20 01 restore %g0, 1, %o0
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
400076b4: 80 a2 20 01 cmp %o0, 1
400076b8: 08 80 00 14 bleu 40007708 <_Objects_Set_name+0xc8>
400076bc: c8 0e 80 00 ldub [ %i2 ], %g4
400076c0: c6 4e a0 01 ldsb [ %i2 + 1 ], %g3
400076c4: 80 a2 20 02 cmp %o0, 2
400076c8: 08 80 00 11 bleu 4000770c <_Objects_Set_name+0xcc>
400076cc: 87 28 e0 10 sll %g3, 0x10, %g3
400076d0: c4 4e a0 02 ldsb [ %i2 + 2 ], %g2
400076d4: 80 a2 20 03 cmp %o0, 3
400076d8: 85 28 a0 08 sll %g2, 8, %g2
400076dc: 08 80 00 03 bleu 400076e8 <_Objects_Set_name+0xa8>
400076e0: 82 10 20 20 mov 0x20, %g1
400076e4: c2 4e a0 03 ldsb [ %i2 + 3 ], %g1
400076e8: 89 29 20 18 sll %g4, 0x18, %g4
400076ec: b0 10 20 01 mov 1, %i0
400076f0: 86 10 c0 04 or %g3, %g4, %g3
400076f4: 84 10 c0 02 or %g3, %g2, %g2
400076f8: 82 10 80 01 or %g2, %g1, %g1
400076fc: c2 26 60 0c st %g1, [ %i1 + 0xc ]
);
}
return true;
}
40007700: 81 c7 e0 08 ret
40007704: 81 e8 00 00 restore
d[length] = '\0';
the_object->name.name_p = d;
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
40007708: 07 00 08 00 sethi %hi(0x200000), %g3
4000770c: 05 00 00 08 sethi %hi(0x2000), %g2
40007710: 10 bf ff f6 b 400076e8 <_Objects_Set_name+0xa8>
40007714: 82 10 20 20 mov 0x20, %g1
4000651c <_POSIX_Condition_variables_Wait_support>:
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
4000651c: 9d e3 bf 98 save %sp, -104, %sp
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
40006520: a0 07 bf fc add %fp, -4, %l0
40006524: 90 10 00 19 mov %i1, %o0
40006528: 40 00 00 7e call 40006720 <_POSIX_Mutex_Get>
4000652c: 92 10 00 10 mov %l0, %o1
40006530: 80 a2 20 00 cmp %o0, 0
40006534: 22 80 00 18 be,a 40006594 <_POSIX_Condition_variables_Wait_support+0x78>
40006538: b0 10 20 16 mov 0x16, %i0
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
4000653c: 03 10 00 7d sethi %hi(0x4001f400), %g1
40006540: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2 ! 4001f4e0 <_Thread_Dispatch_disable_level>
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
40006544: 92 10 00 10 mov %l0, %o1
40006548: 84 00 bf ff add %g2, -1, %g2
4000654c: 90 10 00 18 mov %i0, %o0
40006550: c4 20 60 e0 st %g2, [ %g1 + 0xe0 ]
40006554: 7f ff ff 74 call 40006324 <_POSIX_Condition_variables_Get>
40006558: 01 00 00 00 nop
switch ( location ) {
4000655c: c2 07 bf fc ld [ %fp + -4 ], %g1
40006560: 80 a0 60 00 cmp %g1, 0
40006564: 12 80 00 34 bne 40006634 <_POSIX_Condition_variables_Wait_support+0x118>
40006568: a0 10 00 08 mov %o0, %l0
case OBJECTS_LOCAL:
if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
4000656c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
40006570: 80 a0 60 00 cmp %g1, 0
40006574: 02 80 00 0a be 4000659c <_POSIX_Condition_variables_Wait_support+0x80>
40006578: 01 00 00 00 nop
4000657c: c4 06 40 00 ld [ %i1 ], %g2
40006580: 80 a0 40 02 cmp %g1, %g2
40006584: 02 80 00 06 be 4000659c <_POSIX_Condition_variables_Wait_support+0x80>
40006588: 01 00 00 00 nop
_Thread_Enable_dispatch();
4000658c: 40 00 0c 9f call 40009808 <_Thread_Enable_dispatch>
40006590: b0 10 20 16 mov 0x16, %i0 ! 16 <PROM_START+0x16>
return EINVAL;
40006594: 81 c7 e0 08 ret
40006598: 81 e8 00 00 restore
}
(void) pthread_mutex_unlock( mutex );
4000659c: 40 00 00 f2 call 40006964 <pthread_mutex_unlock>
400065a0: 90 10 00 19 mov %i1, %o0
_Thread_Enable_dispatch();
return EINVAL;
}
*/
if ( !already_timedout ) {
400065a4: 80 8e e0 ff btst 0xff, %i3
400065a8: 12 80 00 1c bne 40006618 <_POSIX_Condition_variables_Wait_support+0xfc>
400065ac: 23 10 00 7d sethi %hi(0x4001f400), %l1
the_cond->Mutex = *mutex;
400065b0: c4 06 40 00 ld [ %i1 ], %g2
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
400065b4: c2 04 61 9c ld [ %l1 + 0x19c ], %g1
return EINVAL;
}
*/
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
400065b8: c4 24 20 14 st %g2, [ %l0 + 0x14 ]
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
400065bc: c0 20 60 34 clr [ %g1 + 0x34 ]
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
_Thread_Executing->Wait.id = *cond;
400065c0: c6 06 00 00 ld [ %i0 ], %g3
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
400065c4: 84 04 20 18 add %l0, 0x18, %g2
_Thread_Executing->Wait.id = *cond;
400065c8: c6 20 60 20 st %g3, [ %g1 + 0x20 ]
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
400065cc: c4 20 60 44 st %g2, [ %g1 + 0x44 ]
_Thread_Executing->Wait.id = *cond;
_Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
400065d0: 92 10 00 1a mov %i2, %o1
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
400065d4: 82 10 20 01 mov 1, %g1
400065d8: 90 10 00 02 mov %g2, %o0
400065dc: 15 10 00 28 sethi %hi(0x4000a000), %o2
400065e0: 94 12 a1 2c or %o2, 0x12c, %o2 ! 4000a12c <_Thread_queue_Timeout>
400065e4: 40 00 0d dc call 40009d54 <_Thread_queue_Enqueue_with_handler>
400065e8: c2 24 20 48 st %g1, [ %l0 + 0x48 ]
_Thread_Enable_dispatch();
400065ec: 40 00 0c 87 call 40009808 <_Thread_Enable_dispatch>
400065f0: 01 00 00 00 nop
/*
* Switch ourself out because we blocked as a result of the
* _Thread_queue_Enqueue.
*/
status = _Thread_Executing->Wait.return_code;
400065f4: c2 04 61 9c ld [ %l1 + 0x19c ], %g1
400065f8: f0 00 60 34 ld [ %g1 + 0x34 ], %i0
if ( status && status != ETIMEDOUT )
400065fc: 80 a6 20 74 cmp %i0, 0x74
40006600: 02 80 00 08 be 40006620 <_POSIX_Condition_variables_Wait_support+0x104>
40006604: 80 a6 20 00 cmp %i0, 0
40006608: 02 80 00 06 be 40006620 <_POSIX_Condition_variables_Wait_support+0x104><== ALWAYS TAKEN
4000660c: 01 00 00 00 nop
40006610: 81 c7 e0 08 ret <== NOT EXECUTED
40006614: 81 e8 00 00 restore <== NOT EXECUTED
return status;
} else {
_Thread_Enable_dispatch();
40006618: 40 00 0c 7c call 40009808 <_Thread_Enable_dispatch>
4000661c: b0 10 20 74 mov 0x74, %i0
/*
* When we get here the dispatch disable level is 0.
*/
mutex_status = pthread_mutex_lock( mutex );
40006620: 40 00 00 b0 call 400068e0 <pthread_mutex_lock>
40006624: 90 10 00 19 mov %i1, %o0
if ( mutex_status )
40006628: 80 a2 20 00 cmp %o0, 0
4000662c: 02 80 00 03 be 40006638 <_POSIX_Condition_variables_Wait_support+0x11c>
40006630: 01 00 00 00 nop
40006634: b0 10 20 16 mov 0x16, %i0 ! 16 <PROM_START+0x16>
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
40006638: 81 c7 e0 08 ret
4000663c: 81 e8 00 00 restore
4000a350 <_POSIX_Message_queue_Receive_support>:
size_t msg_len,
unsigned int *msg_prio,
bool wait,
Watchdog_Interval timeout
)
{
4000a350: 9d e3 bf 98 save %sp, -104, %sp
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd (
mqd_t id,
Objects_Locations *location
)
{
return (POSIX_Message_queue_Control_fd *) _Objects_Get(
4000a354: 11 10 00 9a sethi %hi(0x40026800), %o0
4000a358: 94 07 bf fc add %fp, -4, %o2
4000a35c: 90 12 21 dc or %o0, 0x1dc, %o0
4000a360: 40 00 0c 61 call 4000d4e4 <_Objects_Get>
4000a364: 92 10 00 18 mov %i0, %o1
Objects_Locations location;
size_t length_out;
bool do_wait;
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
4000a368: c2 07 bf fc ld [ %fp + -4 ], %g1
size_t msg_len,
unsigned int *msg_prio,
bool wait,
Watchdog_Interval timeout
)
{
4000a36c: 94 10 00 19 mov %i1, %o2
Objects_Locations location;
size_t length_out;
bool do_wait;
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
4000a370: 80 a0 60 00 cmp %g1, 0
4000a374: 12 80 00 3b bne 4000a460 <_POSIX_Message_queue_Receive_support+0x110>
4000a378: 9a 10 00 1d mov %i5, %o5
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
4000a37c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
4000a380: 84 08 60 03 and %g1, 3, %g2
4000a384: 80 a0 a0 01 cmp %g2, 1
4000a388: 32 80 00 08 bne,a 4000a3a8 <_POSIX_Message_queue_Receive_support+0x58>
4000a38c: d0 02 20 10 ld [ %o0 + 0x10 ], %o0
_Thread_Enable_dispatch();
4000a390: 40 00 0e a1 call 4000de14 <_Thread_Enable_dispatch>
4000a394: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EBADF );
4000a398: 40 00 2a de call 40014f10 <__errno>
4000a39c: 01 00 00 00 nop
4000a3a0: 10 80 00 0b b 4000a3cc <_POSIX_Message_queue_Receive_support+0x7c>
4000a3a4: 82 10 20 09 mov 9, %g1 ! 9 <PROM_START+0x9>
}
the_mq = the_mq_fd->Queue;
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
4000a3a8: c4 02 20 68 ld [ %o0 + 0x68 ], %g2
4000a3ac: 80 a6 80 02 cmp %i2, %g2
4000a3b0: 1a 80 00 09 bcc 4000a3d4 <_POSIX_Message_queue_Receive_support+0x84>
4000a3b4: 80 8f 20 ff btst 0xff, %i4
_Thread_Enable_dispatch();
4000a3b8: 40 00 0e 97 call 4000de14 <_Thread_Enable_dispatch>
4000a3bc: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EMSGSIZE );
4000a3c0: 40 00 2a d4 call 40014f10 <__errno>
4000a3c4: 01 00 00 00 nop
4000a3c8: 82 10 20 7a mov 0x7a, %g1 ! 7a <PROM_START+0x7a>
4000a3cc: 10 80 00 23 b 4000a458 <_POSIX_Message_queue_Receive_support+0x108>
4000a3d0: c2 22 00 00 st %g1, [ %o0 ]
length_out = -1;
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
4000a3d4: 02 80 00 05 be 4000a3e8 <_POSIX_Message_queue_Receive_support+0x98><== NEVER TAKEN
4000a3d8: 98 10 20 00 clr %o4
do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true;
4000a3dc: 99 30 60 0e srl %g1, 0xe, %o4
4000a3e0: 98 1b 20 01 xor %o4, 1, %o4
4000a3e4: 98 0b 20 01 and %o4, 1, %o4
/*
* Now if something goes wrong, we return a "length" of -1
* to indicate an error.
*/
length_out = -1;
4000a3e8: 82 10 3f ff mov -1, %g1
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
4000a3ec: 90 02 20 1c add %o0, 0x1c, %o0
4000a3f0: 92 10 00 18 mov %i0, %o1
4000a3f4: 98 0b 20 01 and %o4, 1, %o4
4000a3f8: 96 07 bf f8 add %fp, -8, %o3
4000a3fc: 40 00 08 0e call 4000c434 <_CORE_message_queue_Seize>
4000a400: c2 27 bf f8 st %g1, [ %fp + -8 ]
&length_out,
do_wait,
timeout
);
_Thread_Enable_dispatch();
4000a404: 40 00 0e 84 call 4000de14 <_Thread_Enable_dispatch>
4000a408: 35 10 00 99 sethi %hi(0x40026400), %i2
*msg_prio =
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
4000a40c: c2 06 a1 7c ld [ %i2 + 0x17c ], %g1 ! 4002657c <_Thread_Executing>
do_wait,
timeout
);
_Thread_Enable_dispatch();
*msg_prio =
4000a410: c4 00 60 24 ld [ %g1 + 0x24 ], %g2
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
if ( !_Thread_Executing->Wait.return_code )
4000a414: c6 00 60 34 ld [ %g1 + 0x34 ], %g3
do_wait,
timeout
);
_Thread_Enable_dispatch();
*msg_prio =
4000a418: 83 38 a0 1f sra %g2, 0x1f, %g1
4000a41c: 84 18 40 02 xor %g1, %g2, %g2
4000a420: 82 20 80 01 sub %g2, %g1, %g1
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
if ( !_Thread_Executing->Wait.return_code )
4000a424: 80 a0 e0 00 cmp %g3, 0
4000a428: 12 80 00 05 bne 4000a43c <_POSIX_Message_queue_Receive_support+0xec>
4000a42c: c2 26 c0 00 st %g1, [ %i3 ]
return length_out;
4000a430: f0 07 bf f8 ld [ %fp + -8 ], %i0
4000a434: 81 c7 e0 08 ret
4000a438: 81 e8 00 00 restore
rtems_set_errno_and_return_minus_one(
4000a43c: 40 00 2a b5 call 40014f10 <__errno>
4000a440: 01 00 00 00 nop
4000a444: c2 06 a1 7c ld [ %i2 + 0x17c ], %g1
4000a448: b6 10 00 08 mov %o0, %i3
4000a44c: 40 00 00 9b call 4000a6b8 <_POSIX_Message_queue_Translate_core_message_queue_return_code>
4000a450: d0 00 60 34 ld [ %g1 + 0x34 ], %o0
4000a454: d0 26 c0 00 st %o0, [ %i3 ]
4000a458: 81 c7 e0 08 ret
4000a45c: 91 e8 3f ff restore %g0, -1, %o0
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
4000a460: 40 00 2a ac call 40014f10 <__errno>
4000a464: b0 10 3f ff mov -1, %i0
4000a468: 82 10 20 09 mov 9, %g1
4000a46c: c2 22 00 00 st %g1, [ %o0 ]
}
4000a470: 81 c7 e0 08 ret
4000a474: 81 e8 00 00 restore
4000ac04 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>:
Thread_Control *the_thread
)
{
POSIX_API_Control *thread_support;
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
4000ac04: c2 02 21 60 ld [ %o0 + 0x160 ], %g1
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
4000ac08: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2
4000ac0c: 80 a0 a0 00 cmp %g2, 0
4000ac10: 12 80 00 12 bne 4000ac58 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54><== NEVER TAKEN
4000ac14: 01 00 00 00 nop
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
4000ac18: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2
4000ac1c: 80 a0 a0 01 cmp %g2, 1
4000ac20: 12 80 00 0e bne 4000ac58 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54>
4000ac24: 01 00 00 00 nop
thread_support->cancelation_requested ) {
4000ac28: c2 00 60 dc ld [ %g1 + 0xdc ], %g1
4000ac2c: 80 a0 60 00 cmp %g1, 0
4000ac30: 02 80 00 0a be 4000ac58 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54>
4000ac34: 01 00 00 00 nop
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
4000ac38: 03 10 00 77 sethi %hi(0x4001dc00), %g1
4000ac3c: c4 00 61 50 ld [ %g1 + 0x150 ], %g2 ! 4001dd50 <_Thread_Dispatch_disable_level>
_Thread_Unnest_dispatch();
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
4000ac40: 92 10 3f ff mov -1, %o1
4000ac44: 84 00 bf ff add %g2, -1, %g2
4000ac48: c4 20 61 50 st %g2, [ %g1 + 0x150 ]
4000ac4c: 82 13 c0 00 mov %o7, %g1
4000ac50: 40 00 01 ab call 4000b2fc <_POSIX_Thread_Exit>
4000ac54: 9e 10 40 00 mov %g1, %o7
} else
_Thread_Enable_dispatch();
4000ac58: 82 13 c0 00 mov %o7, %g1
4000ac5c: 7f ff f3 7a call 40007a44 <_Thread_Enable_dispatch>
4000ac60: 9e 10 40 00 mov %g1, %o7
4000bf78 <_POSIX_Thread_Translate_sched_param>:
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
4000bf78: 9d e3 bf a0 save %sp, -96, %sp
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
4000bf7c: 7f ff ff f4 call 4000bf4c <_POSIX_Priority_Is_valid>
4000bf80: d0 06 40 00 ld [ %i1 ], %o0
4000bf84: 80 8a 20 ff btst 0xff, %o0
4000bf88: 02 80 00 37 be 4000c064 <_POSIX_Thread_Translate_sched_param+0xec><== NEVER TAKEN
4000bf8c: 80 a6 20 00 cmp %i0, 0
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
4000bf90: c0 26 80 00 clr [ %i2 ]
*budget_callout = NULL;
if ( policy == SCHED_OTHER ) {
4000bf94: 12 80 00 06 bne 4000bfac <_POSIX_Thread_Translate_sched_param+0x34>
4000bf98: c0 26 c0 00 clr [ %i3 ]
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
4000bf9c: 82 10 20 01 mov 1, %g1
4000bfa0: c2 26 80 00 st %g1, [ %i2 ]
return 0;
4000bfa4: 81 c7 e0 08 ret
4000bfa8: 81 e8 00 00 restore
}
if ( policy == SCHED_FIFO ) {
4000bfac: 80 a6 20 01 cmp %i0, 1
4000bfb0: 12 80 00 04 bne 4000bfc0 <_POSIX_Thread_Translate_sched_param+0x48>
4000bfb4: 80 a6 20 02 cmp %i0, 2
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
4000bfb8: 10 80 00 29 b 4000c05c <_POSIX_Thread_Translate_sched_param+0xe4>
4000bfbc: c0 26 80 00 clr [ %i2 ]
return 0;
}
if ( policy == SCHED_RR ) {
4000bfc0: 12 80 00 04 bne 4000bfd0 <_POSIX_Thread_Translate_sched_param+0x58>
4000bfc4: 80 a6 20 04 cmp %i0, 4
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
4000bfc8: 10 80 00 25 b 4000c05c <_POSIX_Thread_Translate_sched_param+0xe4>
4000bfcc: f0 26 80 00 st %i0, [ %i2 ]
return 0;
}
if ( policy == SCHED_SPORADIC ) {
4000bfd0: 12 80 00 25 bne 4000c064 <_POSIX_Thread_Translate_sched_param+0xec>
4000bfd4: 01 00 00 00 nop
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
4000bfd8: c2 06 60 08 ld [ %i1 + 8 ], %g1
4000bfdc: 80 a0 60 00 cmp %g1, 0
4000bfe0: 32 80 00 07 bne,a 4000bffc <_POSIX_Thread_Translate_sched_param+0x84>
4000bfe4: c2 06 60 10 ld [ %i1 + 0x10 ], %g1
(param->sched_ss_repl_period.tv_nsec == 0) )
4000bfe8: c2 06 60 0c ld [ %i1 + 0xc ], %g1
4000bfec: 80 a0 60 00 cmp %g1, 0
4000bff0: 02 80 00 1d be 4000c064 <_POSIX_Thread_Translate_sched_param+0xec>
4000bff4: 01 00 00 00 nop
return EINVAL;
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
4000bff8: c2 06 60 10 ld [ %i1 + 0x10 ], %g1
4000bffc: 80 a0 60 00 cmp %g1, 0
4000c000: 12 80 00 06 bne 4000c018 <_POSIX_Thread_Translate_sched_param+0xa0>
4000c004: 01 00 00 00 nop
(param->sched_ss_init_budget.tv_nsec == 0) )
4000c008: c2 06 60 14 ld [ %i1 + 0x14 ], %g1
4000c00c: 80 a0 60 00 cmp %g1, 0
4000c010: 02 80 00 15 be 4000c064 <_POSIX_Thread_Translate_sched_param+0xec>
4000c014: 01 00 00 00 nop
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
4000c018: 7f ff f5 a9 call 400096bc <_Timespec_To_ticks>
4000c01c: 90 06 60 08 add %i1, 8, %o0
4000c020: b0 10 00 08 mov %o0, %i0
4000c024: 7f ff f5 a6 call 400096bc <_Timespec_To_ticks>
4000c028: 90 06 60 10 add %i1, 0x10, %o0
4000c02c: 80 a6 00 08 cmp %i0, %o0
4000c030: 0a 80 00 0d bcs 4000c064 <_POSIX_Thread_Translate_sched_param+0xec>
4000c034: 01 00 00 00 nop
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
return EINVAL;
if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) )
4000c038: 7f ff ff c5 call 4000bf4c <_POSIX_Priority_Is_valid>
4000c03c: d0 06 60 04 ld [ %i1 + 4 ], %o0
4000c040: 80 8a 20 ff btst 0xff, %o0
4000c044: 02 80 00 08 be 4000c064 <_POSIX_Thread_Translate_sched_param+0xec>
4000c048: 82 10 20 03 mov 3, %g1
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
4000c04c: c2 26 80 00 st %g1, [ %i2 ]
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
4000c050: 03 10 00 17 sethi %hi(0x40005c00), %g1
4000c054: 82 10 60 cc or %g1, 0xcc, %g1 ! 40005ccc <_POSIX_Threads_Sporadic_budget_callout>
4000c058: c2 26 c0 00 st %g1, [ %i3 ]
return 0;
4000c05c: 81 c7 e0 08 ret
4000c060: 91 e8 20 00 restore %g0, 0, %o0
}
return EINVAL;
}
4000c064: 81 c7 e0 08 ret
4000c068: 91 e8 20 16 restore %g0, 0x16, %o0
40005a30 <_POSIX_Threads_Initialize_user_threads_body>:
*
* Output parameters: NONE
*/
void _POSIX_Threads_Initialize_user_threads_body(void)
{
40005a30: 9d e3 bf 60 save %sp, -160, %sp
uint32_t maximum;
posix_initialization_threads_table *user_threads;
pthread_t thread_id;
pthread_attr_t attr;
user_threads = Configuration_POSIX_API.User_initialization_threads_table;
40005a34: 03 10 00 74 sethi %hi(0x4001d000), %g1
40005a38: 82 10 62 bc or %g1, 0x2bc, %g1 ! 4001d2bc <Configuration_POSIX_API>
maximum = Configuration_POSIX_API.number_of_initialization_threads;
40005a3c: e6 00 60 30 ld [ %g1 + 0x30 ], %l3
if ( !user_threads || maximum == 0 )
40005a40: 80 a4 e0 00 cmp %l3, 0
40005a44: 02 80 00 1d be 40005ab8 <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN
40005a48: e2 00 60 34 ld [ %g1 + 0x34 ], %l1
40005a4c: 80 a4 60 00 cmp %l1, 0
40005a50: 02 80 00 1a be 40005ab8 <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN
40005a54: a4 10 20 00 clr %l2
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
40005a58: a0 07 bf c0 add %fp, -64, %l0
(void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
(void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
status = pthread_create(
40005a5c: a8 07 bf fc add %fp, -4, %l4
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
40005a60: 40 00 19 83 call 4000c06c <pthread_attr_init>
40005a64: 90 10 00 10 mov %l0, %o0
(void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
40005a68: 92 10 20 02 mov 2, %o1
40005a6c: 40 00 19 8b call 4000c098 <pthread_attr_setinheritsched>
40005a70: 90 10 00 10 mov %l0, %o0
(void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
40005a74: d2 04 60 04 ld [ %l1 + 4 ], %o1
40005a78: 40 00 19 98 call 4000c0d8 <pthread_attr_setstacksize>
40005a7c: 90 10 00 10 mov %l0, %o0
status = pthread_create(
40005a80: d4 04 40 00 ld [ %l1 ], %o2
40005a84: 90 10 00 14 mov %l4, %o0
40005a88: 92 10 00 10 mov %l0, %o1
40005a8c: 7f ff ff 34 call 4000575c <pthread_create>
40005a90: 96 10 20 00 clr %o3
&thread_id,
&attr,
user_threads[ index ].thread_entry,
NULL
);
if ( status )
40005a94: 94 92 20 00 orcc %o0, 0, %o2
40005a98: 22 80 00 05 be,a 40005aac <_POSIX_Threads_Initialize_user_threads_body+0x7c>
40005a9c: a4 04 a0 01 inc %l2
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
40005aa0: 90 10 20 02 mov 2, %o0
40005aa4: 40 00 07 a6 call 4000793c <_Internal_error_Occurred>
40005aa8: 92 10 20 01 mov 1, %o1
*
* Setting the attributes explicitly is critical, since we don't want
* to inherit the idle tasks attributes.
*/
for ( index=0 ; index < maximum ; index++ ) {
40005aac: 80 a4 80 13 cmp %l2, %l3
40005ab0: 0a bf ff ec bcs 40005a60 <_POSIX_Threads_Initialize_user_threads_body+0x30><== NEVER TAKEN
40005ab4: a2 04 60 08 add %l1, 8, %l1
40005ab8: 81 c7 e0 08 ret
40005abc: 81 e8 00 00 restore
4000ae80 <_POSIX_Threads_Sporadic_budget_TSR>:
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
4000ae80: 9d e3 bf a0 save %sp, -96, %sp
Thread_Control *the_thread;
POSIX_API_Control *api;
the_thread = argument;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4000ae84: e0 06 61 60 ld [ %i1 + 0x160 ], %l0
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
4000ae88: 40 00 04 60 call 4000c008 <_Timespec_To_ticks>
4000ae8c: 90 04 20 94 add %l0, 0x94, %o0
4000ae90: 03 10 00 6f sethi %hi(0x4001bc00), %g1
4000ae94: c4 04 20 84 ld [ %l0 + 0x84 ], %g2
4000ae98: d2 08 63 74 ldub [ %g1 + 0x374 ], %o1
*/
#if 0
printk( "TSR %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
4000ae9c: c2 06 60 1c ld [ %i1 + 0x1c ], %g1
4000aea0: 92 22 40 02 sub %o1, %g2, %o1
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
the_thread->cpu_time_budget = ticks;
4000aea4: d0 26 60 78 st %o0, [ %i1 + 0x78 ]
*/
#if 0
printk( "TSR %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
4000aea8: 80 a0 60 00 cmp %g1, 0
4000aeac: 12 80 00 08 bne 4000aecc <_POSIX_Threads_Sporadic_budget_TSR+0x4c><== NEVER TAKEN
4000aeb0: d2 26 60 18 st %o1, [ %i1 + 0x18 ]
/*
* If this would make them less important, then do not change it.
*/
if ( the_thread->current_priority > new_priority ) {
4000aeb4: c2 06 60 14 ld [ %i1 + 0x14 ], %g1
4000aeb8: 80 a0 40 09 cmp %g1, %o1
4000aebc: 08 80 00 04 bleu 4000aecc <_POSIX_Threads_Sporadic_budget_TSR+0x4c>
4000aec0: 90 10 00 19 mov %i1, %o0
_Thread_Change_priority( the_thread, new_priority, true );
4000aec4: 7f ff f0 91 call 40007108 <_Thread_Change_priority>
4000aec8: 94 10 20 01 mov 1, %o2
#endif
}
}
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period );
4000aecc: 40 00 04 4f call 4000c008 <_Timespec_To_ticks>
4000aed0: 90 04 20 8c add %l0, 0x8c, %o0
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4000aed4: 31 10 00 72 sethi %hi(0x4001c800), %i0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
4000aed8: d0 24 20 b0 st %o0, [ %l0 + 0xb0 ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4000aedc: b2 04 20 a4 add %l0, 0xa4, %i1
4000aee0: 7f ff f6 53 call 4000882c <_Watchdog_Insert>
4000aee4: 91 ee 21 bc restore %i0, 0x1bc, %o0
4000ae30 <_POSIX_Threads_Sporadic_budget_callout>:
)
{
POSIX_API_Control *api;
uint32_t new_priority;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4000ae30: c4 02 21 60 ld [ %o0 + 0x160 ], %g2
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
4000ae34: c6 00 a0 88 ld [ %g2 + 0x88 ], %g3
4000ae38: 05 10 00 6f sethi %hi(0x4001bc00), %g2
4000ae3c: d2 08 a3 74 ldub [ %g2 + 0x374 ], %o1 ! 4001bf74 <rtems_maximum_priority>
*/
#if 0
printk( "callout %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
4000ae40: c4 02 20 1c ld [ %o0 + 0x1c ], %g2
4000ae44: 92 22 40 03 sub %o1, %g3, %o1
/*
* This will prevent the thread from consuming its entire "budget"
* while at low priority.
*/
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
4000ae48: 86 10 3f ff mov -1, %g3
new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority);
the_thread->real_priority = new_priority;
4000ae4c: d2 22 20 18 st %o1, [ %o0 + 0x18 ]
*/
#if 0
printk( "callout %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
4000ae50: 80 a0 a0 00 cmp %g2, 0
4000ae54: 12 80 00 09 bne 4000ae78 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN
4000ae58: c6 22 20 78 st %g3, [ %o0 + 0x78 ]
/*
* Make sure we are actually lowering it. If they have lowered it
* to logically lower than sched_ss_low_priority, then we do not want to
* change it.
*/
if ( the_thread->current_priority < new_priority ) {
4000ae5c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
4000ae60: 80 a0 40 09 cmp %g1, %o1
4000ae64: 1a 80 00 05 bcc 4000ae78 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN
4000ae68: 94 10 20 01 mov 1, %o2
_Thread_Change_priority( the_thread, new_priority, true );
4000ae6c: 82 13 c0 00 mov %o7, %g1
4000ae70: 7f ff f0 a6 call 40007108 <_Thread_Change_priority>
4000ae74: 9e 10 40 00 mov %g1, %o7
4000ae78: 81 c3 e0 08 retl <== NOT EXECUTED
4000573c <_POSIX_Timer_TSR>:
* This is the operation that is run when a timer expires
*/
void _POSIX_Timer_TSR(
Objects_Id timer __attribute__((unused)),
void *data)
{
4000573c: 9d e3 bf a0 save %sp, -96, %sp
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
40005740: c4 06 60 68 ld [ %i1 + 0x68 ], %g2
/* The timer must be reprogrammed */
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
40005744: c2 06 60 54 ld [ %i1 + 0x54 ], %g1
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
40005748: 84 00 a0 01 inc %g2
/* The timer must be reprogrammed */
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
4000574c: 80 a0 60 00 cmp %g1, 0
40005750: 12 80 00 06 bne 40005768 <_POSIX_Timer_TSR+0x2c>
40005754: c4 26 60 68 st %g2, [ %i1 + 0x68 ]
( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) {
40005758: c2 06 60 58 ld [ %i1 + 0x58 ], %g1
4000575c: 80 a0 60 00 cmp %g1, 0
40005760: 02 80 00 0f be 4000579c <_POSIX_Timer_TSR+0x60> <== NEVER TAKEN
40005764: 82 10 20 04 mov 4, %g1
activated = _POSIX_Timer_Insert_helper(
40005768: d2 06 60 64 ld [ %i1 + 0x64 ], %o1
4000576c: d4 06 60 08 ld [ %i1 + 8 ], %o2
40005770: 90 06 60 10 add %i1, 0x10, %o0
40005774: 17 10 00 15 sethi %hi(0x40005400), %o3
40005778: 98 10 00 19 mov %i1, %o4
4000577c: 40 00 19 30 call 4000bc3c <_POSIX_Timer_Insert_helper>
40005780: 96 12 e3 3c or %o3, 0x33c, %o3
ptimer->ticks,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated )
40005784: 80 8a 20 ff btst 0xff, %o0
40005788: 02 80 00 0a be 400057b0 <_POSIX_Timer_TSR+0x74> <== NEVER TAKEN
4000578c: 01 00 00 00 nop
return;
/* Store the time when the timer was started again */
_TOD_Get( &ptimer->time );
40005790: 40 00 05 ac call 40006e40 <_TOD_Get>
40005794: 90 06 60 6c add %i1, 0x6c, %o0
40005798: 82 10 20 03 mov 3, %g1
/*
* The sending of the signal to the process running the handling function
* specified for that signal is simulated
*/
if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) {
4000579c: d0 06 60 38 ld [ %i1 + 0x38 ], %o0
400057a0: d2 06 60 44 ld [ %i1 + 0x44 ], %o1
400057a4: 40 00 18 10 call 4000b7e4 <pthread_kill>
400057a8: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ]
}
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
400057ac: c0 26 60 68 clr [ %i1 + 0x68 ]
400057b0: 81 c7 e0 08 ret
400057b4: 81 e8 00 00 restore
4000d044 <_POSIX_signals_Check_signal>:
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
4000d044: 9d e3 bf 90 save %sp, -112, %sp
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
4000d048: 98 10 20 01 mov 1, %o4
4000d04c: 96 0e a0 ff and %i2, 0xff, %o3
4000d050: a0 07 bf f4 add %fp, -12, %l0
4000d054: 90 10 00 18 mov %i0, %o0
4000d058: 92 10 00 19 mov %i1, %o1
4000d05c: 40 00 00 22 call 4000d0e4 <_POSIX_signals_Clear_signals>
4000d060: 94 10 00 10 mov %l0, %o2
4000d064: 80 8a 20 ff btst 0xff, %o0
4000d068: 02 80 00 1d be 4000d0dc <_POSIX_signals_Check_signal+0x98>
4000d06c: 83 2e 60 02 sll %i1, 2, %g1
#endif
/*
* Just to prevent sending a signal which is currently being ignored.
*/
if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN )
4000d070: 07 10 00 73 sethi %hi(0x4001cc00), %g3
4000d074: 85 2e 60 04 sll %i1, 4, %g2
4000d078: 86 10 e2 74 or %g3, 0x274, %g3
4000d07c: 84 20 80 01 sub %g2, %g1, %g2
4000d080: 88 00 c0 02 add %g3, %g2, %g4
4000d084: c2 01 20 08 ld [ %g4 + 8 ], %g1
4000d088: 80 a0 60 01 cmp %g1, 1
4000d08c: 02 80 00 14 be 4000d0dc <_POSIX_signals_Check_signal+0x98><== NEVER TAKEN
4000d090: 01 00 00 00 nop
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
4000d094: c8 01 20 04 ld [ %g4 + 4 ], %g4
return false;
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
4000d098: e2 06 20 cc ld [ %i0 + 0xcc ], %l1
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
/*
* Here, the signal handler function executes
*/
switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
4000d09c: c4 00 c0 02 ld [ %g3 + %g2 ], %g2
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
4000d0a0: 86 11 00 11 or %g4, %l1, %g3
/*
* Here, the signal handler function executes
*/
switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
4000d0a4: 80 a0 a0 02 cmp %g2, 2
4000d0a8: 12 80 00 08 bne 4000d0c8 <_POSIX_signals_Check_signal+0x84>
4000d0ac: c6 26 20 cc st %g3, [ %i0 + 0xcc ]
case SA_SIGINFO:
(*_POSIX_signals_Vectors[ signo ].sa_sigaction)(
4000d0b0: 90 10 00 19 mov %i1, %o0
4000d0b4: 92 10 00 10 mov %l0, %o1
4000d0b8: 9f c0 40 00 call %g1
4000d0bc: 94 10 20 00 clr %o2
signo,
&siginfo_struct,
NULL /* context is undefined per 1003.1b-1993, p. 66 */
);
break;
4000d0c0: 10 80 00 05 b 4000d0d4 <_POSIX_signals_Check_signal+0x90>
4000d0c4: e2 26 20 cc st %l1, [ %i0 + 0xcc ]
default:
(*_POSIX_signals_Vectors[ signo ].sa_handler)( signo );
4000d0c8: 9f c0 40 00 call %g1
4000d0cc: 90 10 00 19 mov %i1, %o0
}
/*
* Restore the previous set of blocked signals
*/
api->signals_blocked = saved_signals_blocked;
4000d0d0: e2 26 20 cc st %l1, [ %i0 + 0xcc ]
return true;
4000d0d4: 81 c7 e0 08 ret
4000d0d8: 91 e8 20 01 restore %g0, 1, %o0
}
4000d0dc: 81 c7 e0 08 ret
4000d0e0: 91 e8 20 00 restore %g0, 0, %o0
4000e1c4 <_POSIX_signals_Clear_process_signals>:
*/
void _POSIX_signals_Clear_process_signals(
int signo
)
{
4000e1c4: 9d e3 bf a0 save %sp, -96, %sp
clear_signal = true;
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
4000e1c8: 7f ff ce b4 call 40001c98 <sparc_disable_interrupts>
4000e1cc: 01 00 00 00 nop
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
4000e1d0: 85 2e 20 04 sll %i0, 4, %g2
4000e1d4: 83 2e 20 02 sll %i0, 2, %g1
4000e1d8: 82 20 80 01 sub %g2, %g1, %g1
4000e1dc: 05 10 00 73 sethi %hi(0x4001cc00), %g2
4000e1e0: 84 10 a2 74 or %g2, 0x274, %g2 ! 4001ce74 <_POSIX_signals_Vectors>
4000e1e4: c4 00 80 01 ld [ %g2 + %g1 ], %g2
4000e1e8: 80 a0 a0 02 cmp %g2, 2
4000e1ec: 12 80 00 0a bne 4000e214 <_POSIX_signals_Clear_process_signals+0x50>
4000e1f0: 05 10 00 74 sethi %hi(0x4001d000), %g2
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
4000e1f4: 05 10 00 74 sethi %hi(0x4001d000), %g2
4000e1f8: 84 10 a0 6c or %g2, 0x6c, %g2 ! 4001d06c <_POSIX_signals_Siginfo>
4000e1fc: c6 00 40 02 ld [ %g1 + %g2 ], %g3
4000e200: 82 00 40 02 add %g1, %g2, %g1
4000e204: 82 00 60 04 add %g1, 4, %g1
4000e208: 80 a0 c0 01 cmp %g3, %g1
4000e20c: 12 80 00 0e bne 4000e244 <_POSIX_signals_Clear_process_signals+0x80><== NEVER TAKEN
4000e210: 05 10 00 74 sethi %hi(0x4001d000), %g2
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
4000e214: c6 00 a0 68 ld [ %g2 + 0x68 ], %g3 ! 4001d068 <_POSIX_signals_Pending>
4000e218: b0 06 3f ff add %i0, -1, %i0
4000e21c: 82 10 20 01 mov 1, %g1
4000e220: 83 28 40 18 sll %g1, %i0, %g1
4000e224: 82 28 c0 01 andn %g3, %g1, %g1
if ( !_POSIX_signals_Pending )
4000e228: 80 a0 60 00 cmp %g1, 0
4000e22c: 12 80 00 06 bne 4000e244 <_POSIX_signals_Clear_process_signals+0x80><== NEVER TAKEN
4000e230: c2 20 a0 68 st %g1, [ %g2 + 0x68 ]
_Thread_Do_post_task_switch_extension--;
4000e234: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000e238: c4 00 61 80 ld [ %g1 + 0x180 ], %g2 ! 4001c980 <_Thread_Do_post_task_switch_extension>
4000e23c: 84 00 bf ff add %g2, -1, %g2
4000e240: c4 20 61 80 st %g2, [ %g1 + 0x180 ]
}
_ISR_Enable( level );
4000e244: 7f ff ce 99 call 40001ca8 <sparc_enable_interrupts>
4000e248: 91 e8 00 08 restore %g0, %o0, %o0
400061d8 <_POSIX_signals_Get_highest>:
#include <rtems/score/isr.h>
int _POSIX_signals_Get_highest(
sigset_t set
)
{
400061d8: 82 10 20 1b mov 0x1b, %g1 ! 1b <PROM_START+0x1b>
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
if ( set & signo_to_mask( signo ) ) {
400061dc: 84 10 20 01 mov 1, %g2
400061e0: 86 00 7f ff add %g1, -1, %g3
400061e4: 87 28 80 03 sll %g2, %g3, %g3
400061e8: 80 88 c0 08 btst %g3, %o0
400061ec: 12 80 00 11 bne 40006230 <_POSIX_signals_Get_highest+0x58><== NEVER TAKEN
400061f0: 01 00 00 00 nop
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
400061f4: 82 00 60 01 inc %g1
400061f8: 80 a0 60 20 cmp %g1, 0x20
400061fc: 12 bf ff fa bne 400061e4 <_POSIX_signals_Get_highest+0xc>
40006200: 86 00 7f ff add %g1, -1, %g3
40006204: 82 10 20 01 mov 1, %g1
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
if ( set & signo_to_mask( signo ) ) {
40006208: 84 10 20 01 mov 1, %g2
4000620c: 86 00 7f ff add %g1, -1, %g3
40006210: 87 28 80 03 sll %g2, %g3, %g3
40006214: 80 88 c0 08 btst %g3, %o0
40006218: 12 80 00 06 bne 40006230 <_POSIX_signals_Get_highest+0x58>
4000621c: 01 00 00 00 nop
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
40006220: 82 00 60 01 inc %g1
40006224: 80 a0 60 1b cmp %g1, 0x1b
40006228: 12 bf ff fa bne 40006210 <_POSIX_signals_Get_highest+0x38><== ALWAYS TAKEN
4000622c: 86 00 7f ff add %g1, -1, %g3
* a return 0. This routine will NOT be called unless a signal
* is pending in the set passed in.
*/
found_it:
return signo;
}
40006230: 81 c3 e0 08 retl
40006234: 90 10 00 01 mov %g1, %o0
4000e294 <_POSIX_signals_Unblock_thread>:
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
4000e294: 9d e3 bf a0 save %sp, -96, %sp
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
4000e298: c2 06 20 10 ld [ %i0 + 0x10 ], %g1
4000e29c: 09 04 00 20 sethi %hi(0x10008000), %g4
4000e2a0: 86 06 7f ff add %i1, -1, %g3
4000e2a4: 9a 08 40 04 and %g1, %g4, %o5
4000e2a8: 84 10 20 01 mov 1, %g2
4000e2ac: 80 a3 40 04 cmp %o5, %g4
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
4000e2b0: 92 10 00 1a mov %i2, %o1
4000e2b4: 87 28 80 03 sll %g2, %g3, %g3
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
4000e2b8: 12 80 00 1a bne 4000e320 <_POSIX_signals_Unblock_thread+0x8c>
4000e2bc: c8 06 21 60 ld [ %i0 + 0x160 ], %g4
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
4000e2c0: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
4000e2c4: 80 88 c0 01 btst %g3, %g1
4000e2c8: 12 80 00 06 bne 4000e2e0 <_POSIX_signals_Unblock_thread+0x4c>
4000e2cc: 82 10 20 04 mov 4, %g1
4000e2d0: c2 01 20 cc ld [ %g4 + 0xcc ], %g1
4000e2d4: 80 a8 c0 01 andncc %g3, %g1, %g0
4000e2d8: 02 80 00 38 be 4000e3b8 <_POSIX_signals_Unblock_thread+0x124>
4000e2dc: 82 10 20 04 mov 4, %g1
the_thread->Wait.return_code = EINTR;
4000e2e0: c2 26 20 34 st %g1, [ %i0 + 0x34 ]
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
4000e2e4: 80 a2 60 00 cmp %o1, 0
4000e2e8: 12 80 00 07 bne 4000e304 <_POSIX_signals_Unblock_thread+0x70>
4000e2ec: d0 06 20 28 ld [ %i0 + 0x28 ], %o0
the_info->si_signo = signo;
the_info->si_code = SI_USER;
4000e2f0: 82 10 20 01 mov 1, %g1
the_thread->Wait.return_code = EINTR;
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
4000e2f4: f2 22 00 00 st %i1, [ %o0 ]
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
4000e2f8: c0 22 20 08 clr [ %o0 + 8 ]
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
the_info->si_code = SI_USER;
4000e2fc: 10 80 00 04 b 4000e30c <_POSIX_signals_Unblock_thread+0x78>
4000e300: c2 22 20 04 st %g1, [ %o0 + 4 ]
the_info->si_value.sival_int = 0;
} else {
*the_info = *info;
4000e304: 40 00 02 d1 call 4000ee48 <memcpy>
4000e308: 94 10 20 0c mov 0xc, %o2
}
_Thread_queue_Extract_with_proxy( the_thread );
4000e30c: 90 10 00 18 mov %i0, %o0
4000e310: 7f ff e6 d1 call 40007e54 <_Thread_queue_Extract_with_proxy>
4000e314: b0 10 20 01 mov 1, %i0
return true;
4000e318: 81 c7 e0 08 ret
4000e31c: 81 e8 00 00 restore
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
4000e320: c8 01 20 cc ld [ %g4 + 0xcc ], %g4
4000e324: 80 a8 c0 04 andncc %g3, %g4, %g0
4000e328: 02 80 00 24 be 4000e3b8 <_POSIX_signals_Unblock_thread+0x124>
4000e32c: 07 04 00 00 sethi %hi(0x10000000), %g3
* + Any other combination, do nothing.
*/
the_thread->do_post_task_switch_extension = true;
if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) {
4000e330: 80 88 40 03 btst %g1, %g3
4000e334: 02 80 00 12 be 4000e37c <_POSIX_signals_Unblock_thread+0xe8>
4000e338: c4 2e 20 74 stb %g2, [ %i0 + 0x74 ]
the_thread->Wait.return_code = EINTR;
4000e33c: 84 10 20 04 mov 4, %g2
#if 0
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
_Thread_queue_Extract_with_proxy( the_thread );
else
#endif
if ( _States_Is_delaying(the_thread->current_state) ){
4000e340: 80 88 60 08 btst 8, %g1
4000e344: 02 80 00 1d be 4000e3b8 <_POSIX_signals_Unblock_thread+0x124><== NEVER TAKEN
4000e348: c4 26 20 34 st %g2, [ %i0 + 0x34 ]
if ( _Watchdog_Is_active( &the_thread->Timer ) )
4000e34c: c2 06 20 50 ld [ %i0 + 0x50 ], %g1
4000e350: 80 a0 60 02 cmp %g1, 2
4000e354: 12 80 00 05 bne 4000e368 <_POSIX_signals_Unblock_thread+0xd4><== NEVER TAKEN
4000e358: 90 10 00 18 mov %i0, %o0
(void) _Watchdog_Remove( &the_thread->Timer );
4000e35c: 7f ff e9 91 call 400089a0 <_Watchdog_Remove>
4000e360: 90 06 20 48 add %i0, 0x48, %o0
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
4000e364: 90 10 00 18 mov %i0, %o0
4000e368: 13 04 00 ff sethi %hi(0x1003fc00), %o1
4000e36c: 7f ff e3 e0 call 400072ec <_Thread_Clear_state>
4000e370: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1003fff8 <RAM_SIZE+0xfc3fff8>
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_ISR_Signals_to_thread_executing = true;
4000e374: 81 c7 e0 08 ret
4000e378: 91 e8 20 00 restore %g0, 0, %o0
if ( _States_Is_delaying(the_thread->current_state) ){
if ( _Watchdog_Is_active( &the_thread->Timer ) )
(void) _Watchdog_Remove( &the_thread->Timer );
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
4000e37c: 80 a0 60 00 cmp %g1, 0
4000e380: 12 80 00 0e bne 4000e3b8 <_POSIX_signals_Unblock_thread+0x124><== NEVER TAKEN
4000e384: 03 10 00 72 sethi %hi(0x4001c800), %g1
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
4000e388: c2 00 61 78 ld [ %g1 + 0x178 ], %g1 ! 4001c978 <_ISR_Nest_level>
4000e38c: 80 a0 60 00 cmp %g1, 0
4000e390: 02 80 00 0a be 4000e3b8 <_POSIX_signals_Unblock_thread+0x124>
4000e394: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000e398: c2 00 61 9c ld [ %g1 + 0x19c ], %g1 ! 4001c99c <_Thread_Executing>
4000e39c: 80 a6 00 01 cmp %i0, %g1
4000e3a0: 12 bf ff de bne 4000e318 <_POSIX_signals_Unblock_thread+0x84><== NEVER TAKEN
4000e3a4: b0 10 20 00 clr %i0
_ISR_Signals_to_thread_executing = true;
4000e3a8: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000e3ac: c4 28 62 38 stb %g2, [ %g1 + 0x238 ] ! 4001ca38 <_ISR_Signals_to_thread_executing>
4000e3b0: 81 c7 e0 08 ret
4000e3b4: 81 e8 00 00 restore
4000e3b8: b0 10 20 00 clr %i0
}
}
return false;
}
4000e3bc: 81 c7 e0 08 ret
4000e3c0: 81 e8 00 00 restore
4000b244 <_RTEMS_tasks_Post_switch_extension>:
*/
void _RTEMS_tasks_Post_switch_extension(
Thread_Control *executing
)
{
4000b244: 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 ];
4000b248: e0 06 21 5c ld [ %i0 + 0x15c ], %l0
if ( !api )
4000b24c: 80 a4 20 00 cmp %l0, 0
4000b250: 02 80 00 1d be 4000b2c4 <_RTEMS_tasks_Post_switch_extension+0x80><== NEVER TAKEN
4000b254: 01 00 00 00 nop
* Signal Processing
*/
asr = &api->Signal;
_ISR_Disable( level );
4000b258: 7f ff da 90 call 40001c98 <sparc_disable_interrupts>
4000b25c: 01 00 00 00 nop
signal_set = asr->signals_posted;
4000b260: e6 04 20 14 ld [ %l0 + 0x14 ], %l3
asr->signals_posted = 0;
4000b264: c0 24 20 14 clr [ %l0 + 0x14 ]
_ISR_Enable( level );
4000b268: 7f ff da 90 call 40001ca8 <sparc_enable_interrupts>
4000b26c: 01 00 00 00 nop
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
4000b270: 80 a4 e0 00 cmp %l3, 0
4000b274: 02 80 00 14 be 4000b2c4 <_RTEMS_tasks_Post_switch_extension+0x80>
4000b278: a2 07 bf fc add %fp, -4, %l1
return;
asr->nest_level += 1;
4000b27c: c2 04 20 1c ld [ %l0 + 0x1c ], %g1
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
4000b280: d0 04 20 10 ld [ %l0 + 0x10 ], %o0
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
return;
asr->nest_level += 1;
4000b284: 82 00 60 01 inc %g1
4000b288: c2 24 20 1c st %g1, [ %l0 + 0x1c ]
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
4000b28c: 94 10 00 11 mov %l1, %o2
4000b290: 25 00 00 3f sethi %hi(0xfc00), %l2
4000b294: 40 00 08 74 call 4000d464 <rtems_task_mode>
4000b298: 92 14 a3 ff or %l2, 0x3ff, %o1 ! ffff <PROM_START+0xffff>
(*asr->handler)( signal_set );
4000b29c: c2 04 20 0c ld [ %l0 + 0xc ], %g1
4000b2a0: 9f c0 40 00 call %g1
4000b2a4: 90 10 00 13 mov %l3, %o0
asr->nest_level -= 1;
4000b2a8: c2 04 20 1c ld [ %l0 + 0x1c ], %g1
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
4000b2ac: 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;
4000b2b0: 82 00 7f ff add %g1, -1, %g1
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
4000b2b4: 92 14 a3 ff or %l2, 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;
4000b2b8: c2 24 20 1c st %g1, [ %l0 + 0x1c ]
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
4000b2bc: 40 00 08 6a call 4000d464 <rtems_task_mode>
4000b2c0: 94 10 00 11 mov %l1, %o2
4000b2c4: 81 c7 e0 08 ret
4000b2c8: 81 e8 00 00 restore
40006bd8 <_Rate_monotonic_Timeout>:
void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
)
{
40006bd8: 9d e3 bf 98 save %sp, -104, %sp
40006bdc: 11 10 00 89 sethi %hi(0x40022400), %o0
40006be0: 92 10 00 18 mov %i0, %o1
40006be4: 90 12 21 c8 or %o0, 0x1c8, %o0
40006be8: 40 00 07 a6 call 40008a80 <_Objects_Get>
40006bec: 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 ) {
40006bf0: c2 07 bf fc ld [ %fp + -4 ], %g1
40006bf4: 80 a0 60 00 cmp %g1, 0
40006bf8: 12 80 00 26 bne 40006c90 <_Rate_monotonic_Timeout+0xb8> <== NEVER TAKEN
40006bfc: a0 10 00 08 mov %o0, %l0
case OBJECTS_LOCAL:
the_thread = the_period->owner;
40006c00: d0 02 20 40 ld [ %o0 + 0x40 ], %o0
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
40006c04: 03 00 00 10 sethi %hi(0x4000), %g1
40006c08: c4 02 20 10 ld [ %o0 + 0x10 ], %g2
40006c0c: 80 88 80 01 btst %g2, %g1
40006c10: 22 80 00 0c be,a 40006c40 <_Rate_monotonic_Timeout+0x68>
40006c14: c2 04 20 38 ld [ %l0 + 0x38 ], %g1
the_thread->Wait.id == the_period->Object.id ) {
40006c18: c4 02 20 20 ld [ %o0 + 0x20 ], %g2
40006c1c: c2 04 20 08 ld [ %l0 + 8 ], %g1
40006c20: 80 a0 80 01 cmp %g2, %g1
40006c24: 32 80 00 07 bne,a 40006c40 <_Rate_monotonic_Timeout+0x68>
40006c28: c2 04 20 38 ld [ %l0 + 0x38 ], %g1
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
40006c2c: 13 04 00 ff sethi %hi(0x1003fc00), %o1
40006c30: 40 00 08 eb call 40008fdc <_Thread_Clear_state>
40006c34: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1003fff8 <RAM_SIZE+0xfc3fff8>
_Thread_Unblock( the_thread );
_Rate_monotonic_Initiate_statistics( the_period );
40006c38: 10 80 00 08 b 40006c58 <_Rate_monotonic_Timeout+0x80>
40006c3c: 90 10 00 10 mov %l0, %o0
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) {
40006c40: 80 a0 60 01 cmp %g1, 1
40006c44: 12 80 00 0e bne 40006c7c <_Rate_monotonic_Timeout+0xa4>
40006c48: 82 10 20 04 mov 4, %g1
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
40006c4c: 82 10 20 03 mov 3, %g1
_Rate_monotonic_Initiate_statistics( the_period );
40006c50: 90 10 00 10 mov %l0, %o0
_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 ) {
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
40006c54: c2 24 20 38 st %g1, [ %l0 + 0x38 ]
_Rate_monotonic_Initiate_statistics( the_period );
40006c58: 7f ff fe 3e call 40006550 <_Rate_monotonic_Initiate_statistics>
40006c5c: 01 00 00 00 nop
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40006c60: c2 04 20 3c ld [ %l0 + 0x3c ], %g1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40006c64: 92 04 20 10 add %l0, 0x10, %o1
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40006c68: c2 24 20 1c st %g1, [ %l0 + 0x1c ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40006c6c: 11 10 00 8a sethi %hi(0x40022800), %o0
40006c70: 40 00 0f 0a call 4000a898 <_Watchdog_Insert>
40006c74: 90 12 20 1c or %o0, 0x1c, %o0 ! 4002281c <_Watchdog_Ticks_chain>
40006c78: 30 80 00 02 b,a 40006c80 <_Rate_monotonic_Timeout+0xa8>
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
40006c7c: c2 24 20 38 st %g1, [ %l0 + 0x38 ]
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
40006c80: 03 10 00 89 sethi %hi(0x40022400), %g1
40006c84: c4 00 63 40 ld [ %g1 + 0x340 ], %g2 ! 40022740 <_Thread_Dispatch_disable_level>
40006c88: 84 00 bf ff add %g2, -1, %g2
40006c8c: c4 20 63 40 st %g2, [ %g1 + 0x340 ]
40006c90: 81 c7 e0 08 ret
40006c94: 81 e8 00 00 restore
400065e8 <_TOD_Validate>:
*/
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
400065e8: 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 /
rtems_configuration_get_microseconds_per_tick();
400065ec: 03 10 00 89 sethi %hi(0x40022400), %g1
if ((!the_tod) ||
400065f0: 80 a6 20 00 cmp %i0, 0
400065f4: 02 80 00 2d be 400066a8 <_TOD_Validate+0xc0> <== NEVER TAKEN
400065f8: d2 00 62 f4 ld [ %g1 + 0x2f4 ], %o1
(the_tod->ticks >= ticks_per_second) ||
400065fc: 11 00 03 d0 sethi %hi(0xf4000), %o0
40006600: 40 00 5a 8a call 4001d028 <.udiv>
40006604: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 <PROM_START+0xf4240>
40006608: c2 06 20 18 ld [ %i0 + 0x18 ], %g1
4000660c: 80 a0 40 08 cmp %g1, %o0
40006610: 1a 80 00 26 bcc 400066a8 <_TOD_Validate+0xc0>
40006614: 01 00 00 00 nop
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
40006618: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
4000661c: 80 a0 60 3b cmp %g1, 0x3b
40006620: 18 80 00 22 bgu 400066a8 <_TOD_Validate+0xc0>
40006624: 01 00 00 00 nop
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
40006628: c2 06 20 10 ld [ %i0 + 0x10 ], %g1
4000662c: 80 a0 60 3b cmp %g1, 0x3b
40006630: 18 80 00 1e bgu 400066a8 <_TOD_Validate+0xc0>
40006634: 01 00 00 00 nop
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
40006638: c2 06 20 0c ld [ %i0 + 0xc ], %g1
4000663c: 80 a0 60 17 cmp %g1, 0x17
40006640: 18 80 00 1a bgu 400066a8 <_TOD_Validate+0xc0>
40006644: 01 00 00 00 nop
(the_tod->month == 0) ||
40006648: c2 06 20 04 ld [ %i0 + 4 ], %g1
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
4000664c: 80 a0 60 00 cmp %g1, 0
40006650: 02 80 00 16 be 400066a8 <_TOD_Validate+0xc0> <== NEVER TAKEN
40006654: 80 a0 60 0c cmp %g1, 0xc
40006658: 18 80 00 14 bgu 400066a8 <_TOD_Validate+0xc0>
4000665c: 01 00 00 00 nop
(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) ||
40006660: c6 06 00 00 ld [ %i0 ], %g3
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
40006664: 80 a0 e7 c3 cmp %g3, 0x7c3
40006668: 08 80 00 10 bleu 400066a8 <_TOD_Validate+0xc0>
4000666c: 01 00 00 00 nop
(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) ||
(the_tod->day == 0) )
40006670: c4 06 20 08 ld [ %i0 + 8 ], %g2
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
40006674: 80 a0 a0 00 cmp %g2, 0
40006678: 02 80 00 0c be 400066a8 <_TOD_Validate+0xc0> <== NEVER TAKEN
4000667c: 80 88 e0 03 btst 3, %g3
40006680: 07 10 00 83 sethi %hi(0x40020c00), %g3
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
40006684: 12 80 00 03 bne 40006690 <_TOD_Validate+0xa8>
40006688: 86 10 e2 4c or %g3, 0x24c, %g3 ! 40020e4c <_TOD_Days_per_month>
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
4000668c: 82 00 60 0d add %g1, 0xd, %g1
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
40006690: 83 28 60 02 sll %g1, 2, %g1
40006694: c2 00 c0 01 ld [ %g3 + %g1 ], %g1
* false - if the the_tod is invalid
*
* NOTE: This routine only works for leap-years through 2099.
*/
bool _TOD_Validate(
40006698: 80 a0 40 02 cmp %g1, %g2
4000669c: b0 60 3f ff subx %g0, -1, %i0
400066a0: 81 c7 e0 08 ret
400066a4: 81 e8 00 00 restore
if ( the_tod->day > days_in_month )
return false;
return true;
}
400066a8: 81 c7 e0 08 ret
400066ac: 91 e8 20 00 restore %g0, 0, %o0
40007108 <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
40007108: 9d e3 bf a0 save %sp, -96, %sp
*/
/*
* Save original state
*/
original_state = the_thread->current_state;
4000710c: e2 06 20 10 ld [ %i0 + 0x10 ], %l1
/*
* 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 );
40007110: 40 00 04 26 call 400081a8 <_Thread_Set_transient>
40007114: 90 10 00 18 mov %i0, %o0
/*
* Do not bother recomputing all the priority related information if
* we are not REALLY changing priority.
*/
if ( the_thread->current_priority != new_priority )
40007118: c2 06 20 14 ld [ %i0 + 0x14 ], %g1
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
4000711c: a0 10 00 18 mov %i0, %l0
/*
* Do not bother recomputing all the priority related information if
* we are not REALLY changing priority.
*/
if ( the_thread->current_priority != new_priority )
40007120: 80 a0 40 19 cmp %g1, %i1
40007124: 02 80 00 04 be 40007134 <_Thread_Change_priority+0x2c>
40007128: 92 10 00 19 mov %i1, %o1
_Thread_Set_priority( the_thread, new_priority );
4000712c: 40 00 03 a2 call 40007fb4 <_Thread_Set_priority>
40007130: 90 10 00 18 mov %i0, %o0
_ISR_Disable( level );
40007134: 7f ff ea d9 call 40001c98 <sparc_disable_interrupts>
40007138: 01 00 00 00 nop
4000713c: b0 10 00 08 mov %o0, %i0
/*
* 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;
40007140: e4 04 20 10 ld [ %l0 + 0x10 ], %l2
if ( state != STATES_TRANSIENT ) {
40007144: 80 a4 a0 04 cmp %l2, 4
40007148: 02 80 00 10 be 40007188 <_Thread_Change_priority+0x80>
4000714c: a2 0c 60 04 and %l1, 4, %l1
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
40007150: 80 a4 60 00 cmp %l1, 0
40007154: 12 80 00 03 bne 40007160 <_Thread_Change_priority+0x58> <== NEVER TAKEN
40007158: 82 0c bf fb and %l2, -5, %g1
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
4000715c: c2 24 20 10 st %g1, [ %l0 + 0x10 ]
_ISR_Enable( level );
40007160: 7f ff ea d2 call 40001ca8 <sparc_enable_interrupts>
40007164: 90 10 00 18 mov %i0, %o0
if ( _States_Is_waiting_on_thread_queue( state ) ) {
40007168: 03 00 00 ef sethi %hi(0x3bc00), %g1
4000716c: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <PROM_START+0x3bee0>
40007170: 80 8c 80 01 btst %l2, %g1
40007174: 02 80 00 5c be 400072e4 <_Thread_Change_priority+0x1dc>
40007178: 01 00 00 00 nop
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
4000717c: f0 04 20 44 ld [ %l0 + 0x44 ], %i0
40007180: 40 00 03 60 call 40007f00 <_Thread_queue_Requeue>
40007184: 93 e8 00 10 restore %g0, %l0, %o1
}
return;
}
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) ) {
40007188: 80 a4 60 00 cmp %l1, 0
4000718c: 12 80 00 1c bne 400071fc <_Thread_Change_priority+0xf4> <== NEVER TAKEN
40007190: 01 00 00 00 nop
RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map (
Priority_Information *the_priority_map
)
{
*the_priority_map->minor |= the_priority_map->ready_minor;
40007194: c4 04 20 90 ld [ %l0 + 0x90 ], %g2
40007198: c6 14 20 96 lduh [ %l0 + 0x96 ], %g3
4000719c: c8 10 80 00 lduh [ %g2 ], %g4
_Priority_Major_bit_map |= the_priority_map->ready_major;
400071a0: 03 10 00 72 sethi %hi(0x4001c800), %g1
RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map (
Priority_Information *the_priority_map
)
{
*the_priority_map->minor |= the_priority_map->ready_minor;
400071a4: 86 11 00 03 or %g4, %g3, %g3
400071a8: c6 30 80 00 sth %g3, [ %g2 ]
_Priority_Major_bit_map |= the_priority_map->ready_major;
400071ac: c4 10 61 90 lduh [ %g1 + 0x190 ], %g2
400071b0: c6 14 20 94 lduh [ %l0 + 0x94 ], %g3
* 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 );
400071b4: c0 24 20 10 clr [ %l0 + 0x10 ]
400071b8: 84 10 c0 02 or %g3, %g2, %g2
400071bc: c4 30 61 90 sth %g2, [ %g1 + 0x190 ]
_Priority_Add_to_bit_map( &the_thread->Priority_map );
if ( prepend_it )
400071c0: 80 8e a0 ff btst 0xff, %i2
400071c4: 02 80 00 08 be 400071e4 <_Thread_Change_priority+0xdc>
400071c8: c2 04 20 8c ld [ %l0 + 0x8c ], %g1
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
400071cc: c4 00 40 00 ld [ %g1 ], %g2
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
400071d0: c2 24 20 04 st %g1, [ %l0 + 4 ]
before_node = after_node->next;
after_node->next = the_node;
400071d4: e0 20 40 00 st %l0, [ %g1 ]
the_node->next = before_node;
before_node->previous = the_node;
400071d8: e0 20 a0 04 st %l0, [ %g2 + 4 ]
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
400071dc: 10 80 00 08 b 400071fc <_Thread_Change_priority+0xf4>
400071e0: c4 24 00 00 st %g2, [ %l0 ]
Chain_Node *the_node
)
{
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
400071e4: 84 00 60 04 add %g1, 4, %g2
400071e8: c4 24 00 00 st %g2, [ %l0 ]
old_last_node = the_chain->last;
400071ec: c4 00 60 08 ld [ %g1 + 8 ], %g2
the_chain->last = the_node;
400071f0: e0 20 60 08 st %l0, [ %g1 + 8 ]
old_last_node->next = the_node;
the_node->previous = old_last_node;
400071f4: c4 24 20 04 st %g2, [ %l0 + 4 ]
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
old_last_node = the_chain->last;
the_chain->last = the_node;
old_last_node->next = the_node;
400071f8: e0 20 80 00 st %l0, [ %g2 ]
_Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node );
else
_Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
}
_ISR_Flash( level );
400071fc: 7f ff ea ab call 40001ca8 <sparc_enable_interrupts>
40007200: 90 10 00 18 mov %i0, %o0
40007204: 7f ff ea a5 call 40001c98 <sparc_disable_interrupts>
40007208: 01 00 00 00 nop
RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void )
{
Priority_Bit_map_control minor;
Priority_Bit_map_control major;
_Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
4000720c: 03 10 00 72 sethi %hi(0x4001c800), %g1
40007210: c4 10 61 90 lduh [ %g1 + 0x190 ], %g2 ! 4001c990 <_Priority_Major_bit_map>
*/
RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
{
_Thread_Heir = (Thread_Control *)
_Thread_Ready_chain[ _Priority_Get_highest() ].first;
40007214: 03 10 00 72 sethi %hi(0x4001c800), %g1
40007218: 85 28 a0 10 sll %g2, 0x10, %g2
4000721c: da 00 60 34 ld [ %g1 + 0x34 ], %o5
40007220: 87 30 a0 10 srl %g2, 0x10, %g3
40007224: 03 10 00 6b sethi %hi(0x4001ac00), %g1
40007228: 80 a0 e0 ff cmp %g3, 0xff
4000722c: 18 80 00 05 bgu 40007240 <_Thread_Change_priority+0x138>
40007230: 82 10 63 50 or %g1, 0x350, %g1
40007234: c4 08 40 03 ldub [ %g1 + %g3 ], %g2
40007238: 10 80 00 04 b 40007248 <_Thread_Change_priority+0x140>
4000723c: 84 00 a0 08 add %g2, 8, %g2
40007240: 85 30 a0 18 srl %g2, 0x18, %g2
40007244: c4 08 40 02 ldub [ %g1 + %g2 ], %g2
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
40007248: 83 28 a0 10 sll %g2, 0x10, %g1
4000724c: 07 10 00 72 sethi %hi(0x4001c800), %g3
40007250: 83 30 60 0f srl %g1, 0xf, %g1
40007254: 86 10 e2 10 or %g3, 0x210, %g3
40007258: c6 10 c0 01 lduh [ %g3 + %g1 ], %g3
4000725c: 03 10 00 6b sethi %hi(0x4001ac00), %g1
40007260: 87 28 e0 10 sll %g3, 0x10, %g3
40007264: 89 30 e0 10 srl %g3, 0x10, %g4
40007268: 80 a1 20 ff cmp %g4, 0xff
4000726c: 18 80 00 05 bgu 40007280 <_Thread_Change_priority+0x178>
40007270: 82 10 63 50 or %g1, 0x350, %g1
40007274: c2 08 40 04 ldub [ %g1 + %g4 ], %g1
40007278: 10 80 00 04 b 40007288 <_Thread_Change_priority+0x180>
4000727c: 82 00 60 08 add %g1, 8, %g1
40007280: 87 30 e0 18 srl %g3, 0x18, %g3
40007284: c2 08 40 03 ldub [ %g1 + %g3 ], %g1
* ready thread.
*/
RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
{
_Thread_Heir = (Thread_Control *)
40007288: 83 28 60 10 sll %g1, 0x10, %g1
4000728c: 83 30 60 10 srl %g1, 0x10, %g1
40007290: 85 28 a0 10 sll %g2, 0x10, %g2
40007294: 85 30 a0 0c srl %g2, 0xc, %g2
40007298: 84 00 40 02 add %g1, %g2, %g2
4000729c: 83 28 a0 04 sll %g2, 4, %g1
400072a0: 85 28 a0 02 sll %g2, 2, %g2
400072a4: 84 20 40 02 sub %g1, %g2, %g2
400072a8: c4 03 40 02 ld [ %o5 + %g2 ], %g2
* is also the heir thread, and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void )
{
return ( _Thread_Executing == _Thread_Heir );
400072ac: 03 10 00 72 sethi %hi(0x4001c800), %g1
400072b0: c2 00 61 9c ld [ %g1 + 0x19c ], %g1 ! 4001c99c <_Thread_Executing>
* ready thread.
*/
RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
{
_Thread_Heir = (Thread_Control *)
400072b4: 07 10 00 72 sethi %hi(0x4001c800), %g3
* We altered the set of thread priorities. So let's figure out
* who is the heir and if we need to switch to them.
*/
_Thread_Calculate_heir();
if ( !_Thread_Is_executing_also_the_heir() &&
400072b8: 80 a0 40 02 cmp %g1, %g2
400072bc: 02 80 00 08 be 400072dc <_Thread_Change_priority+0x1d4>
400072c0: c4 20 e1 6c st %g2, [ %g3 + 0x16c ]
_Thread_Executing->is_preemptible )
400072c4: c2 08 60 75 ldub [ %g1 + 0x75 ], %g1
400072c8: 80 a0 60 00 cmp %g1, 0
400072cc: 02 80 00 04 be 400072dc <_Thread_Change_priority+0x1d4>
400072d0: 84 10 20 01 mov 1, %g2
_Context_Switch_necessary = true;
400072d4: 03 10 00 72 sethi %hi(0x4001c800), %g1
400072d8: c4 28 61 ac stb %g2, [ %g1 + 0x1ac ] ! 4001c9ac <_Context_Switch_necessary>
_ISR_Enable( level );
400072dc: 7f ff ea 73 call 40001ca8 <sparc_enable_interrupts>
400072e0: 81 e8 00 00 restore
400072e4: 81 c7 e0 08 ret
400072e8: 81 e8 00 00 restore
400072ec <_Thread_Clear_state>:
void _Thread_Clear_state(
Thread_Control *the_thread,
States_Control state
)
{
400072ec: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
States_Control current_state;
_ISR_Disable( level );
400072f0: 7f ff ea 6a call 40001c98 <sparc_disable_interrupts>
400072f4: a0 10 00 18 mov %i0, %l0
400072f8: b0 10 00 08 mov %o0, %i0
current_state = the_thread->current_state;
400072fc: c2 04 20 10 ld [ %l0 + 0x10 ], %g1
if ( current_state & state ) {
40007300: 80 8e 40 01 btst %i1, %g1
40007304: 02 80 00 2d be 400073b8 <_Thread_Clear_state+0xcc>
40007308: 01 00 00 00 nop
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
4000730c: b2 28 40 19 andn %g1, %i1, %i1
current_state =
the_thread->current_state = _States_Clear( state, current_state );
if ( _States_Is_ready( current_state ) ) {
40007310: 80 a6 60 00 cmp %i1, 0
40007314: 12 80 00 29 bne 400073b8 <_Thread_Clear_state+0xcc>
40007318: f2 24 20 10 st %i1, [ %l0 + 0x10 ]
RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map (
Priority_Information *the_priority_map
)
{
*the_priority_map->minor |= the_priority_map->ready_minor;
4000731c: c4 04 20 90 ld [ %l0 + 0x90 ], %g2
_Priority_Add_to_bit_map( &the_thread->Priority_map );
_Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
40007320: c2 04 20 8c ld [ %l0 + 0x8c ], %g1
40007324: c8 10 80 00 lduh [ %g2 ], %g4
40007328: c6 14 20 96 lduh [ %l0 + 0x96 ], %g3
4000732c: 86 11 00 03 or %g4, %g3, %g3
40007330: c6 30 80 00 sth %g3, [ %g2 ]
Chain_Node *the_node
)
{
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
40007334: 84 00 60 04 add %g1, 4, %g2
_Priority_Major_bit_map |= the_priority_map->ready_major;
40007338: da 14 20 94 lduh [ %l0 + 0x94 ], %o5
4000733c: c4 24 00 00 st %g2, [ %l0 ]
40007340: 07 10 00 72 sethi %hi(0x4001c800), %g3
old_last_node = the_chain->last;
40007344: c4 00 60 08 ld [ %g1 + 8 ], %g2
40007348: c8 10 e1 90 lduh [ %g3 + 0x190 ], %g4
the_chain->last = the_node;
4000734c: e0 20 60 08 st %l0, [ %g1 + 8 ]
old_last_node->next = the_node;
the_node->previous = old_last_node;
40007350: c4 24 20 04 st %g2, [ %l0 + 4 ]
40007354: 82 13 40 04 or %o5, %g4, %g1
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
old_last_node = the_chain->last;
the_chain->last = the_node;
old_last_node->next = the_node;
40007358: e0 20 80 00 st %l0, [ %g2 ]
4000735c: c2 30 e1 90 sth %g1, [ %g3 + 0x190 ]
_ISR_Flash( level );
40007360: 7f ff ea 52 call 40001ca8 <sparc_enable_interrupts>
40007364: 01 00 00 00 nop
40007368: 7f ff ea 4c call 40001c98 <sparc_disable_interrupts>
4000736c: 01 00 00 00 nop
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
40007370: 05 10 00 72 sethi %hi(0x4001c800), %g2
40007374: c6 00 a1 6c ld [ %g2 + 0x16c ], %g3 ! 4001c96c <_Thread_Heir>
40007378: c2 04 20 14 ld [ %l0 + 0x14 ], %g1
4000737c: c6 00 e0 14 ld [ %g3 + 0x14 ], %g3
40007380: 80 a0 40 03 cmp %g1, %g3
40007384: 1a 80 00 0d bcc 400073b8 <_Thread_Clear_state+0xcc>
40007388: 07 10 00 72 sethi %hi(0x4001c800), %g3
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
4000738c: c6 00 e1 9c ld [ %g3 + 0x19c ], %g3 ! 4001c99c <_Thread_Executing>
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
_Thread_Heir = the_thread;
40007390: e0 20 a1 6c st %l0, [ %g2 + 0x16c ]
if ( _Thread_Executing->is_preemptible ||
40007394: c4 08 e0 75 ldub [ %g3 + 0x75 ], %g2
40007398: 80 a0 a0 00 cmp %g2, 0
4000739c: 12 80 00 05 bne 400073b0 <_Thread_Clear_state+0xc4>
400073a0: 84 10 20 01 mov 1, %g2
400073a4: 80 a0 60 00 cmp %g1, 0
400073a8: 12 80 00 04 bne 400073b8 <_Thread_Clear_state+0xcc> <== ALWAYS TAKEN
400073ac: 01 00 00 00 nop
the_thread->current_priority == 0 )
_Context_Switch_necessary = true;
400073b0: 03 10 00 72 sethi %hi(0x4001c800), %g1
400073b4: c4 28 61 ac stb %g2, [ %g1 + 0x1ac ] ! 4001c9ac <_Context_Switch_necessary>
}
}
}
_ISR_Enable( level );
400073b8: 7f ff ea 3c call 40001ca8 <sparc_enable_interrupts>
400073bc: 81 e8 00 00 restore
40007544 <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
40007544: 9d e3 bf 98 save %sp, -104, %sp
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
40007548: 90 10 00 18 mov %i0, %o0
4000754c: 40 00 00 6c call 400076fc <_Thread_Get>
40007550: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
40007554: c2 07 bf fc ld [ %fp + -4 ], %g1
40007558: 80 a0 60 00 cmp %g1, 0
4000755c: 12 80 00 08 bne 4000757c <_Thread_Delay_ended+0x38> <== NEVER TAKEN
40007560: 13 04 00 00 sethi %hi(0x10000000), %o1
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
40007564: 7f ff ff 62 call 400072ec <_Thread_Clear_state>
40007568: 92 12 60 18 or %o1, 0x18, %o1 ! 10000018 <RAM_SIZE+0xfc00018>
4000756c: 03 10 00 72 sethi %hi(0x4001c800), %g1
40007570: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2 ! 4001c8e0 <_Thread_Dispatch_disable_level>
40007574: 84 00 bf ff add %g2, -1, %g2
40007578: c4 20 60 e0 st %g2, [ %g1 + 0xe0 ]
4000757c: 81 c7 e0 08 ret
40007580: 81 e8 00 00 restore
40007584 <_Thread_Dispatch>:
* dispatch thread
* no dispatch thread
*/
void _Thread_Dispatch( void )
{
40007584: 9d e3 bf 90 save %sp, -112, %sp
Thread_Control *executing;
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
40007588: 2d 10 00 72 sethi %hi(0x4001c800), %l6
_ISR_Disable( level );
4000758c: 7f ff e9 c3 call 40001c98 <sparc_disable_interrupts>
40007590: e0 05 a1 9c ld [ %l6 + 0x19c ], %l0 ! 4001c99c <_Thread_Executing>
while ( _Context_Switch_necessary == true ) {
40007594: 2b 10 00 72 sethi %hi(0x4001c800), %l5
40007598: 35 10 00 72 sethi %hi(0x4001c800), %i2
heir = _Thread_Heir;
4000759c: 37 10 00 72 sethi %hi(0x4001c800), %i3
#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;
400075a0: 39 10 00 72 sethi %hi(0x4001c800), %i4
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
400075a4: 25 10 00 72 sethi %hi(0x4001c800), %l2
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
400075a8: 3b 10 00 72 sethi %hi(0x4001c800), %i5
_ISR_Disable( level );
while ( _Context_Switch_necessary == true ) {
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
_Context_Switch_necessary = false;
_Thread_Executing = heir;
400075ac: ac 15 a1 9c or %l6, 0x19c, %l6
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Context_Switch_necessary == true ) {
400075b0: aa 15 61 ac or %l5, 0x1ac, %l5
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
400075b4: b4 16 a0 e0 or %i2, 0xe0, %i2
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Context_Switch_necessary == true ) {
heir = _Thread_Heir;
400075b8: b6 16 e1 6c or %i3, 0x16c, %i3
#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;
400075bc: b8 17 20 38 or %i4, 0x38, %i4
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
400075c0: a4 14 a1 a4 or %l2, 0x1a4, %l2
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
400075c4: ba 17 61 68 or %i5, 0x168, %i5
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Context_Switch_necessary == true ) {
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
400075c8: ae 10 20 01 mov 1, %l7
_ISR_Enable( level );
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
400075cc: a8 07 bf f8 add %fp, -8, %l4
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Context_Switch_necessary == true ) {
400075d0: 10 80 00 29 b 40007674 <_Thread_Dispatch+0xf0>
400075d4: a6 07 bf f0 add %fp, -16, %l3
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
400075d8: ee 26 80 00 st %l7, [ %i2 ]
_Thread_Executing = heir;
#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 )
400075dc: c2 04 60 7c ld [ %l1 + 0x7c ], %g1
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Context_Switch_necessary == true ) {
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
_Context_Switch_necessary = false;
400075e0: c0 2d 40 00 clrb [ %l5 ]
_Thread_Executing = heir;
#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 )
400075e4: 80 a0 60 01 cmp %g1, 1
400075e8: 12 80 00 04 bne 400075f8 <_Thread_Dispatch+0x74>
400075ec: e2 25 80 00 st %l1, [ %l6 ]
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
400075f0: c2 07 00 00 ld [ %i4 ], %g1
400075f4: c2 24 60 78 st %g1, [ %l1 + 0x78 ]
_ISR_Enable( level );
400075f8: 7f ff e9 ac call 40001ca8 <sparc_enable_interrupts>
400075fc: 01 00 00 00 nop
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
40007600: 40 00 10 35 call 4000b6d4 <_TOD_Get_uptime>
40007604: 90 10 00 14 mov %l4, %o0
_Timestamp_Subtract(
40007608: 90 10 00 12 mov %l2, %o0
4000760c: 92 10 00 14 mov %l4, %o1
40007610: 40 00 03 c2 call 40008518 <_Timespec_Subtract>
40007614: 94 10 00 13 mov %l3, %o2
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
40007618: 92 10 00 13 mov %l3, %o1
4000761c: 40 00 03 a5 call 400084b0 <_Timespec_Add_to>
40007620: 90 04 20 84 add %l0, 0x84, %o0
_Thread_Time_of_last_context_switch = uptime;
40007624: c4 07 bf f8 ld [ %fp + -8 ], %g2
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
40007628: c2 07 40 00 ld [ %i5 ], %g1
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
_Thread_Time_of_last_context_switch = uptime;
4000762c: c4 24 80 00 st %g2, [ %l2 ]
40007630: c4 07 bf fc ld [ %fp + -4 ], %g2
if ( _Thread_libc_reent ) {
executing->libc_reent = *_Thread_libc_reent;
*_Thread_libc_reent = heir->libc_reent;
}
_User_extensions_Thread_switch( executing, heir );
40007634: 90 10 00 10 mov %l0, %o0
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
_Thread_Time_of_last_context_switch = uptime;
40007638: c4 24 a0 04 st %g2, [ %l2 + 4 ]
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
4000763c: 80 a0 60 00 cmp %g1, 0
40007640: 02 80 00 06 be 40007658 <_Thread_Dispatch+0xd4> <== NEVER TAKEN
40007644: 92 10 00 11 mov %l1, %o1
executing->libc_reent = *_Thread_libc_reent;
40007648: c4 00 40 00 ld [ %g1 ], %g2
4000764c: c4 24 21 58 st %g2, [ %l0 + 0x158 ]
*_Thread_libc_reent = heir->libc_reent;
40007650: c4 04 61 58 ld [ %l1 + 0x158 ], %g2
40007654: c4 20 40 00 st %g2, [ %g1 ]
}
_User_extensions_Thread_switch( executing, heir );
40007658: 40 00 04 65 call 400087ec <_User_extensions_Thread_switch>
4000765c: 01 00 00 00 nop
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
40007660: 90 04 20 d0 add %l0, 0xd0, %o0
40007664: 40 00 05 59 call 40008bc8 <_CPU_Context_switch>
40007668: 92 04 60 d0 add %l1, 0xd0, %o1
#endif
#endif
executing = _Thread_Executing;
_ISR_Disable( level );
4000766c: 7f ff e9 8b call 40001c98 <sparc_disable_interrupts>
40007670: e0 05 80 00 ld [ %l6 ], %l0
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Context_Switch_necessary == true ) {
40007674: c2 0d 40 00 ldub [ %l5 ], %g1
40007678: 80 a0 60 00 cmp %g1, 0
4000767c: 32 bf ff d7 bne,a 400075d8 <_Thread_Dispatch+0x54>
40007680: e2 06 c0 00 ld [ %i3 ], %l1
executing = _Thread_Executing;
_ISR_Disable( level );
}
_Thread_Dispatch_disable_level = 0;
40007684: 03 10 00 72 sethi %hi(0x4001c800), %g1
40007688: c0 20 60 e0 clr [ %g1 + 0xe0 ] ! 4001c8e0 <_Thread_Dispatch_disable_level>
_ISR_Enable( level );
4000768c: 7f ff e9 87 call 40001ca8 <sparc_enable_interrupts>
40007690: 01 00 00 00 nop
if ( _Thread_Do_post_task_switch_extension ||
40007694: 03 10 00 72 sethi %hi(0x4001c800), %g1
40007698: c2 00 61 80 ld [ %g1 + 0x180 ], %g1 ! 4001c980 <_Thread_Do_post_task_switch_extension>
4000769c: 80 a0 60 00 cmp %g1, 0
400076a0: 12 80 00 06 bne 400076b8 <_Thread_Dispatch+0x134>
400076a4: 01 00 00 00 nop
executing->do_post_task_switch_extension ) {
400076a8: c2 0c 20 74 ldub [ %l0 + 0x74 ], %g1
400076ac: 80 a0 60 00 cmp %g1, 0
400076b0: 02 80 00 04 be 400076c0 <_Thread_Dispatch+0x13c>
400076b4: 01 00 00 00 nop
executing->do_post_task_switch_extension = false;
_API_extensions_Run_postswitch();
400076b8: 7f ff f9 de call 40005e30 <_API_extensions_Run_postswitch>
400076bc: c0 2c 20 74 clrb [ %l0 + 0x74 ]
400076c0: 81 c7 e0 08 ret
400076c4: 81 e8 00 00 restore
4000d884 <_Thread_Evaluate_mode>:
bool _Thread_Evaluate_mode( void )
{
Thread_Control *executing;
executing = _Thread_Executing;
4000d884: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000d888: c2 00 61 9c ld [ %g1 + 0x19c ], %g1 ! 4001c99c <_Thread_Executing>
if ( !_States_Is_ready( executing->current_state ) ||
4000d88c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
4000d890: 80 a0 a0 00 cmp %g2, 0
4000d894: 12 80 00 0b bne 4000d8c0 <_Thread_Evaluate_mode+0x3c> <== NEVER TAKEN
4000d898: 84 10 20 01 mov 1, %g2
4000d89c: 05 10 00 72 sethi %hi(0x4001c800), %g2
4000d8a0: c4 00 a1 6c ld [ %g2 + 0x16c ], %g2 ! 4001c96c <_Thread_Heir>
4000d8a4: 80 a0 40 02 cmp %g1, %g2
4000d8a8: 02 80 00 0b be 4000d8d4 <_Thread_Evaluate_mode+0x50>
4000d8ac: 01 00 00 00 nop
( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) {
4000d8b0: c2 08 60 75 ldub [ %g1 + 0x75 ], %g1
4000d8b4: 80 a0 60 00 cmp %g1, 0
4000d8b8: 02 80 00 07 be 4000d8d4 <_Thread_Evaluate_mode+0x50> <== NEVER TAKEN
4000d8bc: 84 10 20 01 mov 1, %g2
_Context_Switch_necessary = true;
4000d8c0: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000d8c4: 90 10 20 01 mov 1, %o0
4000d8c8: c4 28 61 ac stb %g2, [ %g1 + 0x1ac ]
return true;
4000d8cc: 81 c3 e0 08 retl
4000d8d0: 01 00 00 00 nop
}
return false;
}
4000d8d4: 81 c3 e0 08 retl
4000d8d8: 90 10 20 00 clr %o0 ! 0 <PROM_START>
4000d8dc <_Thread_Handler>:
*
* Output parameters: NONE
*/
void _Thread_Handler( void )
{
4000d8dc: 9d e3 bf a0 save %sp, -96, %sp
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static char doneConstructors;
char doneCons;
#endif
executing = _Thread_Executing;
4000d8e0: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000d8e4: e0 00 61 9c ld [ %g1 + 0x19c ], %l0 ! 4001c99c <_Thread_Executing>
/*
* 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();
4000d8e8: 3f 10 00 36 sethi %hi(0x4000d800), %i7
4000d8ec: be 17 e0 dc or %i7, 0xdc, %i7 ! 4000d8dc <_Thread_Handler>
/*
* have to put level into a register for those cpu's that use
* inline asm here
*/
level = executing->Start.isr_level;
4000d8f0: d0 04 20 b8 ld [ %l0 + 0xb8 ], %o0
_ISR_Set_level(level);
4000d8f4: 7f ff d0 ed call 40001ca8 <sparc_enable_interrupts>
4000d8f8: 91 2a 20 08 sll %o0, 8, %o0
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
doneCons = doneConstructors;
4000d8fc: 03 10 00 71 sethi %hi(0x4001c400), %g1
doneConstructors = 1;
4000d900: 84 10 20 01 mov 1, %g2
level = executing->Start.isr_level;
_ISR_Set_level(level);
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
doneCons = doneConstructors;
4000d904: e2 08 62 94 ldub [ %g1 + 0x294 ], %l1
/*
* Take care that 'begin' extensions get to complete before
* 'switch' extensions can run. This means must keep dispatch
* disabled until all 'begin' extensions complete.
*/
_User_extensions_Thread_begin( executing );
4000d908: 90 10 00 10 mov %l0, %o0
4000d90c: 7f ff eb 45 call 40008620 <_User_extensions_Thread_begin>
4000d910: c4 28 62 94 stb %g2, [ %g1 + 0x294 ]
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
4000d914: 7f ff e7 6d call 400076c8 <_Thread_Enable_dispatch>
4000d918: a3 2c 60 18 sll %l1, 0x18, %l1
/*
* _init could be a weak symbol and we SHOULD test it but it isn't
* in any configuration I know of and it generates a warning on every
* RTEMS target configuration. --joel (12 May 2007)
*/
if (!doneCons) /* && (volatile void *)_init) */ {
4000d91c: 80 a4 60 00 cmp %l1, 0
4000d920: 32 80 00 05 bne,a 4000d934 <_Thread_Handler+0x58>
4000d924: c2 04 20 a0 ld [ %l0 + 0xa0 ], %g1
INIT_NAME ();
4000d928: 40 00 39 54 call 4001be78 <_init>
4000d92c: 01 00 00 00 nop
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
4000d930: c2 04 20 a0 ld [ %l0 + 0xa0 ], %g1
4000d934: 80 a0 60 00 cmp %g1, 0
4000d938: 12 80 00 05 bne 4000d94c <_Thread_Handler+0x70>
4000d93c: 80 a0 60 01 cmp %g1, 1
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
4000d940: c2 04 20 9c ld [ %l0 + 0x9c ], %g1
4000d944: 10 80 00 06 b 4000d95c <_Thread_Handler+0x80>
4000d948: d0 04 20 a8 ld [ %l0 + 0xa8 ], %o0
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
4000d94c: 12 80 00 07 bne 4000d968 <_Thread_Handler+0x8c> <== NEVER TAKEN
4000d950: 01 00 00 00 nop
executing->Wait.return_argument =
(*(Thread_Entry_pointer) executing->Start.entry_point)(
4000d954: c2 04 20 9c ld [ %l0 + 0x9c ], %g1
4000d958: d0 04 20 a4 ld [ %l0 + 0xa4 ], %o0
4000d95c: 9f c0 40 00 call %g1
4000d960: 01 00 00 00 nop
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
executing->Wait.return_argument =
4000d964: d0 24 20 28 st %o0, [ %l0 + 0x28 ]
* was placed in return_argument. This assumed that if it returned
* anything (which is not supporting in all APIs), then it would be
* able to fit in a (void *).
*/
_User_extensions_Thread_exitted( executing );
4000d968: 7f ff eb 3f call 40008664 <_User_extensions_Thread_exitted>
4000d96c: 90 10 00 10 mov %l0, %o0
_Internal_error_Occurred(
4000d970: 90 10 20 00 clr %o0
4000d974: 92 10 20 01 mov 1, %o1
4000d978: 7f ff e3 99 call 400067dc <_Internal_error_Occurred>
4000d97c: 94 10 20 06 mov 6, %o2
400077a8 <_Thread_Initialize>:
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
400077a8: 9d e3 bf a0 save %sp, -96, %sp
400077ac: c2 07 a0 6c ld [ %fp + 0x6c ], %g1
/*
* Zero out all the allocated memory fields
*/
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
the_thread->API_Extensions[i] = NULL;
400077b0: c0 26 61 5c clr [ %i1 + 0x15c ]
400077b4: c0 26 61 60 clr [ %i1 + 0x160 ]
400077b8: c0 26 61 64 clr [ %i1 + 0x164 ]
extensions_area = NULL;
the_thread->libc_reent = NULL;
400077bc: c0 26 61 58 clr [ %i1 + 0x158 ]
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
400077c0: e2 00 40 00 ld [ %g1 ], %l1
if ( !actual_stack_size || actual_stack_size < stack_size )
return false; /* stack allocation failed */
stack = the_thread->Start.stack;
#else
if ( !stack_area ) {
400077c4: 80 a6 a0 00 cmp %i2, 0
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
400077c8: e0 07 a0 60 ld [ %fp + 0x60 ], %l0
if ( !actual_stack_size || actual_stack_size < stack_size )
return false; /* stack allocation failed */
stack = the_thread->Start.stack;
#else
if ( !stack_area ) {
400077cc: 12 80 00 0f bne 40007808 <_Thread_Initialize+0x60>
400077d0: e4 0f a0 5f ldub [ %fp + 0x5f ], %l2
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
400077d4: 90 10 00 19 mov %i1, %o0
400077d8: 40 00 02 99 call 4000823c <_Thread_Stack_Allocate>
400077dc: 92 10 00 1b mov %i3, %o1
if ( !actual_stack_size || actual_stack_size < stack_size )
400077e0: 80 a2 00 1b cmp %o0, %i3
400077e4: 0a 80 00 04 bcs 400077f4 <_Thread_Initialize+0x4c>
400077e8: 80 a2 20 00 cmp %o0, 0
400077ec: 12 80 00 04 bne 400077fc <_Thread_Initialize+0x54> <== ALWAYS TAKEN
400077f0: 82 10 20 01 mov 1, %g1
400077f4: 81 c7 e0 08 ret
400077f8: 91 e8 20 00 restore %g0, 0, %o0
return false; /* stack allocation failed */
stack = the_thread->Start.stack;
400077fc: f4 06 60 cc ld [ %i1 + 0xcc ], %i2
the_thread->Start.core_allocated_stack = true;
40007800: 10 80 00 04 b 40007810 <_Thread_Initialize+0x68>
40007804: c2 2e 60 c0 stb %g1, [ %i1 + 0xc0 ]
} else {
stack = stack_area;
actual_stack_size = stack_size;
the_thread->Start.core_allocated_stack = false;
40007808: c0 2e 60 c0 clrb [ %i1 + 0xc0 ]
4000780c: 90 10 00 1b mov %i3, %o0
#endif
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
40007810: 03 10 00 72 sethi %hi(0x4001c800), %g1
40007814: c2 00 61 7c ld [ %g1 + 0x17c ], %g1 ! 4001c97c <_Thread_Maximum_extensions>
Stack_Control *the_stack,
void *starting_address,
size_t size
)
{
the_stack->area = starting_address;
40007818: f4 26 60 c8 st %i2, [ %i1 + 0xc8 ]
the_stack->size = size;
4000781c: d0 26 60 c4 st %o0, [ %i1 + 0xc4 ]
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
40007820: c0 26 60 50 clr [ %i1 + 0x50 ]
the_watchdog->routine = routine;
40007824: c0 26 60 64 clr [ %i1 + 0x64 ]
the_watchdog->id = id;
40007828: c0 26 60 68 clr [ %i1 + 0x68 ]
the_watchdog->user_data = user_data;
4000782c: c0 26 60 6c clr [ %i1 + 0x6c ]
40007830: 80 a0 60 00 cmp %g1, 0
40007834: 02 80 00 08 be 40007854 <_Thread_Initialize+0xac>
40007838: b6 10 20 00 clr %i3
extensions_area = _Workspace_Allocate(
4000783c: 82 00 60 01 inc %g1
40007840: 40 00 04 b9 call 40008b24 <_Workspace_Allocate>
40007844: 91 28 60 02 sll %g1, 2, %o0
(_Thread_Maximum_extensions + 1) * sizeof( void * )
);
if ( !extensions_area )
40007848: b6 92 20 00 orcc %o0, 0, %i3
4000784c: 22 80 00 31 be,a 40007910 <_Thread_Initialize+0x168>
40007850: d0 06 61 58 ld [ %i1 + 0x158 ], %o0
* 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 ) {
40007854: 80 a6 e0 00 cmp %i3, 0
40007858: 02 80 00 0c be 40007888 <_Thread_Initialize+0xe0>
4000785c: f6 26 61 68 st %i3, [ %i1 + 0x168 ]
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
40007860: 03 10 00 72 sethi %hi(0x4001c800), %g1
40007864: c4 00 61 7c ld [ %g1 + 0x17c ], %g2 ! 4001c97c <_Thread_Maximum_extensions>
40007868: 10 80 00 05 b 4000787c <_Thread_Initialize+0xd4>
4000786c: 82 10 20 00 clr %g1
the_thread->extensions[i] = NULL;
40007870: 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++ )
40007874: 82 00 60 01 inc %g1
the_thread->extensions[i] = NULL;
40007878: 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++ )
4000787c: 80 a0 40 02 cmp %g1, %g2
40007880: 28 bf ff fc bleu,a 40007870 <_Thread_Initialize+0xc8>
40007884: c8 06 61 68 ld [ %i1 + 0x168 ], %g4
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
the_thread->Start.budget_callout = budget_callout;
40007888: c2 07 a0 64 ld [ %fp + 0x64 ], %g1
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
4000788c: e4 2e 60 ac stb %l2, [ %i1 + 0xac ]
the_thread->Start.budget_algorithm = budget_algorithm;
the_thread->Start.budget_callout = budget_callout;
40007890: c2 26 60 b4 st %g1, [ %i1 + 0xb4 ]
switch ( budget_algorithm ) {
40007894: 80 a4 20 02 cmp %l0, 2
40007898: 12 80 00 05 bne 400078ac <_Thread_Initialize+0x104>
4000789c: e0 26 60 b0 st %l0, [ %i1 + 0xb0 ]
case THREAD_CPU_BUDGET_ALGORITHM_NONE:
case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
400078a0: 03 10 00 72 sethi %hi(0x4001c800), %g1
400078a4: c2 00 60 38 ld [ %g1 + 0x38 ], %g1 ! 4001c838 <_Thread_Ticks_per_timeslice>
400078a8: c2 26 60 78 st %g1, [ %i1 + 0x78 ]
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
400078ac: c2 07 a0 68 ld [ %fp + 0x68 ], %g1
#if defined(RTEMS_ITRON_API)
the_thread->suspend_count = 0;
#endif
the_thread->real_priority = priority;
the_thread->Start.initial_priority = priority;
_Thread_Set_priority( the_thread, priority );
400078b0: 92 10 00 1d mov %i5, %o1
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
400078b4: c2 26 60 b8 st %g1, [ %i1 + 0xb8 ]
the_thread->current_state = STATES_DORMANT;
400078b8: 82 10 20 01 mov 1, %g1
#if defined(RTEMS_ITRON_API)
the_thread->suspend_count = 0;
#endif
the_thread->real_priority = priority;
the_thread->Start.initial_priority = priority;
_Thread_Set_priority( the_thread, priority );
400078bc: 90 10 00 19 mov %i1, %o0
#endif
}
the_thread->Start.isr_level = isr_level;
the_thread->current_state = STATES_DORMANT;
400078c0: c2 26 60 10 st %g1, [ %i1 + 0x10 ]
the_thread->Wait.queue = NULL;
400078c4: c0 26 60 44 clr [ %i1 + 0x44 ]
the_thread->resource_count = 0;
400078c8: c0 26 60 1c clr [ %i1 + 0x1c ]
#if defined(RTEMS_ITRON_API)
the_thread->suspend_count = 0;
#endif
the_thread->real_priority = priority;
400078cc: fa 26 60 18 st %i5, [ %i1 + 0x18 ]
the_thread->Start.initial_priority = priority;
_Thread_Set_priority( the_thread, priority );
400078d0: 40 00 01 b9 call 40007fb4 <_Thread_Set_priority>
400078d4: fa 26 60 bc st %i5, [ %i1 + 0xbc ]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
400078d8: c2 16 60 0a lduh [ %i1 + 0xa ], %g1
400078dc: c4 06 20 1c ld [ %i0 + 0x1c ], %g2
400078e0: 83 28 60 02 sll %g1, 2, %g1
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
400078e4: e2 26 60 0c st %l1, [ %i1 + 0xc ]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
400078e8: f2 20 80 01 st %i1, [ %g2 + %g1 ]
/*
* Initialize the CPU usage statistics
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Set_to_zero( &the_thread->cpu_time_used );
400078ec: c0 26 60 84 clr [ %i1 + 0x84 ]
400078f0: c0 26 60 88 clr [ %i1 + 0x88 ]
* enabled when we get here. We want to be able to run the
* 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 );
400078f4: 90 10 00 19 mov %i1, %o0
400078f8: 40 00 03 7f call 400086f4 <_User_extensions_Thread_create>
400078fc: b0 10 20 01 mov 1, %i0
if ( extension_status )
40007900: 80 8a 20 ff btst 0xff, %o0
40007904: 12 80 00 22 bne 4000798c <_Thread_Initialize+0x1e4>
40007908: 01 00 00 00 nop
return true;
failed:
if ( the_thread->libc_reent )
4000790c: d0 06 61 58 ld [ %i1 + 0x158 ], %o0
40007910: 80 a2 20 00 cmp %o0, 0
40007914: 22 80 00 05 be,a 40007928 <_Thread_Initialize+0x180>
40007918: d0 06 61 5c ld [ %i1 + 0x15c ], %o0
_Workspace_Free( the_thread->libc_reent );
4000791c: 40 00 04 8b call 40008b48 <_Workspace_Free>
40007920: 01 00 00 00 nop
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
if ( the_thread->API_Extensions[i] )
40007924: d0 06 61 5c ld [ %i1 + 0x15c ], %o0
40007928: 80 a2 20 00 cmp %o0, 0
4000792c: 22 80 00 05 be,a 40007940 <_Thread_Initialize+0x198>
40007930: d0 06 61 60 ld [ %i1 + 0x160 ], %o0
_Workspace_Free( the_thread->API_Extensions[i] );
40007934: 40 00 04 85 call 40008b48 <_Workspace_Free>
40007938: 01 00 00 00 nop
failed:
if ( the_thread->libc_reent )
_Workspace_Free( the_thread->libc_reent );
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
if ( the_thread->API_Extensions[i] )
4000793c: d0 06 61 60 ld [ %i1 + 0x160 ], %o0
40007940: 80 a2 20 00 cmp %o0, 0
40007944: 22 80 00 05 be,a 40007958 <_Thread_Initialize+0x1b0>
40007948: d0 06 61 64 ld [ %i1 + 0x164 ], %o0
_Workspace_Free( the_thread->API_Extensions[i] );
4000794c: 40 00 04 7f call 40008b48 <_Workspace_Free>
40007950: 01 00 00 00 nop
failed:
if ( the_thread->libc_reent )
_Workspace_Free( the_thread->libc_reent );
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
if ( the_thread->API_Extensions[i] )
40007954: d0 06 61 64 ld [ %i1 + 0x164 ], %o0
40007958: 80 a2 20 00 cmp %o0, 0
4000795c: 02 80 00 05 be 40007970 <_Thread_Initialize+0x1c8> <== ALWAYS TAKEN
40007960: 80 a6 e0 00 cmp %i3, 0
_Workspace_Free( the_thread->API_Extensions[i] );
40007964: 40 00 04 79 call 40008b48 <_Workspace_Free> <== NOT EXECUTED
40007968: 01 00 00 00 nop <== NOT EXECUTED
if ( extensions_area )
4000796c: 80 a6 e0 00 cmp %i3, 0 <== NOT EXECUTED
40007970: 02 80 00 05 be 40007984 <_Thread_Initialize+0x1dc>
40007974: 90 10 00 19 mov %i1, %o0
(void) _Workspace_Free( extensions_area );
40007978: 40 00 04 74 call 40008b48 <_Workspace_Free>
4000797c: 90 10 00 1b mov %i3, %o0
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
if ( fp_area )
(void) _Workspace_Free( fp_area );
#endif
_Thread_Stack_Free( the_thread );
40007980: 90 10 00 19 mov %i1, %o0
40007984: 40 00 02 45 call 40008298 <_Thread_Stack_Free>
40007988: b0 10 20 00 clr %i0
return false;
}
4000798c: 81 c7 e0 08 ret
40007990: 81 e8 00 00 restore
4000c1e4 <_Thread_Resume>:
void _Thread_Resume(
Thread_Control *the_thread,
bool force
)
{
4000c1e4: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
States_Control current_state;
_ISR_Disable( level );
4000c1e8: 7f ff d7 28 call 40001e88 <sparc_disable_interrupts>
4000c1ec: a0 10 00 18 mov %i0, %l0
4000c1f0: b0 10 00 08 mov %o0, %i0
_ISR_Enable( level );
return;
}
#endif
current_state = the_thread->current_state;
4000c1f4: c2 04 20 10 ld [ %l0 + 0x10 ], %g1
if ( current_state & STATES_SUSPENDED ) {
4000c1f8: 80 88 60 02 btst 2, %g1
4000c1fc: 02 80 00 2c be 4000c2ac <_Thread_Resume+0xc8> <== NEVER TAKEN
4000c200: 82 08 7f fd and %g1, -3, %g1
current_state =
the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state);
if ( _States_Is_ready( current_state ) ) {
4000c204: 80 a0 60 00 cmp %g1, 0
4000c208: 12 80 00 29 bne 4000c2ac <_Thread_Resume+0xc8>
4000c20c: c2 24 20 10 st %g1, [ %l0 + 0x10 ]
RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map (
Priority_Information *the_priority_map
)
{
*the_priority_map->minor |= the_priority_map->ready_minor;
4000c210: c4 04 20 90 ld [ %l0 + 0x90 ], %g2
_Priority_Add_to_bit_map( &the_thread->Priority_map );
_Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
4000c214: c2 04 20 8c ld [ %l0 + 0x8c ], %g1
4000c218: c8 10 80 00 lduh [ %g2 ], %g4
4000c21c: c6 14 20 96 lduh [ %l0 + 0x96 ], %g3
4000c220: 86 11 00 03 or %g4, %g3, %g3
4000c224: c6 30 80 00 sth %g3, [ %g2 ]
Chain_Node *the_node
)
{
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
4000c228: 84 00 60 04 add %g1, 4, %g2
_Priority_Major_bit_map |= the_priority_map->ready_major;
4000c22c: da 14 20 94 lduh [ %l0 + 0x94 ], %o5
4000c230: c4 24 00 00 st %g2, [ %l0 ]
4000c234: 07 10 00 89 sethi %hi(0x40022400), %g3
old_last_node = the_chain->last;
4000c238: c4 00 60 08 ld [ %g1 + 8 ], %g2
4000c23c: c8 10 e2 80 lduh [ %g3 + 0x280 ], %g4
the_chain->last = the_node;
4000c240: e0 20 60 08 st %l0, [ %g1 + 8 ]
old_last_node->next = the_node;
the_node->previous = old_last_node;
4000c244: c4 24 20 04 st %g2, [ %l0 + 4 ]
4000c248: 82 13 40 04 or %o5, %g4, %g1
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
old_last_node = the_chain->last;
the_chain->last = the_node;
old_last_node->next = the_node;
4000c24c: e0 20 80 00 st %l0, [ %g2 ]
4000c250: c2 30 e2 80 sth %g1, [ %g3 + 0x280 ]
_ISR_Flash( level );
4000c254: 7f ff d7 11 call 40001e98 <sparc_enable_interrupts>
4000c258: 01 00 00 00 nop
4000c25c: 7f ff d7 0b call 40001e88 <sparc_disable_interrupts>
4000c260: 01 00 00 00 nop
if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
4000c264: 05 10 00 89 sethi %hi(0x40022400), %g2
4000c268: c6 00 a2 5c ld [ %g2 + 0x25c ], %g3 ! 4002265c <_Thread_Heir>
4000c26c: c2 04 20 14 ld [ %l0 + 0x14 ], %g1
4000c270: c6 00 e0 14 ld [ %g3 + 0x14 ], %g3
4000c274: 80 a0 40 03 cmp %g1, %g3
4000c278: 1a 80 00 0d bcc 4000c2ac <_Thread_Resume+0xc8>
4000c27c: 07 10 00 89 sethi %hi(0x40022400), %g3
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
4000c280: c6 00 e2 8c ld [ %g3 + 0x28c ], %g3 ! 4002268c <_Thread_Executing>
_Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
_ISR_Flash( level );
if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
_Thread_Heir = the_thread;
4000c284: e0 20 a2 5c st %l0, [ %g2 + 0x25c ]
if ( _Thread_Executing->is_preemptible ||
4000c288: c4 08 e0 75 ldub [ %g3 + 0x75 ], %g2
4000c28c: 80 a0 a0 00 cmp %g2, 0
4000c290: 12 80 00 05 bne 4000c2a4 <_Thread_Resume+0xc0>
4000c294: 84 10 20 01 mov 1, %g2
4000c298: 80 a0 60 00 cmp %g1, 0
4000c29c: 12 80 00 04 bne 4000c2ac <_Thread_Resume+0xc8> <== ALWAYS TAKEN
4000c2a0: 01 00 00 00 nop
the_thread->current_priority == 0 )
_Context_Switch_necessary = true;
4000c2a4: 03 10 00 89 sethi %hi(0x40022400), %g1
4000c2a8: c4 28 62 9c stb %g2, [ %g1 + 0x29c ] ! 4002269c <_Context_Switch_necessary>
}
}
}
_ISR_Enable( level );
4000c2ac: 7f ff d6 fb call 40001e98 <sparc_enable_interrupts>
4000c2b0: 81 e8 00 00 restore
40008364 <_Thread_Tickle_timeslice>:
*
* Output parameters: NONE
*/
void _Thread_Tickle_timeslice( void )
{
40008364: 9d e3 bf a0 save %sp, -96, %sp
Thread_Control *executing;
executing = _Thread_Executing;
40008368: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000836c: e0 00 61 9c ld [ %g1 + 0x19c ], %l0 ! 4001c99c <_Thread_Executing>
/*
* If the thread is not preemptible or is not ready, then
* just return.
*/
if ( !executing->is_preemptible )
40008370: c2 0c 20 75 ldub [ %l0 + 0x75 ], %g1
40008374: 80 a0 60 00 cmp %g1, 0
40008378: 02 80 00 23 be 40008404 <_Thread_Tickle_timeslice+0xa0>
4000837c: 01 00 00 00 nop
return;
if ( !_States_Is_ready( executing->current_state ) )
40008380: c2 04 20 10 ld [ %l0 + 0x10 ], %g1
40008384: 80 a0 60 00 cmp %g1, 0
40008388: 12 80 00 1f bne 40008404 <_Thread_Tickle_timeslice+0xa0>
4000838c: 01 00 00 00 nop
/*
* The cpu budget algorithm determines what happens next.
*/
switch ( executing->budget_algorithm ) {
40008390: c2 04 20 7c ld [ %l0 + 0x7c ], %g1
40008394: 80 a0 60 01 cmp %g1, 1
40008398: 0a 80 00 12 bcs 400083e0 <_Thread_Tickle_timeslice+0x7c>
4000839c: 80 a0 60 02 cmp %g1, 2
400083a0: 28 80 00 07 bleu,a 400083bc <_Thread_Tickle_timeslice+0x58>
400083a4: c2 04 20 78 ld [ %l0 + 0x78 ], %g1
400083a8: 80 a0 60 03 cmp %g1, 3
400083ac: 12 80 00 16 bne 40008404 <_Thread_Tickle_timeslice+0xa0> <== NEVER TAKEN
400083b0: 01 00 00 00 nop
}
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
if ( --executing->cpu_time_budget == 0 )
400083b4: 10 80 00 0d b 400083e8 <_Thread_Tickle_timeslice+0x84>
400083b8: c2 04 20 78 ld [ %l0 + 0x78 ], %g1
case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
#if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
#endif
if ( (int)(--executing->cpu_time_budget) <= 0 ) {
400083bc: 82 00 7f ff add %g1, -1, %g1
400083c0: 80 a0 60 00 cmp %g1, 0
400083c4: 14 80 00 07 bg 400083e0 <_Thread_Tickle_timeslice+0x7c>
400083c8: c2 24 20 78 st %g1, [ %l0 + 0x78 ]
_Thread_Reset_timeslice();
400083cc: 40 00 0e e9 call 4000bf70 <_Thread_Reset_timeslice>
400083d0: 01 00 00 00 nop
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
400083d4: 03 10 00 72 sethi %hi(0x4001c800), %g1
400083d8: c2 00 60 38 ld [ %g1 + 0x38 ], %g1 ! 4001c838 <_Thread_Ticks_per_timeslice>
400083dc: c2 24 20 78 st %g1, [ %l0 + 0x78 ]
400083e0: 81 c7 e0 08 ret
400083e4: 81 e8 00 00 restore
}
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
if ( --executing->cpu_time_budget == 0 )
400083e8: 82 00 7f ff add %g1, -1, %g1
400083ec: 80 a0 60 00 cmp %g1, 0
400083f0: 12 bf ff fc bne 400083e0 <_Thread_Tickle_timeslice+0x7c>
400083f4: c2 24 20 78 st %g1, [ %l0 + 0x78 ]
(*executing->budget_callout)( executing );
400083f8: c2 04 20 80 ld [ %l0 + 0x80 ], %g1
400083fc: 9f c0 40 00 call %g1
40008400: 90 10 00 10 mov %l0, %o0
40008404: 81 c7 e0 08 ret
40008408: 81 e8 00 00 restore
4000840c <_Thread_Yield_processor>:
* ready chain
* select heir
*/
void _Thread_Yield_processor( void )
{
4000840c: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
Thread_Control *executing;
Chain_Control *ready;
executing = _Thread_Executing;
40008410: 03 10 00 72 sethi %hi(0x4001c800), %g1
40008414: e0 00 61 9c ld [ %g1 + 0x19c ], %l0 ! 4001c99c <_Thread_Executing>
ready = executing->ready;
_ISR_Disable( level );
40008418: 7f ff e6 20 call 40001c98 <sparc_disable_interrupts>
4000841c: e2 04 20 8c ld [ %l0 + 0x8c ], %l1
40008420: b0 10 00 08 mov %o0, %i0
if ( !_Chain_Has_only_one_node( ready ) ) {
40008424: c4 04 40 00 ld [ %l1 ], %g2
40008428: c2 04 60 08 ld [ %l1 + 8 ], %g1
4000842c: 80 a0 80 01 cmp %g2, %g1
40008430: 02 80 00 17 be 4000848c <_Thread_Yield_processor+0x80>
40008434: 25 10 00 72 sethi %hi(0x4001c800), %l2
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
40008438: c2 04 00 00 ld [ %l0 ], %g1
previous = the_node->previous;
4000843c: c4 04 20 04 ld [ %l0 + 4 ], %g2
Chain_Node *the_node
)
{
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
40008440: 86 04 60 04 add %l1, 4, %g3
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
previous->next = next;
40008444: c2 20 80 00 st %g1, [ %g2 ]
Chain_Node *the_node
)
{
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
40008448: c6 24 00 00 st %g3, [ %l0 ]
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
4000844c: c4 20 60 04 st %g2, [ %g1 + 4 ]
)
{
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
old_last_node = the_chain->last;
40008450: c2 04 60 08 ld [ %l1 + 8 ], %g1
the_chain->last = the_node;
40008454: e0 24 60 08 st %l0, [ %l1 + 8 ]
old_last_node->next = the_node;
the_node->previous = old_last_node;
40008458: c2 24 20 04 st %g1, [ %l0 + 4 ]
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
old_last_node = the_chain->last;
the_chain->last = the_node;
old_last_node->next = the_node;
4000845c: e0 20 40 00 st %l0, [ %g1 ]
_Chain_Extract_unprotected( &executing->Object.Node );
_Chain_Append_unprotected( ready, &executing->Object.Node );
_ISR_Flash( level );
40008460: 7f ff e6 12 call 40001ca8 <sparc_enable_interrupts>
40008464: 01 00 00 00 nop
40008468: 7f ff e6 0c call 40001c98 <sparc_disable_interrupts>
4000846c: 01 00 00 00 nop
if ( _Thread_Is_heir( executing ) )
40008470: c2 04 a1 6c ld [ %l2 + 0x16c ], %g1
40008474: 80 a4 00 01 cmp %l0, %g1
40008478: 12 80 00 09 bne 4000849c <_Thread_Yield_processor+0x90> <== NEVER TAKEN
4000847c: 84 10 20 01 mov 1, %g2
_Thread_Heir = (Thread_Control *) ready->first;
40008480: c2 04 40 00 ld [ %l1 ], %g1
40008484: 10 80 00 06 b 4000849c <_Thread_Yield_processor+0x90>
40008488: c2 24 a1 6c st %g1, [ %l2 + 0x16c ]
_Context_Switch_necessary = true;
}
else if ( !_Thread_Is_heir( executing ) )
4000848c: c2 04 a1 6c ld [ %l2 + 0x16c ], %g1
40008490: 80 a4 00 01 cmp %l0, %g1
40008494: 02 80 00 04 be 400084a4 <_Thread_Yield_processor+0x98> <== ALWAYS TAKEN
40008498: 84 10 20 01 mov 1, %g2
_Context_Switch_necessary = true;
4000849c: 03 10 00 72 sethi %hi(0x4001c800), %g1
400084a0: c4 28 61 ac stb %g2, [ %g1 + 0x1ac ] ! 4001c9ac <_Context_Switch_necessary>
_ISR_Enable( level );
400084a4: 7f ff e6 01 call 40001ca8 <sparc_enable_interrupts>
400084a8: 81 e8 00 00 restore
40007ca8 <_Thread_queue_Enqueue_priority>:
Thread_blocking_operation_States _Thread_queue_Enqueue_priority (
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
ISR_Level *level_p
)
{
40007ca8: 9d e3 bf a0 save %sp, -96, %sp
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
40007cac: e0 06 60 14 ld [ %i1 + 0x14 ], %l0
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
40007cb0: 82 06 60 3c add %i1, 0x3c, %g1
the_chain->permanent_null = NULL;
40007cb4: c0 26 60 3c clr [ %i1 + 0x3c ]
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
40007cb8: c2 26 60 38 st %g1, [ %i1 + 0x38 ]
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
40007cbc: 82 06 60 38 add %i1, 0x38, %g1
40007cc0: c2 26 60 40 st %g1, [ %i1 + 0x40 ]
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
40007cc4: 2d 10 00 6f sethi %hi(0x4001bc00), %l6
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
40007cc8: 83 34 20 06 srl %l0, 6, %g1
block_state = the_thread_queue->state;
if ( _Thread_queue_Is_reverse_search( priority ) )
40007ccc: 80 8c 20 20 btst 0x20, %l0
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
40007cd0: a7 28 60 04 sll %g1, 4, %l3
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
40007cd4: ac 15 a3 74 or %l6, 0x374, %l6
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
40007cd8: 83 28 60 02 sll %g1, 2, %g1
block_state = the_thread_queue->state;
40007cdc: ea 06 20 38 ld [ %i0 + 0x38 ], %l5
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
40007ce0: a6 24 c0 01 sub %l3, %g1, %l3
block_state = the_thread_queue->state;
if ( _Thread_queue_Is_reverse_search( priority ) )
40007ce4: 12 80 00 28 bne 40007d84 <_Thread_queue_Enqueue_priority+0xdc>
40007ce8: a6 06 00 13 add %i0, %l3, %l3
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
40007cec: ac 04 e0 04 add %l3, 4, %l6
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
40007cf0: 7f ff e7 ea call 40001c98 <sparc_disable_interrupts>
40007cf4: 01 00 00 00 nop
40007cf8: a4 10 00 08 mov %o0, %l2
search_thread = (Thread_Control *) header->first;
40007cfc: a8 10 3f ff mov -1, %l4
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
40007d00: 10 80 00 10 b 40007d40 <_Thread_queue_Enqueue_priority+0x98>
40007d04: e2 04 c0 00 ld [ %l3 ], %l1
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
40007d08: 80 a4 00 14 cmp %l0, %l4
40007d0c: 28 80 00 11 bleu,a 40007d50 <_Thread_queue_Enqueue_priority+0xa8>
40007d10: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
break;
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
40007d14: 7f ff e7 e5 call 40001ca8 <sparc_enable_interrupts>
40007d18: 90 10 00 12 mov %l2, %o0
40007d1c: 7f ff e7 df call 40001c98 <sparc_disable_interrupts>
40007d20: 01 00 00 00 nop
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
40007d24: c2 04 60 10 ld [ %l1 + 0x10 ], %g1
40007d28: 80 8d 40 01 btst %l5, %g1
40007d2c: 32 80 00 05 bne,a 40007d40 <_Thread_queue_Enqueue_priority+0x98><== ALWAYS TAKEN
40007d30: e2 04 40 00 ld [ %l1 ], %l1
_ISR_Enable( level );
40007d34: 7f ff e7 dd call 40001ca8 <sparc_enable_interrupts> <== NOT EXECUTED
40007d38: 90 10 00 12 mov %l2, %o0 <== NOT EXECUTED
goto restart_forward_search;
40007d3c: 30 bf ff ed b,a 40007cf0 <_Thread_queue_Enqueue_priority+0x48><== NOT EXECUTED
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->first;
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
40007d40: 80 a4 40 16 cmp %l1, %l6
40007d44: 32 bf ff f1 bne,a 40007d08 <_Thread_queue_Enqueue_priority+0x60>
40007d48: e8 04 60 14 ld [ %l1 + 0x14 ], %l4
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
40007d4c: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
40007d50: 80 a0 60 01 cmp %g1, 1
40007d54: 12 80 00 3c bne 40007e44 <_Thread_queue_Enqueue_priority+0x19c>
40007d58: 90 10 00 12 mov %l2, %o0
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( priority == search_priority )
40007d5c: 80 a4 00 14 cmp %l0, %l4
40007d60: 02 80 00 2e be 40007e18 <_Thread_queue_Enqueue_priority+0x170>
40007d64: c0 26 20 30 clr [ %i0 + 0x30 ]
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
40007d68: c2 04 60 04 ld [ %l1 + 4 ], %g1
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
40007d6c: e2 26 40 00 st %l1, [ %i1 ]
the_node->previous = previous_node;
40007d70: c2 26 60 04 st %g1, [ %i1 + 4 ]
previous_node->next = the_node;
search_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
40007d74: f0 26 60 44 st %i0, [ %i1 + 0x44 ]
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
the_node->previous = previous_node;
previous_node->next = the_node;
40007d78: f2 20 40 00 st %i1, [ %g1 ]
search_node->previous = the_node;
40007d7c: f2 24 60 04 st %i1, [ %l1 + 4 ]
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
40007d80: 30 80 00 2d b,a 40007e34 <_Thread_queue_Enqueue_priority+0x18c>
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
40007d84: 7f ff e7 c5 call 40001c98 <sparc_disable_interrupts>
40007d88: e8 0d 80 00 ldub [ %l6 ], %l4
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
40007d8c: a8 05 20 01 inc %l4
_ISR_Disable( level );
40007d90: a4 10 00 08 mov %o0, %l2
search_thread = (Thread_Control *) header->last;
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
40007d94: 10 80 00 10 b 40007dd4 <_Thread_queue_Enqueue_priority+0x12c>
40007d98: e2 04 e0 08 ld [ %l3 + 8 ], %l1
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
40007d9c: 80 a4 00 14 cmp %l0, %l4
40007da0: 3a 80 00 11 bcc,a 40007de4 <_Thread_queue_Enqueue_priority+0x13c>
40007da4: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
break;
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
40007da8: 7f ff e7 c0 call 40001ca8 <sparc_enable_interrupts>
40007dac: 90 10 00 12 mov %l2, %o0
40007db0: 7f ff e7 ba call 40001c98 <sparc_disable_interrupts>
40007db4: 01 00 00 00 nop
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
40007db8: c2 04 60 10 ld [ %l1 + 0x10 ], %g1
40007dbc: 80 8d 40 01 btst %l5, %g1
40007dc0: 32 80 00 05 bne,a 40007dd4 <_Thread_queue_Enqueue_priority+0x12c>
40007dc4: e2 04 60 04 ld [ %l1 + 4 ], %l1
_ISR_Enable( level );
40007dc8: 7f ff e7 b8 call 40001ca8 <sparc_enable_interrupts>
40007dcc: 90 10 00 12 mov %l2, %o0
goto restart_reverse_search;
40007dd0: 30 bf ff ed b,a 40007d84 <_Thread_queue_Enqueue_priority+0xdc>
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
40007dd4: 80 a4 40 13 cmp %l1, %l3
40007dd8: 32 bf ff f1 bne,a 40007d9c <_Thread_queue_Enqueue_priority+0xf4>
40007ddc: e8 04 60 14 ld [ %l1 + 0x14 ], %l4
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
40007de0: c2 06 20 30 ld [ %i0 + 0x30 ], %g1
40007de4: 80 a0 60 01 cmp %g1, 1
40007de8: 12 80 00 17 bne 40007e44 <_Thread_queue_Enqueue_priority+0x19c>
40007dec: 90 10 00 12 mov %l2, %o0
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( priority == search_priority )
40007df0: 80 a4 00 14 cmp %l0, %l4
40007df4: 02 80 00 09 be 40007e18 <_Thread_queue_Enqueue_priority+0x170>
40007df8: c0 26 20 30 clr [ %i0 + 0x30 ]
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
40007dfc: c2 04 40 00 ld [ %l1 ], %g1
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
40007e00: e2 26 60 04 st %l1, [ %i1 + 4 ]
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
40007e04: c2 26 40 00 st %g1, [ %i1 ]
the_node->previous = search_node;
search_node->next = the_node;
next_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
40007e08: f0 26 60 44 st %i0, [ %i1 + 0x44 ]
next_node = search_node->next;
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
search_node->next = the_node;
40007e0c: f2 24 40 00 st %i1, [ %l1 ]
next_node->previous = the_node;
40007e10: f2 20 60 04 st %i1, [ %g1 + 4 ]
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
40007e14: 30 80 00 08 b,a 40007e34 <_Thread_queue_Enqueue_priority+0x18c>
40007e18: a2 04 60 3c add %l1, 0x3c, %l1
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
previous_node = search_node->previous;
40007e1c: c2 04 60 04 ld [ %l1 + 4 ], %g1
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
40007e20: e2 26 40 00 st %l1, [ %i1 ]
the_node->previous = previous_node;
40007e24: c2 26 60 04 st %g1, [ %i1 + 4 ]
previous_node->next = the_node;
search_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
40007e28: f0 26 60 44 st %i0, [ %i1 + 0x44 ]
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
the_node->previous = previous_node;
previous_node->next = the_node;
40007e2c: f2 20 40 00 st %i1, [ %g1 ]
search_node->previous = the_node;
40007e30: f2 24 60 04 st %i1, [ %l1 + 4 ]
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
40007e34: 7f ff e7 9d call 40001ca8 <sparc_enable_interrupts>
40007e38: b0 10 20 01 mov 1, %i0
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
40007e3c: 81 c7 e0 08 ret
40007e40: 81 e8 00 00 restore
* the mutex by an ISR or timed out.
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
40007e44: f0 06 20 30 ld [ %i0 + 0x30 ], %i0
* For example, the blocking thread could have been given
* the mutex by an ISR or timed out.
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
40007e48: d0 26 80 00 st %o0, [ %i2 ]
return the_thread_queue->sync_state;
}
40007e4c: 81 c7 e0 08 ret
40007e50: 81 e8 00 00 restore
40007f00 <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
40007f00: 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 )
40007f04: 80 a6 20 00 cmp %i0, 0
40007f08: 02 80 00 19 be 40007f6c <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN
40007f0c: 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 ) {
40007f10: e2 06 20 34 ld [ %i0 + 0x34 ], %l1
40007f14: 80 a4 60 01 cmp %l1, 1
40007f18: 12 80 00 15 bne 40007f6c <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN
40007f1c: 01 00 00 00 nop
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
40007f20: 7f ff e7 5e call 40001c98 <sparc_disable_interrupts>
40007f24: 01 00 00 00 nop
40007f28: a0 10 00 08 mov %o0, %l0
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
40007f2c: c4 06 60 10 ld [ %i1 + 0x10 ], %g2
40007f30: 03 00 00 ef sethi %hi(0x3bc00), %g1
40007f34: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <PROM_START+0x3bee0>
40007f38: 80 88 80 01 btst %g2, %g1
40007f3c: 02 80 00 0a be 40007f64 <_Thread_queue_Requeue+0x64> <== NEVER TAKEN
40007f40: 94 10 20 01 mov 1, %o2
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
40007f44: 90 10 00 18 mov %i0, %o0
40007f48: 92 10 00 19 mov %i1, %o1
40007f4c: 40 00 0f 67 call 4000bce8 <_Thread_queue_Extract_priority_helper>
40007f50: e2 26 20 30 st %l1, [ %i0 + 0x30 ]
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
40007f54: 90 10 00 18 mov %i0, %o0
40007f58: 92 10 00 19 mov %i1, %o1
40007f5c: 7f ff ff 53 call 40007ca8 <_Thread_queue_Enqueue_priority>
40007f60: 94 07 bf fc add %fp, -4, %o2
}
_ISR_Enable( level );
40007f64: 7f ff e7 51 call 40001ca8 <sparc_enable_interrupts>
40007f68: 90 10 00 10 mov %l0, %o0
40007f6c: 81 c7 e0 08 ret
40007f70: 81 e8 00 00 restore
40007f74 <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
40007f74: 9d e3 bf 98 save %sp, -104, %sp
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
40007f78: 90 10 00 18 mov %i0, %o0
40007f7c: 7f ff fd e0 call 400076fc <_Thread_Get>
40007f80: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
40007f84: c2 07 bf fc ld [ %fp + -4 ], %g1
40007f88: 80 a0 60 00 cmp %g1, 0
40007f8c: 12 80 00 08 bne 40007fac <_Thread_queue_Timeout+0x38> <== NEVER TAKEN
40007f90: 01 00 00 00 nop
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
40007f94: 40 00 0f 8d call 4000bdc8 <_Thread_queue_Process_timeout>
40007f98: 01 00 00 00 nop
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
40007f9c: 03 10 00 72 sethi %hi(0x4001c800), %g1
40007fa0: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2 ! 4001c8e0 <_Thread_Dispatch_disable_level>
40007fa4: 84 00 bf ff add %g2, -1, %g2
40007fa8: c4 20 60 e0 st %g2, [ %g1 + 0xe0 ]
40007fac: 81 c7 e0 08 ret
40007fb0: 81 e8 00 00 restore
40015048 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
40015048: 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;
4001504c: 35 10 00 f5 sethi %hi(0x4003d400), %i2
40015050: b2 07 bf f4 add %fp, -12, %i1
40015054: ac 07 bf f8 add %fp, -8, %l6
40015058: a2 07 bf e8 add %fp, -24, %l1
4001505c: a6 07 bf ec add %fp, -20, %l3
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
40015060: 37 10 00 f5 sethi %hi(0x4003d400), %i3
40015064: 2b 10 00 f5 sethi %hi(0x4003d400), %l5
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
the_chain->permanent_null = NULL;
40015068: c0 27 bf f8 clr [ %fp + -8 ]
4001506c: c0 27 bf ec clr [ %fp + -20 ]
the_chain->last = _Chain_Head(the_chain);
40015070: f2 27 bf fc st %i1, [ %fp + -4 ]
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
40015074: ec 27 bf f4 st %l6, [ %fp + -12 ]
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
40015078: e2 27 bf f0 st %l1, [ %fp + -16 ]
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
4001507c: e6 27 bf e8 st %l3, [ %fp + -24 ]
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
40015080: b4 16 a1 f4 or %i2, 0x1f4, %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();
40015084: b6 16 e1 30 or %i3, 0x130, %i3
40015088: aa 15 60 a0 or %l5, 0xa0, %l5
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
4001508c: a8 06 20 30 add %i0, 0x30, %l4
/*
* 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 );
40015090: a4 06 20 68 add %i0, 0x68, %l2
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
40015094: b8 06 20 08 add %i0, 8, %i4
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
40015098: ba 06 20 40 add %i0, 0x40, %i5
_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;
4001509c: ae 10 20 01 mov 1, %l7
{
/*
* 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;
400150a0: f2 26 20 78 st %i1, [ %i0 + 0x78 ]
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
400150a4: c2 06 80 00 ld [ %i2 ], %g1
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
400150a8: d2 06 20 3c ld [ %i0 + 0x3c ], %o1
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
400150ac: 94 10 00 11 mov %l1, %o2
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
400150b0: c2 26 20 3c st %g1, [ %i0 + 0x3c ]
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
400150b4: 92 20 40 09 sub %g1, %o1, %o1
400150b8: 40 00 11 69 call 4001965c <_Watchdog_Adjust_to_chain>
400150bc: 90 10 00 14 mov %l4, %o0
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
400150c0: d4 06 20 74 ld [ %i0 + 0x74 ], %o2
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
400150c4: e0 06 c0 00 ld [ %i3 ], %l0
/*
* 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 ) {
400150c8: 80 a4 00 0a cmp %l0, %o2
400150cc: 08 80 00 06 bleu 400150e4 <_Timer_server_Body+0x9c>
400150d0: 92 24 00 0a sub %l0, %o2, %o1
/*
* 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 );
400150d4: 90 10 00 12 mov %l2, %o0
400150d8: 40 00 11 61 call 4001965c <_Watchdog_Adjust_to_chain>
400150dc: 94 10 00 11 mov %l1, %o2
400150e0: 30 80 00 06 b,a 400150f8 <_Timer_server_Body+0xb0>
} else if ( snapshot < last_snapshot ) {
400150e4: 1a 80 00 05 bcc 400150f8 <_Timer_server_Body+0xb0>
400150e8: 94 22 80 10 sub %o2, %l0, %o2
/*
* 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 );
400150ec: 90 10 00 12 mov %l2, %o0
400150f0: 40 00 11 34 call 400195c0 <_Watchdog_Adjust>
400150f4: 92 10 20 01 mov 1, %o1
}
watchdogs->last_snapshot = snapshot;
400150f8: e0 26 20 74 st %l0, [ %i0 + 0x74 ]
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
400150fc: d0 06 20 78 ld [ %i0 + 0x78 ], %o0
40015100: 40 00 02 7e call 40015af8 <_Chain_Get>
40015104: 01 00 00 00 nop
if ( timer == NULL ) {
40015108: 80 a2 20 00 cmp %o0, 0
4001510c: 02 80 00 0f be 40015148 <_Timer_server_Body+0x100>
40015110: 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 ) {
40015114: c2 02 20 38 ld [ %o0 + 0x38 ], %g1
40015118: 80 a0 60 01 cmp %g1, 1
4001511c: 12 80 00 05 bne 40015130 <_Timer_server_Body+0xe8>
40015120: 80 a0 60 03 cmp %g1, 3
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
40015124: 92 02 20 10 add %o0, 0x10, %o1
40015128: 10 80 00 05 b 4001513c <_Timer_server_Body+0xf4>
4001512c: 90 10 00 14 mov %l4, %o0
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
40015130: 12 bf ff f3 bne 400150fc <_Timer_server_Body+0xb4> <== NEVER TAKEN
40015134: 92 02 20 10 add %o0, 0x10, %o1
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
40015138: 90 10 00 12 mov %l2, %o0
4001513c: 40 00 11 7d call 40019730 <_Watchdog_Insert>
40015140: 01 00 00 00 nop
40015144: 30 bf ff ee b,a 400150fc <_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 );
40015148: 7f ff e5 03 call 4000e554 <sparc_disable_interrupts>
4001514c: 01 00 00 00 nop
if ( _Chain_Is_empty( insert_chain ) ) {
40015150: c2 07 bf f4 ld [ %fp + -12 ], %g1
40015154: 80 a0 40 16 cmp %g1, %l6
40015158: 12 80 00 0a bne 40015180 <_Timer_server_Body+0x138> <== NEVER TAKEN
4001515c: 01 00 00 00 nop
ts->insert_chain = NULL;
40015160: c0 26 20 78 clr [ %i0 + 0x78 ]
_ISR_Enable( level );
40015164: 7f ff e5 00 call 4000e564 <sparc_enable_interrupts>
40015168: 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 ) ) {
4001516c: c2 07 bf e8 ld [ %fp + -24 ], %g1
40015170: 80 a0 40 13 cmp %g1, %l3
40015174: 12 80 00 06 bne 4001518c <_Timer_server_Body+0x144>
40015178: 01 00 00 00 nop
4001517c: 30 80 00 1a b,a 400151e4 <_Timer_server_Body+0x19c>
ts->insert_chain = NULL;
_ISR_Enable( level );
break;
} else {
_ISR_Enable( level );
40015180: 7f ff e4 f9 call 4000e564 <sparc_enable_interrupts> <== NOT EXECUTED
40015184: 01 00 00 00 nop <== NOT EXECUTED
40015188: 30 bf ff c7 b,a 400150a4 <_Timer_server_Body+0x5c> <== 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 );
4001518c: 7f ff e4 f2 call 4000e554 <sparc_disable_interrupts>
40015190: 01 00 00 00 nop
40015194: 84 10 00 08 mov %o0, %g2
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
40015198: e0 07 bf e8 ld [ %fp + -24 ], %l0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
4001519c: 80 a4 00 13 cmp %l0, %l3
400151a0: 02 80 00 0e be 400151d8 <_Timer_server_Body+0x190>
400151a4: 80 a4 20 00 cmp %l0, 0
{
Chain_Node *return_node;
Chain_Node *new_first;
return_node = the_chain->first;
new_first = return_node->next;
400151a8: c2 04 00 00 ld [ %l0 ], %g1
the_chain->first = new_first;
400151ac: c2 27 bf e8 st %g1, [ %fp + -24 ]
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
400151b0: 02 80 00 0a be 400151d8 <_Timer_server_Body+0x190> <== NEVER TAKEN
400151b4: e2 20 60 04 st %l1, [ %g1 + 4 ]
watchdog->state = WATCHDOG_INACTIVE;
400151b8: c0 24 20 08 clr [ %l0 + 8 ]
_ISR_Enable( level );
400151bc: 7f ff e4 ea call 4000e564 <sparc_enable_interrupts>
400151c0: 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 );
400151c4: d2 04 20 24 ld [ %l0 + 0x24 ], %o1
400151c8: c2 04 20 1c ld [ %l0 + 0x1c ], %g1
400151cc: 9f c0 40 00 call %g1
400151d0: d0 04 20 20 ld [ %l0 + 0x20 ], %o0
}
400151d4: 30 bf ff ee b,a 4001518c <_Timer_server_Body+0x144>
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
_ISR_Enable( level );
} else {
_ISR_Enable( level );
400151d8: 7f ff e4 e3 call 4000e564 <sparc_enable_interrupts>
400151dc: 90 10 00 02 mov %g2, %o0
400151e0: 30 bf ff b0 b,a 400150a0 <_Timer_server_Body+0x58>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
400151e4: c0 2e 20 7c clrb [ %i0 + 0x7c ]
400151e8: c2 05 40 00 ld [ %l5 ], %g1
400151ec: 82 00 60 01 inc %g1
400151f0: c2 25 40 00 st %g1, [ %l5 ]
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
400151f4: d0 06 00 00 ld [ %i0 ], %o0
400151f8: 40 00 0e 55 call 40018b4c <_Thread_Set_state>
400151fc: 92 10 20 08 mov 8, %o1
_Timer_server_Reset_interval_system_watchdog( ts );
40015200: 7f ff ff 68 call 40014fa0 <_Timer_server_Reset_interval_system_watchdog>
40015204: 90 10 00 18 mov %i0, %o0
_Timer_server_Reset_tod_system_watchdog( ts );
40015208: 7f ff ff 7b call 40014ff4 <_Timer_server_Reset_tod_system_watchdog>
4001520c: 90 10 00 18 mov %i0, %o0
_Thread_Enable_dispatch();
40015210: 40 00 0b 94 call 40018060 <_Thread_Enable_dispatch>
40015214: 01 00 00 00 nop
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
40015218: 90 10 00 1c mov %i4, %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;
4001521c: ee 2e 20 7c stb %l7, [ %i0 + 0x7c ]
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
40015220: 40 00 11 a1 call 400198a4 <_Watchdog_Remove>
40015224: 01 00 00 00 nop
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
40015228: 40 00 11 9f call 400198a4 <_Watchdog_Remove>
4001522c: 90 10 00 1d mov %i5, %o0
40015230: 30 bf ff 9c b,a 400150a0 <_Timer_server_Body+0x58>
4000aa2c <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
4000aa2c: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
_ISR_Disable( level );
4000aa30: 7f ff e0 84 call 40002c40 <sparc_disable_interrupts>
4000aa34: a0 10 00 18 mov %i0, %l0
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
4000aa38: c2 06 00 00 ld [ %i0 ], %g1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
4000aa3c: a2 06 20 04 add %i0, 4, %l1
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
4000aa40: 80 a0 40 11 cmp %g1, %l1
4000aa44: 02 80 00 1e be 4000aabc <_Watchdog_Adjust+0x90>
4000aa48: 80 a6 60 00 cmp %i1, 0
switch ( direction ) {
4000aa4c: 02 80 00 19 be 4000aab0 <_Watchdog_Adjust+0x84>
4000aa50: a4 10 20 01 mov 1, %l2
4000aa54: 80 a6 60 01 cmp %i1, 1
4000aa58: 12 80 00 19 bne 4000aabc <_Watchdog_Adjust+0x90> <== NEVER TAKEN
4000aa5c: 01 00 00 00 nop
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
4000aa60: c4 00 60 10 ld [ %g1 + 0x10 ], %g2
4000aa64: 10 80 00 07 b 4000aa80 <_Watchdog_Adjust+0x54>
4000aa68: b4 00 80 1a add %g2, %i2, %i2
break;
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
4000aa6c: f2 00 60 10 ld [ %g1 + 0x10 ], %i1
4000aa70: 80 a6 80 19 cmp %i2, %i1
4000aa74: 3a 80 00 05 bcc,a 4000aa88 <_Watchdog_Adjust+0x5c>
4000aa78: e4 20 60 10 st %l2, [ %g1 + 0x10 ]
_Watchdog_First( header )->delta_interval -= units;
4000aa7c: b4 26 40 1a sub %i1, %i2, %i2
break;
4000aa80: 10 80 00 0f b 4000aabc <_Watchdog_Adjust+0x90>
4000aa84: f4 20 60 10 st %i2, [ %g1 + 0x10 ]
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
_ISR_Enable( level );
4000aa88: 7f ff e0 72 call 40002c50 <sparc_enable_interrupts>
4000aa8c: 01 00 00 00 nop
_Watchdog_Tickle( header );
4000aa90: 40 00 00 95 call 4000ace4 <_Watchdog_Tickle>
4000aa94: 90 10 00 10 mov %l0, %o0
_ISR_Disable( level );
4000aa98: 7f ff e0 6a call 40002c40 <sparc_disable_interrupts>
4000aa9c: 01 00 00 00 nop
if ( _Chain_Is_empty( header ) )
4000aaa0: c2 04 00 00 ld [ %l0 ], %g1
4000aaa4: 80 a0 40 11 cmp %g1, %l1
4000aaa8: 02 80 00 05 be 4000aabc <_Watchdog_Adjust+0x90>
4000aaac: b4 26 80 19 sub %i2, %i1, %i2
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
4000aab0: 80 a6 a0 00 cmp %i2, 0
4000aab4: 32 bf ff ee bne,a 4000aa6c <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN
4000aab8: c2 04 00 00 ld [ %l0 ], %g1
}
break;
}
}
_ISR_Enable( level );
4000aabc: 7f ff e0 65 call 40002c50 <sparc_enable_interrupts>
4000aac0: 91 e8 00 08 restore %g0, %o0, %o0
400089a0 <_Watchdog_Remove>:
*/
Watchdog_States _Watchdog_Remove(
Watchdog_Control *the_watchdog
)
{
400089a0: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
400089a4: 7f ff e4 bd call 40001c98 <sparc_disable_interrupts>
400089a8: a0 10 00 18 mov %i0, %l0
previous_state = the_watchdog->state;
400089ac: f0 06 20 08 ld [ %i0 + 8 ], %i0
switch ( previous_state ) {
400089b0: 80 a6 20 01 cmp %i0, 1
400089b4: 22 80 00 1e be,a 40008a2c <_Watchdog_Remove+0x8c>
400089b8: c0 24 20 08 clr [ %l0 + 8 ]
400089bc: 0a 80 00 1d bcs 40008a30 <_Watchdog_Remove+0x90>
400089c0: 03 10 00 72 sethi %hi(0x4001c800), %g1
400089c4: 80 a6 20 03 cmp %i0, 3
400089c8: 18 80 00 1a bgu 40008a30 <_Watchdog_Remove+0x90> <== NEVER TAKEN
400089cc: 01 00 00 00 nop
400089d0: c2 04 00 00 ld [ %l0 ], %g1
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
400089d4: c0 24 20 08 clr [ %l0 + 8 ]
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
400089d8: c4 00 40 00 ld [ %g1 ], %g2
400089dc: 80 a0 a0 00 cmp %g2, 0
400089e0: 22 80 00 07 be,a 400089fc <_Watchdog_Remove+0x5c>
400089e4: 03 10 00 72 sethi %hi(0x4001c800), %g1
next_watchdog->delta_interval += the_watchdog->delta_interval;
400089e8: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 ! 4001c810 <_RTEMS_tasks_Information+0x28>
400089ec: c4 04 20 10 ld [ %l0 + 0x10 ], %g2
400089f0: 84 00 c0 02 add %g3, %g2, %g2
400089f4: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
if ( _Watchdog_Sync_count )
400089f8: 03 10 00 72 sethi %hi(0x4001c800), %g1
400089fc: c2 00 62 30 ld [ %g1 + 0x230 ], %g1 ! 4001ca30 <_Watchdog_Sync_count>
40008a00: 80 a0 60 00 cmp %g1, 0
40008a04: 22 80 00 07 be,a 40008a20 <_Watchdog_Remove+0x80>
40008a08: c2 04 00 00 ld [ %l0 ], %g1
_Watchdog_Sync_level = _ISR_Nest_level;
40008a0c: 03 10 00 72 sethi %hi(0x4001c800), %g1
40008a10: c4 00 61 78 ld [ %g1 + 0x178 ], %g2 ! 4001c978 <_ISR_Nest_level>
40008a14: 03 10 00 72 sethi %hi(0x4001c800), %g1
40008a18: c4 20 61 98 st %g2, [ %g1 + 0x198 ] ! 4001c998 <_Watchdog_Sync_level>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
40008a1c: c2 04 00 00 ld [ %l0 ], %g1
previous = the_node->previous;
40008a20: c4 04 20 04 ld [ %l0 + 4 ], %g2
next->previous = previous;
previous->next = next;
40008a24: c2 20 80 00 st %g1, [ %g2 ]
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
40008a28: c4 20 60 04 st %g2, [ %g1 + 4 ]
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
40008a2c: 03 10 00 72 sethi %hi(0x4001c800), %g1
40008a30: c2 00 62 34 ld [ %g1 + 0x234 ], %g1 ! 4001ca34 <_Watchdog_Ticks_since_boot>
40008a34: c2 24 20 18 st %g1, [ %l0 + 0x18 ]
_ISR_Enable( level );
40008a38: 7f ff e4 9c call 40001ca8 <sparc_enable_interrupts>
40008a3c: 01 00 00 00 nop
return( previous_state );
}
40008a40: 81 c7 e0 08 ret
40008a44: 81 e8 00 00 restore
4000a1d8 <_Watchdog_Report_chain>:
void _Watchdog_Report_chain(
const char *name,
Chain_Control *header
)
{
4000a1d8: 9d e3 bf a0 save %sp, -96, %sp
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
4000a1dc: 7f ff e1 67 call 40002778 <sparc_disable_interrupts>
4000a1e0: a0 10 00 18 mov %i0, %l0
4000a1e4: b0 10 00 08 mov %o0, %i0
printk( "Watchdog Chain: %s %p\n", name, header );
4000a1e8: 11 10 00 81 sethi %hi(0x40020400), %o0
4000a1ec: 94 10 00 19 mov %i1, %o2
4000a1f0: 90 12 23 18 or %o0, 0x318, %o0
4000a1f4: 7f ff e6 34 call 40003ac4 <printk>
4000a1f8: 92 10 00 10 mov %l0, %o1
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
4000a1fc: e2 06 40 00 ld [ %i1 ], %l1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
4000a200: b2 06 60 04 add %i1, 4, %i1
if ( !_Chain_Is_empty( header ) ) {
4000a204: 80 a4 40 19 cmp %l1, %i1
4000a208: 02 80 00 0e be 4000a240 <_Watchdog_Report_chain+0x68>
4000a20c: 11 10 00 81 sethi %hi(0x40020400), %o0
node != _Chain_Tail(header) ;
node = node->next )
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
4000a210: 92 10 00 11 mov %l1, %o1
4000a214: 40 00 00 10 call 4000a254 <_Watchdog_Report>
4000a218: 90 10 20 00 clr %o0
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = header->first ;
node != _Chain_Tail(header) ;
node = node->next )
4000a21c: e2 04 40 00 ld [ %l1 ], %l1
Chain_Node *node;
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = header->first ;
4000a220: 80 a4 40 19 cmp %l1, %i1
4000a224: 12 bf ff fc bne 4000a214 <_Watchdog_Report_chain+0x3c> <== NEVER TAKEN
4000a228: 92 10 00 11 mov %l1, %o1
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
4000a22c: 92 10 00 10 mov %l0, %o1
4000a230: 11 10 00 81 sethi %hi(0x40020400), %o0
4000a234: 7f ff e6 24 call 40003ac4 <printk>
4000a238: 90 12 23 30 or %o0, 0x330, %o0 ! 40020730 <C.32.3506+0x2c>
4000a23c: 30 80 00 03 b,a 4000a248 <_Watchdog_Report_chain+0x70>
} else {
printk( "Chain is empty\n" );
4000a240: 7f ff e6 21 call 40003ac4 <printk>
4000a244: 90 12 23 40 or %o0, 0x340, %o0
}
_ISR_Enable( level );
4000a248: 7f ff e1 50 call 40002788 <sparc_enable_interrupts>
4000a24c: 81 e8 00 00 restore
40005568 <adjtime>:
int adjtime(
struct timeval *delta,
struct timeval *olddelta
)
{
40005568: 9d e3 bf 98 save %sp, -104, %sp
long adjustment;
/*
* Simple validations
*/
if ( !delta )
4000556c: a0 96 20 00 orcc %i0, 0, %l0
40005570: 02 80 00 07 be 4000558c <adjtime+0x24>
40005574: 03 00 03 d0 sethi %hi(0xf4000), %g1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND )
40005578: c4 04 20 04 ld [ %l0 + 4 ], %g2
4000557c: 82 10 62 3f or %g1, 0x23f, %g1
40005580: 80 a0 80 01 cmp %g2, %g1
40005584: 08 80 00 08 bleu 400055a4 <adjtime+0x3c>
40005588: 80 a6 60 00 cmp %i1, 0
rtems_set_errno_and_return_minus_one( EINVAL );
4000558c: 40 00 26 d3 call 4000f0d8 <__errno>
40005590: b0 10 3f ff mov -1, %i0
40005594: 82 10 20 16 mov 0x16, %g1
40005598: c2 22 00 00 st %g1, [ %o0 ]
4000559c: 81 c7 e0 08 ret
400055a0: 81 e8 00 00 restore
if ( olddelta ) {
400055a4: 22 80 00 05 be,a 400055b8 <adjtime+0x50>
400055a8: c2 04 00 00 ld [ %l0 ], %g1
olddelta->tv_sec = 0;
400055ac: c0 26 40 00 clr [ %i1 ]
olddelta->tv_usec = 0;
400055b0: c0 26 60 04 clr [ %i1 + 4 ]
}
/* convert delta to microseconds */
adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND);
400055b4: c2 04 00 00 ld [ %l0 ], %g1
adjustment += delta->tv_usec;
/* too small to account for */
if ( adjustment < rtems_configuration_get_microseconds_per_tick() )
400055b8: 05 10 00 75 sethi %hi(0x4001d400), %g2
olddelta->tv_usec = 0;
}
/* convert delta to microseconds */
adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND);
adjustment += delta->tv_usec;
400055bc: c8 04 20 04 ld [ %l0 + 4 ], %g4
/* too small to account for */
if ( adjustment < rtems_configuration_get_microseconds_per_tick() )
400055c0: c6 00 a2 14 ld [ %g2 + 0x214 ], %g3
olddelta->tv_sec = 0;
olddelta->tv_usec = 0;
}
/* convert delta to microseconds */
adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND);
400055c4: 9b 28 60 08 sll %g1, 8, %o5
400055c8: 85 28 60 03 sll %g1, 3, %g2
400055cc: 84 23 40 02 sub %o5, %g2, %g2
400055d0: 9b 28 a0 06 sll %g2, 6, %o5
400055d4: 84 23 40 02 sub %o5, %g2, %g2
400055d8: 82 00 80 01 add %g2, %g1, %g1
400055dc: 83 28 60 06 sll %g1, 6, %g1
adjustment += delta->tv_usec;
400055e0: 82 00 40 04 add %g1, %g4, %g1
/* too small to account for */
if ( adjustment < rtems_configuration_get_microseconds_per_tick() )
400055e4: 80 a0 40 03 cmp %g1, %g3
400055e8: 0a 80 00 35 bcs 400056bc <adjtime+0x154>
400055ec: 03 10 00 78 sethi %hi(0x4001e000), %g1
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
400055f0: c4 00 60 a0 ld [ %g1 + 0xa0 ], %g2 ! 4001e0a0 <_Thread_Dispatch_disable_level>
400055f4: 84 00 a0 01 inc %g2
400055f8: c4 20 60 a0 st %g2, [ %g1 + 0xa0 ]
* This prevents context switches while we are adjusting the TOD
*/
_Thread_Disable_dispatch();
_TOD_Get( &ts );
400055fc: 40 00 06 24 call 40006e8c <_TOD_Get>
40005600: 90 07 bf f8 add %fp, -8, %o0
ts.tv_sec += delta->tv_sec;
ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND;
40005604: c4 04 20 04 ld [ %l0 + 4 ], %g2
_Thread_Disable_dispatch();
_TOD_Get( &ts );
ts.tv_sec += delta->tv_sec;
40005608: c2 04 00 00 ld [ %l0 ], %g1
ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND;
4000560c: c8 07 bf f8 ld [ %fp + -8 ], %g4
40005610: 87 28 a0 07 sll %g2, 7, %g3
40005614: 88 01 00 01 add %g4, %g1, %g4
40005618: 83 28 a0 02 sll %g2, 2, %g1
4000561c: 82 20 c0 01 sub %g3, %g1, %g1
40005620: c6 07 bf fc ld [ %fp + -4 ], %g3
40005624: 82 00 40 02 add %g1, %g2, %g1
/* if adjustment is too much positive */
while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
40005628: 1b 0e e6 b2 sethi %hi(0x3b9ac800), %o5
_Thread_Disable_dispatch();
_TOD_Get( &ts );
ts.tv_sec += delta->tv_sec;
ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND;
4000562c: 83 28 60 03 sll %g1, 3, %g1
/* if adjustment is too much positive */
while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
40005630: 05 31 19 4d sethi %hi(0xc4653400), %g2
_Thread_Disable_dispatch();
_TOD_Get( &ts );
ts.tv_sec += delta->tv_sec;
ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND;
40005634: 82 00 40 03 add %g1, %g3, %g1
/* if adjustment is too much positive */
while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
40005638: 9a 13 61 ff or %o5, 0x1ff, %o5
4000563c: 10 80 00 03 b 40005648 <adjtime+0xe0>
40005640: 84 10 a2 00 or %g2, 0x200, %g2
40005644: 82 00 40 02 add %g1, %g2, %g1
40005648: 86 10 00 04 mov %g4, %g3
4000564c: 80 a0 40 0d cmp %g1, %o5
40005650: 18 bf ff fd bgu 40005644 <adjtime+0xdc>
40005654: 88 01 20 01 inc %g4
ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
ts.tv_sec++;
}
/* if adjustment is too much negative */
while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) {
40005658: 1b 31 19 4d sethi %hi(0xc4653400), %o5
ts.tv_sec += delta->tv_sec;
ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND;
/* if adjustment is too much positive */
while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
4000565c: 09 0e e6 b2 sethi %hi(0x3b9ac800), %g4
ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
ts.tv_sec++;
}
/* if adjustment is too much negative */
while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) {
40005660: 9a 13 62 00 or %o5, 0x200, %o5
ts.tv_sec += delta->tv_sec;
ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND;
/* if adjustment is too much positive */
while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
40005664: 10 80 00 03 b 40005670 <adjtime+0x108>
40005668: 88 11 22 00 or %g4, 0x200, %g4
4000566c: 82 00 40 04 add %g1, %g4, %g1
40005670: 84 10 00 03 mov %g3, %g2
ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
ts.tv_sec++;
}
/* if adjustment is too much negative */
while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) {
40005674: 80 a0 40 0d cmp %g1, %o5
40005678: 08 bf ff fd bleu 4000566c <adjtime+0x104>
4000567c: 86 00 ff ff add %g3, -1, %g3
ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND;
ts.tv_sec--;
}
_TOD_Set( &ts );
40005680: 90 07 bf f8 add %fp, -8, %o0
ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
ts.tv_sec++;
}
/* if adjustment is too much negative */
while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) {
40005684: c2 27 bf fc st %g1, [ %fp + -4 ]
ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND;
ts.tv_sec--;
}
_TOD_Set( &ts );
40005688: 40 00 06 2d call 40006f3c <_TOD_Set>
4000568c: c4 27 bf f8 st %g2, [ %fp + -8 ]
_Thread_Enable_dispatch();
40005690: 40 00 0a df call 4000820c <_Thread_Enable_dispatch>
40005694: 01 00 00 00 nop
/* set the user's output */
if ( olddelta )
40005698: 80 a6 60 00 cmp %i1, 0
4000569c: 02 80 00 08 be 400056bc <adjtime+0x154> <== NEVER TAKEN
400056a0: 01 00 00 00 nop
*olddelta = *delta;
400056a4: c2 04 00 00 ld [ %l0 ], %g1
400056a8: c2 26 40 00 st %g1, [ %i1 ]
400056ac: c2 04 20 04 ld [ %l0 + 4 ], %g1
400056b0: c2 26 60 04 st %g1, [ %i1 + 4 ]
400056b4: 81 c7 e0 08 ret
400056b8: 91 e8 20 00 restore %g0, 0, %o0
return 0;
}
400056bc: 81 c7 e0 08 ret
400056c0: 91 e8 20 00 restore %g0, 0, %o0
400054a8 <clock_gettime>:
int clock_gettime(
clockid_t clock_id,
struct timespec *tp
)
{
400054a8: 9d e3 bf a0 save %sp, -96, %sp
if ( !tp )
400054ac: 90 96 60 00 orcc %i1, 0, %o0
400054b0: 12 80 00 06 bne 400054c8 <clock_gettime+0x20>
400054b4: 80 a6 20 01 cmp %i0, 1
rtems_set_errno_and_return_minus_one( EINVAL );
400054b8: 40 00 28 3d call 4000f5ac <__errno>
400054bc: 01 00 00 00 nop
400054c0: 10 80 00 14 b 40005510 <clock_gettime+0x68>
400054c4: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
if ( clock_id == CLOCK_REALTIME ) {
400054c8: 12 80 00 05 bne 400054dc <clock_gettime+0x34>
400054cc: 80 a6 20 04 cmp %i0, 4
_TOD_Get(tp);
400054d0: 40 00 07 c7 call 400073ec <_TOD_Get>
400054d4: b0 10 20 00 clr %i0
400054d8: 30 80 00 15 b,a 4000552c <clock_gettime+0x84>
return 0;
}
#ifdef CLOCK_MONOTONIC
if ( clock_id == CLOCK_MONOTONIC ) {
400054dc: 02 80 00 04 be 400054ec <clock_gettime+0x44> <== NEVER TAKEN
400054e0: 80 a6 20 02 cmp %i0, 2
return 0;
}
#endif
#ifdef _POSIX_CPUTIME
if ( clock_id == CLOCK_PROCESS_CPUTIME ) {
400054e4: 12 80 00 06 bne 400054fc <clock_gettime+0x54>
400054e8: 80 a6 20 03 cmp %i0, 3
_TOD_Get_uptime_as_timespec( tp );
400054ec: 40 00 07 df call 40007468 <_TOD_Get_uptime_as_timespec>
400054f0: b0 10 20 00 clr %i0
return 0;
400054f4: 81 c7 e0 08 ret
400054f8: 81 e8 00 00 restore
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
if ( clock_id == CLOCK_THREAD_CPUTIME )
400054fc: 12 80 00 08 bne 4000551c <clock_gettime+0x74>
40005500: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( ENOSYS );
40005504: 40 00 28 2a call 4000f5ac <__errno>
40005508: 01 00 00 00 nop
4000550c: 82 10 20 58 mov 0x58, %g1 ! 58 <PROM_START+0x58>
40005510: c2 22 00 00 st %g1, [ %o0 ]
40005514: 81 c7 e0 08 ret
40005518: 91 e8 3f ff restore %g0, -1, %o0
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
4000551c: 40 00 28 24 call 4000f5ac <__errno>
40005520: b0 10 3f ff mov -1, %i0
40005524: 82 10 20 16 mov 0x16, %g1
40005528: c2 22 00 00 st %g1, [ %o0 ]
return 0;
}
4000552c: 81 c7 e0 08 ret
40005530: 81 e8 00 00 restore
40005534 <clock_settime>:
int clock_settime(
clockid_t clock_id,
const struct timespec *tp
)
{
40005534: 9d e3 bf a0 save %sp, -96, %sp
if ( !tp )
40005538: 90 96 60 00 orcc %i1, 0, %o0
4000553c: 02 80 00 0a be 40005564 <clock_settime+0x30> <== NEVER TAKEN
40005540: 80 a6 20 01 cmp %i0, 1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
40005544: 12 80 00 15 bne 40005598 <clock_settime+0x64>
40005548: 80 a6 20 02 cmp %i0, 2
if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 )
4000554c: c4 02 00 00 ld [ %o0 ], %g2
40005550: 03 08 76 b9 sethi %hi(0x21dae400), %g1
40005554: 82 10 60 ff or %g1, 0xff, %g1 ! 21dae4ff <RAM_SIZE+0x219ae4ff>
40005558: 80 a0 80 01 cmp %g2, %g1
4000555c: 38 80 00 06 bgu,a 40005574 <clock_settime+0x40>
40005560: 03 10 00 7a sethi %hi(0x4001e800), %g1
rtems_set_errno_and_return_minus_one( EINVAL );
40005564: 40 00 28 12 call 4000f5ac <__errno>
40005568: 01 00 00 00 nop
4000556c: 10 80 00 12 b 400055b4 <clock_settime+0x80>
40005570: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
40005574: c4 00 63 80 ld [ %g1 + 0x380 ], %g2
40005578: 84 00 a0 01 inc %g2
4000557c: c4 20 63 80 st %g2, [ %g1 + 0x380 ]
_Thread_Disable_dispatch();
_TOD_Set( tp );
40005580: 40 00 07 d0 call 400074c0 <_TOD_Set>
40005584: b0 10 20 00 clr %i0
_Thread_Enable_dispatch();
40005588: 40 00 0c 82 call 40008790 <_Thread_Enable_dispatch>
4000558c: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
40005590: 81 c7 e0 08 ret
40005594: 81 e8 00 00 restore
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
}
#ifdef _POSIX_CPUTIME
else if ( clock_id == CLOCK_PROCESS_CPUTIME )
40005598: 02 80 00 04 be 400055a8 <clock_settime+0x74>
4000559c: 80 a6 20 03 cmp %i0, 3
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME )
400055a0: 12 80 00 08 bne 400055c0 <clock_settime+0x8c>
400055a4: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( ENOSYS );
400055a8: 40 00 28 01 call 4000f5ac <__errno>
400055ac: 01 00 00 00 nop
400055b0: 82 10 20 58 mov 0x58, %g1 ! 58 <PROM_START+0x58>
400055b4: c2 22 00 00 st %g1, [ %o0 ]
400055b8: 81 c7 e0 08 ret
400055bc: 91 e8 3f ff restore %g0, -1, %o0
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
400055c0: 40 00 27 fb call 4000f5ac <__errno>
400055c4: b0 10 3f ff mov -1, %i0
400055c8: 82 10 20 16 mov 0x16, %g1
400055cc: c2 22 00 00 st %g1, [ %o0 ]
return 0;
}
400055d0: 81 c7 e0 08 ret
400055d4: 81 e8 00 00 restore
4000dee4 <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
4000dee4: 9d e3 bf 90 save %sp, -112, %sp
POSIX_signals_Siginfo_node *psiginfo;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
4000dee8: 7f ff fc 04 call 4000cef8 <getpid>
4000deec: 01 00 00 00 nop
4000def0: 80 a6 00 08 cmp %i0, %o0
4000def4: 02 80 00 06 be 4000df0c <killinfo+0x28>
4000def8: 80 a6 60 00 cmp %i1, 0
rtems_set_errno_and_return_minus_one( ESRCH );
4000defc: 40 00 01 97 call 4000e558 <__errno>
4000df00: 01 00 00 00 nop
4000df04: 10 80 00 07 b 4000df20 <killinfo+0x3c>
4000df08: 82 10 20 03 mov 3, %g1 ! 3 <PROM_START+0x3>
/*
* Validate the signal passed.
*/
if ( !sig )
4000df0c: 12 80 00 08 bne 4000df2c <killinfo+0x48>
4000df10: 82 06 7f ff add %i1, -1, %g1
rtems_set_errno_and_return_minus_one( EINVAL );
4000df14: 40 00 01 91 call 4000e558 <__errno>
4000df18: 01 00 00 00 nop
4000df1c: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
4000df20: c2 22 00 00 st %g1, [ %o0 ]
4000df24: 10 80 00 a5 b 4000e1b8 <killinfo+0x2d4>
4000df28: 90 10 3f ff mov -1, %o0
if ( !is_valid_signo(sig) )
4000df2c: 80 a0 60 1f cmp %g1, 0x1f
4000df30: 18 bf ff f9 bgu 4000df14 <killinfo+0x30>
4000df34: 85 2e 60 02 sll %i1, 2, %g2
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
4000df38: 87 2e 60 04 sll %i1, 4, %g3
4000df3c: 86 20 c0 02 sub %g3, %g2, %g3
4000df40: 05 10 00 73 sethi %hi(0x4001cc00), %g2
4000df44: 84 10 a2 74 or %g2, 0x274, %g2 ! 4001ce74 <_POSIX_signals_Vectors>
4000df48: 84 00 80 03 add %g2, %g3, %g2
4000df4c: c4 00 a0 08 ld [ %g2 + 8 ], %g2
4000df50: 80 a0 a0 01 cmp %g2, 1
4000df54: 02 80 00 99 be 4000e1b8 <killinfo+0x2d4>
4000df58: 90 10 20 00 clr %o0
/*
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
4000df5c: 80 a6 60 04 cmp %i1, 4
4000df60: 02 80 00 06 be 4000df78 <killinfo+0x94>
4000df64: 80 a6 60 08 cmp %i1, 8
4000df68: 02 80 00 04 be 4000df78 <killinfo+0x94>
4000df6c: 80 a6 60 0b cmp %i1, 0xb
4000df70: 12 80 00 08 bne 4000df90 <killinfo+0xac>
4000df74: a0 10 20 01 mov 1, %l0
return pthread_kill( pthread_self(), sig );
4000df78: 40 00 01 4f call 4000e4b4 <pthread_self>
4000df7c: 01 00 00 00 nop
4000df80: 40 00 01 11 call 4000e3c4 <pthread_kill>
4000df84: 92 10 00 19 mov %i1, %o1
4000df88: 81 c7 e0 08 ret
4000df8c: 91 e8 00 08 restore %g0, %o0, %o0
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
4000df90: f2 27 bf f4 st %i1, [ %fp + -12 ]
siginfo->si_code = SI_USER;
4000df94: e0 27 bf f8 st %l0, [ %fp + -8 ]
if ( !value ) {
4000df98: 80 a6 a0 00 cmp %i2, 0
4000df9c: 12 80 00 04 bne 4000dfac <killinfo+0xc8>
4000dfa0: a1 2c 00 01 sll %l0, %g1, %l0
siginfo->si_value.sival_int = 0;
4000dfa4: 10 80 00 04 b 4000dfb4 <killinfo+0xd0>
4000dfa8: c0 27 bf fc clr [ %fp + -4 ]
} else {
siginfo->si_value = *value;
4000dfac: c2 06 80 00 ld [ %i2 ], %g1
4000dfb0: c2 27 bf fc st %g1, [ %fp + -4 ]
4000dfb4: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000dfb8: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2 ! 4001c8e0 <_Thread_Dispatch_disable_level>
4000dfbc: 84 00 a0 01 inc %g2
4000dfc0: c4 20 60 e0 st %g2, [ %g1 + 0xe0 ]
/*
* Is the currently executing thread interested? If so then it will
* get it an execute it as soon as the dispatcher executes.
*/
the_thread = _Thread_Executing;
4000dfc4: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000dfc8: c2 00 61 9c ld [ %g1 + 0x19c ], %g1 ! 4001c99c <_Thread_Executing>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4000dfcc: c4 00 61 60 ld [ %g1 + 0x160 ], %g2
4000dfd0: c4 00 a0 cc ld [ %g2 + 0xcc ], %g2
4000dfd4: 80 ac 00 02 andncc %l0, %g2, %g0
4000dfd8: 12 80 00 4e bne 4000e110 <killinfo+0x22c>
4000dfdc: 07 10 00 74 sethi %hi(0x4001d000), %g3
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = the_chain->first ;
4000dfe0: 03 10 00 74 sethi %hi(0x4001d000), %g1
4000dfe4: c4 00 60 00 ld [ %g1 ], %g2
4000dfe8: 10 80 00 0b b 4000e014 <killinfo+0x130>
4000dfec: 86 10 e0 04 or %g3, 4, %g3
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4000dff0: c8 00 a1 60 ld [ %g2 + 0x160 ], %g4
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
4000dff4: 80 8c 00 01 btst %l0, %g1
4000dff8: 12 80 00 46 bne 4000e110 <killinfo+0x22c>
4000dffc: 82 10 00 02 mov %g2, %g1
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
4000e000: c8 01 20 cc ld [ %g4 + 0xcc ], %g4
4000e004: 80 ac 00 04 andncc %l0, %g4, %g0
4000e008: 32 80 00 43 bne,a 4000e114 <killinfo+0x230>
4000e00c: 84 10 20 01 mov 1, %g2
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = the_chain->first ;
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
4000e010: c4 00 80 00 ld [ %g2 ], %g2
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
4000e014: 80 a0 80 03 cmp %g2, %g3
4000e018: 32 bf ff f6 bne,a 4000dff0 <killinfo+0x10c>
4000e01c: c2 00 a0 30 ld [ %g2 + 0x30 ], %g1
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
4000e020: 03 10 00 6f sethi %hi(0x4001bc00), %g1
4000e024: c8 08 63 74 ldub [ %g1 + 0x374 ], %g4 ! 4001bf74 <rtems_maximum_priority>
4000e028: 05 10 00 72 sethi %hi(0x4001c800), %g2
4000e02c: 88 01 20 01 inc %g4
4000e030: 84 10 a0 48 or %g2, 0x48, %g2
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
4000e034: 82 10 20 00 clr %g1
4000e038: 90 00 a0 0c add %g2, 0xc, %o0
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
4000e03c: 17 04 00 00 sethi %hi(0x10000000), %o3
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
/*
* This can occur when no one is interested and ITRON is not configured.
*/
if ( !_Objects_Information_table[ the_api ] )
4000e040: c6 00 80 00 ld [ %g2 ], %g3
4000e044: 80 a0 e0 00 cmp %g3, 0
4000e048: 22 80 00 2c be,a 4000e0f8 <killinfo+0x214>
4000e04c: 84 00 a0 04 add %g2, 4, %g2
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
4000e050: c6 00 e0 04 ld [ %g3 + 4 ], %g3
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
4000e054: 9a 10 20 01 mov 1, %o5
4000e058: f4 00 e0 1c ld [ %g3 + 0x1c ], %i2
for ( index = 1 ; index <= maximum ; index++ ) {
4000e05c: 10 80 00 23 b 4000e0e8 <killinfo+0x204>
4000e060: de 10 e0 10 lduh [ %g3 + 0x10 ], %o7
the_thread = (Thread_Control *) object_table[ index ];
4000e064: c6 06 80 03 ld [ %i2 + %g3 ], %g3
if ( !the_thread )
4000e068: 80 a0 e0 00 cmp %g3, 0
4000e06c: 02 80 00 1d be 4000e0e0 <killinfo+0x1fc>
4000e070: 98 10 00 04 mov %g4, %o4
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
4000e074: d8 00 e0 14 ld [ %g3 + 0x14 ], %o4
4000e078: 80 a3 00 04 cmp %o4, %g4
4000e07c: 38 80 00 19 bgu,a 4000e0e0 <killinfo+0x1fc>
4000e080: 98 10 00 04 mov %g4, %o4
DEBUG_STEP("2");
/*
* If this thread is not interested, then go on to the next thread.
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4000e084: d4 00 e1 60 ld [ %g3 + 0x160 ], %o2
4000e088: d4 02 a0 cc ld [ %o2 + 0xcc ], %o2
4000e08c: 80 ac 00 0a andncc %l0, %o2, %g0
4000e090: 22 80 00 14 be,a 4000e0e0 <killinfo+0x1fc>
4000e094: 98 10 00 04 mov %g4, %o4
*
* NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1
* so we never have to worry about deferencing a NULL
* interested thread.
*/
if ( the_thread->current_priority < interested_priority ) {
4000e098: 80 a3 00 04 cmp %o4, %g4
4000e09c: 2a 80 00 11 bcs,a 4000e0e0 <killinfo+0x1fc>
4000e0a0: 82 10 00 03 mov %g3, %g1
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( !_States_Is_ready( interested->current_state ) ) {
4000e0a4: d2 00 60 10 ld [ %g1 + 0x10 ], %o1
4000e0a8: 80 a2 60 00 cmp %o1, 0
4000e0ac: 22 80 00 0d be,a 4000e0e0 <killinfo+0x1fc> <== NEVER TAKEN
4000e0b0: 98 10 00 04 mov %g4, %o4 <== NOT EXECUTED
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
4000e0b4: d4 00 e0 10 ld [ %g3 + 0x10 ], %o2
4000e0b8: 80 a2 a0 00 cmp %o2, 0
4000e0bc: 22 80 00 09 be,a 4000e0e0 <killinfo+0x1fc>
4000e0c0: 82 10 00 03 mov %g3, %g1
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
4000e0c4: 80 8a 40 0b btst %o1, %o3
4000e0c8: 32 80 00 06 bne,a 4000e0e0 <killinfo+0x1fc>
4000e0cc: 98 10 00 04 mov %g4, %o4
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
4000e0d0: 80 8a 80 0b btst %o2, %o3
4000e0d4: 32 80 00 03 bne,a 4000e0e0 <killinfo+0x1fc>
4000e0d8: 82 10 00 03 mov %g3, %g1
4000e0dc: 98 10 00 04 mov %g4, %o4
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
4000e0e0: 9a 03 60 01 inc %o5
4000e0e4: 88 10 00 0c mov %o4, %g4
4000e0e8: 80 a3 40 0f cmp %o5, %o7
4000e0ec: 28 bf ff de bleu,a 4000e064 <killinfo+0x180>
4000e0f0: 87 2b 60 02 sll %o5, 2, %g3
4000e0f4: 84 00 a0 04 add %g2, 4, %g2
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
4000e0f8: 80 a0 80 08 cmp %g2, %o0
4000e0fc: 32 bf ff d2 bne,a 4000e044 <killinfo+0x160>
4000e100: c6 00 80 00 ld [ %g2 ], %g3
}
}
}
}
if ( interested ) {
4000e104: 80 a0 60 00 cmp %g1, 0
4000e108: 02 80 00 0b be 4000e134 <killinfo+0x250>
4000e10c: 01 00 00 00 nop
* thread needs to do the post context switch extension so it can
* evaluate the signals pending.
*/
process_it:
the_thread->do_post_task_switch_extension = true;
4000e110: 84 10 20 01 mov 1, %g2 ! 1 <PROM_START+0x1>
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
4000e114: 90 10 00 01 mov %g1, %o0
* thread needs to do the post context switch extension so it can
* evaluate the signals pending.
*/
process_it:
the_thread->do_post_task_switch_extension = true;
4000e118: c4 28 60 74 stb %g2, [ %g1 + 0x74 ]
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
4000e11c: 92 10 00 19 mov %i1, %o1
4000e120: 40 00 00 5d call 4000e294 <_POSIX_signals_Unblock_thread>
4000e124: 94 07 bf f4 add %fp, -12, %o2
4000e128: 80 8a 20 ff btst 0xff, %o0
4000e12c: 12 80 00 20 bne 4000e1ac <killinfo+0x2c8>
4000e130: 01 00 00 00 nop
/*
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
4000e134: 40 00 00 47 call 4000e250 <_POSIX_signals_Set_process_signals>
4000e138: 90 10 00 10 mov %l0, %o0
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
4000e13c: 83 2e 60 04 sll %i1, 4, %g1
4000e140: b3 2e 60 02 sll %i1, 2, %i1
4000e144: b2 20 40 19 sub %g1, %i1, %i1
4000e148: 03 10 00 73 sethi %hi(0x4001cc00), %g1
4000e14c: 82 10 62 74 or %g1, 0x274, %g1 ! 4001ce74 <_POSIX_signals_Vectors>
4000e150: c2 00 40 19 ld [ %g1 + %i1 ], %g1
4000e154: 80 a0 60 02 cmp %g1, 2
4000e158: 12 80 00 15 bne 4000e1ac <killinfo+0x2c8>
4000e15c: 11 10 00 73 sethi %hi(0x4001cc00), %o0
psiginfo = (POSIX_signals_Siginfo_node *)
4000e160: 7f ff f4 d3 call 4000b4ac <_Chain_Get>
4000e164: 90 12 23 f4 or %o0, 0x3f4, %o0 ! 4001cff4 <_POSIX_signals_Inactive_siginfo>
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
4000e168: a0 92 20 00 orcc %o0, 0, %l0
4000e16c: 12 80 00 08 bne 4000e18c <killinfo+0x2a8>
4000e170: 92 07 bf f4 add %fp, -12, %o1
_Thread_Enable_dispatch();
4000e174: 7f ff e5 55 call 400076c8 <_Thread_Enable_dispatch>
4000e178: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EAGAIN );
4000e17c: 40 00 00 f7 call 4000e558 <__errno>
4000e180: 01 00 00 00 nop
4000e184: 10 bf ff 67 b 4000df20 <killinfo+0x3c>
4000e188: 82 10 20 0b mov 0xb, %g1 ! b <PROM_START+0xb>
}
psiginfo->Info = *siginfo;
4000e18c: 90 04 20 08 add %l0, 8, %o0
4000e190: 40 00 03 2e call 4000ee48 <memcpy>
4000e194: 94 10 20 0c mov 0xc, %o2
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
4000e198: 11 10 00 74 sethi %hi(0x4001d000), %o0
4000e19c: 92 10 00 10 mov %l0, %o1
4000e1a0: 90 12 20 6c or %o0, 0x6c, %o0
4000e1a4: 7f ff df 75 call 40005f78 <_Chain_Append>
4000e1a8: 90 02 00 19 add %o0, %i1, %o0
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
4000e1ac: 7f ff e5 47 call 400076c8 <_Thread_Enable_dispatch>
4000e1b0: 01 00 00 00 nop
4000e1b4: 90 10 20 00 clr %o0 ! 0 <PROM_START>
return 0;
}
4000e1b8: b0 10 00 08 mov %o0, %i0
4000e1bc: 81 c7 e0 08 ret
4000e1c0: 81 e8 00 00 restore
4001aecc <nanosleep>:
int nanosleep(
const struct timespec *rqtp,
struct timespec *rmtp
)
{
4001aecc: 9d e3 bf a0 save %sp, -96, %sp
Watchdog_Interval ticks;
if ( !_Timespec_Is_valid( rqtp ) )
4001aed0: 40 00 00 72 call 4001b098 <_Timespec_Is_valid>
4001aed4: 90 10 00 18 mov %i0, %o0
4001aed8: 80 8a 20 ff btst 0xff, %o0
4001aedc: 02 80 00 0a be 4001af04 <nanosleep+0x38>
4001aee0: 01 00 00 00 nop
* Return EINVAL if the delay interval is negative.
*
* NOTE: This behavior is beyond the POSIX specification.
* FSU and GNU/Linux pthreads shares this behavior.
*/
if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 )
4001aee4: c2 06 00 00 ld [ %i0 ], %g1
4001aee8: 80 a0 60 00 cmp %g1, 0
4001aeec: 06 80 00 06 bl 4001af04 <nanosleep+0x38> <== NEVER TAKEN
4001aef0: 01 00 00 00 nop
4001aef4: c2 06 20 04 ld [ %i0 + 4 ], %g1
4001aef8: 80 a0 60 00 cmp %g1, 0
4001aefc: 16 80 00 06 bge 4001af14 <nanosleep+0x48> <== ALWAYS TAKEN
4001af00: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EINVAL );
4001af04: 7f ff ce be call 4000e9fc <__errno>
4001af08: 01 00 00 00 nop
4001af0c: 10 80 00 3c b 4001affc <nanosleep+0x130>
4001af10: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
ticks = _Timespec_To_ticks( rqtp );
4001af14: 7f ff c5 5e call 4000c48c <_Timespec_To_ticks>
4001af18: 90 10 00 18 mov %i0, %o0
* A nanosleep for zero time is implemented as a yield.
* This behavior is also beyond the POSIX specification but is
* consistent with the RTEMS API and yields desirable behavior.
*/
if ( !ticks ) {
4001af1c: b0 92 20 00 orcc %o0, 0, %i0
4001af20: 12 80 00 10 bne 4001af60 <nanosleep+0x94>
4001af24: 03 10 00 76 sethi %hi(0x4001d800), %g1
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
4001af28: c4 00 61 50 ld [ %g1 + 0x150 ], %g2 ! 4001d950 <_Thread_Dispatch_disable_level>
4001af2c: 84 00 a0 01 inc %g2
4001af30: c4 20 61 50 st %g2, [ %g1 + 0x150 ]
_Thread_Disable_dispatch();
_Thread_Yield_processor();
4001af34: 7f ff b6 4f call 40008870 <_Thread_Yield_processor>
4001af38: 01 00 00 00 nop
_Thread_Enable_dispatch();
4001af3c: 7f ff b2 fc call 40007b2c <_Thread_Enable_dispatch>
4001af40: 01 00 00 00 nop
if ( rmtp ) {
4001af44: 80 a6 60 00 cmp %i1, 0
4001af48: 02 80 00 30 be 4001b008 <nanosleep+0x13c>
4001af4c: 01 00 00 00 nop
rmtp->tv_sec = 0;
rmtp->tv_nsec = 0;
4001af50: c0 26 60 04 clr [ %i1 + 4 ]
if ( !ticks ) {
_Thread_Disable_dispatch();
_Thread_Yield_processor();
_Thread_Enable_dispatch();
if ( rmtp ) {
rmtp->tv_sec = 0;
4001af54: c0 26 40 00 clr [ %i1 ]
4001af58: 81 c7 e0 08 ret
4001af5c: 81 e8 00 00 restore
4001af60: c4 00 61 50 ld [ %g1 + 0x150 ], %g2
4001af64: 84 00 a0 01 inc %g2
4001af68: c4 20 61 50 st %g2, [ %g1 + 0x150 ]
/*
* Block for the desired amount of time
*/
_Thread_Disable_dispatch();
_Thread_Set_state(
4001af6c: 21 10 00 76 sethi %hi(0x4001d800), %l0
4001af70: d0 04 22 0c ld [ %l0 + 0x20c ], %o0 ! 4001da0c <_Thread_Executing>
4001af74: 13 04 00 00 sethi %hi(0x10000000), %o1
4001af78: 7f ff b5 42 call 40008480 <_Thread_Set_state>
4001af7c: 92 12 60 08 or %o1, 8, %o1 ! 10000008 <RAM_SIZE+0xfc00008>
_Thread_Executing,
STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Watchdog_Initialize(
&_Thread_Executing->Timer,
4001af80: c2 04 22 0c ld [ %l0 + 0x20c ], %g1
4001af84: 11 10 00 76 sethi %hi(0x4001d800), %o0
_Thread_Disable_dispatch();
_Thread_Set_state(
_Thread_Executing,
STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Watchdog_Initialize(
4001af88: c4 00 60 08 ld [ %g1 + 8 ], %g2
4001af8c: 90 12 22 2c or %o0, 0x22c, %o0
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
the_watchdog->id = id;
4001af90: c4 20 60 68 st %g2, [ %g1 + 0x68 ]
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4001af94: 92 00 60 48 add %g1, 0x48, %o1
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
4001af98: 05 10 00 1e sethi %hi(0x40007800), %g2
4001af9c: 84 10 a1 a8 or %g2, 0x1a8, %g2 ! 400079a8 <_Thread_Delay_ended>
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
4001afa0: c0 20 60 50 clr [ %g1 + 0x50 ]
the_watchdog->routine = routine;
the_watchdog->id = id;
the_watchdog->user_data = user_data;
4001afa4: c0 20 60 6c clr [ %g1 + 0x6c ]
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
4001afa8: f0 20 60 54 st %i0, [ %g1 + 0x54 ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4001afac: 7f ff b7 60 call 40008d2c <_Watchdog_Insert>
4001afb0: c4 20 60 64 st %g2, [ %g1 + 0x64 ]
_Thread_Delay_ended,
_Thread_Executing->Object.id,
NULL
);
_Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks );
_Thread_Enable_dispatch();
4001afb4: 7f ff b2 de call 40007b2c <_Thread_Enable_dispatch>
4001afb8: 01 00 00 00 nop
/* calculate time remaining */
if ( rmtp ) {
4001afbc: 80 a6 60 00 cmp %i1, 0
4001afc0: 02 80 00 12 be 4001b008 <nanosleep+0x13c>
4001afc4: c2 04 22 0c ld [ %l0 + 0x20c ], %g1
ticks -=
_Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time;
_Timespec_From_ticks( ticks, rmtp );
4001afc8: 92 10 00 19 mov %i1, %o1
_Thread_Enable_dispatch();
/* calculate time remaining */
if ( rmtp ) {
ticks -=
4001afcc: c4 00 60 60 ld [ %g1 + 0x60 ], %g2
4001afd0: c2 00 60 5c ld [ %g1 + 0x5c ], %g1
4001afd4: 82 20 40 02 sub %g1, %g2, %g1
4001afd8: b0 00 40 18 add %g1, %i0, %i0
_Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time;
_Timespec_From_ticks( ticks, rmtp );
4001afdc: 40 00 00 1a call 4001b044 <_Timespec_From_ticks>
4001afe0: 90 10 00 18 mov %i0, %o0
*/
#if defined(RTEMS_POSIX_API)
/*
* If there is time remaining, then we were interrupted by a signal.
*/
if ( ticks )
4001afe4: 80 a6 20 00 cmp %i0, 0
4001afe8: 02 80 00 08 be 4001b008 <nanosleep+0x13c>
4001afec: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EINTR );
4001aff0: 7f ff ce 83 call 4000e9fc <__errno>
4001aff4: 01 00 00 00 nop
4001aff8: 82 10 20 04 mov 4, %g1 ! 4 <PROM_START+0x4>
4001affc: c2 22 00 00 st %g1, [ %o0 ]
4001b000: 81 c7 e0 08 ret
4001b004: 91 e8 3f ff restore %g0, -1, %o0
#endif
}
return 0;
}
4001b008: 81 c7 e0 08 ret
4001b00c: 91 e8 20 00 restore %g0, 0, %o0
40009ff4 <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
40009ff4: 80 a2 20 00 cmp %o0, 0
40009ff8: 02 80 00 10 be 4000a038 <pthread_attr_setschedpolicy+0x44>
40009ffc: 01 00 00 00 nop
4000a000: c2 02 00 00 ld [ %o0 ], %g1
4000a004: 80 a0 60 00 cmp %g1, 0
4000a008: 02 80 00 0c be 4000a038 <pthread_attr_setschedpolicy+0x44>
4000a00c: 80 a2 60 04 cmp %o1, 4
return EINVAL;
switch ( policy ) {
4000a010: 18 80 00 06 bgu 4000a028 <pthread_attr_setschedpolicy+0x34>
4000a014: 82 10 20 01 mov 1, %g1
4000a018: 83 28 40 09 sll %g1, %o1, %g1
4000a01c: 80 88 60 17 btst 0x17, %g1
4000a020: 32 80 00 04 bne,a 4000a030 <pthread_attr_setschedpolicy+0x3c><== ALWAYS TAKEN
4000a024: d2 22 20 14 st %o1, [ %o0 + 0x14 ]
4000a028: 81 c3 e0 08 retl
4000a02c: 90 10 20 86 mov 0x86, %o0
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
4000a030: 81 c3 e0 08 retl
4000a034: 90 10 20 00 clr %o0
default:
return ENOTSUP;
}
}
4000a038: 81 c3 e0 08 retl
4000a03c: 90 10 20 16 mov 0x16, %o0
40005ac0 <pthread_barrier_init>:
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
40005ac0: 9d e3 bf 90 save %sp, -112, %sp
const pthread_barrierattr_t *the_attr;
/*
* Error check parameters
*/
if ( !barrier )
40005ac4: 80 a6 20 00 cmp %i0, 0
40005ac8: 02 80 00 2e be 40005b80 <pthread_barrier_init+0xc0>
40005acc: 80 a6 a0 00 cmp %i2, 0
return EINVAL;
if ( count == 0 )
40005ad0: 02 80 00 2c be 40005b80 <pthread_barrier_init+0xc0>
40005ad4: 80 a6 60 00 cmp %i1, 0
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
40005ad8: 32 80 00 06 bne,a 40005af0 <pthread_barrier_init+0x30>
40005adc: c2 06 40 00 ld [ %i1 ], %g1
the_attr = attr;
} else {
(void) pthread_barrierattr_init( &my_attr );
40005ae0: b2 07 bf f0 add %fp, -16, %i1
40005ae4: 7f ff ff c0 call 400059e4 <pthread_barrierattr_init>
40005ae8: 90 10 00 19 mov %i1, %o0
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
40005aec: c2 06 40 00 ld [ %i1 ], %g1
40005af0: 80 a0 60 00 cmp %g1, 0
40005af4: 02 80 00 23 be 40005b80 <pthread_barrier_init+0xc0>
40005af8: 01 00 00 00 nop
return EINVAL;
switch ( the_attr->process_shared ) {
40005afc: c2 06 60 04 ld [ %i1 + 4 ], %g1
40005b00: 80 a0 60 00 cmp %g1, 0
40005b04: 12 80 00 1f bne 40005b80 <pthread_barrier_init+0xc0> <== NEVER TAKEN
40005b08: 03 10 00 78 sethi %hi(0x4001e000), %g1
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
40005b0c: c4 00 61 c0 ld [ %g1 + 0x1c0 ], %g2 ! 4001e1c0 <_Thread_Dispatch_disable_level>
/*
* Convert from POSIX attributes to Core Barrier attributes
*/
the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE;
the_attributes.maximum_count = count;
40005b10: f4 27 bf fc st %i2, [ %fp + -4 ]
40005b14: 84 00 a0 01 inc %g2
}
/*
* Convert from POSIX attributes to Core Barrier attributes
*/
the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE;
40005b18: c0 27 bf f8 clr [ %fp + -8 ]
40005b1c: c4 20 61 c0 st %g2, [ %g1 + 0x1c0 ]
* This function allocates a barrier control block from
* the inactive chain of free barrier control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void )
{
return (POSIX_Barrier_Control *)
40005b20: 23 10 00 79 sethi %hi(0x4001e400), %l1
40005b24: 40 00 08 28 call 40007bc4 <_Objects_Allocate>
40005b28: 90 14 61 d0 or %l1, 0x1d0, %o0 ! 4001e5d0 <_POSIX_Barrier_Information>
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_barrier = _POSIX_Barrier_Allocate();
if ( !the_barrier ) {
40005b2c: a0 92 20 00 orcc %o0, 0, %l0
40005b30: 12 80 00 06 bne 40005b48 <pthread_barrier_init+0x88>
40005b34: 90 04 20 10 add %l0, 0x10, %o0
_Thread_Enable_dispatch();
40005b38: 40 00 0b 82 call 40008940 <_Thread_Enable_dispatch>
40005b3c: b0 10 20 0b mov 0xb, %i0
return EAGAIN;
40005b40: 81 c7 e0 08 ret
40005b44: 81 e8 00 00 restore
}
_CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes );
40005b48: 40 00 05 b4 call 40007218 <_CORE_barrier_Initialize>
40005b4c: 92 07 bf f8 add %fp, -8, %o1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40005b50: c4 14 20 0a lduh [ %l0 + 0xa ], %g2
40005b54: a2 14 61 d0 or %l1, 0x1d0, %l1
40005b58: c6 04 60 1c ld [ %l1 + 0x1c ], %g3
40005b5c: c2 04 20 08 ld [ %l0 + 8 ], %g1
40005b60: 85 28 a0 02 sll %g2, 2, %g2
40005b64: e0 20 c0 02 st %l0, [ %g3 + %g2 ]
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
40005b68: c0 24 20 0c clr [ %l0 + 0xc ]
);
/*
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
40005b6c: c2 26 00 00 st %g1, [ %i0 ]
_Thread_Enable_dispatch();
40005b70: 40 00 0b 74 call 40008940 <_Thread_Enable_dispatch>
40005b74: b0 10 20 00 clr %i0
return 0;
40005b78: 81 c7 e0 08 ret
40005b7c: 81 e8 00 00 restore
}
40005b80: 81 c7 e0 08 ret
40005b84: 91 e8 20 16 restore %g0, 0x16, %o0
4000527c <pthread_cleanup_push>:
void pthread_cleanup_push(
void (*routine)( void * ),
void *arg
)
{
4000527c: 9d e3 bf a0 save %sp, -96, %sp
/*
* The POSIX standard does not address what to do when the routine
* is NULL. It also does not address what happens when we cannot
* allocate memory or anything else bad happens.
*/
if ( !routine )
40005280: 80 a6 20 00 cmp %i0, 0
40005284: 02 80 00 12 be 400052cc <pthread_cleanup_push+0x50>
40005288: 03 10 00 79 sethi %hi(0x4001e400), %g1
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
4000528c: c4 00 62 50 ld [ %g1 + 0x250 ], %g2 ! 4001e650 <_Thread_Dispatch_disable_level>
40005290: 84 00 a0 01 inc %g2
40005294: c4 20 62 50 st %g2, [ %g1 + 0x250 ]
return;
_Thread_Disable_dispatch();
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
40005298: 40 00 10 f7 call 40009674 <_Workspace_Allocate>
4000529c: 90 10 20 10 mov 0x10, %o0
if ( handler ) {
400052a0: 92 92 20 00 orcc %o0, 0, %o1
400052a4: 02 80 00 08 be 400052c4 <pthread_cleanup_push+0x48> <== NEVER TAKEN
400052a8: 03 10 00 79 sethi %hi(0x4001e400), %g1
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
handler_stack = &thread_support->Cancellation_Handlers;
400052ac: c2 00 63 0c ld [ %g1 + 0x30c ], %g1 ! 4001e70c <_Thread_Executing>
handler->routine = routine;
400052b0: f0 22 60 08 st %i0, [ %o1 + 8 ]
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
if ( handler ) {
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
handler_stack = &thread_support->Cancellation_Handlers;
400052b4: d0 00 61 60 ld [ %g1 + 0x160 ], %o0
handler->routine = routine;
handler->arg = arg;
400052b8: f2 22 60 0c st %i1, [ %o1 + 0xc ]
_Chain_Append( handler_stack, &handler->Node );
400052bc: 40 00 06 06 call 40006ad4 <_Chain_Append>
400052c0: 90 02 20 e0 add %o0, 0xe0, %o0
}
_Thread_Enable_dispatch();
400052c4: 40 00 0b aa call 4000816c <_Thread_Enable_dispatch>
400052c8: 81 e8 00 00 restore
400052cc: 81 c7 e0 08 ret
400052d0: 81 e8 00 00 restore
4000637c <pthread_cond_init>:
int pthread_cond_init(
pthread_cond_t *cond,
const pthread_condattr_t *attr
)
{
4000637c: 9d e3 bf a0 save %sp, -96, %sp
POSIX_Condition_variables_Control *the_cond;
const pthread_condattr_t *the_attr;
if ( attr ) the_attr = attr;
40006380: 25 10 00 76 sethi %hi(0x4001d800), %l2
40006384: 80 a6 60 00 cmp %i1, 0
40006388: 02 80 00 03 be 40006394 <pthread_cond_init+0x18>
4000638c: a4 14 a3 10 or %l2, 0x310, %l2
40006390: a4 10 00 19 mov %i1, %l2
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
40006394: c2 04 a0 04 ld [ %l2 + 4 ], %g1
40006398: 80 a0 60 01 cmp %g1, 1
4000639c: 02 80 00 26 be 40006434 <pthread_cond_init+0xb8> <== NEVER TAKEN
400063a0: 01 00 00 00 nop
return EINVAL;
if ( !the_attr->is_initialized )
400063a4: c2 04 80 00 ld [ %l2 ], %g1
400063a8: 80 a0 60 00 cmp %g1, 0
400063ac: 02 80 00 22 be 40006434 <pthread_cond_init+0xb8>
400063b0: 03 10 00 7d sethi %hi(0x4001f400), %g1
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
400063b4: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2 ! 4001f4e0 <_Thread_Dispatch_disable_level>
400063b8: 84 00 a0 01 inc %g2
400063bc: c4 20 60 e0 st %g2, [ %g1 + 0xe0 ]
*/
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
*_POSIX_Condition_variables_Allocate( void )
{
return (POSIX_Condition_variables_Control *)
400063c0: 23 10 00 7e sethi %hi(0x4001f800), %l1
400063c4: 40 00 09 b2 call 40008a8c <_Objects_Allocate>
400063c8: 90 14 61 88 or %l1, 0x188, %o0 ! 4001f988 <_POSIX_Condition_variables_Information>
_Thread_Disable_dispatch();
the_cond = _POSIX_Condition_variables_Allocate();
if ( !the_cond ) {
400063cc: a0 92 20 00 orcc %o0, 0, %l0
400063d0: 32 80 00 06 bne,a 400063e8 <pthread_cond_init+0x6c>
400063d4: c2 04 a0 04 ld [ %l2 + 4 ], %g1
_Thread_Enable_dispatch();
400063d8: 40 00 0d 0c call 40009808 <_Thread_Enable_dispatch>
400063dc: b0 10 20 0c mov 0xc, %i0
return ENOMEM;
400063e0: 81 c7 e0 08 ret
400063e4: 81 e8 00 00 restore
the_cond->process_shared = the_attr->process_shared;
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
/* XXX some more initialization might need to go here */
_Thread_queue_Initialize(
400063e8: 90 04 20 18 add %l0, 0x18, %o0
if ( !the_cond ) {
_Thread_Enable_dispatch();
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
400063ec: c2 24 20 10 st %g1, [ %l0 + 0x10 ]
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
/* XXX some more initialization might need to go here */
_Thread_queue_Initialize(
400063f0: 92 10 20 00 clr %o1
400063f4: 94 10 28 00 mov 0x800, %o2
400063f8: 96 10 20 74 mov 0x74, %o3
400063fc: 40 00 0f 19 call 4000a060 <_Thread_queue_Initialize>
40006400: c0 24 20 14 clr [ %l0 + 0x14 ]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40006404: c4 14 20 0a lduh [ %l0 + 0xa ], %g2
40006408: a2 14 61 88 or %l1, 0x188, %l1
4000640c: c6 04 60 1c ld [ %l1 + 0x1c ], %g3
40006410: c2 04 20 08 ld [ %l0 + 8 ], %g1
40006414: 85 28 a0 02 sll %g2, 2, %g2
40006418: e0 20 c0 02 st %l0, [ %g3 + %g2 ]
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
4000641c: c0 24 20 0c clr [ %l0 + 0xc ]
&_POSIX_Condition_variables_Information,
&the_cond->Object,
0
);
*cond = the_cond->Object.id;
40006420: c2 26 00 00 st %g1, [ %i0 ]
_Thread_Enable_dispatch();
40006424: 40 00 0c f9 call 40009808 <_Thread_Enable_dispatch>
40006428: b0 10 20 00 clr %i0
return 0;
4000642c: 81 c7 e0 08 ret
40006430: 81 e8 00 00 restore
}
40006434: 81 c7 e0 08 ret
40006438: 91 e8 20 16 restore %g0, 0x16, %o0
400061f4 <pthread_condattr_destroy>:
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
if ( !attr || attr->is_initialized == false )
400061f4: 80 a2 20 00 cmp %o0, 0
400061f8: 02 80 00 09 be 4000621c <pthread_condattr_destroy+0x28>
400061fc: 01 00 00 00 nop
40006200: c2 02 00 00 ld [ %o0 ], %g1
40006204: 80 a0 60 00 cmp %g1, 0
40006208: 02 80 00 05 be 4000621c <pthread_condattr_destroy+0x28> <== NEVER TAKEN
4000620c: 01 00 00 00 nop
return EINVAL;
attr->is_initialized = false;
40006210: c0 22 00 00 clr [ %o0 ]
return 0;
40006214: 81 c3 e0 08 retl
40006218: 90 10 20 00 clr %o0
}
4000621c: 81 c3 e0 08 retl
40006220: 90 10 20 16 mov 0x16, %o0
4000575c <pthread_create>:
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
4000575c: 9d e3 bf 58 save %sp, -168, %sp
40005760: a0 10 00 18 mov %i0, %l0
int schedpolicy = SCHED_RR;
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
40005764: 80 a6 a0 00 cmp %i2, 0
40005768: 02 80 00 8b be 40005994 <pthread_create+0x238>
4000576c: b0 10 20 0e mov 0xe, %i0
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
40005770: 23 10 00 70 sethi %hi(0x4001c000), %l1
40005774: 80 a6 60 00 cmp %i1, 0
40005778: 02 80 00 03 be 40005784 <pthread_create+0x28>
4000577c: a2 14 62 88 or %l1, 0x288, %l1
40005780: a2 10 00 19 mov %i1, %l1
if ( !the_attr->is_initialized )
40005784: c2 04 40 00 ld [ %l1 ], %g1
40005788: 80 a0 60 00 cmp %g1, 0
4000578c: 22 80 00 82 be,a 40005994 <pthread_create+0x238>
40005790: b0 10 20 16 mov 0x16, %i0
* stack space if it is allowed to allocate it itself.
*
* NOTE: If the user provides the stack we will let it drop below
* twice the minimum.
*/
if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) )
40005794: c2 04 60 04 ld [ %l1 + 4 ], %g1
40005798: 80 a0 60 00 cmp %g1, 0
4000579c: 02 80 00 07 be 400057b8 <pthread_create+0x5c>
400057a0: 03 10 00 74 sethi %hi(0x4001d000), %g1
400057a4: c4 04 60 08 ld [ %l1 + 8 ], %g2
400057a8: c2 00 62 f4 ld [ %g1 + 0x2f4 ], %g1
400057ac: 80 a0 80 01 cmp %g2, %g1
400057b0: 2a 80 00 79 bcs,a 40005994 <pthread_create+0x238>
400057b4: b0 10 20 16 mov 0x16, %i0
* If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread
* inherits scheduling attributes from the creating thread. If it is
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
400057b8: c2 04 60 10 ld [ %l1 + 0x10 ], %g1
400057bc: 80 a0 60 01 cmp %g1, 1
400057c0: 02 80 00 06 be 400057d8 <pthread_create+0x7c>
400057c4: 80 a0 60 02 cmp %g1, 2
400057c8: 12 80 00 73 bne 40005994 <pthread_create+0x238>
400057cc: b0 10 20 16 mov 0x16, %i0
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
400057d0: 10 80 00 0a b 400057f8 <pthread_create+0x9c>
400057d4: e6 04 60 14 ld [ %l1 + 0x14 ], %l3
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
400057d8: 03 10 00 77 sethi %hi(0x4001dc00), %g1
400057dc: c2 00 60 ec ld [ %g1 + 0xec ], %g1 ! 4001dcec <_Thread_Executing>
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
400057e0: 90 07 bf dc add %fp, -36, %o0
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
400057e4: c2 00 61 60 ld [ %g1 + 0x160 ], %g1
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
400057e8: 94 10 20 1c mov 0x1c, %o2
400057ec: 92 00 60 84 add %g1, 0x84, %o1
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
schedpolicy = api->schedpolicy;
400057f0: 10 80 00 05 b 40005804 <pthread_create+0xa8>
400057f4: e6 00 60 80 ld [ %g1 + 0x80 ], %l3
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
400057f8: 90 07 bf dc add %fp, -36, %o0
400057fc: 92 04 60 18 add %l1, 0x18, %o1
40005800: 94 10 20 1c mov 0x1c, %o2
40005804: 40 00 29 13 call 4000fc50 <memcpy>
40005808: b0 10 20 86 mov 0x86, %i0
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
4000580c: c2 04 60 0c ld [ %l1 + 0xc ], %g1
40005810: 80 a0 60 00 cmp %g1, 0
40005814: 12 80 00 62 bne 4000599c <pthread_create+0x240>
40005818: 01 00 00 00 nop
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
4000581c: 40 00 19 cc call 4000bf4c <_POSIX_Priority_Is_valid>
40005820: d0 07 bf dc ld [ %fp + -36 ], %o0
40005824: 80 8a 20 ff btst 0xff, %o0
40005828: 02 80 00 5b be 40005994 <pthread_create+0x238> <== NEVER TAKEN
4000582c: b0 10 20 16 mov 0x16, %i0
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
40005830: 03 10 00 74 sethi %hi(0x4001d000), %g1
return EINVAL;
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
40005834: e8 07 bf dc ld [ %fp + -36 ], %l4
40005838: ea 08 62 f8 ldub [ %g1 + 0x2f8 ], %l5
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
4000583c: 90 10 00 13 mov %l3, %o0
40005840: 92 07 bf dc add %fp, -36, %o1
40005844: 94 07 bf fc add %fp, -4, %o2
40005848: 40 00 19 cc call 4000bf78 <_POSIX_Thread_Translate_sched_param>
4000584c: 96 07 bf f8 add %fp, -8, %o3
schedpolicy,
&schedparam,
&budget_algorithm,
&budget_callout
);
if ( rc )
40005850: b0 92 20 00 orcc %o0, 0, %i0
40005854: 12 80 00 50 bne 40005994 <pthread_create+0x238>
40005858: 2d 10 00 77 sethi %hi(0x4001dc00), %l6
#endif
/*
* Lock the allocator mutex for protection
*/
_RTEMS_Lock_allocator();
4000585c: 40 00 05 fd call 40007050 <_API_Mutex_Lock>
40005860: d0 05 a0 e4 ld [ %l6 + 0xe4 ], %o0 ! 4001dce4 <_RTEMS_Allocator_Mutex>
* _POSIX_Threads_Allocate
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
40005864: 11 10 00 77 sethi %hi(0x4001dc00), %o0
40005868: 40 00 08 63 call 400079f4 <_Objects_Allocate>
4000586c: 90 12 22 c0 or %o0, 0x2c0, %o0 ! 4001dec0 <_POSIX_Threads_Information>
* Allocate the thread control block.
*
* NOTE: Global threads are not currently supported.
*/
the_thread = _POSIX_Threads_Allocate();
if ( !the_thread ) {
40005870: a4 92 20 00 orcc %o0, 0, %l2
40005874: 32 80 00 04 bne,a 40005884 <pthread_create+0x128>
40005878: c2 04 60 08 ld [ %l1 + 8 ], %g1
_RTEMS_Unlock_allocator();
4000587c: 10 80 00 21 b 40005900 <pthread_create+0x1a4>
40005880: d0 05 a0 e4 ld [ %l6 + 0xe4 ], %o0
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
40005884: 05 10 00 74 sethi %hi(0x4001d000), %g2
40005888: d6 00 a2 f4 ld [ %g2 + 0x2f4 ], %o3 ! 4001d2f4 <rtems_minimum_stack_size>
4000588c: c0 27 bf d4 clr [ %fp + -44 ]
40005890: 97 2a e0 01 sll %o3, 1, %o3
40005894: 80 a2 c0 01 cmp %o3, %g1
40005898: 1a 80 00 03 bcc 400058a4 <pthread_create+0x148>
4000589c: d4 04 60 04 ld [ %l1 + 4 ], %o2
400058a0: 96 10 00 01 mov %g1, %o3
400058a4: c2 07 bf fc ld [ %fp + -4 ], %g1
400058a8: 9a 0d 60 ff and %l5, 0xff, %o5
400058ac: c2 23 a0 60 st %g1, [ %sp + 0x60 ]
400058b0: c2 07 bf f8 ld [ %fp + -8 ], %g1
400058b4: 9a 23 40 14 sub %o5, %l4, %o5
400058b8: c2 23 a0 64 st %g1, [ %sp + 0x64 ]
400058bc: 82 07 bf d4 add %fp, -44, %g1
400058c0: c0 23 a0 68 clr [ %sp + 0x68 ]
400058c4: a8 10 20 01 mov 1, %l4
400058c8: c2 23 a0 6c st %g1, [ %sp + 0x6c ]
400058cc: e8 23 a0 5c st %l4, [ %sp + 0x5c ]
400058d0: 2b 10 00 77 sethi %hi(0x4001dc00), %l5
400058d4: 92 10 00 12 mov %l2, %o1
400058d8: 90 15 62 c0 or %l5, 0x2c0, %o0
400058dc: 40 00 0b f3 call 400088a8 <_Thread_Initialize>
400058e0: 98 10 20 00 clr %o4
budget_callout,
0, /* isr level */
name /* posix threads don't have a name */
);
if ( !status ) {
400058e4: 80 8a 20 ff btst 0xff, %o0
400058e8: 12 80 00 08 bne 40005908 <pthread_create+0x1ac>
400058ec: 90 15 62 c0 or %l5, 0x2c0, %o0
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
400058f0: 40 00 09 1b call 40007d5c <_Objects_Free>
400058f4: 92 10 00 12 mov %l2, %o1
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
400058f8: 03 10 00 77 sethi %hi(0x4001dc00), %g1
400058fc: d0 00 60 e4 ld [ %g1 + 0xe4 ], %o0 ! 4001dce4 <_RTEMS_Allocator_Mutex>
40005900: 10 80 00 23 b 4000598c <pthread_create+0x230>
40005904: b0 10 20 0b mov 0xb, %i0
}
/*
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
40005908: ea 04 a1 60 ld [ %l2 + 0x160 ], %l5
api->Attributes = *the_attr;
4000590c: 92 10 00 11 mov %l1, %o1
40005910: 94 10 20 3c mov 0x3c, %o2
40005914: 40 00 28 cf call 4000fc50 <memcpy>
40005918: 90 10 00 15 mov %l5, %o0
api->detachstate = the_attr->detachstate;
4000591c: c2 04 60 38 ld [ %l1 + 0x38 ], %g1
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
40005920: 92 07 bf dc add %fp, -36, %o1
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
40005924: c2 25 60 3c st %g1, [ %l5 + 0x3c ]
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
40005928: 94 10 20 1c mov 0x1c, %o2
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
4000592c: e6 25 60 80 st %l3, [ %l5 + 0x80 ]
api->schedparam = schedparam;
40005930: 40 00 28 c8 call 4000fc50 <memcpy>
40005934: 90 05 60 84 add %l5, 0x84, %o0
the_thread->do_post_task_switch_extension = true;
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
40005938: 94 10 00 1a mov %i2, %o2
* This insures we evaluate the process-wide signals pending when we
* first run.
*
* NOTE: Since the thread starts with all unblocked, this is necessary.
*/
the_thread->do_post_task_switch_extension = true;
4000593c: e8 2c a0 74 stb %l4, [ %l2 + 0x74 ]
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
40005940: 96 10 00 1b mov %i3, %o3
40005944: 90 10 00 12 mov %l2, %o0
40005948: 92 10 20 01 mov 1, %o1
4000594c: 40 00 0e b3 call 40009418 <_Thread_Start>
40005950: 98 10 20 00 clr %o4
_RTEMS_Unlock_allocator();
return EINVAL;
}
#endif
if ( schedpolicy == SCHED_SPORADIC ) {
40005954: 80 a4 e0 04 cmp %l3, 4
40005958: 32 80 00 0a bne,a 40005980 <pthread_create+0x224>
4000595c: c2 04 a0 08 ld [ %l2 + 8 ], %g1
_Watchdog_Insert_ticks(
40005960: 40 00 0f 57 call 400096bc <_Timespec_To_ticks>
40005964: 90 05 60 8c add %l5, 0x8c, %o0
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40005968: 92 05 60 a4 add %l5, 0xa4, %o1
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
4000596c: d0 25 60 b0 st %o0, [ %l5 + 0xb0 ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40005970: 11 10 00 77 sethi %hi(0x4001dc00), %o0
40005974: 40 00 10 2e call 40009a2c <_Watchdog_Insert>
40005978: 90 12 21 0c or %o0, 0x10c, %o0 ! 4001dd0c <_Watchdog_Ticks_chain>
}
/*
* Return the id and indicate we successfully created the thread
*/
*thread = the_thread->Object.id;
4000597c: c2 04 a0 08 ld [ %l2 + 8 ], %g1
_RTEMS_Unlock_allocator();
40005980: 05 10 00 77 sethi %hi(0x4001dc00), %g2
40005984: d0 00 a0 e4 ld [ %g2 + 0xe4 ], %o0 ! 4001dce4 <_RTEMS_Allocator_Mutex>
}
/*
* Return the id and indicate we successfully created the thread
*/
*thread = the_thread->Object.id;
40005988: c2 24 00 00 st %g1, [ %l0 ]
_RTEMS_Unlock_allocator();
4000598c: 40 00 05 c7 call 400070a8 <_API_Mutex_Unlock>
40005990: 01 00 00 00 nop
return 0;
40005994: 81 c7 e0 08 ret
40005998: 81 e8 00 00 restore
}
4000599c: 81 c7 e0 08 ret
400059a0: 81 e8 00 00 restore
40005098 <pthread_mutexattr_gettype>:
int pthread_mutexattr_gettype(
const pthread_mutexattr_t *attr,
int *type
)
{
if ( !attr )
40005098: 80 a2 20 00 cmp %o0, 0
4000509c: 02 80 00 0c be 400050cc <pthread_mutexattr_gettype+0x34>
400050a0: 01 00 00 00 nop
return EINVAL;
if ( !attr->is_initialized )
400050a4: c2 02 00 00 ld [ %o0 ], %g1
400050a8: 80 a0 60 00 cmp %g1, 0
400050ac: 02 80 00 08 be 400050cc <pthread_mutexattr_gettype+0x34>
400050b0: 80 a2 60 00 cmp %o1, 0
return EINVAL;
if ( !type )
400050b4: 02 80 00 06 be 400050cc <pthread_mutexattr_gettype+0x34> <== NEVER TAKEN
400050b8: 01 00 00 00 nop
return EINVAL;
*type = attr->type;
400050bc: c2 02 20 10 ld [ %o0 + 0x10 ], %g1
400050c0: 90 10 20 00 clr %o0
return 0;
400050c4: 81 c3 e0 08 retl
400050c8: c2 22 40 00 st %g1, [ %o1 ]
}
400050cc: 81 c3 e0 08 retl
400050d0: 90 10 20 16 mov 0x16, %o0
400075e0 <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
400075e0: 80 a2 20 00 cmp %o0, 0
400075e4: 02 80 00 0b be 40007610 <pthread_mutexattr_setpshared+0x30>
400075e8: 01 00 00 00 nop
400075ec: c2 02 00 00 ld [ %o0 ], %g1
400075f0: 80 a0 60 00 cmp %g1, 0
400075f4: 02 80 00 07 be 40007610 <pthread_mutexattr_setpshared+0x30>
400075f8: 80 a2 60 01 cmp %o1, 1
return EINVAL;
switch ( pshared ) {
400075fc: 18 80 00 05 bgu 40007610 <pthread_mutexattr_setpshared+0x30><== NEVER TAKEN
40007600: 01 00 00 00 nop
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
40007604: d2 22 20 04 st %o1, [ %o0 + 4 ]
return 0;
40007608: 81 c3 e0 08 retl
4000760c: 90 10 20 00 clr %o0
default:
return EINVAL;
}
}
40007610: 81 c3 e0 08 retl
40007614: 90 10 20 16 mov 0x16, %o0
40005100 <pthread_mutexattr_settype>:
int pthread_mutexattr_settype(
pthread_mutexattr_t *attr,
int type
)
{
if ( !attr || !attr->is_initialized )
40005100: 80 a2 20 00 cmp %o0, 0
40005104: 02 80 00 0b be 40005130 <pthread_mutexattr_settype+0x30>
40005108: 01 00 00 00 nop
4000510c: c2 02 00 00 ld [ %o0 ], %g1
40005110: 80 a0 60 00 cmp %g1, 0
40005114: 02 80 00 07 be 40005130 <pthread_mutexattr_settype+0x30> <== NEVER TAKEN
40005118: 80 a2 60 03 cmp %o1, 3
return EINVAL;
switch ( type ) {
4000511c: 18 80 00 05 bgu 40005130 <pthread_mutexattr_settype+0x30>
40005120: 01 00 00 00 nop
case PTHREAD_MUTEX_NORMAL:
case PTHREAD_MUTEX_RECURSIVE:
case PTHREAD_MUTEX_ERRORCHECK:
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
40005124: d2 22 20 10 st %o1, [ %o0 + 0x10 ]
return 0;
40005128: 81 c3 e0 08 retl
4000512c: 90 10 20 00 clr %o0
default:
return EINVAL;
}
}
40005130: 81 c3 e0 08 retl
40005134: 90 10 20 16 mov 0x16, %o0
40005d88 <pthread_once>:
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
40005d88: 9d e3 bf 98 save %sp, -104, %sp
if ( !once_control || !init_routine )
40005d8c: 80 a6 60 00 cmp %i1, 0
40005d90: 02 80 00 05 be 40005da4 <pthread_once+0x1c>
40005d94: a0 10 00 18 mov %i0, %l0
40005d98: 80 a6 20 00 cmp %i0, 0
40005d9c: 32 80 00 04 bne,a 40005dac <pthread_once+0x24>
40005da0: c2 06 20 04 ld [ %i0 + 4 ], %g1
40005da4: 81 c7 e0 08 ret
40005da8: 91 e8 20 16 restore %g0, 0x16, %o0
return EINVAL;
if ( !once_control->init_executed ) {
40005dac: 80 a0 60 00 cmp %g1, 0
40005db0: 12 80 00 13 bne 40005dfc <pthread_once+0x74>
40005db4: b0 10 20 00 clr %i0
rtems_mode saveMode;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
40005db8: 90 10 21 00 mov 0x100, %o0
40005dbc: 92 10 21 00 mov 0x100, %o1
40005dc0: 40 00 03 03 call 400069cc <rtems_task_mode>
40005dc4: 94 07 bf fc add %fp, -4, %o2
if ( !once_control->init_executed ) {
40005dc8: c2 04 20 04 ld [ %l0 + 4 ], %g1
40005dcc: 80 a0 60 00 cmp %g1, 0
40005dd0: 12 80 00 07 bne 40005dec <pthread_once+0x64> <== NEVER TAKEN
40005dd4: d0 07 bf fc ld [ %fp + -4 ], %o0
once_control->is_initialized = true;
40005dd8: 82 10 20 01 mov 1, %g1
once_control->init_executed = true;
40005ddc: c2 24 20 04 st %g1, [ %l0 + 4 ]
(*init_routine)();
40005de0: 9f c6 40 00 call %i1
40005de4: c2 24 00 00 st %g1, [ %l0 ]
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
40005de8: d0 07 bf fc ld [ %fp + -4 ], %o0
40005dec: 92 10 21 00 mov 0x100, %o1
40005df0: 94 07 bf fc add %fp, -4, %o2
40005df4: 40 00 02 f6 call 400069cc <rtems_task_mode>
40005df8: b0 10 20 00 clr %i0
}
return 0;
}
40005dfc: 81 c7 e0 08 ret
40005e00: 81 e8 00 00 restore
400065b0 <pthread_rwlock_init>:
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
400065b0: 9d e3 bf 90 save %sp, -112, %sp
const pthread_rwlockattr_t *the_attr;
/*
* Error check parameters
*/
if ( !rwlock )
400065b4: 80 a6 20 00 cmp %i0, 0
400065b8: 02 80 00 2a be 40006660 <pthread_rwlock_init+0xb0>
400065bc: 80 a6 60 00 cmp %i1, 0
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
400065c0: 32 80 00 06 bne,a 400065d8 <pthread_rwlock_init+0x28>
400065c4: c2 06 40 00 ld [ %i1 ], %g1
the_attr = attr;
} else {
(void) pthread_rwlockattr_init( &default_attr );
400065c8: b2 07 bf f4 add %fp, -12, %i1
400065cc: 40 00 02 7f call 40006fc8 <pthread_rwlockattr_init>
400065d0: 90 10 00 19 mov %i1, %o0
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
400065d4: c2 06 40 00 ld [ %i1 ], %g1
400065d8: 80 a0 60 00 cmp %g1, 0
400065dc: 02 80 00 21 be 40006660 <pthread_rwlock_init+0xb0> <== NEVER TAKEN
400065e0: 01 00 00 00 nop
return EINVAL;
switch ( the_attr->process_shared ) {
400065e4: c2 06 60 04 ld [ %i1 + 4 ], %g1
400065e8: 80 a0 60 00 cmp %g1, 0
400065ec: 12 80 00 1d bne 40006660 <pthread_rwlock_init+0xb0> <== NEVER TAKEN
400065f0: 03 10 00 7e sethi %hi(0x4001f800), %g1
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
400065f4: c4 00 62 10 ld [ %g1 + 0x210 ], %g2 ! 4001fa10 <_Thread_Dispatch_disable_level>
400065f8: 84 00 a0 01 inc %g2
400065fc: c4 20 62 10 st %g2, [ %g1 + 0x210 ]
* This function allocates a RWLock control block from
* the inactive chain of free RWLock control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void )
{
return (POSIX_RWLock_Control *)
40006600: 23 10 00 7f sethi %hi(0x4001fc00), %l1
40006604: 40 00 09 dc call 40008d74 <_Objects_Allocate>
40006608: 90 14 60 60 or %l1, 0x60, %o0 ! 4001fc60 <_POSIX_RWLock_Information>
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_rwlock = _POSIX_RWLock_Allocate();
if ( !the_rwlock ) {
4000660c: a0 92 20 00 orcc %o0, 0, %l0
40006610: 12 80 00 06 bne 40006628 <pthread_rwlock_init+0x78>
40006614: 90 04 20 10 add %l0, 0x10, %o0
_Thread_Enable_dispatch();
40006618: 40 00 0d 36 call 40009af0 <_Thread_Enable_dispatch>
4000661c: b0 10 20 0b mov 0xb, %i0
return EAGAIN;
40006620: 81 c7 e0 08 ret
40006624: 81 e8 00 00 restore
}
_CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes );
40006628: 40 00 07 91 call 4000846c <_CORE_RWLock_Initialize>
4000662c: 92 07 bf fc add %fp, -4, %o1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40006630: c4 14 20 0a lduh [ %l0 + 0xa ], %g2
40006634: a2 14 60 60 or %l1, 0x60, %l1
40006638: c6 04 60 1c ld [ %l1 + 0x1c ], %g3
4000663c: c2 04 20 08 ld [ %l0 + 8 ], %g1
40006640: 85 28 a0 02 sll %g2, 2, %g2
40006644: e0 20 c0 02 st %l0, [ %g3 + %g2 ]
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
40006648: c0 24 20 0c clr [ %l0 + 0xc ]
&_POSIX_RWLock_Information,
&the_rwlock->Object,
0
);
*rwlock = the_rwlock->Object.id;
4000664c: c2 26 00 00 st %g1, [ %i0 ]
_Thread_Enable_dispatch();
40006650: 40 00 0d 28 call 40009af0 <_Thread_Enable_dispatch>
40006654: b0 10 20 00 clr %i0
return 0;
40006658: 81 c7 e0 08 ret
4000665c: 81 e8 00 00 restore
}
40006660: 81 c7 e0 08 ret
40006664: 91 e8 20 16 restore %g0, 0x16, %o0
400066e0 <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
400066e0: 9d e3 bf 98 save %sp, -104, %sp
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
400066e4: 80 a6 20 00 cmp %i0, 0
400066e8: 02 80 00 2d be 4000679c <pthread_rwlock_timedrdlock+0xbc>
400066ec: 90 10 00 19 mov %i1, %o0
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
400066f0: 40 00 1a bd call 4000d1e4 <_POSIX_Absolute_timeout_to_ticks>
400066f4: 92 07 bf f8 add %fp, -8, %o1
400066f8: d2 06 00 00 ld [ %i0 ], %o1
400066fc: a0 10 00 08 mov %o0, %l0
40006700: 94 07 bf fc add %fp, -4, %o2
40006704: 11 10 00 7f sethi %hi(0x4001fc00), %o0
40006708: 40 00 0a da call 40009270 <_Objects_Get>
4000670c: 90 12 20 60 or %o0, 0x60, %o0 ! 4001fc60 <_POSIX_RWLock_Information>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
40006710: c2 07 bf fc ld [ %fp + -4 ], %g1
40006714: 80 a0 60 00 cmp %g1, 0
40006718: 32 80 00 22 bne,a 400067a0 <pthread_rwlock_timedrdlock+0xc0>
4000671c: 90 10 20 16 mov 0x16, %o0
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
40006720: d2 06 00 00 ld [ %i0 ], %o1
40006724: d6 07 bf f8 ld [ %fp + -8 ], %o3
int _EXFUN(pthread_rwlock_init,
(pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr));
int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_timedrdlock,
40006728: 82 1c 20 03 xor %l0, 3, %g1
4000672c: 90 02 20 10 add %o0, 0x10, %o0
40006730: 80 a0 00 01 cmp %g0, %g1
40006734: 98 10 20 00 clr %o4
40006738: a2 60 3f ff subx %g0, -1, %l1
4000673c: 40 00 07 57 call 40008498 <_CORE_RWLock_Obtain_for_reading>
40006740: 94 10 00 11 mov %l1, %o2
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
40006744: 40 00 0c eb call 40009af0 <_Thread_Enable_dispatch>
40006748: 01 00 00 00 nop
if ( !do_wait ) {
4000674c: 80 a4 60 00 cmp %l1, 0
40006750: 12 80 00 0d bne 40006784 <pthread_rwlock_timedrdlock+0xa4>
40006754: 03 10 00 7e sethi %hi(0x4001f800), %g1
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
40006758: c2 00 62 cc ld [ %g1 + 0x2cc ], %g1 ! 4001facc <_Thread_Executing>
4000675c: c2 00 60 34 ld [ %g1 + 0x34 ], %g1
40006760: 80 a0 60 02 cmp %g1, 2
40006764: 32 80 00 09 bne,a 40006788 <pthread_rwlock_timedrdlock+0xa8>
40006768: 03 10 00 7e sethi %hi(0x4001f800), %g1
switch (status) {
4000676c: 80 a4 20 00 cmp %l0, 0
40006770: 02 80 00 0c be 400067a0 <pthread_rwlock_timedrdlock+0xc0> <== NEVER TAKEN
40006774: 90 10 20 16 mov 0x16, %o0
40006778: 80 a4 20 02 cmp %l0, 2
4000677c: 08 80 00 09 bleu 400067a0 <pthread_rwlock_timedrdlock+0xc0><== ALWAYS TAKEN
40006780: 90 10 20 74 mov 0x74, %o0
break;
}
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
40006784: 03 10 00 7e sethi %hi(0x4001f800), %g1
40006788: c2 00 62 cc ld [ %g1 + 0x2cc ], %g1 ! 4001facc <_Thread_Executing>
4000678c: 40 00 00 3b call 40006878 <_POSIX_RWLock_Translate_core_RWLock_return_code>
40006790: d0 00 60 34 ld [ %g1 + 0x34 ], %o0
40006794: 81 c7 e0 08 ret
40006798: 91 e8 00 08 restore %g0, %o0, %o0
4000679c: 90 10 20 16 mov 0x16, %o0
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
400067a0: b0 10 00 08 mov %o0, %i0
400067a4: 81 c7 e0 08 ret
400067a8: 81 e8 00 00 restore
400067ac <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
400067ac: 9d e3 bf 98 save %sp, -104, %sp
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
400067b0: 80 a6 20 00 cmp %i0, 0
400067b4: 02 80 00 2d be 40006868 <pthread_rwlock_timedwrlock+0xbc>
400067b8: 90 10 00 19 mov %i1, %o0
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
400067bc: 40 00 1a 8a call 4000d1e4 <_POSIX_Absolute_timeout_to_ticks>
400067c0: 92 07 bf f8 add %fp, -8, %o1
400067c4: d2 06 00 00 ld [ %i0 ], %o1
400067c8: a0 10 00 08 mov %o0, %l0
400067cc: 94 07 bf fc add %fp, -4, %o2
400067d0: 11 10 00 7f sethi %hi(0x4001fc00), %o0
400067d4: 40 00 0a a7 call 40009270 <_Objects_Get>
400067d8: 90 12 20 60 or %o0, 0x60, %o0 ! 4001fc60 <_POSIX_RWLock_Information>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
400067dc: c2 07 bf fc ld [ %fp + -4 ], %g1
400067e0: 80 a0 60 00 cmp %g1, 0
400067e4: 32 80 00 22 bne,a 4000686c <pthread_rwlock_timedwrlock+0xc0>
400067e8: 90 10 20 16 mov 0x16, %o0
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
400067ec: d2 06 00 00 ld [ %i0 ], %o1
400067f0: d6 07 bf f8 ld [ %fp + -8 ], %o3
(pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime));
int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_timedwrlock,
400067f4: 82 1c 20 03 xor %l0, 3, %g1
400067f8: 90 02 20 10 add %o0, 0x10, %o0
400067fc: 80 a0 00 01 cmp %g0, %g1
40006800: 98 10 20 00 clr %o4
40006804: a2 60 3f ff subx %g0, -1, %l1
40006808: 40 00 07 58 call 40008568 <_CORE_RWLock_Obtain_for_writing>
4000680c: 94 10 00 11 mov %l1, %o2
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
40006810: 40 00 0c b8 call 40009af0 <_Thread_Enable_dispatch>
40006814: 01 00 00 00 nop
if ( !do_wait &&
40006818: 80 a4 60 00 cmp %l1, 0
4000681c: 12 80 00 0d bne 40006850 <pthread_rwlock_timedwrlock+0xa4>
40006820: 03 10 00 7e sethi %hi(0x4001f800), %g1
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
40006824: c2 00 62 cc ld [ %g1 + 0x2cc ], %g1 ! 4001facc <_Thread_Executing>
40006828: c2 00 60 34 ld [ %g1 + 0x34 ], %g1
4000682c: 80 a0 60 02 cmp %g1, 2
40006830: 32 80 00 09 bne,a 40006854 <pthread_rwlock_timedwrlock+0xa8>
40006834: 03 10 00 7e sethi %hi(0x4001f800), %g1
switch (status) {
40006838: 80 a4 20 00 cmp %l0, 0
4000683c: 02 80 00 0c be 4000686c <pthread_rwlock_timedwrlock+0xc0> <== NEVER TAKEN
40006840: 90 10 20 16 mov 0x16, %o0
40006844: 80 a4 20 02 cmp %l0, 2
40006848: 08 80 00 09 bleu 4000686c <pthread_rwlock_timedwrlock+0xc0><== ALWAYS TAKEN
4000684c: 90 10 20 74 mov 0x74, %o0
case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE:
break;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
40006850: 03 10 00 7e sethi %hi(0x4001f800), %g1
40006854: c2 00 62 cc ld [ %g1 + 0x2cc ], %g1 ! 4001facc <_Thread_Executing>
40006858: 40 00 00 08 call 40006878 <_POSIX_RWLock_Translate_core_RWLock_return_code>
4000685c: d0 00 60 34 ld [ %g1 + 0x34 ], %o0
40006860: 81 c7 e0 08 ret
40006864: 91 e8 00 08 restore %g0, %o0, %o0
40006868: 90 10 20 16 mov 0x16, %o0
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
4000686c: b0 10 00 08 mov %o0, %i0
40006870: 81 c7 e0 08 ret
40006874: 81 e8 00 00 restore
40006fec <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
40006fec: 80 a2 20 00 cmp %o0, 0
40006ff0: 02 80 00 0b be 4000701c <pthread_rwlockattr_setpshared+0x30>
40006ff4: 01 00 00 00 nop
return EINVAL;
if ( !attr->is_initialized )
40006ff8: c2 02 00 00 ld [ %o0 ], %g1
40006ffc: 80 a0 60 00 cmp %g1, 0
40007000: 02 80 00 07 be 4000701c <pthread_rwlockattr_setpshared+0x30>
40007004: 80 a2 60 01 cmp %o1, 1
return EINVAL;
switch ( pshared ) {
40007008: 18 80 00 05 bgu 4000701c <pthread_rwlockattr_setpshared+0x30><== NEVER TAKEN
4000700c: 01 00 00 00 nop
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
40007010: d2 22 20 04 st %o1, [ %o0 + 4 ]
return 0;
40007014: 81 c3 e0 08 retl
40007018: 90 10 20 00 clr %o0
default:
return EINVAL;
}
}
4000701c: 81 c3 e0 08 retl
40007020: 90 10 20 16 mov 0x16, %o0
40008200 <pthread_setschedparam>:
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
40008200: 9d e3 bf 90 save %sp, -112, %sp
40008204: a0 10 00 18 mov %i0, %l0
int rc;
/*
* Check all the parameters
*/
if ( !param )
40008208: 80 a6 a0 00 cmp %i2, 0
4000820c: 02 80 00 42 be 40008314 <pthread_setschedparam+0x114>
40008210: b0 10 20 16 mov 0x16, %i0
return EINVAL;
rc = _POSIX_Thread_Translate_sched_param(
40008214: 90 10 00 19 mov %i1, %o0
40008218: 92 10 00 1a mov %i2, %o1
4000821c: 94 07 bf fc add %fp, -4, %o2
40008220: 40 00 18 3b call 4000e30c <_POSIX_Thread_Translate_sched_param>
40008224: 96 07 bf f8 add %fp, -8, %o3
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( rc )
40008228: b0 92 20 00 orcc %o0, 0, %i0
4000822c: 12 80 00 3a bne 40008314 <pthread_setschedparam+0x114>
40008230: 92 10 00 10 mov %l0, %o1
40008234: 11 10 00 88 sethi %hi(0x40022000), %o0
40008238: 94 07 bf f4 add %fp, -12, %o2
4000823c: 40 00 08 22 call 4000a2c4 <_Objects_Get>
40008240: 90 12 23 a0 or %o0, 0x3a0, %o0
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _POSIX_Threads_Get( thread, &location );
switch ( location ) {
40008244: c2 07 bf f4 ld [ %fp + -12 ], %g1
40008248: 80 a0 60 00 cmp %g1, 0
4000824c: 02 80 00 04 be 4000825c <pthread_setschedparam+0x5c>
40008250: a2 10 00 08 mov %o0, %l1
40008254: 81 c7 e0 08 ret
40008258: 91 e8 20 03 restore %g0, 3, %o0
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4000825c: e0 02 21 60 ld [ %o0 + 0x160 ], %l0
if ( api->schedpolicy == SCHED_SPORADIC )
40008260: c2 04 20 80 ld [ %l0 + 0x80 ], %g1
40008264: 80 a0 60 04 cmp %g1, 4
40008268: 32 80 00 05 bne,a 4000827c <pthread_setschedparam+0x7c>
4000826c: f2 24 20 80 st %i1, [ %l0 + 0x80 ]
(void) _Watchdog_Remove( &api->Sporadic_timer );
40008270: 40 00 0f 5f call 4000bfec <_Watchdog_Remove>
40008274: 90 04 20 a4 add %l0, 0xa4, %o0
api->schedpolicy = policy;
40008278: f2 24 20 80 st %i1, [ %l0 + 0x80 ]
api->schedparam = *param;
4000827c: 92 10 00 1a mov %i2, %o1
40008280: 90 04 20 84 add %l0, 0x84, %o0
40008284: 40 00 27 ab call 40012130 <memcpy>
40008288: 94 10 20 1c mov 0x1c, %o2
the_thread->budget_algorithm = budget_algorithm;
4000828c: c4 07 bf fc ld [ %fp + -4 ], %g2
the_thread->budget_callout = budget_callout;
switch ( api->schedpolicy ) {
40008290: c2 04 20 80 ld [ %l0 + 0x80 ], %g1
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
api->schedpolicy = policy;
api->schedparam = *param;
the_thread->budget_algorithm = budget_algorithm;
40008294: c4 24 60 7c st %g2, [ %l1 + 0x7c ]
the_thread->budget_callout = budget_callout;
40008298: c4 07 bf f8 ld [ %fp + -8 ], %g2
switch ( api->schedpolicy ) {
4000829c: 80 a0 60 00 cmp %g1, 0
400082a0: 06 80 00 1b bl 4000830c <pthread_setschedparam+0x10c> <== NEVER TAKEN
400082a4: c4 24 60 80 st %g2, [ %l1 + 0x80 ]
400082a8: 80 a0 60 02 cmp %g1, 2
400082ac: 24 80 00 07 ble,a 400082c8 <pthread_setschedparam+0xc8>
400082b0: c2 04 20 84 ld [ %l0 + 0x84 ], %g1
400082b4: 80 a0 60 04 cmp %g1, 4
400082b8: 12 80 00 15 bne 4000830c <pthread_setschedparam+0x10c> <== NEVER TAKEN
400082bc: 01 00 00 00 nop
true
);
break;
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
400082c0: 10 80 00 0d b 400082f4 <pthread_setschedparam+0xf4>
400082c4: c2 04 20 84 ld [ %l0 + 0x84 ], %g1
400082c8: 07 10 00 85 sethi %hi(0x40021400), %g3
switch ( api->schedpolicy ) {
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
400082cc: 05 10 00 88 sethi %hi(0x40022000), %g2
400082d0: d2 08 e3 68 ldub [ %g3 + 0x368 ], %o1
400082d4: c4 00 a0 68 ld [ %g2 + 0x68 ], %g2
400082d8: 92 22 40 01 sub %o1, %g1, %o1
400082dc: c4 24 60 78 st %g2, [ %l1 + 0x78 ]
the_thread->real_priority =
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
400082e0: 90 10 00 11 mov %l1, %o0
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
the_thread->real_priority =
400082e4: d2 24 60 18 st %o1, [ %l1 + 0x18 ]
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
400082e8: 40 00 08 a7 call 4000a584 <_Thread_Change_priority>
400082ec: 94 10 20 01 mov 1, %o2
the_thread,
the_thread->real_priority,
true
);
break;
400082f0: 30 80 00 07 b,a 4000830c <pthread_setschedparam+0x10c>
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
_Watchdog_Remove( &api->Sporadic_timer );
400082f4: 90 04 20 a4 add %l0, 0xa4, %o0
400082f8: 40 00 0f 3d call 4000bfec <_Watchdog_Remove>
400082fc: c2 24 20 a0 st %g1, [ %l0 + 0xa0 ]
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
40008300: 92 10 00 11 mov %l1, %o1
40008304: 7f ff ff a0 call 40008184 <_POSIX_Threads_Sporadic_budget_TSR>
40008308: 90 10 20 00 clr %o0
break;
}
_Thread_Enable_dispatch();
4000830c: 40 00 0a 0e call 4000ab44 <_Thread_Enable_dispatch>
40008310: 01 00 00 00 nop
case OBJECTS_ERROR:
break;
}
return ESRCH;
}
40008314: 81 c7 e0 08 ret
40008318: 81 e8 00 00 restore
40005a10 <pthread_testcancel>:
*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
void pthread_testcancel( void )
{
40005a10: 9d e3 bf a0 save %sp, -96, %sp
* Don't even think about deleting a resource from an ISR.
* Besides this request is supposed to be for _Thread_Executing
* and the ISR context is not a thread.
*/
if ( _ISR_Is_in_progress() )
40005a14: 03 10 00 79 sethi %hi(0x4001e400), %g1
40005a18: c2 00 62 e8 ld [ %g1 + 0x2e8 ], %g1 ! 4001e6e8 <_ISR_Nest_level>
40005a1c: 80 a0 60 00 cmp %g1, 0
40005a20: 12 80 00 17 bne 40005a7c <pthread_testcancel+0x6c> <== NEVER TAKEN
40005a24: 05 10 00 79 sethi %hi(0x4001e400), %g2
return;
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
40005a28: 03 10 00 79 sethi %hi(0x4001e400), %g1
40005a2c: c6 00 a2 50 ld [ %g2 + 0x250 ], %g3
40005a30: c2 00 63 0c ld [ %g1 + 0x30c ], %g1
40005a34: 86 00 e0 01 inc %g3
40005a38: c2 00 61 60 ld [ %g1 + 0x160 ], %g1
40005a3c: c6 20 a2 50 st %g3, [ %g2 + 0x250 ]
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
40005a40: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2
40005a44: 80 a0 a0 00 cmp %g2, 0
40005a48: 12 80 00 05 bne 40005a5c <pthread_testcancel+0x4c> <== NEVER TAKEN
40005a4c: a0 10 20 00 clr %l0
/* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */
int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate));
int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype));
void _EXFUN(pthread_testcancel, (void));
40005a50: c2 00 60 dc ld [ %g1 + 0xdc ], %g1
40005a54: 80 a0 00 01 cmp %g0, %g1
40005a58: a0 40 20 00 addx %g0, 0, %l0
thread_support->cancelation_requested )
cancel = true;
_Thread_Enable_dispatch();
40005a5c: 40 00 09 c4 call 4000816c <_Thread_Enable_dispatch>
40005a60: 01 00 00 00 nop
if ( cancel )
40005a64: 80 8c 20 ff btst 0xff, %l0
40005a68: 02 80 00 05 be 40005a7c <pthread_testcancel+0x6c>
40005a6c: 03 10 00 79 sethi %hi(0x4001e400), %g1
_POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED );
40005a70: f0 00 63 0c ld [ %g1 + 0x30c ], %i0 ! 4001e70c <_Thread_Executing>
40005a74: 40 00 18 17 call 4000bad0 <_POSIX_Thread_Exit>
40005a78: 93 e8 3f ff restore %g0, -1, %o1
40005a7c: 81 c7 e0 08 ret
40005a80: 81 e8 00 00 restore
40008468 <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)
{
40008468: 9d e3 bf a0 save %sp, -96, %sp
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
4000846c: 80 a6 20 00 cmp %i0, 0
40008470: 02 80 00 1d be 400084e4 <rtems_iterate_over_all_threads+0x7c><== NEVER TAKEN
40008474: 21 10 00 ab sethi %hi(0x4002ac00), %l0
40008478: a0 14 21 a4 or %l0, 0x1a4, %l0 ! 4002ada4 <_Objects_Information_table+0x4>
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
4000847c: a6 04 20 10 add %l0, 0x10, %l3
if ( !routine )
return;
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
if ( !_Objects_Information_table[ api_index ] )
40008480: c2 04 00 00 ld [ %l0 ], %g1
40008484: 80 a0 60 00 cmp %g1, 0
40008488: 22 80 00 14 be,a 400084d8 <rtems_iterate_over_all_threads+0x70>
4000848c: a0 04 20 04 add %l0, 4, %l0
continue;
information = _Objects_Information_table[ api_index ][ 1 ];
40008490: e4 00 60 04 ld [ %g1 + 4 ], %l2
if ( !information )
40008494: 80 a4 a0 00 cmp %l2, 0
40008498: 12 80 00 0b bne 400084c4 <rtems_iterate_over_all_threads+0x5c>
4000849c: a2 10 20 01 mov 1, %l1
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
400084a0: 10 80 00 0e b 400084d8 <rtems_iterate_over_all_threads+0x70>
400084a4: a0 04 20 04 add %l0, 4, %l0
the_thread = (Thread_Control *)information->local_table[ i ];
400084a8: c2 04 a0 1c ld [ %l2 + 0x1c ], %g1
400084ac: d0 00 40 02 ld [ %g1 + %g2 ], %o0
if ( !the_thread )
400084b0: 80 a2 20 00 cmp %o0, 0
400084b4: 02 80 00 04 be 400084c4 <rtems_iterate_over_all_threads+0x5c><== NEVER TAKEN
400084b8: a2 04 60 01 inc %l1
continue;
(*routine)(the_thread);
400084bc: 9f c6 00 00 call %i0
400084c0: 01 00 00 00 nop
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
400084c4: c2 14 a0 10 lduh [ %l2 + 0x10 ], %g1
400084c8: 80 a4 40 01 cmp %l1, %g1
400084cc: 08 bf ff f7 bleu 400084a8 <rtems_iterate_over_all_threads+0x40>
400084d0: 85 2c 60 02 sll %l1, 2, %g2
400084d4: a0 04 20 04 add %l0, 4, %l0
Objects_Information *information;
if ( !routine )
return;
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
400084d8: 80 a4 00 13 cmp %l0, %l3
400084dc: 32 bf ff ea bne,a 40008484 <rtems_iterate_over_all_threads+0x1c>
400084e0: c2 04 00 00 ld [ %l0 ], %g1
400084e4: 81 c7 e0 08 ret
400084e8: 81 e8 00 00 restore
400128c0 <rtems_partition_create>:
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
400128c0: 9d e3 bf a0 save %sp, -96, %sp
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
400128c4: a0 96 20 00 orcc %i0, 0, %l0
400128c8: 02 80 00 1c be 40012938 <rtems_partition_create+0x78>
400128cc: b0 10 20 03 mov 3, %i0
return RTEMS_INVALID_NAME;
if ( !starting_address )
400128d0: 80 a6 60 00 cmp %i1, 0
400128d4: 02 80 00 34 be 400129a4 <rtems_partition_create+0xe4>
400128d8: 80 a7 60 00 cmp %i5, 0
return RTEMS_INVALID_ADDRESS;
if ( !id )
400128dc: 02 80 00 32 be 400129a4 <rtems_partition_create+0xe4> <== NEVER TAKEN
400128e0: 80 a6 e0 00 cmp %i3, 0
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
400128e4: 02 80 00 32 be 400129ac <rtems_partition_create+0xec>
400128e8: 80 a6 a0 00 cmp %i2, 0
400128ec: 02 80 00 30 be 400129ac <rtems_partition_create+0xec>
400128f0: 80 a6 80 1b cmp %i2, %i3
400128f4: 0a 80 00 2e bcs 400129ac <rtems_partition_create+0xec>
400128f8: 80 8e e0 07 btst 7, %i3
400128fc: 12 80 00 2c bne 400129ac <rtems_partition_create+0xec>
40012900: 80 8e 60 07 btst 7, %i1
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
40012904: 12 80 00 28 bne 400129a4 <rtems_partition_create+0xe4>
40012908: 03 10 00 f5 sethi %hi(0x4003d400), %g1
4001290c: c4 00 60 a0 ld [ %g1 + 0xa0 ], %g2 ! 4003d4a0 <_Thread_Dispatch_disable_level>
40012910: 84 00 a0 01 inc %g2
40012914: c4 20 60 a0 st %g2, [ %g1 + 0xa0 ]
* 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 );
40012918: 25 10 00 f4 sethi %hi(0x4003d000), %l2
4001291c: 40 00 12 07 call 40017138 <_Objects_Allocate>
40012920: 90 14 a2 a8 or %l2, 0x2a8, %o0 ! 4003d2a8 <_Partition_Information>
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
40012924: a2 92 20 00 orcc %o0, 0, %l1
40012928: 32 80 00 06 bne,a 40012940 <rtems_partition_create+0x80>
4001292c: f4 24 60 14 st %i2, [ %l1 + 0x14 ]
_Thread_Enable_dispatch();
40012930: 40 00 15 cc call 40018060 <_Thread_Enable_dispatch>
40012934: b0 10 20 05 mov 5, %i0
return RTEMS_TOO_MANY;
40012938: 81 c7 e0 08 ret
4001293c: 81 e8 00 00 restore
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,
40012940: 90 10 00 1a mov %i2, %o0
40012944: 92 10 00 1b mov %i3, %o1
#endif
the_partition->starting_address = starting_address;
the_partition->length = length;
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
40012948: f8 24 60 1c st %i4, [ %l1 + 0x1c ]
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
4001294c: f2 24 60 10 st %i1, [ %l1 + 0x10 ]
the_partition->length = length;
the_partition->buffer_size = buffer_size;
40012950: f6 24 60 18 st %i3, [ %l1 + 0x18 ]
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
_Chain_Initialize( &the_partition->Memory, starting_address,
40012954: 40 00 64 21 call 4002b9d8 <.udiv>
40012958: c0 24 60 20 clr [ %l1 + 0x20 ]
4001295c: 92 10 00 19 mov %i1, %o1
40012960: 94 10 00 08 mov %o0, %o2
40012964: 96 10 00 1b mov %i3, %o3
40012968: b4 04 60 24 add %l1, 0x24, %i2
4001296c: 40 00 0c 73 call 40015b38 <_Chain_Initialize>
40012970: 90 10 00 1a mov %i2, %o0
40012974: c2 14 60 0a lduh [ %l1 + 0xa ], %g1
40012978: c6 04 60 08 ld [ %l1 + 8 ], %g3
4001297c: a4 14 a2 a8 or %l2, 0x2a8, %l2
40012980: c4 04 a0 1c ld [ %l2 + 0x1c ], %g2
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
40012984: e0 24 60 0c st %l0, [ %l1 + 0xc ]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40012988: 83 28 60 02 sll %g1, 2, %g1
&_Partition_Information,
&the_partition->Object,
(Objects_Name) name
);
*id = the_partition->Object.id;
4001298c: c6 27 40 00 st %g3, [ %i5 ]
40012990: e2 20 80 01 st %l1, [ %g2 + %g1 ]
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
40012994: 40 00 15 b3 call 40018060 <_Thread_Enable_dispatch>
40012998: b0 10 20 00 clr %i0
return RTEMS_SUCCESSFUL;
4001299c: 81 c7 e0 08 ret
400129a0: 81 e8 00 00 restore
400129a4: 81 c7 e0 08 ret
400129a8: 91 e8 20 09 restore %g0, 9, %o0
400129ac: b0 10 20 08 mov 8, %i0
}
400129b0: 81 c7 e0 08 ret
400129b4: 81 e8 00 00 restore
40006760 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
40006760: 9d e3 bf 98 save %sp, -104, %sp
RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Rate_monotonic_Control *)
40006764: 11 10 00 89 sethi %hi(0x40022400), %o0
40006768: 92 10 00 18 mov %i0, %o1
4000676c: 90 12 21 c8 or %o0, 0x1c8, %o0
40006770: 40 00 08 c4 call 40008a80 <_Objects_Get>
40006774: 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 ) {
40006778: c2 07 bf fc ld [ %fp + -4 ], %g1
4000677c: 80 a0 60 00 cmp %g1, 0
40006780: 12 80 00 63 bne 4000690c <rtems_rate_monotonic_period+0x1ac>
40006784: a0 10 00 08 mov %o0, %l0
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
40006788: 25 10 00 89 sethi %hi(0x40022400), %l2
4000678c: c4 02 20 40 ld [ %o0 + 0x40 ], %g2
40006790: c2 04 a3 fc ld [ %l2 + 0x3fc ], %g1
40006794: 80 a0 80 01 cmp %g2, %g1
40006798: 02 80 00 06 be 400067b0 <rtems_rate_monotonic_period+0x50>
4000679c: 80 a6 60 00 cmp %i1, 0
_Thread_Enable_dispatch();
400067a0: 40 00 0b 06 call 400093b8 <_Thread_Enable_dispatch>
400067a4: b0 10 20 17 mov 0x17, %i0
return RTEMS_NOT_OWNER_OF_RESOURCE;
400067a8: 81 c7 e0 08 ret
400067ac: 81 e8 00 00 restore
}
if ( length == RTEMS_PERIOD_STATUS ) {
400067b0: 12 80 00 0b bne 400067dc <rtems_rate_monotonic_period+0x7c>
400067b4: 01 00 00 00 nop
switch ( the_period->state ) {
400067b8: c2 02 20 38 ld [ %o0 + 0x38 ], %g1
400067bc: 80 a0 60 04 cmp %g1, 4
400067c0: 18 80 00 4f bgu 400068fc <rtems_rate_monotonic_period+0x19c><== NEVER TAKEN
400067c4: b0 10 20 00 clr %i0
400067c8: 83 28 60 02 sll %g1, 2, %g1
400067cc: 05 10 00 80 sethi %hi(0x40020000), %g2
400067d0: 84 10 a3 88 or %g2, 0x388, %g2 ! 40020388 <CSWTCH.47>
400067d4: 10 80 00 4a b 400068fc <rtems_rate_monotonic_period+0x19c>
400067d8: f0 00 80 01 ld [ %g2 + %g1 ], %i0
}
_Thread_Enable_dispatch();
return( return_value );
}
_ISR_Disable( level );
400067dc: 7f ff f0 d9 call 40002b40 <sparc_disable_interrupts>
400067e0: 01 00 00 00 nop
400067e4: a6 10 00 08 mov %o0, %l3
switch ( the_period->state ) {
400067e8: e2 04 20 38 ld [ %l0 + 0x38 ], %l1
400067ec: 80 a4 60 02 cmp %l1, 2
400067f0: 02 80 00 1a be 40006858 <rtems_rate_monotonic_period+0xf8>
400067f4: 80 a4 60 04 cmp %l1, 4
400067f8: 02 80 00 34 be 400068c8 <rtems_rate_monotonic_period+0x168>
400067fc: 80 a4 60 00 cmp %l1, 0
40006800: 12 80 00 43 bne 4000690c <rtems_rate_monotonic_period+0x1ac><== NEVER TAKEN
40006804: 01 00 00 00 nop
case RATE_MONOTONIC_INACTIVE: {
_ISR_Enable( level );
40006808: 7f ff f0 d2 call 40002b50 <sparc_enable_interrupts>
4000680c: 01 00 00 00 nop
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
40006810: 7f ff ff 50 call 40006550 <_Rate_monotonic_Initiate_statistics>
40006814: 90 10 00 10 mov %l0, %o0
the_period->state = RATE_MONOTONIC_ACTIVE;
40006818: 82 10 20 02 mov 2, %g1
4000681c: c2 24 20 38 st %g1, [ %l0 + 0x38 ]
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
40006820: 03 10 00 1a sethi %hi(0x40006800), %g1
40006824: 82 10 63 d8 or %g1, 0x3d8, %g1 ! 40006bd8 <_Rate_monotonic_Timeout>
the_watchdog->id = id;
40006828: f0 24 20 30 st %i0, [ %l0 + 0x30 ]
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4000682c: 92 04 20 10 add %l0, 0x10, %o1
40006830: 11 10 00 8a sethi %hi(0x40022800), %o0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40006834: f2 24 20 1c st %i1, [ %l0 + 0x1c ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40006838: 90 12 20 1c or %o0, 0x1c, %o0
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
4000683c: c0 24 20 18 clr [ %l0 + 0x18 ]
the_watchdog->routine = routine;
the_watchdog->id = id;
the_watchdog->user_data = user_data;
40006840: c0 24 20 34 clr [ %l0 + 0x34 ]
_Rate_monotonic_Timeout,
id,
NULL
);
the_period->next_length = length;
40006844: f2 24 20 3c st %i1, [ %l0 + 0x3c ]
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
40006848: c2 24 20 2c st %g1, [ %l0 + 0x2c ]
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4000684c: 40 00 10 13 call 4000a898 <_Watchdog_Insert>
40006850: b0 10 20 00 clr %i0
40006854: 30 80 00 2a b,a 400068fc <rtems_rate_monotonic_period+0x19c>
case RATE_MONOTONIC_ACTIVE:
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
40006858: 7f ff ff 84 call 40006668 <_Rate_monotonic_Update_statistics>
4000685c: 90 10 00 10 mov %l0, %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;
40006860: 82 10 20 01 mov 1, %g1
the_period->next_length = length;
40006864: f2 24 20 3c st %i1, [ %l0 + 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;
40006868: c2 24 20 38 st %g1, [ %l0 + 0x38 ]
the_period->next_length = length;
_ISR_Enable( level );
4000686c: 7f ff f0 b9 call 40002b50 <sparc_enable_interrupts>
40006870: 90 10 00 13 mov %l3, %o0
_Thread_Executing->Wait.id = the_period->Object.id;
40006874: c2 04 a3 fc ld [ %l2 + 0x3fc ], %g1
40006878: c4 04 20 08 ld [ %l0 + 8 ], %g2
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
4000687c: 90 10 00 01 mov %g1, %o0
the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING;
the_period->next_length = length;
_ISR_Enable( level );
_Thread_Executing->Wait.id = the_period->Object.id;
40006880: c4 20 60 20 st %g2, [ %g1 + 0x20 ]
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
40006884: 40 00 0d 38 call 40009d64 <_Thread_Set_state>
40006888: 13 00 00 10 sethi %hi(0x4000), %o1
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
4000688c: 7f ff f0 ad call 40002b40 <sparc_disable_interrupts>
40006890: 01 00 00 00 nop
local_state = the_period->state;
40006894: e6 04 20 38 ld [ %l0 + 0x38 ], %l3
the_period->state = RATE_MONOTONIC_ACTIVE;
40006898: e2 24 20 38 st %l1, [ %l0 + 0x38 ]
_ISR_Enable( level );
4000689c: 7f ff f0 ad call 40002b50 <sparc_enable_interrupts>
400068a0: 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 )
400068a4: 80 a4 e0 03 cmp %l3, 3
400068a8: 12 80 00 04 bne 400068b8 <rtems_rate_monotonic_period+0x158>
400068ac: d0 04 a3 fc ld [ %l2 + 0x3fc ], %o0
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
400068b0: 40 00 09 cb call 40008fdc <_Thread_Clear_state>
400068b4: 13 00 00 10 sethi %hi(0x4000), %o1
_Thread_Enable_dispatch();
400068b8: 40 00 0a c0 call 400093b8 <_Thread_Enable_dispatch>
400068bc: b0 10 20 00 clr %i0
return RTEMS_SUCCESSFUL;
400068c0: 81 c7 e0 08 ret
400068c4: 81 e8 00 00 restore
case RATE_MONOTONIC_EXPIRED:
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
400068c8: 7f ff ff 68 call 40006668 <_Rate_monotonic_Update_statistics>
400068cc: 90 10 00 10 mov %l0, %o0
_ISR_Enable( level );
400068d0: 7f ff f0 a0 call 40002b50 <sparc_enable_interrupts>
400068d4: 90 10 00 13 mov %l3, %o0
the_period->state = RATE_MONOTONIC_ACTIVE;
400068d8: 82 10 20 02 mov 2, %g1
400068dc: 92 04 20 10 add %l0, 0x10, %o1
400068e0: 11 10 00 8a sethi %hi(0x40022800), %o0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
400068e4: f2 24 20 1c st %i1, [ %l0 + 0x1c ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
400068e8: 90 12 20 1c or %o0, 0x1c, %o0
the_period->next_length = length;
400068ec: f2 24 20 3c st %i1, [ %l0 + 0x3c ]
*/
_Rate_monotonic_Update_statistics( the_period );
_ISR_Enable( level );
the_period->state = RATE_MONOTONIC_ACTIVE;
400068f0: c2 24 20 38 st %g1, [ %l0 + 0x38 ]
400068f4: 40 00 0f e9 call 4000a898 <_Watchdog_Insert>
400068f8: b0 10 20 06 mov 6, %i0
the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
400068fc: 40 00 0a af call 400093b8 <_Thread_Enable_dispatch>
40006900: 01 00 00 00 nop
return RTEMS_TIMEOUT;
40006904: 81 c7 e0 08 ret
40006908: 81 e8 00 00 restore
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4000690c: 81 c7 e0 08 ret
40006910: 91 e8 20 04 restore %g0, 4, %o0
40006914 <rtems_rate_monotonic_report_statistics_with_plugin>:
*/
void rtems_rate_monotonic_report_statistics_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
40006914: 9d e3 bf 30 save %sp, -208, %sp
rtems_id id;
rtems_rate_monotonic_period_statistics the_stats;
rtems_rate_monotonic_period_status the_status;
char name[5];
if ( !print )
40006918: 80 a6 60 00 cmp %i1, 0
4000691c: 02 80 00 7a be 40006b04 <rtems_rate_monotonic_report_statistics_with_plugin+0x1f0><== NEVER TAKEN
40006920: 90 10 00 18 mov %i0, %o0
return;
(*print)( context, "Period information by period\n" );
40006924: 13 10 00 80 sethi %hi(0x40020000), %o1
40006928: 9f c6 40 00 call %i1
4000692c: 92 12 63 a0 or %o1, 0x3a0, %o1 ! 400203a0 <CSWTCH.47+0x18>
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)( context, "--- CPU times are in seconds ---\n" );
40006930: 90 10 00 18 mov %i0, %o0
40006934: 13 10 00 80 sethi %hi(0x40020000), %o1
40006938: 9f c6 40 00 call %i1
4000693c: 92 12 63 c0 or %o1, 0x3c0, %o1 ! 400203c0 <CSWTCH.47+0x38>
(*print)( context, "--- Wall times are in seconds ---\n" );
40006940: 90 10 00 18 mov %i0, %o0
40006944: 13 10 00 80 sethi %hi(0x40020000), %o1
40006948: 9f c6 40 00 call %i1
4000694c: 92 12 63 e8 or %o1, 0x3e8, %o1 ! 400203e8 <CSWTCH.47+0x60>
Be sure to test the various cases.
(*print)( context,"\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
*/
(*print)( context, " ID OWNER COUNT MISSED "
40006950: 90 10 00 18 mov %i0, %o0
40006954: 13 10 00 81 sethi %hi(0x40020400), %o1
40006958: 9f c6 40 00 call %i1
4000695c: 92 12 60 10 or %o1, 0x10, %o1 ! 40020410 <CSWTCH.47+0x88>
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
" "
#endif
" WALL TIME\n"
);
(*print)( context, " "
40006960: 90 10 00 18 mov %i0, %o0
40006964: 13 10 00 81 sethi %hi(0x40020400), %o1
40006968: 9f c6 40 00 call %i1
4000696c: 92 12 60 60 or %o1, 0x60, %o1 ! 40020460 <CSWTCH.47+0xd8>
/*
* 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 ;
40006970: 03 10 00 89 sethi %hi(0x40022400), %g1
rtems_object_get_name( the_status.owner, sizeof(name), name );
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
40006974: 2d 10 00 81 sethi %hi(0x40020400), %l6
/*
* 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 ;
40006978: 82 10 61 c8 or %g1, 0x1c8, %g1
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,
4000697c: 2b 10 00 81 sethi %hi(0x40020400), %l5
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,
40006980: 29 10 00 81 sethi %hi(0x40020400), %l4
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
40006984: 27 10 00 81 sethi %hi(0x40020400), %l3
* 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++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
40006988: ba 07 bf a0 add %fp, -96, %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 ;
4000698c: ae 10 00 01 mov %g1, %l7
rtems_object_get_name( the_status.owner, sizeof(name), name );
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
40006990: ac 15 a0 b0 or %l6, 0xb0, %l6
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,
40006994: aa 15 60 d0 or %l5, 0xd0, %l5
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,
40006998: a8 15 20 f0 or %l4, 0xf0, %l4
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
4000699c: a6 14 e0 c8 or %l3, 0xc8, %l3
/*
* 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 ;
400069a0: e0 00 60 08 ld [ %g1 + 8 ], %l0
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
if ( status != RTEMS_SUCCESSFUL )
continue;
/* If the above passed, so should this but check it anyway */
status = rtems_rate_monotonic_get_status( id, &the_status );
400069a4: b8 07 bf d8 add %fp, -40, %i4
#if defined(RTEMS_DEBUG)
if ( status != RTEMS_SUCCESSFUL )
continue;
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
400069a8: a4 07 bf f8 add %fp, -8, %l2
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 );
400069ac: b4 07 bf b8 add %fp, -72, %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 ;
400069b0: 10 80 00 51 b 40006af4 <rtems_rate_monotonic_report_statistics_with_plugin+0x1e0>
400069b4: a2 07 bf f0 add %fp, -16, %l1
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
400069b8: 40 00 19 fd call 4000d1ac <rtems_rate_monotonic_get_statistics>
400069bc: 92 10 00 1d mov %i5, %o1
if ( status != RTEMS_SUCCESSFUL )
400069c0: 80 a2 20 00 cmp %o0, 0
400069c4: 32 80 00 4c bne,a 40006af4 <rtems_rate_monotonic_report_statistics_with_plugin+0x1e0>
400069c8: a0 04 20 01 inc %l0
continue;
/* If the above passed, so should this but check it anyway */
status = rtems_rate_monotonic_get_status( id, &the_status );
400069cc: 92 10 00 1c mov %i4, %o1
400069d0: 40 00 1a 24 call 4000d260 <rtems_rate_monotonic_get_status>
400069d4: 90 10 00 10 mov %l0, %o0
#if defined(RTEMS_DEBUG)
if ( status != RTEMS_SUCCESSFUL )
continue;
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
400069d8: d0 07 bf d8 ld [ %fp + -40 ], %o0
400069dc: 94 10 00 12 mov %l2, %o2
400069e0: 40 00 00 ae call 40006c98 <rtems_object_get_name>
400069e4: 92 10 20 05 mov 5, %o1
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
400069e8: d8 1f bf a0 ldd [ %fp + -96 ], %o4
400069ec: 92 10 00 16 mov %l6, %o1
400069f0: 94 10 00 10 mov %l0, %o2
400069f4: 90 10 00 18 mov %i0, %o0
400069f8: 9f c6 40 00 call %i1
400069fc: 96 10 00 12 mov %l2, %o3
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
40006a00: c2 07 bf a0 ld [ %fp + -96 ], %g1
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 );
40006a04: 94 10 00 11 mov %l1, %o2
40006a08: 90 10 00 1a mov %i2, %o0
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
40006a0c: 80 a0 60 00 cmp %g1, 0
40006a10: 12 80 00 06 bne 40006a28 <rtems_rate_monotonic_report_statistics_with_plugin+0x114>
40006a14: 92 10 00 13 mov %l3, %o1
(*print)( context, "\n" );
40006a18: 9f c6 40 00 call %i1
40006a1c: 90 10 00 18 mov %i0, %o0
continue;
40006a20: 10 80 00 35 b 40006af4 <rtems_rate_monotonic_report_statistics_with_plugin+0x1e0>
40006a24: a0 04 20 01 inc %l0
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 );
40006a28: 40 00 0e 72 call 4000a3f0 <_Timespec_Divide_by_integer>
40006a2c: 92 10 00 01 mov %g1, %o1
(*print)( context,
40006a30: d0 07 bf ac ld [ %fp + -84 ], %o0
40006a34: 40 00 57 a3 call 4001c8c0 <.div>
40006a38: 92 10 23 e8 mov 0x3e8, %o1
40006a3c: 96 10 00 08 mov %o0, %o3
40006a40: d0 07 bf b4 ld [ %fp + -76 ], %o0
40006a44: d6 27 bf 9c st %o3, [ %fp + -100 ]
40006a48: 40 00 57 9e call 4001c8c0 <.div>
40006a4c: 92 10 23 e8 mov 0x3e8, %o1
40006a50: c2 07 bf f0 ld [ %fp + -16 ], %g1
40006a54: b6 10 00 08 mov %o0, %i3
40006a58: d0 07 bf f4 ld [ %fp + -12 ], %o0
40006a5c: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
40006a60: 40 00 57 98 call 4001c8c0 <.div>
40006a64: 92 10 23 e8 mov 0x3e8, %o1
40006a68: d8 07 bf b0 ld [ %fp + -80 ], %o4
40006a6c: d6 07 bf 9c ld [ %fp + -100 ], %o3
40006a70: d4 07 bf a8 ld [ %fp + -88 ], %o2
40006a74: 9a 10 00 1b mov %i3, %o5
40006a78: d0 23 a0 60 st %o0, [ %sp + 0x60 ]
40006a7c: 92 10 00 15 mov %l5, %o1
40006a80: 9f c6 40 00 call %i1
40006a84: 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);
40006a88: d2 07 bf a0 ld [ %fp + -96 ], %o1
40006a8c: 94 10 00 11 mov %l1, %o2
40006a90: 40 00 0e 58 call 4000a3f0 <_Timespec_Divide_by_integer>
40006a94: 90 07 bf d0 add %fp, -48, %o0
(*print)( context,
40006a98: d0 07 bf c4 ld [ %fp + -60 ], %o0
40006a9c: 40 00 57 89 call 4001c8c0 <.div>
40006aa0: 92 10 23 e8 mov 0x3e8, %o1
40006aa4: 96 10 00 08 mov %o0, %o3
40006aa8: d0 07 bf cc ld [ %fp + -52 ], %o0
40006aac: d6 27 bf 9c st %o3, [ %fp + -100 ]
40006ab0: 40 00 57 84 call 4001c8c0 <.div>
40006ab4: 92 10 23 e8 mov 0x3e8, %o1
40006ab8: c2 07 bf f0 ld [ %fp + -16 ], %g1
40006abc: b6 10 00 08 mov %o0, %i3
40006ac0: d0 07 bf f4 ld [ %fp + -12 ], %o0
40006ac4: 92 10 23 e8 mov 0x3e8, %o1
40006ac8: 40 00 57 7e call 4001c8c0 <.div>
40006acc: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
40006ad0: d4 07 bf c0 ld [ %fp + -64 ], %o2
40006ad4: d6 07 bf 9c ld [ %fp + -100 ], %o3
40006ad8: d8 07 bf c8 ld [ %fp + -56 ], %o4
40006adc: d0 23 a0 60 st %o0, [ %sp + 0x60 ]
40006ae0: 9a 10 00 1b mov %i3, %o5
40006ae4: 90 10 00 18 mov %i0, %o0
40006ae8: 9f c6 40 00 call %i1
40006aec: 92 10 00 14 mov %l4, %o1
* 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++ ) {
40006af0: a0 04 20 01 inc %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 ;
40006af4: c2 05 e0 0c ld [ %l7 + 0xc ], %g1
40006af8: 80 a4 00 01 cmp %l0, %g1
40006afc: 08 bf ff af bleu 400069b8 <rtems_rate_monotonic_report_statistics_with_plugin+0xa4>
40006b00: 90 10 00 10 mov %l0, %o0
40006b04: 81 c7 e0 08 ret
40006b08: 81 e8 00 00 restore
40013ea8 <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
40013ea8: 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 )
40013eac: 82 10 20 0a mov 0xa, %g1
40013eb0: 80 a6 60 00 cmp %i1, 0
40013eb4: 02 80 00 2a be 40013f5c <rtems_signal_send+0xb4>
40013eb8: 90 10 00 18 mov %i0, %o0
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
40013ebc: 40 00 10 8c call 400180ec <_Thread_Get>
40013ec0: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
40013ec4: c4 07 bf fc ld [ %fp + -4 ], %g2
ASR_Information *asr;
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
40013ec8: a0 10 00 08 mov %o0, %l0
switch ( location ) {
40013ecc: 80 a0 a0 00 cmp %g2, 0
40013ed0: 12 80 00 23 bne 40013f5c <rtems_signal_send+0xb4>
40013ed4: 82 10 20 04 mov 4, %g1
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
40013ed8: d2 02 21 5c ld [ %o0 + 0x15c ], %o1
asr = &api->Signal;
40013edc: c2 02 60 0c ld [ %o1 + 0xc ], %g1
40013ee0: 80 a0 60 00 cmp %g1, 0
40013ee4: 02 80 00 1b be 40013f50 <rtems_signal_send+0xa8>
40013ee8: 01 00 00 00 nop
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
if ( asr->is_enabled ) {
40013eec: c2 0a 60 08 ldub [ %o1 + 8 ], %g1
40013ef0: 80 a0 60 00 cmp %g1, 0
40013ef4: 02 80 00 11 be 40013f38 <rtems_signal_send+0x90>
40013ef8: 90 10 00 19 mov %i1, %o0
_ASR_Post_signals( signal_set, &asr->signals_posted );
40013efc: 7f ff ff e2 call 40013e84 <_ASR_Post_signals>
40013f00: 92 02 60 14 add %o1, 0x14, %o1
the_thread->do_post_task_switch_extension = true;
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
40013f04: 03 10 00 f5 sethi %hi(0x4003d400), %g1
40013f08: c4 00 61 38 ld [ %g1 + 0x138 ], %g2 ! 4003d538 <_ISR_Nest_level>
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
if ( asr->is_enabled ) {
_ASR_Post_signals( signal_set, &asr->signals_posted );
the_thread->do_post_task_switch_extension = true;
40013f0c: 82 10 20 01 mov 1, %g1
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
40013f10: 80 a0 a0 00 cmp %g2, 0
40013f14: 02 80 00 0b be 40013f40 <rtems_signal_send+0x98>
40013f18: c2 2c 20 74 stb %g1, [ %l0 + 0x74 ]
40013f1c: 05 10 00 f5 sethi %hi(0x4003d400), %g2
40013f20: c4 00 a1 5c ld [ %g2 + 0x15c ], %g2 ! 4003d55c <_Thread_Executing>
40013f24: 80 a4 00 02 cmp %l0, %g2
40013f28: 12 80 00 06 bne 40013f40 <rtems_signal_send+0x98> <== NEVER TAKEN
40013f2c: 05 10 00 f5 sethi %hi(0x4003d400), %g2
_ISR_Signals_to_thread_executing = true;
40013f30: 10 80 00 04 b 40013f40 <rtems_signal_send+0x98>
40013f34: c2 28 a1 f8 stb %g1, [ %g2 + 0x1f8 ] ! 4003d5f8 <_ISR_Signals_to_thread_executing>
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
40013f38: 7f ff ff d3 call 40013e84 <_ASR_Post_signals>
40013f3c: 92 02 60 18 add %o1, 0x18, %o1
}
_Thread_Enable_dispatch();
40013f40: 40 00 10 48 call 40018060 <_Thread_Enable_dispatch>
40013f44: 01 00 00 00 nop
return RTEMS_SUCCESSFUL;
40013f48: 10 80 00 05 b 40013f5c <rtems_signal_send+0xb4>
40013f4c: 82 10 20 00 clr %g1 ! 0 <PROM_START>
}
_Thread_Enable_dispatch();
40013f50: 40 00 10 44 call 40018060 <_Thread_Enable_dispatch>
40013f54: 01 00 00 00 nop
40013f58: 82 10 20 0b mov 0xb, %g1 ! b <PROM_START+0xb>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
40013f5c: 81 c7 e0 08 ret
40013f60: 91 e8 00 01 restore %g0, %g1, %o0
4000d464 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
4000d464: 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 )
4000d468: 80 a6 a0 00 cmp %i2, 0
4000d46c: 02 80 00 54 be 4000d5bc <rtems_task_mode+0x158>
4000d470: 82 10 20 09 mov 9, %g1
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
4000d474: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000d478: e0 00 61 9c ld [ %g1 + 0x19c ], %l0 ! 4001c99c <_Thread_Executing>
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
4000d47c: c4 0c 20 75 ldub [ %l0 + 0x75 ], %g2
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
4000d480: c2 04 20 7c ld [ %l0 + 0x7c ], %g1
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
4000d484: 80 a0 00 02 cmp %g0, %g2
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
4000d488: e2 04 21 5c ld [ %l0 + 0x15c ], %l1
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
4000d48c: a4 60 3f ff subx %g0, -1, %l2
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
4000d490: 80 a0 60 00 cmp %g1, 0
4000d494: 02 80 00 03 be 4000d4a0 <rtems_task_mode+0x3c>
4000d498: a5 2c a0 08 sll %l2, 8, %l2
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
4000d49c: a4 14 a2 00 or %l2, 0x200, %l2
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
4000d4a0: c2 0c 60 08 ldub [ %l1 + 8 ], %g1
4000d4a4: 80 a0 00 01 cmp %g0, %g1
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
old_mode |= _ISR_Get_level();
4000d4a8: 7f ff ee d1 call 40008fec <_CPU_ISR_Get_level>
4000d4ac: a6 60 3f ff subx %g0, -1, %l3
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
4000d4b0: a7 2c e0 0a sll %l3, 0xa, %l3
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;
4000d4b4: a6 14 c0 08 or %l3, %o0, %l3
old_mode |= _ISR_Get_level();
*previous_mode_set = old_mode;
4000d4b8: a4 14 c0 12 or %l3, %l2, %l2
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
4000d4bc: 80 8e 61 00 btst 0x100, %i1
4000d4c0: 02 80 00 06 be 4000d4d8 <rtems_task_mode+0x74>
4000d4c4: e4 26 80 00 st %l2, [ %i2 ]
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
4000d4c8: 83 36 20 08 srl %i0, 8, %g1
4000d4cc: 82 18 60 01 xor %g1, 1, %g1
4000d4d0: 82 08 60 01 and %g1, 1, %g1
4000d4d4: c2 2c 20 75 stb %g1, [ %l0 + 0x75 ]
if ( mask & RTEMS_TIMESLICE_MASK ) {
4000d4d8: 80 8e 62 00 btst 0x200, %i1
4000d4dc: 02 80 00 0b be 4000d508 <rtems_task_mode+0xa4>
4000d4e0: 80 8e 60 0f btst 0xf, %i1
if ( _Modes_Is_timeslice(mode_set) ) {
4000d4e4: 80 8e 22 00 btst 0x200, %i0
4000d4e8: 22 80 00 07 be,a 4000d504 <rtems_task_mode+0xa0>
4000d4ec: c0 24 20 7c clr [ %l0 + 0x7c ]
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
4000d4f0: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000d4f4: c2 00 60 38 ld [ %g1 + 0x38 ], %g1 ! 4001c838 <_Thread_Ticks_per_timeslice>
4000d4f8: c2 24 20 78 st %g1, [ %l0 + 0x78 ]
if ( mask & RTEMS_PREEMPT_MASK )
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
4000d4fc: 82 10 20 01 mov 1, %g1
4000d500: c2 24 20 7c st %g1, [ %l0 + 0x7c ]
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
4000d504: 80 8e 60 0f btst 0xf, %i1
4000d508: 02 80 00 06 be 4000d520 <rtems_task_mode+0xbc>
4000d50c: 80 8e 64 00 btst 0x400, %i1
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
4000d510: 90 0e 20 0f and %i0, 0xf, %o0
4000d514: 7f ff d1 e5 call 40001ca8 <sparc_enable_interrupts>
4000d518: 91 2a 20 08 sll %o0, 8, %o0
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
4000d51c: 80 8e 64 00 btst 0x400, %i1
4000d520: 22 80 00 18 be,a 4000d580 <rtems_task_mode+0x11c>
4000d524: a0 10 20 00 clr %l0
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
4000d528: c2 0c 60 08 ldub [ %l1 + 8 ], %g1
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
4000d52c: b1 36 20 0a srl %i0, 0xa, %i0
4000d530: b0 1e 20 01 xor %i0, 1, %i0
4000d534: b0 0e 20 01 and %i0, 1, %i0
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
4000d538: 80 a6 00 01 cmp %i0, %g1
4000d53c: 22 80 00 11 be,a 4000d580 <rtems_task_mode+0x11c>
4000d540: a0 10 20 00 clr %l0
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
4000d544: 7f ff d1 d5 call 40001c98 <sparc_disable_interrupts>
4000d548: f0 2c 60 08 stb %i0, [ %l1 + 8 ]
_signals = information->signals_pending;
4000d54c: c4 04 60 18 ld [ %l1 + 0x18 ], %g2
information->signals_pending = information->signals_posted;
4000d550: c2 04 60 14 ld [ %l1 + 0x14 ], %g1
information->signals_posted = _signals;
4000d554: c4 24 60 14 st %g2, [ %l1 + 0x14 ]
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
information->signals_pending = information->signals_posted;
4000d558: c2 24 60 18 st %g1, [ %l1 + 0x18 ]
information->signals_posted = _signals;
_ISR_Enable( _level );
4000d55c: 7f ff d1 d3 call 40001ca8 <sparc_enable_interrupts>
4000d560: 01 00 00 00 nop
4000d564: c2 04 60 14 ld [ %l1 + 0x14 ], %g1
4000d568: 80 a0 60 00 cmp %g1, 0
4000d56c: 22 80 00 05 be,a 4000d580 <rtems_task_mode+0x11c>
4000d570: a0 10 20 00 clr %l0
if ( is_asr_enabled != asr->is_enabled ) {
asr->is_enabled = is_asr_enabled;
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
needs_asr_dispatching = true;
executing->do_post_task_switch_extension = true;
4000d574: 82 10 20 01 mov 1, %g1
4000d578: c2 2c 20 74 stb %g1, [ %l0 + 0x74 ]
4000d57c: a0 10 20 01 mov 1, %l0
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) )
4000d580: 03 10 00 72 sethi %hi(0x4001c800), %g1
4000d584: c2 00 62 80 ld [ %g1 + 0x280 ], %g1 ! 4001ca80 <_System_state_Current>
4000d588: 80 a0 60 03 cmp %g1, 3
4000d58c: 12 80 00 0c bne 4000d5bc <rtems_task_mode+0x158> <== NEVER TAKEN
4000d590: 82 10 20 00 clr %g1
if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
4000d594: 40 00 00 bc call 4000d884 <_Thread_Evaluate_mode>
4000d598: 01 00 00 00 nop
4000d59c: 80 8a 20 ff btst 0xff, %o0
4000d5a0: 12 80 00 04 bne 4000d5b0 <rtems_task_mode+0x14c>
4000d5a4: 80 8c 20 ff btst 0xff, %l0
4000d5a8: 02 80 00 05 be 4000d5bc <rtems_task_mode+0x158>
4000d5ac: 82 10 20 00 clr %g1
_Thread_Dispatch();
4000d5b0: 7f ff e7 f5 call 40007584 <_Thread_Dispatch>
4000d5b4: 01 00 00 00 nop
4000d5b8: 82 10 20 00 clr %g1 ! 0 <PROM_START>
return RTEMS_SUCCESSFUL;
}
4000d5bc: 81 c7 e0 08 ret
4000d5c0: 91 e8 00 01 restore %g0, %g1, %o0
4000aac0 <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
4000aac0: 9d e3 bf 98 save %sp, -104, %sp
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
4000aac4: 80 a6 60 00 cmp %i1, 0
4000aac8: 02 80 00 07 be 4000aae4 <rtems_task_set_priority+0x24>
4000aacc: 90 10 00 18 mov %i0, %o0
4000aad0: 03 10 00 8a sethi %hi(0x40022800), %g1
4000aad4: c2 08 61 f4 ldub [ %g1 + 0x1f4 ], %g1 ! 400229f4 <rtems_maximum_priority>
4000aad8: 80 a6 40 01 cmp %i1, %g1
4000aadc: 18 80 00 1c bgu 4000ab4c <rtems_task_set_priority+0x8c>
4000aae0: b0 10 20 13 mov 0x13, %i0
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
4000aae4: 80 a6 a0 00 cmp %i2, 0
4000aae8: 02 80 00 19 be 4000ab4c <rtems_task_set_priority+0x8c>
4000aaec: b0 10 20 09 mov 9, %i0
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
4000aaf0: 40 00 08 3e call 4000cbe8 <_Thread_Get>
4000aaf4: 92 07 bf fc add %fp, -4, %o1
switch ( location ) {
4000aaf8: c2 07 bf fc ld [ %fp + -4 ], %g1
4000aafc: 80 a0 60 00 cmp %g1, 0
4000ab00: 12 80 00 13 bne 4000ab4c <rtems_task_set_priority+0x8c>
4000ab04: b0 10 20 04 mov 4, %i0
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
4000ab08: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
4000ab0c: 80 a6 60 00 cmp %i1, 0
4000ab10: 02 80 00 0d be 4000ab44 <rtems_task_set_priority+0x84>
4000ab14: c2 26 80 00 st %g1, [ %i2 ]
the_thread->real_priority = new_priority;
if ( the_thread->resource_count == 0 ||
4000ab18: c2 02 20 1c ld [ %o0 + 0x1c ], %g1
4000ab1c: 80 a0 60 00 cmp %g1, 0
4000ab20: 02 80 00 06 be 4000ab38 <rtems_task_set_priority+0x78>
4000ab24: f2 22 20 18 st %i1, [ %o0 + 0x18 ]
the_thread->current_priority > new_priority )
4000ab28: c2 02 20 14 ld [ %o0 + 0x14 ], %g1
4000ab2c: 80 a0 40 19 cmp %g1, %i1
4000ab30: 08 80 00 05 bleu 4000ab44 <rtems_task_set_priority+0x84> <== ALWAYS TAKEN
4000ab34: 01 00 00 00 nop
_Thread_Change_priority( the_thread, new_priority, false );
4000ab38: 92 10 00 19 mov %i1, %o1
4000ab3c: 40 00 06 98 call 4000c59c <_Thread_Change_priority>
4000ab40: 94 10 20 00 clr %o2
}
_Thread_Enable_dispatch();
4000ab44: 40 00 08 06 call 4000cb5c <_Thread_Enable_dispatch>
4000ab48: b0 10 20 00 clr %i0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4000ab4c: 81 c7 e0 08 ret
4000ab50: 81 e8 00 00 restore
40014860 <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
40014860: 9d e3 bf 98 save %sp, -104, %sp
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
40014864: 11 10 00 f7 sethi %hi(0x4003dc00), %o0
40014868: 92 10 00 18 mov %i0, %o1
4001486c: 90 12 22 20 or %o0, 0x220, %o0
40014870: 40 00 0b 83 call 4001767c <_Objects_Get>
40014874: 94 07 bf fc add %fp, -4, %o2
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
40014878: c2 07 bf fc ld [ %fp + -4 ], %g1
4001487c: 80 a0 60 00 cmp %g1, 0
40014880: 12 80 00 0a bne 400148a8 <rtems_timer_cancel+0x48>
40014884: b0 10 20 04 mov 4, %i0
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
40014888: c2 02 20 38 ld [ %o0 + 0x38 ], %g1
4001488c: 80 a0 60 04 cmp %g1, 4
40014890: 02 80 00 04 be 400148a0 <rtems_timer_cancel+0x40> <== NEVER TAKEN
40014894: 01 00 00 00 nop
(void) _Watchdog_Remove( &the_timer->Ticker );
40014898: 40 00 14 03 call 400198a4 <_Watchdog_Remove>
4001489c: 90 02 20 10 add %o0, 0x10, %o0
_Thread_Enable_dispatch();
400148a0: 40 00 0d f0 call 40018060 <_Thread_Enable_dispatch>
400148a4: b0 10 20 00 clr %i0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
400148a8: 81 c7 e0 08 ret
400148ac: 81 e8 00 00 restore
40014d50 <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
40014d50: 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;
40014d54: 03 10 00 f7 sethi %hi(0x4003dc00), %g1
40014d58: e0 00 62 60 ld [ %g1 + 0x260 ], %l0 ! 4003de60 <_Timer_server>
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
40014d5c: a2 10 00 18 mov %i0, %l1
Timer_Control *the_timer;
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
40014d60: 80 a4 20 00 cmp %l0, 0
40014d64: 02 80 00 32 be 40014e2c <rtems_timer_server_fire_when+0xdc>
40014d68: b0 10 20 0e mov 0xe, %i0
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
40014d6c: 03 10 00 f5 sethi %hi(0x4003d400), %g1
40014d70: c2 08 60 b4 ldub [ %g1 + 0xb4 ], %g1 ! 4003d4b4 <_TOD_Is_set>
40014d74: 80 a0 60 00 cmp %g1, 0
40014d78: 02 80 00 2d be 40014e2c <rtems_timer_server_fire_when+0xdc><== NEVER TAKEN
40014d7c: b0 10 20 0b mov 0xb, %i0
return RTEMS_NOT_DEFINED;
if ( !routine )
40014d80: 80 a6 a0 00 cmp %i2, 0
40014d84: 02 80 00 2a be 40014e2c <rtems_timer_server_fire_when+0xdc>
40014d88: b0 10 20 09 mov 9, %i0
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
40014d8c: 7f ff f4 0d call 40011dc0 <_TOD_Validate>
40014d90: 90 10 00 19 mov %i1, %o0
40014d94: 80 8a 20 ff btst 0xff, %o0
40014d98: 22 80 00 25 be,a 40014e2c <rtems_timer_server_fire_when+0xdc>
40014d9c: b0 10 20 14 mov 0x14, %i0
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
40014da0: 7f ff f3 d4 call 40011cf0 <_TOD_To_seconds>
40014da4: 90 10 00 19 mov %i1, %o0
if ( seconds <= _TOD_Seconds_since_epoch() )
40014da8: 27 10 00 f5 sethi %hi(0x4003d400), %l3
40014dac: c2 04 e1 30 ld [ %l3 + 0x130 ], %g1 ! 4003d530 <_TOD_Now>
40014db0: 80 a2 00 01 cmp %o0, %g1
40014db4: 08 80 00 20 bleu 40014e34 <rtems_timer_server_fire_when+0xe4>
40014db8: a4 10 00 08 mov %o0, %l2
40014dbc: 11 10 00 f7 sethi %hi(0x4003dc00), %o0
40014dc0: 92 10 00 11 mov %l1, %o1
40014dc4: 90 12 22 20 or %o0, 0x220, %o0
40014dc8: 40 00 0a 2d call 4001767c <_Objects_Get>
40014dcc: 94 07 bf fc add %fp, -4, %o2
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
40014dd0: c2 07 bf fc ld [ %fp + -4 ], %g1
40014dd4: b2 10 00 08 mov %o0, %i1
40014dd8: 80 a0 60 00 cmp %g1, 0
40014ddc: 12 80 00 14 bne 40014e2c <rtems_timer_server_fire_when+0xdc>
40014de0: b0 10 20 04 mov 4, %i0
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
40014de4: 40 00 12 b0 call 400198a4 <_Watchdog_Remove>
40014de8: 90 02 20 10 add %o0, 0x10, %o0
the_watchdog->routine = routine;
the_watchdog->id = id;
40014dec: e2 26 60 30 st %l1, [ %i1 + 0x30 ]
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();
40014df0: c4 04 e1 30 ld [ %l3 + 0x130 ], %g2
(*timer_server->schedule_operation)( timer_server, the_timer );
40014df4: c2 04 20 04 ld [ %l0 + 4 ], %g1
40014df8: 90 10 00 10 mov %l0, %o0
40014dfc: 92 10 00 19 mov %i1, %o1
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
40014e00: a4 24 80 02 sub %l2, %g2, %l2
the_timer = _Timer_Get( id, &location );
switch ( location ) {
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
40014e04: 84 10 20 03 mov 3, %g2
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
40014e08: f4 26 60 2c st %i2, [ %i1 + 0x2c ]
40014e0c: c4 26 60 38 st %g2, [ %i1 + 0x38 ]
the_watchdog->id = id;
the_watchdog->user_data = user_data;
40014e10: f6 26 60 34 st %i3, [ %i1 + 0x34 ]
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
40014e14: e4 26 60 1c st %l2, [ %i1 + 0x1c ]
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
40014e18: c0 26 60 18 clr [ %i1 + 0x18 ]
(*timer_server->schedule_operation)( timer_server, the_timer );
40014e1c: 9f c0 40 00 call %g1
40014e20: b0 10 20 00 clr %i0
_Thread_Enable_dispatch();
40014e24: 40 00 0c 8f call 40018060 <_Thread_Enable_dispatch>
40014e28: 01 00 00 00 nop
return RTEMS_SUCCESSFUL;
40014e2c: 81 c7 e0 08 ret
40014e30: 81 e8 00 00 restore
40014e34: b0 10 20 14 mov 0x14, %i0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
40014e38: 81 c7 e0 08 ret
40014e3c: 81 e8 00 00 restore
40005e14 <sched_get_priority_max>:
#include <rtems/posix/priority.h>
int sched_get_priority_max(
int policy
)
{
40005e14: 9d e3 bf a0 save %sp, -96, %sp
switch ( policy ) {
40005e18: 80 a6 20 04 cmp %i0, 4
40005e1c: 18 80 00 06 bgu 40005e34 <sched_get_priority_max+0x20>
40005e20: 82 10 20 01 mov 1, %g1
40005e24: b1 28 40 18 sll %g1, %i0, %i0
40005e28: 80 8e 20 17 btst 0x17, %i0
40005e2c: 12 80 00 08 bne 40005e4c <sched_get_priority_max+0x38> <== ALWAYS TAKEN
40005e30: 03 10 00 74 sethi %hi(0x4001d000), %g1
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
40005e34: 40 00 25 4b call 4000f360 <__errno>
40005e38: b0 10 3f ff mov -1, %i0
40005e3c: 82 10 20 16 mov 0x16, %g1
40005e40: c2 22 00 00 st %g1, [ %o0 ]
40005e44: 81 c7 e0 08 ret
40005e48: 81 e8 00 00 restore
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
40005e4c: f0 08 62 f8 ldub [ %g1 + 0x2f8 ], %i0
}
40005e50: 81 c7 e0 08 ret
40005e54: 91 ee 3f ff restore %i0, -1, %o0
40005e58 <sched_get_priority_min>:
#include <rtems/posix/priority.h>
int sched_get_priority_min(
int policy
)
{
40005e58: 9d e3 bf a0 save %sp, -96, %sp
switch ( policy ) {
40005e5c: 80 a6 20 04 cmp %i0, 4
40005e60: 18 80 00 06 bgu 40005e78 <sched_get_priority_min+0x20>
40005e64: 82 10 20 01 mov 1, %g1
40005e68: b1 28 40 18 sll %g1, %i0, %i0
40005e6c: 80 8e 20 17 btst 0x17, %i0
40005e70: 12 80 00 06 bne 40005e88 <sched_get_priority_min+0x30> <== ALWAYS TAKEN
40005e74: b0 10 20 01 mov 1, %i0
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
40005e78: 40 00 25 3a call 4000f360 <__errno>
40005e7c: b0 10 3f ff mov -1, %i0
40005e80: 82 10 20 16 mov 0x16, %g1
40005e84: c2 22 00 00 st %g1, [ %o0 ]
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
}
40005e88: 81 c7 e0 08 ret
40005e8c: 81 e8 00 00 restore
40005e90 <sched_rr_get_interval>:
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
)
{
40005e90: 9d e3 bf a0 save %sp, -96, %sp
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid && pid != getpid() )
40005e94: 80 a6 20 00 cmp %i0, 0
40005e98: 02 80 00 0b be 40005ec4 <sched_rr_get_interval+0x34> <== NEVER TAKEN
40005e9c: 80 a6 60 00 cmp %i1, 0
40005ea0: 7f ff f2 d5 call 400029f4 <getpid>
40005ea4: 01 00 00 00 nop
40005ea8: 80 a6 00 08 cmp %i0, %o0
40005eac: 02 80 00 06 be 40005ec4 <sched_rr_get_interval+0x34>
40005eb0: 80 a6 60 00 cmp %i1, 0
rtems_set_errno_and_return_minus_one( ESRCH );
40005eb4: 40 00 25 2b call 4000f360 <__errno>
40005eb8: 01 00 00 00 nop
40005ebc: 10 80 00 07 b 40005ed8 <sched_rr_get_interval+0x48>
40005ec0: 82 10 20 03 mov 3, %g1 ! 3 <PROM_START+0x3>
if ( !interval )
40005ec4: 12 80 00 08 bne 40005ee4 <sched_rr_get_interval+0x54>
40005ec8: 03 10 00 76 sethi %hi(0x4001d800), %g1
rtems_set_errno_and_return_minus_one( EINVAL );
40005ecc: 40 00 25 25 call 4000f360 <__errno>
40005ed0: 01 00 00 00 nop
40005ed4: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
40005ed8: c2 22 00 00 st %g1, [ %o0 ]
40005edc: 81 c7 e0 08 ret
40005ee0: 91 e8 3f ff restore %g0, -1, %o0
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
40005ee4: d0 00 63 88 ld [ %g1 + 0x388 ], %o0
40005ee8: 92 10 00 19 mov %i1, %o1
40005eec: 40 00 0d cb call 40009618 <_Timespec_From_ticks>
40005ef0: b0 10 20 00 clr %i0
return 0;
}
40005ef4: 81 c7 e0 08 ret
40005ef8: 81 e8 00 00 restore
400087ac <sem_open>:
int oflag,
...
/* mode_t mode, */
/* unsigned int value */
)
{
400087ac: 9d e3 bf 90 save %sp, -112, %sp
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
400087b0: 03 10 00 8b sethi %hi(0x40022c00), %g1
400087b4: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ! 40022c10 <_Thread_Dispatch_disable_level>
Objects_Locations location;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
va_start(arg, oflag);
400087b8: f4 27 a0 4c st %i2, [ %fp + 0x4c ]
400087bc: 84 00 a0 01 inc %g2
400087c0: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
400087c4: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
400087c8: fa 27 a0 58 st %i5, [ %fp + 0x58 ]
400087cc: c4 20 60 10 st %g2, [ %g1 + 0x10 ]
POSIX_Semaphore_Control *the_semaphore;
Objects_Locations location;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
400087d0: a2 8e 62 00 andcc %i1, 0x200, %l1
400087d4: 02 80 00 05 be 400087e8 <sem_open+0x3c>
400087d8: a0 10 20 00 clr %l0
va_start(arg, oflag);
mode = (mode_t) va_arg( arg, unsigned int );
value = va_arg( arg, unsigned int );
400087dc: e0 07 a0 50 ld [ %fp + 0x50 ], %l0
400087e0: 82 07 a0 54 add %fp, 0x54, %g1
400087e4: c2 27 bf fc st %g1, [ %fp + -4 ]
va_end(arg);
}
status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
400087e8: 90 10 00 18 mov %i0, %o0
400087ec: 40 00 19 da call 4000ef54 <_POSIX_Semaphore_Name_to_id>
400087f0: 92 07 bf f8 add %fp, -8, %o1
* and we can just return a pointer to the id. Otherwise we may
* need to check to see if this is a "semaphore does not exist"
* or some other miscellaneous error on the name.
*/
if ( status ) {
400087f4: a4 92 20 00 orcc %o0, 0, %l2
400087f8: 22 80 00 0e be,a 40008830 <sem_open+0x84>
400087fc: b2 0e 6a 00 and %i1, 0xa00, %i1
/*
* Unless provided a valid name that did not already exist
* and we are willing to create then it is an error.
*/
if ( !( status == ENOENT && (oflag & O_CREAT) ) ) {
40008800: 80 a4 a0 02 cmp %l2, 2
40008804: 12 80 00 04 bne 40008814 <sem_open+0x68> <== NEVER TAKEN
40008808: 80 a4 60 00 cmp %l1, 0
4000880c: 12 80 00 21 bne 40008890 <sem_open+0xe4>
40008810: 94 10 00 10 mov %l0, %o2
_Thread_Enable_dispatch();
40008814: 40 00 0a 87 call 4000b230 <_Thread_Enable_dispatch>
40008818: b0 10 3f ff mov -1, %i0
rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
4000881c: 40 00 28 50 call 4001295c <__errno>
40008820: 01 00 00 00 nop
40008824: e4 22 00 00 st %l2, [ %o0 ]
40008828: 81 c7 e0 08 ret
4000882c: 81 e8 00 00 restore
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
40008830: 80 a6 6a 00 cmp %i1, 0xa00
40008834: 12 80 00 0a bne 4000885c <sem_open+0xb0>
40008838: d2 07 bf f8 ld [ %fp + -8 ], %o1
_Thread_Enable_dispatch();
4000883c: 40 00 0a 7d call 4000b230 <_Thread_Enable_dispatch>
40008840: b0 10 3f ff mov -1, %i0
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
40008844: 40 00 28 46 call 4001295c <__errno>
40008848: 01 00 00 00 nop
4000884c: 82 10 20 11 mov 0x11, %g1 ! 11 <PROM_START+0x11>
40008850: c2 22 00 00 st %g1, [ %o0 ]
40008854: 81 c7 e0 08 ret
40008858: 81 e8 00 00 restore
4000885c: 94 07 bf f0 add %fp, -16, %o2
40008860: 11 10 00 8b sethi %hi(0x40022c00), %o0
40008864: 40 00 08 27 call 4000a900 <_Objects_Get>
40008868: 90 12 23 20 or %o0, 0x320, %o0 ! 40022f20 <_POSIX_Semaphore_Information>
}
the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location );
the_semaphore->open_count += 1;
4000886c: c2 02 20 18 ld [ %o0 + 0x18 ], %g1
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
}
the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location );
40008870: d0 27 bf f4 st %o0, [ %fp + -12 ]
the_semaphore->open_count += 1;
40008874: 82 00 60 01 inc %g1
_Thread_Enable_dispatch();
40008878: 40 00 0a 6e call 4000b230 <_Thread_Enable_dispatch>
4000887c: c2 22 20 18 st %g1, [ %o0 + 0x18 ]
_Thread_Enable_dispatch();
40008880: 40 00 0a 6c call 4000b230 <_Thread_Enable_dispatch>
40008884: 01 00 00 00 nop
goto return_id;
40008888: 10 80 00 0c b 400088b8 <sem_open+0x10c>
4000888c: f0 07 bf f4 ld [ %fp + -12 ], %i0
/*
* At this point, the semaphore does not exist and everything has been
* checked. We should go ahead and create a semaphore.
*/
status =_POSIX_Semaphore_Create_support(
40008890: 90 10 00 18 mov %i0, %o0
40008894: 92 10 20 00 clr %o1
40008898: 40 00 19 59 call 4000edfc <_POSIX_Semaphore_Create_support>
4000889c: 96 07 bf f4 add %fp, -12, %o3
/*
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
400088a0: 40 00 0a 64 call 4000b230 <_Thread_Enable_dispatch>
400088a4: a0 10 00 08 mov %o0, %l0
if ( status == -1 )
400088a8: 80 a4 3f ff cmp %l0, -1
400088ac: 02 bf ff ea be 40008854 <sem_open+0xa8>
400088b0: b0 10 3f ff mov -1, %i0
return_id:
#if defined(RTEMS_USE_16_BIT_OBJECT)
the_semaphore->Semaphore_id = the_semaphore->Object.id;
id = &the_semaphore->Semaphore_id;
#else
id = (sem_t *)&the_semaphore->Object.id;
400088b4: f0 07 bf f4 ld [ %fp + -12 ], %i0
400088b8: b0 06 20 08 add %i0, 8, %i0
#endif
return id;
}
400088bc: 81 c7 e0 08 ret
400088c0: 81 e8 00 00 restore
40005dbc <sigaction>:
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
40005dbc: 9d e3 bf a0 save %sp, -96, %sp
40005dc0: 90 10 00 1a mov %i2, %o0
ISR_Level level;
if ( oact )
40005dc4: 80 a6 a0 00 cmp %i2, 0
40005dc8: 02 80 00 0a be 40005df0 <sigaction+0x34>
40005dcc: a0 10 00 18 mov %i0, %l0
*oact = _POSIX_signals_Vectors[ sig ];
40005dd0: 83 2e 20 02 sll %i0, 2, %g1
40005dd4: 85 2e 20 04 sll %i0, 4, %g2
40005dd8: 82 20 80 01 sub %g2, %g1, %g1
40005ddc: 13 10 00 7c sethi %hi(0x4001f000), %o1
40005de0: 94 10 20 0c mov 0xc, %o2
40005de4: 92 12 61 14 or %o1, 0x114, %o1
40005de8: 40 00 28 32 call 4000feb0 <memcpy>
40005dec: 92 02 40 01 add %o1, %g1, %o1
if ( !sig )
40005df0: 80 a4 20 00 cmp %l0, 0
40005df4: 02 80 00 07 be 40005e10 <sigaction+0x54>
40005df8: 82 04 3f ff add %l0, -1, %g1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
40005dfc: 80 a0 60 1f cmp %g1, 0x1f
40005e00: 18 80 00 04 bgu 40005e10 <sigaction+0x54>
40005e04: 80 a4 20 09 cmp %l0, 9
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
40005e08: 12 80 00 08 bne 40005e28 <sigaction+0x6c>
40005e0c: 80 a6 60 00 cmp %i1, 0
rtems_set_errno_and_return_minus_one( EINVAL );
40005e10: 40 00 25 e7 call 4000f5ac <__errno>
40005e14: b0 10 3f ff mov -1, %i0
40005e18: 82 10 20 16 mov 0x16, %g1
40005e1c: c2 22 00 00 st %g1, [ %o0 ]
40005e20: 81 c7 e0 08 ret
40005e24: 81 e8 00 00 restore
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
40005e28: 02 bf ff fe be 40005e20 <sigaction+0x64> <== NEVER TAKEN
40005e2c: b0 10 20 00 clr %i0
/*
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
40005e30: 7f ff f1 34 call 40002300 <sparc_disable_interrupts>
40005e34: 01 00 00 00 nop
40005e38: a2 10 00 08 mov %o0, %l1
if ( act->sa_handler == SIG_DFL ) {
40005e3c: c2 06 60 08 ld [ %i1 + 8 ], %g1
40005e40: 25 10 00 7c sethi %hi(0x4001f000), %l2
40005e44: 80 a0 60 00 cmp %g1, 0
40005e48: a4 14 a1 14 or %l2, 0x114, %l2
40005e4c: a7 2c 20 02 sll %l0, 2, %l3
40005e50: 12 80 00 08 bne 40005e70 <sigaction+0xb4>
40005e54: a9 2c 20 04 sll %l0, 4, %l4
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
40005e58: a6 25 00 13 sub %l4, %l3, %l3
40005e5c: 13 10 00 75 sethi %hi(0x4001d400), %o1
40005e60: 90 04 80 13 add %l2, %l3, %o0
40005e64: 92 12 60 d8 or %o1, 0xd8, %o1
40005e68: 10 80 00 07 b 40005e84 <sigaction+0xc8>
40005e6c: 92 02 40 13 add %o1, %l3, %o1
} else {
_POSIX_signals_Clear_process_signals( sig );
40005e70: 40 00 17 e5 call 4000be04 <_POSIX_signals_Clear_process_signals>
40005e74: 90 10 00 10 mov %l0, %o0
_POSIX_signals_Vectors[ sig ] = *act;
40005e78: a6 25 00 13 sub %l4, %l3, %l3
40005e7c: 92 10 00 19 mov %i1, %o1
40005e80: 90 04 80 13 add %l2, %l3, %o0
40005e84: 40 00 28 0b call 4000feb0 <memcpy>
40005e88: 94 10 20 0c mov 0xc, %o2
}
_ISR_Enable( level );
40005e8c: b0 10 20 00 clr %i0
40005e90: 7f ff f1 20 call 40002310 <sparc_enable_interrupts>
40005e94: 90 10 00 11 mov %l1, %o0
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
}
40005e98: 81 c7 e0 08 ret
40005e9c: 81 e8 00 00 restore
40007fe8 <sigsuspend>:
#include <rtems/seterr.h>
int sigsuspend(
const sigset_t *sigmask
)
{
40007fe8: 9d e3 bf 98 save %sp, -104, %sp
int status;
POSIX_API_Control *api;
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
40007fec: 90 10 20 01 mov 1, %o0
40007ff0: 92 10 00 18 mov %i0, %o1
40007ff4: a0 07 bf fc add %fp, -4, %l0
40007ff8: 7f ff ff f1 call 40007fbc <sigprocmask>
40007ffc: 94 10 00 10 mov %l0, %o2
(void) sigfillset( &all_signals );
40008000: a2 07 bf f8 add %fp, -8, %l1
40008004: 7f ff ff b6 call 40007edc <sigfillset>
40008008: 90 10 00 11 mov %l1, %o0
status = sigtimedwait( &all_signals, NULL, NULL );
4000800c: 90 10 00 11 mov %l1, %o0
40008010: 92 10 20 00 clr %o1
40008014: 40 00 00 28 call 400080b4 <sigtimedwait>
40008018: 94 10 20 00 clr %o2
(void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
4000801c: 92 10 00 10 mov %l0, %o1
status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
(void) sigfillset( &all_signals );
status = sigtimedwait( &all_signals, NULL, NULL );
40008020: a2 10 00 08 mov %o0, %l1
(void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
40008024: 94 10 20 00 clr %o2
40008028: 7f ff ff e5 call 40007fbc <sigprocmask>
4000802c: 90 10 20 00 clr %o0
/*
* sigtimedwait() returns the signal number while sigsuspend()
* is supposed to return -1 and EINTR when a signal is caught.
*/
if ( status != -1 )
40008030: 80 a4 7f ff cmp %l1, -1
40008034: 02 80 00 06 be 4000804c <sigsuspend+0x64> <== NEVER TAKEN
40008038: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EINTR );
4000803c: 40 00 25 38 call 4001151c <__errno>
40008040: 01 00 00 00 nop
40008044: 82 10 20 04 mov 4, %g1 ! 4 <PROM_START+0x4>
40008048: c2 22 00 00 st %g1, [ %o0 ]
return status;
}
4000804c: 81 c7 e0 08 ret
40008050: 91 e8 3f ff restore %g0, -1, %o0
40006238 <sigtimedwait>:
int sigtimedwait(
const sigset_t *set,
siginfo_t *info,
const struct timespec *timeout
)
{
40006238: 9d e3 bf 90 save %sp, -112, %sp
ISR_Level level;
/*
* Error check parameters before disabling interrupts.
*/
if ( !set )
4000623c: 80 a6 20 00 cmp %i0, 0
40006240: 02 80 00 0e be 40006278 <sigtimedwait+0x40>
40006244: 80 a6 a0 00 cmp %i2, 0
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
if ( timeout ) {
40006248: 02 80 00 12 be 40006290 <sigtimedwait+0x58>
4000624c: a8 10 20 00 clr %l4
if ( !_Timespec_Is_valid( timeout ) )
40006250: 40 00 0d fd call 40009a44 <_Timespec_Is_valid>
40006254: 90 10 00 1a mov %i2, %o0
40006258: 80 8a 20 ff btst 0xff, %o0
4000625c: 02 80 00 07 be 40006278 <sigtimedwait+0x40>
40006260: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EINVAL );
interval = _Timespec_To_ticks( timeout );
40006264: 40 00 0e 1d call 40009ad8 <_Timespec_To_ticks>
40006268: 90 10 00 1a mov %i2, %o0
if ( !interval )
4000626c: a8 92 20 00 orcc %o0, 0, %l4
40006270: 12 80 00 09 bne 40006294 <sigtimedwait+0x5c> <== ALWAYS TAKEN
40006274: 80 a6 60 00 cmp %i1, 0
rtems_set_errno_and_return_minus_one( EINVAL );
40006278: 40 00 25 a9 call 4000f91c <__errno>
4000627c: b0 10 3f ff mov -1, %i0
40006280: 82 10 20 16 mov 0x16, %g1
40006284: c2 22 00 00 st %g1, [ %o0 ]
40006288: 81 c7 e0 08 ret
4000628c: 81 e8 00 00 restore
/*
* Initialize local variables.
*/
the_info = ( info ) ? info : &signal_information;
40006290: 80 a6 60 00 cmp %i1, 0
40006294: 02 80 00 03 be 400062a0 <sigtimedwait+0x68>
40006298: a0 07 bf f4 add %fp, -12, %l0
4000629c: a0 10 00 19 mov %i1, %l0
the_thread = _Thread_Executing;
400062a0: 23 10 00 7c sethi %hi(0x4001f000), %l1
400062a4: f2 04 60 6c ld [ %l1 + 0x6c ], %i1 ! 4001f06c <_Thread_Executing>
* What if they are already pending?
*/
/* API signals pending? */
_ISR_Disable( level );
400062a8: 7f ff f0 e7 call 40002644 <sparc_disable_interrupts>
400062ac: e6 06 61 60 ld [ %i1 + 0x160 ], %l3
400062b0: a4 10 00 08 mov %o0, %l2
if ( *set & api->signals_pending ) {
400062b4: c4 06 00 00 ld [ %i0 ], %g2
400062b8: c2 04 e0 d0 ld [ %l3 + 0xd0 ], %g1
400062bc: 80 88 80 01 btst %g2, %g1
400062c0: 22 80 00 10 be,a 40006300 <sigtimedwait+0xc8>
400062c4: 03 10 00 7d sethi %hi(0x4001f400), %g1
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending );
400062c8: 7f ff ff c4 call 400061d8 <_POSIX_signals_Get_highest>
400062cc: 90 10 00 01 mov %g1, %o0
_POSIX_signals_Clear_signals(
400062d0: 94 10 00 10 mov %l0, %o2
/* API signals pending? */
_ISR_Disable( level );
if ( *set & api->signals_pending ) {
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending );
400062d4: 92 10 00 08 mov %o0, %o1
_POSIX_signals_Clear_signals(
400062d8: 96 10 20 00 clr %o3
400062dc: 90 10 00 13 mov %l3, %o0
/* API signals pending? */
_ISR_Disable( level );
if ( *set & api->signals_pending ) {
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending );
400062e0: d2 24 00 00 st %o1, [ %l0 ]
_POSIX_signals_Clear_signals(
400062e4: 40 00 18 a7 call 4000c580 <_POSIX_signals_Clear_signals>
400062e8: 98 10 20 00 clr %o4
the_info->si_signo,
the_info,
false,
false
);
_ISR_Enable( level );
400062ec: 7f ff f0 da call 40002654 <sparc_enable_interrupts>
400062f0: 90 10 00 12 mov %l2, %o0
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
400062f4: c0 24 20 08 clr [ %l0 + 8 ]
return the_info->si_signo;
400062f8: 10 80 00 13 b 40006344 <sigtimedwait+0x10c>
400062fc: f0 04 00 00 ld [ %l0 ], %i0
}
/* Process pending signals? */
if ( *set & _POSIX_signals_Pending ) {
40006300: c2 00 63 38 ld [ %g1 + 0x338 ], %g1
40006304: 80 88 80 01 btst %g2, %g1
40006308: 22 80 00 13 be,a 40006354 <sigtimedwait+0x11c>
4000630c: 03 10 00 7b sethi %hi(0x4001ec00), %g1
signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending );
40006310: 7f ff ff b2 call 400061d8 <_POSIX_signals_Get_highest>
40006314: 90 10 00 01 mov %g1, %o0
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
40006318: 94 10 00 10 mov %l0, %o2
}
/* Process pending signals? */
if ( *set & _POSIX_signals_Pending ) {
signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending );
4000631c: b0 10 00 08 mov %o0, %i0
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
40006320: 96 10 20 01 mov 1, %o3
40006324: 90 10 00 13 mov %l3, %o0
40006328: 92 10 00 18 mov %i0, %o1
4000632c: 40 00 18 95 call 4000c580 <_POSIX_signals_Clear_signals>
40006330: 98 10 20 00 clr %o4
_ISR_Enable( level );
40006334: 7f ff f0 c8 call 40002654 <sparc_enable_interrupts>
40006338: 90 10 00 12 mov %l2, %o0
the_info->si_signo = signo;
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
4000633c: c0 24 20 08 clr [ %l0 + 8 ]
if ( *set & _POSIX_signals_Pending ) {
signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending );
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
_ISR_Enable( level );
the_info->si_signo = signo;
40006340: f0 24 00 00 st %i0, [ %l0 ]
the_info->si_code = SI_USER;
40006344: 82 10 20 01 mov 1, %g1
40006348: c2 24 20 04 st %g1, [ %l0 + 4 ]
the_info->si_value.sival_int = 0;
return signo;
4000634c: 81 c7 e0 08 ret
40006350: 81 e8 00 00 restore
40006354: c4 00 63 b0 ld [ %g1 + 0x3b0 ], %g2
40006358: 84 00 a0 01 inc %g2
4000635c: c4 20 63 b0 st %g2, [ %g1 + 0x3b0 ]
}
the_info->si_signo = -1;
40006360: 82 10 3f ff mov -1, %g1
40006364: c2 24 00 00 st %g1, [ %l0 ]
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
the_thread->Wait.return_code = EINTR;
40006368: 82 10 20 04 mov 4, %g1
4000636c: c2 26 60 34 st %g1, [ %i1 + 0x34 ]
the_thread->Wait.option = *set;
40006370: c2 06 00 00 ld [ %i0 ], %g1
the_thread->Wait.return_argument = the_info;
40006374: e0 26 60 28 st %l0, [ %i1 + 0x28 ]
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
the_thread->Wait.return_code = EINTR;
the_thread->Wait.option = *set;
40006378: c2 26 60 30 st %g1, [ %i1 + 0x30 ]
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
4000637c: 25 10 00 7d sethi %hi(0x4001f400), %l2
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
40006380: 82 10 20 01 mov 1, %g1
40006384: a4 14 a2 d0 or %l2, 0x2d0, %l2
40006388: e4 26 60 44 st %l2, [ %i1 + 0x44 ]
4000638c: c2 24 a0 30 st %g1, [ %l2 + 0x30 ]
the_thread->Wait.return_code = EINTR;
the_thread->Wait.option = *set;
the_thread->Wait.return_argument = the_info;
_Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue );
_ISR_Enable( level );
40006390: 7f ff f0 b1 call 40002654 <sparc_enable_interrupts>
40006394: 01 00 00 00 nop
_Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval );
40006398: 90 10 00 12 mov %l2, %o0
4000639c: 92 10 00 14 mov %l4, %o1
400063a0: 15 10 00 25 sethi %hi(0x40009400), %o2
400063a4: 40 00 0b 67 call 40009140 <_Thread_queue_Enqueue_with_handler>
400063a8: 94 12 a0 a0 or %o2, 0xa0, %o2 ! 400094a0 <_Thread_queue_Timeout>
_Thread_Enable_dispatch();
400063ac: 40 00 0a 12 call 40008bf4 <_Thread_Enable_dispatch>
400063b0: 01 00 00 00 nop
/*
* When the thread is set free by a signal, it is need to eliminate
* the signal.
*/
_POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false );
400063b4: d2 04 00 00 ld [ %l0 ], %o1
400063b8: 94 10 00 10 mov %l0, %o2
400063bc: 96 10 20 00 clr %o3
400063c0: 98 10 20 00 clr %o4
400063c4: 40 00 18 6f call 4000c580 <_POSIX_signals_Clear_signals>
400063c8: 90 10 00 13 mov %l3, %o0
errno = _Thread_Executing->Wait.return_code;
400063cc: 40 00 25 54 call 4000f91c <__errno>
400063d0: 01 00 00 00 nop
400063d4: c2 04 60 6c ld [ %l1 + 0x6c ], %g1
400063d8: c2 00 60 34 ld [ %g1 + 0x34 ], %g1
400063dc: c2 22 00 00 st %g1, [ %o0 ]
return the_info->si_signo;
400063e0: f0 04 00 00 ld [ %l0 ], %i0
}
400063e4: 81 c7 e0 08 ret
400063e8: 81 e8 00 00 restore
4000827c <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
4000827c: 9d e3 bf a0 save %sp, -96, %sp
int status;
status = sigtimedwait( set, NULL, NULL );
40008280: 92 10 20 00 clr %o1
40008284: 90 10 00 18 mov %i0, %o0
40008288: 7f ff ff 8b call 400080b4 <sigtimedwait>
4000828c: 94 10 20 00 clr %o2
if ( status != -1 ) {
40008290: 80 a2 3f ff cmp %o0, -1
40008294: 02 80 00 07 be 400082b0 <sigwait+0x34>
40008298: 80 a6 60 00 cmp %i1, 0
if ( sig )
4000829c: 02 80 00 03 be 400082a8 <sigwait+0x2c> <== NEVER TAKEN
400082a0: b0 10 20 00 clr %i0
*sig = status;
400082a4: d0 26 40 00 st %o0, [ %i1 ]
400082a8: 81 c7 e0 08 ret
400082ac: 81 e8 00 00 restore
return 0;
}
return errno;
400082b0: 40 00 24 9b call 4001151c <__errno>
400082b4: 01 00 00 00 nop
400082b8: f0 02 00 00 ld [ %o0 ], %i0
}
400082bc: 81 c7 e0 08 ret
400082c0: 81 e8 00 00 restore
400050e0 <sysconf>:
*/
long sysconf(
int name
)
{
400050e0: 9d e3 bf a0 save %sp, -96, %sp
if ( name == _SC_CLK_TCK )
400050e4: 80 a6 20 02 cmp %i0, 2
400050e8: 12 80 00 09 bne 4000510c <sysconf+0x2c>
400050ec: 80 a6 20 04 cmp %i0, 4
return (TOD_MICROSECONDS_PER_SECOND /
400050f0: 03 10 00 74 sethi %hi(0x4001d000), %g1
400050f4: d2 00 62 c8 ld [ %g1 + 0x2c8 ], %o1 ! 4001d2c8 <Configuration+0xc>
400050f8: 11 00 03 d0 sethi %hi(0xf4000), %o0
400050fc: 40 00 4d 65 call 40018690 <.udiv>
40005100: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 <PROM_START+0xf4240>
40005104: 81 c7 e0 08 ret
40005108: 91 e8 00 08 restore %g0, %o0, %o0
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
4000510c: 12 80 00 05 bne 40005120 <sysconf+0x40>
40005110: 80 a6 20 33 cmp %i0, 0x33
return rtems_libio_number_iops;
40005114: 03 10 00 74 sethi %hi(0x4001d000), %g1
40005118: 10 80 00 0f b 40005154 <sysconf+0x74>
4000511c: d0 00 61 e4 ld [ %g1 + 0x1e4 ], %o0 ! 4001d1e4 <rtems_libio_number_iops>
if ( name == _SC_GETPW_R_SIZE_MAX )
40005120: 02 80 00 0d be 40005154 <sysconf+0x74>
40005124: 90 10 24 00 mov 0x400, %o0
return 1024;
if ( name == _SC_PAGESIZE )
40005128: 80 a6 20 08 cmp %i0, 8
4000512c: 02 80 00 0a be 40005154 <sysconf+0x74>
40005130: 90 02 2c 00 add %o0, 0xc00, %o0
return PAGE_SIZE;
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
40005134: 80 a6 22 03 cmp %i0, 0x203
40005138: 02 80 00 07 be 40005154 <sysconf+0x74> <== NEVER TAKEN
4000513c: 90 10 20 00 clr %o0
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
40005140: 40 00 26 6c call 4000eaf0 <__errno>
40005144: 01 00 00 00 nop
40005148: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
4000514c: c2 22 00 00 st %g1, [ %o0 ]
40005150: 90 10 3f ff mov -1, %o0
}
40005154: b0 10 00 08 mov %o0, %i0
40005158: 81 c7 e0 08 ret
4000515c: 81 e8 00 00 restore
4000544c <timer_create>:
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
)
{
4000544c: 9d e3 bf a0 save %sp, -96, %sp
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
40005450: 80 a6 20 01 cmp %i0, 1
40005454: 12 80 00 13 bne 400054a0 <timer_create+0x54>
40005458: 80 a6 a0 00 cmp %i2, 0
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !timerid )
4000545c: 02 80 00 11 be 400054a0 <timer_create+0x54>
40005460: 80 a6 60 00 cmp %i1, 0
/*
* The data of the structure evp are checked in order to verify if they
* are coherent.
*/
if (evp != NULL) {
40005464: 02 80 00 13 be 400054b0 <timer_create+0x64>
40005468: 03 10 00 83 sethi %hi(0x40020c00), %g1
/* The structure has data */
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
4000546c: c2 06 40 00 ld [ %i1 ], %g1
40005470: 82 00 7f ff add %g1, -1, %g1
40005474: 80 a0 60 01 cmp %g1, 1
40005478: 18 80 00 0a bgu 400054a0 <timer_create+0x54> <== NEVER TAKEN
4000547c: 01 00 00 00 nop
( evp->sigev_notify != SIGEV_SIGNAL ) ) {
/* The value of the field sigev_notify is not valid */
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !evp->sigev_signo )
40005480: c2 06 60 04 ld [ %i1 + 4 ], %g1
40005484: 80 a0 60 00 cmp %g1, 0
40005488: 02 80 00 06 be 400054a0 <timer_create+0x54> <== NEVER TAKEN
4000548c: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(evp->sigev_signo) )
40005490: 82 00 7f ff add %g1, -1, %g1
40005494: 80 a0 60 1f cmp %g1, 0x1f
40005498: 28 80 00 06 bleu,a 400054b0 <timer_create+0x64> <== ALWAYS TAKEN
4000549c: 03 10 00 83 sethi %hi(0x40020c00), %g1
rtems_set_errno_and_return_minus_one( EINVAL );
400054a0: 40 00 26 ef call 4000f05c <__errno>
400054a4: 01 00 00 00 nop
400054a8: 10 80 00 10 b 400054e8 <timer_create+0x9c>
400054ac: 82 10 20 16 mov 0x16, %g1 ! 16 <PROM_START+0x16>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
400054b0: c4 00 63 e0 ld [ %g1 + 0x3e0 ], %g2
400054b4: 84 00 a0 01 inc %g2
400054b8: c4 20 63 e0 st %g2, [ %g1 + 0x3e0 ]
* the inactive chain of free timer control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void )
{
return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information );
400054bc: 11 10 00 84 sethi %hi(0x40021000), %o0
400054c0: 40 00 07 c1 call 400073c4 <_Objects_Allocate>
400054c4: 90 12 23 30 or %o0, 0x330, %o0 ! 40021330 <_POSIX_Timer_Information>
/*
* Allocate a timer
*/
ptimer = _POSIX_Timer_Allocate();
if ( !ptimer ) {
400054c8: 80 a2 20 00 cmp %o0, 0
400054cc: 12 80 00 0a bne 400054f4 <timer_create+0xa8>
400054d0: 82 10 20 02 mov 2, %g1
_Thread_Enable_dispatch();
400054d4: 40 00 0b 1b call 40008140 <_Thread_Enable_dispatch>
400054d8: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EAGAIN );
400054dc: 40 00 26 e0 call 4000f05c <__errno>
400054e0: 01 00 00 00 nop
400054e4: 82 10 20 0b mov 0xb, %g1 ! b <PROM_START+0xb>
400054e8: c2 22 00 00 st %g1, [ %o0 ]
400054ec: 81 c7 e0 08 ret
400054f0: 91 e8 3f ff restore %g0, -1, %o0
}
/* The data of the created timer are stored to use them later */
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
400054f4: c2 2a 20 3c stb %g1, [ %o0 + 0x3c ]
ptimer->thread_id = _Thread_Executing->Object.id;
400054f8: 03 10 00 84 sethi %hi(0x40021000), %g1
400054fc: c2 00 60 9c ld [ %g1 + 0x9c ], %g1 ! 4002109c <_Thread_Executing>
if ( evp != NULL ) {
40005500: 80 a6 60 00 cmp %i1, 0
}
/* The data of the created timer are stored to use them later */
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
ptimer->thread_id = _Thread_Executing->Object.id;
40005504: c2 00 60 08 ld [ %g1 + 8 ], %g1
if ( evp != NULL ) {
40005508: 02 80 00 08 be 40005528 <timer_create+0xdc>
4000550c: c2 22 20 38 st %g1, [ %o0 + 0x38 ]
ptimer->inf.sigev_notify = evp->sigev_notify;
ptimer->inf.sigev_signo = evp->sigev_signo;
ptimer->inf.sigev_value = evp->sigev_value;
40005510: c2 06 60 08 ld [ %i1 + 8 ], %g1
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
ptimer->thread_id = _Thread_Executing->Object.id;
if ( evp != NULL ) {
ptimer->inf.sigev_notify = evp->sigev_notify;
40005514: c6 06 40 00 ld [ %i1 ], %g3
ptimer->inf.sigev_signo = evp->sigev_signo;
40005518: c4 06 60 04 ld [ %i1 + 4 ], %g2
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
ptimer->thread_id = _Thread_Executing->Object.id;
if ( evp != NULL ) {
ptimer->inf.sigev_notify = evp->sigev_notify;
4000551c: c6 22 20 40 st %g3, [ %o0 + 0x40 ]
ptimer->inf.sigev_signo = evp->sigev_signo;
40005520: c4 22 20 44 st %g2, [ %o0 + 0x44 ]
ptimer->inf.sigev_value = evp->sigev_value;
40005524: c2 22 20 48 st %g1, [ %o0 + 0x48 ]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
40005528: c2 12 20 0a lduh [ %o0 + 0xa ], %g1
4000552c: 05 10 00 84 sethi %hi(0x40021000), %g2
40005530: c4 00 a3 4c ld [ %g2 + 0x34c ], %g2 ! 4002134c <_POSIX_Timer_Information+0x1c>
40005534: 83 28 60 02 sll %g1, 2, %g1
40005538: d0 20 80 01 st %o0, [ %g2 + %g1 ]
4000553c: c2 02 20 08 ld [ %o0 + 8 ], %g1
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
40005540: c0 22 20 0c clr [ %o0 + 0xc ]
}
ptimer->overrun = 0;
40005544: c0 22 20 68 clr [ %o0 + 0x68 ]
ptimer->timer_data.it_value.tv_sec = 0;
40005548: c0 22 20 5c clr [ %o0 + 0x5c ]
ptimer->timer_data.it_value.tv_nsec = 0;
4000554c: c0 22 20 60 clr [ %o0 + 0x60 ]
ptimer->timer_data.it_interval.tv_sec = 0;
40005550: c0 22 20 54 clr [ %o0 + 0x54 ]
ptimer->timer_data.it_interval.tv_nsec = 0;
40005554: c0 22 20 58 clr [ %o0 + 0x58 ]
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
the_watchdog->id = id;
40005558: c0 22 20 30 clr [ %o0 + 0x30 ]
_Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL );
_Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0);
*timerid = ptimer->Object.id;
4000555c: c2 26 80 00 st %g1, [ %i2 ]
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
40005560: c0 22 20 18 clr [ %o0 + 0x18 ]
the_watchdog->routine = routine;
40005564: c0 22 20 2c clr [ %o0 + 0x2c ]
the_watchdog->id = id;
the_watchdog->user_data = user_data;
40005568: c0 22 20 34 clr [ %o0 + 0x34 ]
_Thread_Enable_dispatch();
4000556c: 40 00 0a f5 call 40008140 <_Thread_Enable_dispatch>
40005570: b0 10 20 00 clr %i0
return 0;
}
40005574: 81 c7 e0 08 ret
40005578: 81 e8 00 00 restore
4000557c <timer_settime>:
timer_t timerid,
int flags,
const struct itimerspec *value,
struct itimerspec *ovalue
)
{
4000557c: 9d e3 bf 80 save %sp, -128, %sp
Objects_Locations location;
bool activated;
uint32_t initial_period;
struct itimerspec normalize;
if ( !value )
40005580: 80 a6 a0 00 cmp %i2, 0
40005584: 02 80 00 20 be 40005604 <timer_settime+0x88> <== NEVER TAKEN
40005588: 03 0e e6 b2 sethi %hi(0x3b9ac800), %g1
rtems_set_errno_and_return_minus_one( EINVAL );
/* First, it verifies if the structure "value" is correct */
if ( ( value->it_value.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) ||
4000558c: c4 06 a0 0c ld [ %i2 + 0xc ], %g2
40005590: 82 10 61 ff or %g1, 0x1ff, %g1
40005594: 80 a0 80 01 cmp %g2, %g1
40005598: 18 80 00 1b bgu 40005604 <timer_settime+0x88>
4000559c: 01 00 00 00 nop
( value->it_value.tv_nsec < 0 ) ||
( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) ||
400055a0: c4 06 a0 04 ld [ %i2 + 4 ], %g2
400055a4: 80 a0 80 01 cmp %g2, %g1
400055a8: 18 80 00 17 bgu 40005604 <timer_settime+0x88> <== NEVER TAKEN
400055ac: 80 a6 60 00 cmp %i1, 0
( value->it_interval.tv_nsec < 0 )) {
/* The number of nanoseconds is not correct */
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) {
400055b0: 02 80 00 05 be 400055c4 <timer_settime+0x48>
400055b4: 90 07 bf e4 add %fp, -28, %o0
400055b8: 80 a6 60 04 cmp %i1, 4
400055bc: 12 80 00 12 bne 40005604 <timer_settime+0x88>
400055c0: 01 00 00 00 nop
rtems_set_errno_and_return_minus_one( EINVAL );
}
normalize = *value;
400055c4: 92 10 00 1a mov %i2, %o1
400055c8: 40 00 28 fb call 4000f9b4 <memcpy>
400055cc: 94 10 20 10 mov 0x10, %o2
/* Convert absolute to relative time */
if (flags == TIMER_ABSTIME) {
400055d0: 80 a6 60 04 cmp %i1, 4
400055d4: 12 80 00 16 bne 4000562c <timer_settime+0xb0>
400055d8: 92 10 00 18 mov %i0, %o1
struct timespec now;
_TOD_Get( &now );
400055dc: a0 07 bf f4 add %fp, -12, %l0
400055e0: 40 00 06 18 call 40006e40 <_TOD_Get>
400055e4: 90 10 00 10 mov %l0, %o0
/* Check for seconds in the past */
if ( _Timespec_Greater_than( &now, &normalize.it_value ) )
400055e8: b2 07 bf ec add %fp, -20, %i1
400055ec: 90 10 00 10 mov %l0, %o0
400055f0: 40 00 0e 68 call 40008f90 <_Timespec_Greater_than>
400055f4: 92 10 00 19 mov %i1, %o1
400055f8: 80 8a 20 ff btst 0xff, %o0
400055fc: 02 80 00 08 be 4000561c <timer_settime+0xa0>
40005600: 92 10 00 19 mov %i1, %o1
rtems_set_errno_and_return_minus_one( EINVAL );
40005604: 40 00 26 96 call 4000f05c <__errno>
40005608: b0 10 3f ff mov -1, %i0
4000560c: 82 10 20 16 mov 0x16, %g1
40005610: c2 22 00 00 st %g1, [ %o0 ]
40005614: 81 c7 e0 08 ret
40005618: 81 e8 00 00 restore
_Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value );
4000561c: 90 10 00 10 mov %l0, %o0
40005620: 40 00 0e 6d call 40008fd4 <_Timespec_Subtract>
40005624: 94 10 00 19 mov %i1, %o2
RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get (
timer_t id,
Objects_Locations *location
)
{
return (POSIX_Timer_Control *)
40005628: 92 10 00 18 mov %i0, %o1
4000562c: 11 10 00 84 sethi %hi(0x40021000), %o0
40005630: 94 07 bf fc add %fp, -4, %o2
40005634: 40 00 08 a3 call 400078c0 <_Objects_Get>
40005638: 90 12 23 30 or %o0, 0x330, %o0
* something with the structure of times of the timer: to stop, start
* or start it again
*/
ptimer = _POSIX_Timer_Get( timerid, &location );
switch ( location ) {
4000563c: c2 07 bf fc ld [ %fp + -4 ], %g1
40005640: 80 a0 60 00 cmp %g1, 0
40005644: 12 80 00 38 bne 40005724 <timer_settime+0x1a8>
40005648: a0 10 00 08 mov %o0, %l0
case OBJECTS_LOCAL:
/* First, it verifies if the timer must be stopped */
if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) {
4000564c: c2 07 bf ec ld [ %fp + -20 ], %g1
40005650: 80 a0 60 00 cmp %g1, 0
40005654: 12 80 00 14 bne 400056a4 <timer_settime+0x128>
40005658: c2 07 bf f0 ld [ %fp + -16 ], %g1
4000565c: 80 a0 60 00 cmp %g1, 0
40005660: 12 80 00 11 bne 400056a4 <timer_settime+0x128>
40005664: 01 00 00 00 nop
/* Stop the timer */
(void) _Watchdog_Remove( &ptimer->Timer );
40005668: 40 00 0f 99 call 400094cc <_Watchdog_Remove>
4000566c: 90 02 20 10 add %o0, 0x10, %o0
/* The old data of the timer are returned */
if ( ovalue )
40005670: 80 a6 e0 00 cmp %i3, 0
40005674: 02 80 00 05 be 40005688 <timer_settime+0x10c>
40005678: 90 10 00 1b mov %i3, %o0
*ovalue = ptimer->timer_data;
4000567c: 92 04 20 54 add %l0, 0x54, %o1
40005680: 40 00 28 cd call 4000f9b4 <memcpy>
40005684: 94 10 20 10 mov 0x10, %o2
/* The new data are set */
ptimer->timer_data = normalize;
40005688: 92 07 bf e4 add %fp, -28, %o1
4000568c: 94 10 20 10 mov 0x10, %o2
40005690: 40 00 28 c9 call 4000f9b4 <memcpy>
40005694: 90 04 20 54 add %l0, 0x54, %o0
/* Indicates that the timer is created and stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
40005698: 82 10 20 04 mov 4, %g1
4000569c: 10 80 00 1e b 40005714 <timer_settime+0x198>
400056a0: c2 2c 20 3c stb %g1, [ %l0 + 0x3c ]
_Thread_Enable_dispatch();
return 0;
}
/* Convert from seconds and nanoseconds to ticks */
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
400056a4: 40 00 0e 60 call 40009024 <_Timespec_To_ticks>
400056a8: 90 10 00 1a mov %i2, %o0
400056ac: d0 24 20 64 st %o0, [ %l0 + 0x64 ]
initial_period = _Timespec_To_ticks( &normalize.it_value );
400056b0: 40 00 0e 5d call 40009024 <_Timespec_To_ticks>
400056b4: 90 07 bf ec add %fp, -20, %o0
activated = _POSIX_Timer_Insert_helper(
400056b8: d4 04 20 08 ld [ %l0 + 8 ], %o2
return 0;
}
/* Convert from seconds and nanoseconds to ticks */
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
initial_period = _Timespec_To_ticks( &normalize.it_value );
400056bc: 92 10 00 08 mov %o0, %o1
activated = _POSIX_Timer_Insert_helper(
400056c0: 17 10 00 15 sethi %hi(0x40005400), %o3
400056c4: 90 04 20 10 add %l0, 0x10, %o0
400056c8: 96 12 e3 3c or %o3, 0x33c, %o3
400056cc: 40 00 19 5c call 4000bc3c <_POSIX_Timer_Insert_helper>
400056d0: 98 10 00 10 mov %l0, %o4
initial_period,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated ) {
400056d4: 80 8a 20 ff btst 0xff, %o0
400056d8: 02 80 00 0f be 40005714 <timer_settime+0x198>
400056dc: 80 a6 e0 00 cmp %i3, 0
/*
* The timer has been started and is running. So we return the
* old ones in "ovalue"
*/
if ( ovalue )
400056e0: 02 80 00 05 be 400056f4 <timer_settime+0x178>
400056e4: 90 10 00 1b mov %i3, %o0
*ovalue = ptimer->timer_data;
400056e8: 92 04 20 54 add %l0, 0x54, %o1
400056ec: 40 00 28 b2 call 4000f9b4 <memcpy>
400056f0: 94 10 20 10 mov 0x10, %o2
ptimer->timer_data = normalize;
400056f4: 92 07 bf e4 add %fp, -28, %o1
400056f8: 94 10 20 10 mov 0x10, %o2
400056fc: 40 00 28 ae call 4000f9b4 <memcpy>
40005700: 90 04 20 54 add %l0, 0x54, %o0
/* Indicate that the time is running */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
40005704: 82 10 20 03 mov 3, %g1
_TOD_Get( &ptimer->time );
40005708: 90 04 20 6c add %l0, 0x6c, %o0
4000570c: 40 00 05 cd call 40006e40 <_TOD_Get>
40005710: c2 2c 20 3c stb %g1, [ %l0 + 0x3c ]
_Thread_Enable_dispatch();
40005714: 40 00 0a 8b call 40008140 <_Thread_Enable_dispatch>
40005718: b0 10 20 00 clr %i0
return 0;
4000571c: 81 c7 e0 08 ret
40005720: 81 e8 00 00 restore
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EINVAL );
40005724: 40 00 26 4e call 4000f05c <__errno>
40005728: b0 10 3f ff mov -1, %i0
4000572c: 82 10 20 16 mov 0x16, %g1
40005730: c2 22 00 00 st %g1, [ %o0 ]
}
40005734: 81 c7 e0 08 ret
40005738: 81 e8 00 00 restore
40005350 <ualarm>:
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
40005350: 9d e3 bf 98 save %sp, -104, %sp
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
40005354: 21 10 00 7b sethi %hi(0x4001ec00), %l0
40005358: a0 14 22 4c or %l0, 0x24c, %l0 ! 4001ee4c <_POSIX_signals_Ualarm_timer>
4000535c: c2 04 20 1c ld [ %l0 + 0x1c ], %g1
40005360: 80 a0 60 00 cmp %g1, 0
40005364: 12 80 00 0a bne 4000538c <ualarm+0x3c>
40005368: a2 10 00 18 mov %i0, %l1
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
4000536c: 03 10 00 15 sethi %hi(0x40005400), %g1
the_watchdog->id = id;
the_watchdog->user_data = user_data;
40005370: c0 24 20 24 clr [ %l0 + 0x24 ]
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
40005374: 82 10 60 64 or %g1, 0x64, %g1
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
40005378: c0 24 20 08 clr [ %l0 + 8 ]
the_watchdog->routine = routine;
the_watchdog->id = id;
4000537c: c0 24 20 20 clr [ %l0 + 0x20 ]
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
40005380: c2 24 20 1c st %g1, [ %l0 + 0x1c ]
the_watchdog->id = id;
the_watchdog->user_data = user_data;
40005384: 10 80 00 1b b 400053f0 <ualarm+0xa0>
40005388: b0 10 20 00 clr %i0
_Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL );
} else {
Watchdog_States state;
state = _Watchdog_Remove( the_timer );
4000538c: 40 00 0f 2a call 40009034 <_Watchdog_Remove>
40005390: 90 10 00 10 mov %l0, %o0
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
40005394: 90 02 3f fe add %o0, -2, %o0
40005398: 80 a2 20 01 cmp %o0, 1
4000539c: 18 80 00 15 bgu 400053f0 <ualarm+0xa0> <== NEVER TAKEN
400053a0: b0 10 20 00 clr %i0
ticks = the_timer->initial;
ticks -= (the_timer->stop_time - the_timer->start_time);
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
400053a4: c2 04 20 18 ld [ %l0 + 0x18 ], %g1
* boot. Since alarm() is dealing in seconds, we must account for
* this.
*/
ticks = the_timer->initial;
ticks -= (the_timer->stop_time - the_timer->start_time);
400053a8: c4 04 20 0c ld [ %l0 + 0xc ], %g2
400053ac: d0 04 20 14 ld [ %l0 + 0x14 ], %o0
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
400053b0: 92 07 bf f8 add %fp, -8, %o1
* boot. Since alarm() is dealing in seconds, we must account for
* this.
*/
ticks = the_timer->initial;
ticks -= (the_timer->stop_time - the_timer->start_time);
400053b4: 90 02 00 02 add %o0, %g2, %o0
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
400053b8: 40 00 0d a5 call 40008a4c <_Timespec_From_ticks>
400053bc: 90 22 00 01 sub %o0, %g1, %o0
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
400053c0: c2 07 bf f8 ld [ %fp + -8 ], %g1
remaining += tp.tv_nsec / 1000;
400053c4: d0 07 bf fc ld [ %fp + -4 ], %o0
ticks = the_timer->initial;
ticks -= (the_timer->stop_time - the_timer->start_time);
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
400053c8: b1 28 60 08 sll %g1, 8, %i0
400053cc: 85 28 60 03 sll %g1, 3, %g2
400053d0: 84 26 00 02 sub %i0, %g2, %g2
remaining += tp.tv_nsec / 1000;
400053d4: 92 10 23 e8 mov 0x3e8, %o1
ticks = the_timer->initial;
ticks -= (the_timer->stop_time - the_timer->start_time);
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
400053d8: b1 28 a0 06 sll %g2, 6, %i0
400053dc: b0 26 00 02 sub %i0, %g2, %i0
remaining += tp.tv_nsec / 1000;
400053e0: 40 00 50 45 call 400194f4 <.div>
400053e4: b0 06 00 01 add %i0, %g1, %i0
ticks = the_timer->initial;
ticks -= (the_timer->stop_time - the_timer->start_time);
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
400053e8: b1 2e 20 06 sll %i0, 6, %i0
remaining += tp.tv_nsec / 1000;
400053ec: b0 02 00 18 add %o0, %i0, %i0
/*
* If useconds is non-zero, then the caller wants to schedule
* the alarm repeatedly at that interval. If the interval is
* less than a single clock tick, then fudge it to a clock tick.
*/
if ( useconds ) {
400053f0: 80 a4 60 00 cmp %l1, 0
400053f4: 02 80 00 1a be 4000545c <ualarm+0x10c>
400053f8: 21 00 03 d0 sethi %hi(0xf4000), %l0
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
400053fc: 90 10 00 11 mov %l1, %o0
40005400: 40 00 50 3b call 400194ec <.udiv>
40005404: 92 14 22 40 or %l0, 0x240, %o1
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
40005408: 92 14 22 40 or %l0, 0x240, %o1
* less than a single clock tick, then fudge it to a clock tick.
*/
if ( useconds ) {
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
4000540c: d0 27 bf f8 st %o0, [ %fp + -8 ]
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
40005410: 40 00 50 e3 call 4001979c <.urem>
40005414: 90 10 00 11 mov %l1, %o0
40005418: 85 2a 20 07 sll %o0, 7, %g2
4000541c: 83 2a 20 02 sll %o0, 2, %g1
40005420: 82 20 80 01 sub %g2, %g1, %g1
40005424: 90 00 40 08 add %g1, %o0, %o0
40005428: 91 2a 20 03 sll %o0, 3, %o0
ticks = _Timespec_To_ticks( &tp );
4000542c: a0 07 bf f8 add %fp, -8, %l0
*/
if ( useconds ) {
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
40005430: d0 27 bf fc st %o0, [ %fp + -4 ]
ticks = _Timespec_To_ticks( &tp );
40005434: 40 00 0d af call 40008af0 <_Timespec_To_ticks>
40005438: 90 10 00 10 mov %l0, %o0
if ( ticks == 0 )
ticks = 1;
_Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) );
4000543c: 40 00 0d ad call 40008af0 <_Timespec_To_ticks>
40005440: 90 10 00 10 mov %l0, %o0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
40005444: 13 10 00 7b sethi %hi(0x4001ec00), %o1
40005448: 92 12 62 4c or %o1, 0x24c, %o1 ! 4001ee4c <_POSIX_signals_Ualarm_timer>
4000544c: d0 22 60 0c st %o0, [ %o1 + 0xc ]
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
40005450: 11 10 00 79 sethi %hi(0x4001e400), %o0
40005454: 40 00 0e 9b call 40008ec0 <_Watchdog_Insert>
40005458: 90 12 22 1c or %o0, 0x21c, %o0 ! 4001e61c <_Watchdog_Ticks_chain>
}
return remaining;
}
4000545c: 81 c7 e0 08 ret
40005460: 81 e8 00 00 restore