RTEMS 4.11Annotated Report
Sat Jul 17 05:46:04 2010
08005d08 <_CORE_RWLock_Obtain_for_reading>:
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_RWLock_API_mp_support_callout api_rwlock_mp_support
)
{
8005d08: 37 9c ff e4 addi sp,sp,-28
8005d0c: 5b 8b 00 1c sw (sp+28),r11
8005d10: 5b 8c 00 18 sw (sp+24),r12
8005d14: 5b 8d 00 14 sw (sp+20),r13
8005d18: 5b 8e 00 10 sw (sp+16),r14
8005d1c: 5b 8f 00 0c sw (sp+12),r15
8005d20: 5b 90 00 08 sw (sp+8),r16
8005d24: 5b 9d 00 04 sw (sp+4),ra
8005d28: b8 20 58 00 mv r11,r1
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
8005d2c: 78 01 08 01 mvhi r1,0x801
8005d30: 38 21 7d 44 ori r1,r1,0x7d44
8005d34: 28 2c 00 0c lw r12,(r1+12)
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_RWLock_API_mp_support_callout api_rwlock_mp_support
)
{
8005d38: b8 40 78 00 mv r15,r2
8005d3c: b8 80 70 00 mv r14,r4
8005d40: 20 70 00 ff andi r16,r3,0xff
* 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 );
8005d44: 90 00 68 00 rcsr r13,IE
8005d48: 34 01 ff fe mvi r1,-2
8005d4c: a1 a1 08 00 and r1,r13,r1
8005d50: d0 01 00 00 wcsr IE,r1
switch ( the_rwlock->current_state ) {
8005d54: 29 61 00 44 lw r1,(r11+68)
8005d58: 44 20 00 04 be r1,r0,8005d68 <_CORE_RWLock_Obtain_for_reading+0x60>
8005d5c: 34 02 00 01 mvi r2,1
8005d60: 5c 22 00 12 bne r1,r2,8005da8 <_CORE_RWLock_Obtain_for_reading+0xa0>
8005d64: e0 00 00 08 bi 8005d84 <_CORE_RWLock_Obtain_for_reading+0x7c>
case CORE_RWLOCK_UNLOCKED:
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
8005d68: 34 01 00 01 mvi r1,1
8005d6c: 59 61 00 44 sw (r11+68),r1
the_rwlock->number_of_readers += 1;
8005d70: 29 61 00 48 lw r1,(r11+72)
8005d74: 34 21 00 01 addi r1,r1,1
8005d78: 59 61 00 48 sw (r11+72),r1
_ISR_Enable( level );
8005d7c: d0 0d 00 00 wcsr IE,r13
8005d80: e0 00 00 08 bi 8005da0 <_CORE_RWLock_Obtain_for_reading+0x98>
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 );
8005d84: b9 60 08 00 mv r1,r11
8005d88: f8 00 08 9f calli 8008004 <_Thread_queue_First>
if ( !waiter ) {
8005d8c: 5c 20 00 07 bne r1,r0,8005da8 <_CORE_RWLock_Obtain_for_reading+0xa0><== NEVER TAKEN
the_rwlock->number_of_readers += 1;
8005d90: 29 61 00 48 lw r1,(r11+72)
8005d94: 34 21 00 01 addi r1,r1,1
8005d98: 59 61 00 48 sw (r11+72),r1
_ISR_Enable( level );
8005d9c: d0 0d 00 00 wcsr IE,r13
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
8005da0: 59 80 00 34 sw (r12+52),r0
return;
8005da4: e0 00 00 12 bi 8005dec <_CORE_RWLock_Obtain_for_reading+0xe4>
/*
* If the thread is not willing to wait, then return immediately.
*/
if ( !wait ) {
8005da8: 5e 00 00 05 bne r16,r0,8005dbc <_CORE_RWLock_Obtain_for_reading+0xb4>
_ISR_Enable( level );
8005dac: d0 0d 00 00 wcsr IE,r13
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
8005db0: 34 01 00 02 mvi r1,2
8005db4: 59 81 00 34 sw (r12+52),r1
return;
8005db8: e0 00 00 0d bi 8005dec <_CORE_RWLock_Obtain_for_reading+0xe4>
8005dbc: 34 01 00 01 mvi r1,1
8005dc0: 59 61 00 30 sw (r11+48),r1
/*
* 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;
8005dc4: 59 8b 00 44 sw (r12+68),r11
executing->Wait.id = id;
8005dc8: 59 8f 00 20 sw (r12+32),r15
executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ;
8005dcc: 59 80 00 30 sw (r12+48),r0
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
8005dd0: 59 80 00 34 sw (r12+52),r0
_ISR_Enable( level );
8005dd4: d0 0d 00 00 wcsr IE,r13
_Thread_queue_Enqueue_with_handler(
8005dd8: 78 03 08 00 mvhi r3,0x800
8005ddc: b9 60 08 00 mv r1,r11
8005de0: b9 c0 10 00 mv r2,r14
8005de4: 38 63 5f 94 ori r3,r3,0x5f94
8005de8: f8 00 07 74 calli 8007bb8 <_Thread_queue_Enqueue_with_handler>
timeout,
_CORE_RWLock_Timeout
);
/* return to API level so it can dispatch and we block */
}
8005dec: 2b 9d 00 04 lw ra,(sp+4)
8005df0: 2b 8b 00 1c lw r11,(sp+28)
8005df4: 2b 8c 00 18 lw r12,(sp+24)
8005df8: 2b 8d 00 14 lw r13,(sp+20)
8005dfc: 2b 8e 00 10 lw r14,(sp+16)
8005e00: 2b 8f 00 0c lw r15,(sp+12)
8005e04: 2b 90 00 08 lw r16,(sp+8)
8005e08: 37 9c 00 1c addi sp,sp,28
8005e0c: c3 a0 00 00 ret
08005ea0 <_CORE_RWLock_Release>:
*/
CORE_RWLock_Status _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock
)
{
8005ea0: 37 9c ff f4 addi sp,sp,-12
8005ea4: 5b 8b 00 0c sw (sp+12),r11
8005ea8: 5b 8c 00 08 sw (sp+8),r12
8005eac: 5b 9d 00 04 sw (sp+4),ra
8005eb0: b8 20 58 00 mv r11,r1
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
8005eb4: 78 01 08 01 mvhi r1,0x801
8005eb8: 38 21 7d 44 ori r1,r1,0x7d44
8005ebc: 28 22 00 0c lw r2,(r1+12)
* 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 );
8005ec0: 90 00 08 00 rcsr r1,IE
8005ec4: 34 03 ff fe mvi r3,-2
8005ec8: a0 23 18 00 and r3,r1,r3
8005ecc: d0 03 00 00 wcsr IE,r3
if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){
8005ed0: 29 63 00 44 lw r3,(r11+68)
8005ed4: 5c 60 00 05 bne r3,r0,8005ee8 <_CORE_RWLock_Release+0x48>
_ISR_Enable( level );
8005ed8: d0 01 00 00 wcsr IE,r1
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
8005edc: 34 01 00 02 mvi r1,2
8005ee0: 58 41 00 34 sw (r2+52),r1
return CORE_RWLOCK_SUCCESSFUL;
8005ee4: e0 00 00 26 bi 8005f7c <_CORE_RWLock_Release+0xdc>
}
if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) {
8005ee8: 34 04 00 01 mvi r4,1
8005eec: 5c 64 00 07 bne r3,r4,8005f08 <_CORE_RWLock_Release+0x68>
the_rwlock->number_of_readers -= 1;
8005ef0: 29 63 00 48 lw r3,(r11+72)
8005ef4: 34 63 ff ff addi r3,r3,-1
8005ef8: 59 63 00 48 sw (r11+72),r3
if ( the_rwlock->number_of_readers != 0 ) {
8005efc: 44 60 00 03 be r3,r0,8005f08 <_CORE_RWLock_Release+0x68>
/* must be unlocked again */
_ISR_Enable( level );
8005f00: d0 01 00 00 wcsr IE,r1
return CORE_RWLOCK_SUCCESSFUL;
8005f04: e0 00 00 1e bi 8005f7c <_CORE_RWLock_Release+0xdc>
}
}
/* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
8005f08: 58 40 00 34 sw (r2+52),r0
/*
* Implicitly transition to "unlocked" and find another thread interested
* in obtaining this rwlock.
*/
the_rwlock->current_state = CORE_RWLOCK_UNLOCKED;
8005f0c: 59 60 00 44 sw (r11+68),r0
_ISR_Enable( level );
8005f10: d0 01 00 00 wcsr IE,r1
next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue );
8005f14: b9 60 08 00 mv r1,r11
8005f18: f8 00 06 b7 calli 80079f4 <_Thread_queue_Dequeue>
if ( next ) {
8005f1c: 44 20 00 18 be r1,r0,8005f7c <_CORE_RWLock_Release+0xdc>
if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
8005f20: 28 22 00 30 lw r2,(r1+48)
8005f24: 34 01 00 01 mvi r1,1
8005f28: 5c 41 00 04 bne r2,r1,8005f38 <_CORE_RWLock_Release+0x98>
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
8005f2c: 34 01 00 02 mvi r1,2
8005f30: 59 61 00 44 sw (r11+68),r1
return CORE_RWLOCK_SUCCESSFUL;
8005f34: e0 00 00 12 bi 8005f7c <_CORE_RWLock_Release+0xdc>
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
8005f38: 29 62 00 48 lw r2,(r11+72)
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
8005f3c: 59 61 00 44 sw (r11+68),r1
/*
* Now see if more readers can be let go.
*/
while ( 1 ) {
next = _Thread_queue_First( &the_rwlock->Wait_queue );
if ( !next ||
8005f40: 34 0c 00 01 mvi r12,1
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
8005f44: 34 42 00 01 addi r2,r2,1
8005f48: 59 62 00 48 sw (r11+72),r2
/*
* Now see if more readers can be let go.
*/
while ( 1 ) {
next = _Thread_queue_First( &the_rwlock->Wait_queue );
8005f4c: b9 60 08 00 mv r1,r11
8005f50: f8 00 08 2d calli 8008004 <_Thread_queue_First>
8005f54: b8 20 10 00 mv r2,r1
if ( !next ||
8005f58: 44 20 00 09 be r1,r0,8005f7c <_CORE_RWLock_Release+0xdc>
8005f5c: 28 21 00 30 lw r1,(r1+48)
8005f60: 44 2c 00 07 be r1,r12,8005f7c <_CORE_RWLock_Release+0xdc> <== NEVER TAKEN
next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE )
return CORE_RWLOCK_SUCCESSFUL;
the_rwlock->number_of_readers += 1;
8005f64: 29 61 00 48 lw r1,(r11+72)
8005f68: 34 21 00 01 addi r1,r1,1
8005f6c: 59 61 00 48 sw (r11+72),r1
_Thread_queue_Extract( &the_rwlock->Wait_queue, next );
8005f70: b9 60 08 00 mv r1,r11
8005f74: f8 00 07 dc calli 8007ee4 <_Thread_queue_Extract>
}
8005f78: e3 ff ff f5 bi 8005f4c <_CORE_RWLock_Release+0xac>
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
8005f7c: 34 01 00 00 mvi r1,0
8005f80: 2b 9d 00 04 lw ra,(sp+4)
8005f84: 2b 8b 00 0c lw r11,(sp+12)
8005f88: 2b 8c 00 08 lw r12,(sp+8)
8005f8c: 37 9c 00 0c addi sp,sp,12
8005f90: c3 a0 00 00 ret
08005f94 <_CORE_RWLock_Timeout>:
void _CORE_RWLock_Timeout(
Objects_Id id,
void *ignored
)
{
8005f94: 37 9c ff f8 addi sp,sp,-8
8005f98: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
8005f9c: 37 82 00 08 addi r2,sp,8
8005fa0: f8 00 05 98 calli 8007600 <_Thread_Get>
switch ( location ) {
8005fa4: 2b 82 00 08 lw r2,(sp+8)
8005fa8: 5c 40 00 07 bne r2,r0,8005fc4 <_CORE_RWLock_Timeout+0x30> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
8005fac: f8 00 08 7b calli 8008198 <_Thread_queue_Process_timeout>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
8005fb0: 78 01 08 01 mvhi r1,0x801
8005fb4: 38 21 78 6c ori r1,r1,0x786c
8005fb8: 28 22 00 00 lw r2,(r1+0)
8005fbc: 34 42 ff ff addi r2,r2,-1
8005fc0: 58 22 00 00 sw (r1+0),r2
_Thread_Unnest_dispatch();
break;
}
}
8005fc4: 2b 9d 00 04 lw ra,(sp+4)
8005fc8: 37 9c 00 08 addi sp,sp,8
8005fcc: c3 a0 00 00 ret
08015790 <_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
)
{
8015790: 37 9c ff e4 addi sp,sp,-28
8015794: 5b 8b 00 1c sw (sp+28),r11
8015798: 5b 8c 00 18 sw (sp+24),r12
801579c: 5b 8d 00 14 sw (sp+20),r13
80157a0: 5b 8e 00 10 sw (sp+16),r14
80157a4: 5b 8f 00 0c sw (sp+12),r15
80157a8: 5b 90 00 08 sw (sp+8),r16
80157ac: 5b 9d 00 04 sw (sp+4),ra
80157b0: b8 40 80 00 mv r16,r2
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
80157b4: 28 22 00 4c lw r2,(r1+76)
Objects_Id id __attribute__((unused)),
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)),
#endif
uint32_t *count
)
{
80157b8: b8 20 58 00 mv r11,r1
80157bc: b8 60 68 00 mv r13,r3
80157c0: b8 c0 78 00 mv r15,r6
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE;
80157c4: 34 01 00 01 mvi r1,1
{
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
80157c8: 54 62 00 13 bgu r3,r2,8015814 <_CORE_message_queue_Broadcast+0x84><== NEVER TAKEN
* 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 ) {
80157cc: 29 61 00 48 lw r1,(r11+72)
80157d0: 34 0c 00 00 mvi r12,0
80157d4: 44 20 00 0a be r1,r0,80157fc <_CORE_message_queue_Broadcast+0x6c>
*count = 0;
80157d8: 58 c0 00 00 sw (r6+0),r0
80157dc: e0 00 00 0d bi 8015810 <_CORE_message_queue_Broadcast+0x80>
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
80157e0: 29 c1 00 2c lw r1,(r14+44)
80157e4: ba 00 10 00 mv r2,r16
80157e8: b9 a0 18 00 mv r3,r13
80157ec: f8 00 2a ef calli 80203a8 <memcpy>
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
80157f0: 29 c1 00 28 lw r1,(r14+40)
*/
number_broadcasted = 0;
while ((the_thread =
_Thread_queue_Dequeue(&the_message_queue->Wait_queue))) {
waitp = &the_thread->Wait;
number_broadcasted += 1;
80157f4: 35 8c 00 01 addi r12,r12,1
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
80157f8: 58 2d 00 00 sw (r1+0),r13
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
80157fc: b9 60 08 00 mv r1,r11
8015800: f8 00 0c 67 calli 801899c <_Thread_queue_Dequeue>
8015804: b8 20 70 00 mv r14,r1
8015808: 5c 20 ff f6 bne r1,r0,80157e0 <_CORE_message_queue_Broadcast+0x50>
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_message_queue_mp_support) ( the_thread, id );
#endif
}
*count = number_broadcasted;
801580c: 59 ec 00 00 sw (r15+0),r12
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
8015810: 34 01 00 00 mvi r1,0
}
8015814: 2b 9d 00 04 lw ra,(sp+4)
8015818: 2b 8b 00 1c lw r11,(sp+28)
801581c: 2b 8c 00 18 lw r12,(sp+24)
8015820: 2b 8d 00 14 lw r13,(sp+20)
8015824: 2b 8e 00 10 lw r14,(sp+16)
8015828: 2b 8f 00 0c lw r15,(sp+12)
801582c: 2b 90 00 08 lw r16,(sp+8)
8015830: 37 9c 00 1c addi sp,sp,28
8015834: c3 a0 00 00 ret
0800db4c <_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
)
{
800db4c: 37 9c ff e4 addi sp,sp,-28
800db50: 5b 8b 00 1c sw (sp+28),r11
800db54: 5b 8c 00 18 sw (sp+24),r12
800db58: 5b 8d 00 14 sw (sp+20),r13
800db5c: 5b 8e 00 10 sw (sp+16),r14
800db60: 5b 8f 00 0c sw (sp+12),r15
800db64: 5b 90 00 08 sw (sp+8),r16
800db68: 5b 9d 00 04 sw (sp+4),ra
800db6c: b8 20 58 00 mv r11,r1
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;
800db70: 58 20 00 48 sw (r1+72),r0
the_message_queue->maximum_message_size = maximum_message_size;
800db74: 58 24 00 4c sw (r1+76),r4
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Notify_Handler the_handler,
void *the_argument
)
{
the_message_queue->notify_handler = the_handler;
800db78: 58 20 00 60 sw (r1+96),r0
the_message_queue->notify_argument = the_argument;
800db7c: 58 20 00 64 sw (r1+100),r0
)
{
size_t message_buffering_required;
size_t allocated_message_size;
the_message_queue->maximum_pending_messages = maximum_pending_messages;
800db80: 59 63 00 44 sw (r11+68),r3
/*
* 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)) {
800db84: 20 81 00 03 andi r1,r4,0x3
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
)
{
800db88: b8 40 80 00 mv r16,r2
800db8c: b8 60 70 00 mv r14,r3
/*
* 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)) {
800db90: b8 80 60 00 mv r12,r4
800db94: 44 20 00 06 be r1,r0,800dbac <_CORE_message_queue_Initialize+0x60>
allocated_message_size += sizeof(uint32_t);
800db98: 34 8c 00 04 addi r12,r4,4
allocated_message_size &= ~(sizeof(uint32_t) - 1);
800db9c: 34 01 ff fc mvi r1,-4
800dba0: a1 81 60 00 and r12,r12,r1
}
if (allocated_message_size < maximum_message_size)
return false;
800dba4: 34 0d 00 00 mvi r13,0
if (allocated_message_size & (sizeof(uint32_t) - 1)) {
allocated_message_size += sizeof(uint32_t);
allocated_message_size &= ~(sizeof(uint32_t) - 1);
}
if (allocated_message_size < maximum_message_size)
800dba8: 54 8c 00 1c bgu r4,r12,800dc18 <_CORE_message_queue_Initialize+0xcc><== NEVER TAKEN
/*
* 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));
800dbac: 35 8f 00 14 addi r15,r12,20
/*
* 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 *
800dbb0: b9 e0 08 00 mv r1,r15
800dbb4: b9 c0 10 00 mv r2,r14
800dbb8: f8 00 5c ee calli 8024f70 <__mulsi3>
(allocated_message_size + sizeof(CORE_message_queue_Buffer_control));
if (message_buffering_required < allocated_message_size)
return false;
800dbbc: 34 0d 00 00 mvi r13,0
* check for overflow on the multiplication.
*/
message_buffering_required = (size_t) maximum_pending_messages *
(allocated_message_size + sizeof(CORE_message_queue_Buffer_control));
if (message_buffering_required < allocated_message_size)
800dbc0: 55 81 00 16 bgu r12,r1,800dc18 <_CORE_message_queue_Initialize+0xcc><== NEVER TAKEN
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
_Workspace_Allocate( message_buffering_required );
800dbc4: f8 00 0e 6e calli 801157c <_Workspace_Allocate>
return false;
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
800dbc8: 59 61 00 5c sw (r11+92),r1
_Workspace_Allocate( message_buffering_required );
800dbcc: b8 20 28 00 mv r5,r1
if (the_message_queue->message_buffers == 0)
800dbd0: 44 20 00 12 be r1,r0,800dc18 <_CORE_message_queue_Initialize+0xcc>
/*
* Initialize the pool of inactive messages, pending messages,
* and set of waiting threads.
*/
_Chain_Initialize (
800dbd4: b8 a0 10 00 mv r2,r5
800dbd8: 35 61 00 68 addi r1,r11,104
800dbdc: b9 c0 18 00 mv r3,r14
800dbe0: b9 e0 20 00 mv r4,r15
800dbe4: f8 00 19 b9 calli 80142c8 <_Chain_Initialize>
allocated_message_size + sizeof( CORE_message_queue_Buffer_control )
);
_Chain_Initialize_empty( &the_message_queue->Pending_messages );
_Thread_queue_Initialize(
800dbe8: 2a 02 00 00 lw r2,(r16+0)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
800dbec: 35 61 00 54 addi r1,r11,84
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
800dbf0: 59 61 00 50 sw (r11+80),r1
800dbf4: 64 42 00 01 cmpei r2,r2,1
the_message_queue->message_buffers,
(size_t) maximum_pending_messages,
allocated_message_size + sizeof( CORE_message_queue_Buffer_control )
);
_Chain_Initialize_empty( &the_message_queue->Pending_messages );
800dbf8: 35 61 00 50 addi r1,r11,80
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
800dbfc: 59 61 00 58 sw (r11+88),r1
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
the_chain->permanent_null = NULL;
800dc00: 59 60 00 54 sw (r11+84),r0
_Thread_queue_Initialize(
800dc04: b9 60 08 00 mv r1,r11
800dc08: 34 03 00 80 mvi r3,128
800dc0c: 34 04 00 06 mvi r4,6
800dc10: f8 00 0a 7b calli 80105fc <_Thread_queue_Initialize>
THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
STATES_WAITING_FOR_MESSAGE,
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
);
return true;
800dc14: 34 0d 00 01 mvi r13,1
}
800dc18: b9 a0 08 00 mv r1,r13
800dc1c: 2b 9d 00 04 lw ra,(sp+4)
800dc20: 2b 8b 00 1c lw r11,(sp+28)
800dc24: 2b 8c 00 18 lw r12,(sp+24)
800dc28: 2b 8d 00 14 lw r13,(sp+20)
800dc2c: 2b 8e 00 10 lw r14,(sp+16)
800dc30: 2b 8f 00 0c lw r15,(sp+12)
800dc34: 2b 90 00 08 lw r16,(sp+8)
800dc38: 37 9c 00 1c addi sp,sp,28
800dc3c: c3 a0 00 00 ret
0800dc40 <_CORE_message_queue_Seize>:
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800dc40: 37 9c ff f0 addi sp,sp,-16
800dc44: 5b 8b 00 10 sw (sp+16),r11
800dc48: 5b 8c 00 0c sw (sp+12),r12
800dc4c: 5b 8d 00 08 sw (sp+8),r13
800dc50: 5b 9d 00 04 sw (sp+4),ra
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
800dc54: 78 07 08 02 mvhi r7,0x802
800dc58: 38 e7 8f 0c ori r7,r7,0x8f0c
800dc5c: 28 e7 00 0c lw r7,(r7+12)
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800dc60: b8 20 60 00 mv r12,r1
800dc64: 20 a5 00 ff andi r5,r5,0xff
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;
800dc68: 58 e0 00 34 sw (r7+52),r0
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800dc6c: b8 60 08 00 mv r1,r3
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
_ISR_Disable( level );
800dc70: 90 00 40 00 rcsr r8,IE
800dc74: 34 03 ff fe mvi r3,-2
800dc78: a1 03 18 00 and r3,r8,r3
800dc7c: d0 03 00 00 wcsr IE,r3
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
800dc80: 29 8b 00 50 lw r11,(r12+80)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
800dc84: 35 83 00 54 addi r3,r12,84
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800dc88: 45 63 00 07 be r11,r3,800dca4 <_CORE_message_queue_Seize+0x64>
{
Chain_Node *return_node;
Chain_Node *new_first;
return_node = the_chain->first;
new_first = return_node->next;
800dc8c: 29 63 00 00 lw r3,(r11+0)
CORE_message_queue_Buffer_control *_CORE_message_queue_Get_pending_message (
CORE_message_queue_Control *the_message_queue
)
{
return (CORE_message_queue_Buffer_control *)
_Chain_Get_unprotected( &the_message_queue->Pending_messages );
800dc90: 35 89 00 50 addi r9,r12,80
the_chain->first = new_first;
800dc94: 59 83 00 50 sw (r12+80),r3
new_first->previous = _Chain_Head(the_chain);
800dc98: 58 69 00 04 sw (r3+4),r9
the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
if ( the_message != NULL ) {
800dc9c: 5d 60 00 04 bne r11,r0,800dcac <_CORE_message_queue_Seize+0x6c><== ALWAYS TAKEN
800dca0: e0 00 00 25 bi 800dd34 <_CORE_message_queue_Seize+0xf4> <== NOT EXECUTED
)
{
if ( !_Chain_Is_empty(the_chain))
return _Chain_Get_first_unprotected(the_chain);
else
return NULL;
800dca4: 34 0b 00 00 mvi r11,0
800dca8: e0 00 00 23 bi 800dd34 <_CORE_message_queue_Seize+0xf4>
the_message_queue->number_of_pending_messages -= 1;
800dcac: 29 82 00 48 lw r2,(r12+72)
800dcb0: 34 42 ff ff addi r2,r2,-1
800dcb4: 59 82 00 48 sw (r12+72),r2
_ISR_Enable( level );
800dcb8: d0 08 00 00 wcsr IE,r8
*size_p = the_message->Contents.size;
800dcbc: 29 63 00 0c lw r3,(r11+12)
_Thread_Executing->Wait.count =
800dcc0: 78 02 08 02 mvhi r2,0x802
800dcc4: 38 42 8f 0c ori r2,r2,0x8f0c
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;
800dcc8: 58 83 00 00 sw (r4+0),r3
_Thread_Executing->Wait.count =
800dccc: 29 64 00 08 lw r4,(r11+8)
800dcd0: 28 42 00 0c lw r2,(r2+12)
_CORE_message_queue_Get_message_priority( the_message );
_CORE_message_queue_Copy_buffer(
the_message->Contents.buffer,
800dcd4: 35 6d 00 10 addi r13,r11,16
if ( the_message != NULL ) {
the_message_queue->number_of_pending_messages -= 1;
_ISR_Enable( level );
*size_p = the_message->Contents.size;
_Thread_Executing->Wait.count =
800dcd8: 58 44 00 24 sw (r2+36),r4
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800dcdc: b9 a0 10 00 mv r2,r13
800dce0: f8 00 27 a1 calli 8017b64 <memcpy>
* 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 );
800dce4: b9 80 08 00 mv r1,r12
800dce8: f8 00 08 e8 calli 8010088 <_Thread_queue_Dequeue>
800dcec: b8 20 20 00 mv r4,r1
if ( !the_thread ) {
800dcf0: 5c 20 00 05 bne r1,r0,800dd04 <_CORE_message_queue_Seize+0xc4>
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 );
800dcf4: 35 81 00 68 addi r1,r12,104
800dcf8: b9 60 10 00 mv r2,r11
800dcfc: fb ff ff 64 calli 800da8c <_Chain_Append>
_CORE_message_queue_Free_message_buffer(
the_message_queue,
the_message
);
return;
800dd00: e0 00 00 1e bi 800dd78 <_CORE_message_queue_Seize+0x138>
CORE_message_queue_Buffer_control *the_message,
int priority
)
{
#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
the_message->priority = priority;
800dd04: 28 21 00 24 lw r1,(r1+36)
*/
_CORE_message_queue_Set_message_priority(
the_message,
the_thread->Wait.count
);
the_message->Contents.size = (size_t) the_thread->Wait.option;
800dd08: 28 83 00 30 lw r3,(r4+48)
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800dd0c: 28 82 00 2c lw r2,(r4+44)
CORE_message_queue_Buffer_control *the_message,
int priority
)
{
#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
the_message->priority = priority;
800dd10: 59 61 00 08 sw (r11+8),r1
800dd14: 59 63 00 0c sw (r11+12),r3
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800dd18: b9 a0 08 00 mv r1,r13
800dd1c: f8 00 27 92 calli 8017b64 <memcpy>
the_thread->Wait.return_argument_second.immutable_object,
the_message->Contents.buffer,
the_message->Contents.size
);
_CORE_message_queue_Insert_message(
800dd20: 29 63 00 08 lw r3,(r11+8)
800dd24: b9 80 08 00 mv r1,r12
800dd28: b9 60 10 00 mv r2,r11
800dd2c: f8 00 19 74 calli 80142fc <_CORE_message_queue_Insert_message>
the_message_queue,
the_message,
_CORE_message_queue_Get_message_priority( the_message )
);
return;
800dd30: e0 00 00 12 bi 800dd78 <_CORE_message_queue_Seize+0x138>
}
#endif
}
if ( !wait ) {
800dd34: 5c ab 00 05 bne r5,r11,800dd48 <_CORE_message_queue_Seize+0x108>
_ISR_Enable( level );
800dd38: d0 08 00 00 wcsr IE,r8
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
800dd3c: 34 01 00 04 mvi r1,4
800dd40: 58 e1 00 34 sw (r7+52),r1
return;
800dd44: e0 00 00 0d bi 800dd78 <_CORE_message_queue_Seize+0x138>
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;
800dd48: 34 03 00 01 mvi r3,1
800dd4c: 59 83 00 30 sw (r12+48),r3
}
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
executing->Wait.queue = &the_message_queue->Wait_queue;
800dd50: 58 ec 00 44 sw (r7+68),r12
executing->Wait.id = id;
800dd54: 58 e2 00 20 sw (r7+32),r2
executing->Wait.return_argument_second.mutable_object = buffer;
800dd58: 58 e1 00 2c sw (r7+44),r1
executing->Wait.return_argument = size_p;
800dd5c: 58 e4 00 28 sw (r7+40),r4
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
800dd60: d0 08 00 00 wcsr IE,r8
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
800dd64: 78 03 08 01 mvhi r3,0x801
800dd68: b9 80 08 00 mv r1,r12
800dd6c: b8 c0 10 00 mv r2,r6
800dd70: 38 63 07 68 ori r3,r3,0x768
800dd74: f8 00 09 36 calli 801024c <_Thread_queue_Enqueue_with_handler>
}
800dd78: 2b 9d 00 04 lw ra,(sp+4)
800dd7c: 2b 8b 00 10 lw r11,(sp+16)
800dd80: 2b 8c 00 0c lw r12,(sp+12)
800dd84: 2b 8d 00 08 lw r13,(sp+8)
800dd88: 37 9c 00 10 addi sp,sp,16
800dd8c: c3 a0 00 00 ret
08004d84 <_CORE_mutex_Seize>:
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
8004d84: 37 9c ff e8 addi sp,sp,-24
8004d88: 5b 8b 00 14 sw (sp+20),r11
8004d8c: 5b 8c 00 10 sw (sp+16),r12
8004d90: 5b 8d 00 0c sw (sp+12),r13
8004d94: 5b 8e 00 08 sw (sp+8),r14
8004d98: 5b 9d 00 04 sw (sp+4),ra
8004d9c: b8 20 58 00 mv r11,r1
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
8004da0: 78 01 08 01 mvhi r1,0x801
8004da4: 38 21 99 24 ori r1,r1,0x9924
8004da8: 28 21 00 00 lw r1,(r1+0)
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
8004dac: 5b 85 00 18 sw (sp+24),r5
8004db0: b8 40 70 00 mv r14,r2
8004db4: b8 80 68 00 mv r13,r4
8004db8: 20 6c 00 ff andi r12,r3,0xff
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
8004dbc: 44 20 00 0b be r1,r0,8004de8 <_CORE_mutex_Seize+0x64>
8004dc0: 45 80 00 0a be r12,r0,8004de8 <_CORE_mutex_Seize+0x64> <== NEVER TAKEN
8004dc4: 78 01 08 01 mvhi r1,0x801
8004dc8: 38 21 9a a4 ori r1,r1,0x9aa4
8004dcc: 28 21 00 00 lw r1,(r1+0)
8004dd0: 34 02 00 01 mvi r2,1
8004dd4: 50 41 00 05 bgeu r2,r1,8004de8 <_CORE_mutex_Seize+0x64>
8004dd8: 34 01 00 00 mvi r1,0
8004ddc: 34 02 00 00 mvi r2,0
8004de0: 34 03 00 12 mvi r3,18
8004de4: f8 00 02 0e calli 800561c <_Internal_error_Occurred>
8004de8: b9 60 08 00 mv r1,r11
8004dec: 37 82 00 18 addi r2,sp,24
8004df0: f8 00 25 9d calli 800e464 <_CORE_mutex_Seize_interrupt_trylock>
8004df4: 44 20 00 19 be r1,r0,8004e58 <_CORE_mutex_Seize+0xd4>
8004df8: 78 01 08 01 mvhi r1,0x801
8004dfc: 38 21 9d fc ori r1,r1,0x9dfc
8004e00: 5d 80 00 07 bne r12,r0,8004e1c <_CORE_mutex_Seize+0x98>
8004e04: 2b 82 00 18 lw r2,(sp+24)
8004e08: d0 02 00 00 wcsr IE,r2
8004e0c: 28 21 00 0c lw r1,(r1+12)
8004e10: 34 02 00 01 mvi r2,1
8004e14: 58 22 00 34 sw (r1+52),r2
8004e18: e0 00 00 10 bi 8004e58 <_CORE_mutex_Seize+0xd4>
8004e1c: 28 21 00 0c lw r1,(r1+12)
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;
8004e20: 34 02 00 01 mvi r2,1
8004e24: 59 62 00 30 sw (r11+48),r2
8004e28: 58 2b 00 44 sw (r1+68),r11
8004e2c: 58 2e 00 20 sw (r1+32),r14
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8004e30: 78 01 08 01 mvhi r1,0x801
8004e34: 38 21 99 24 ori r1,r1,0x9924
8004e38: 28 22 00 00 lw r2,(r1+0)
8004e3c: 34 42 00 01 addi r2,r2,1
8004e40: 58 22 00 00 sw (r1+0),r2
8004e44: 2b 81 00 18 lw r1,(sp+24)
8004e48: d0 01 00 00 wcsr IE,r1
8004e4c: b9 60 08 00 mv r1,r11
8004e50: b9 a0 10 00 mv r2,r13
8004e54: fb ff ff ab calli 8004d00 <_CORE_mutex_Seize_interrupt_blocking>
}
8004e58: 2b 9d 00 04 lw ra,(sp+4)
8004e5c: 2b 8b 00 14 lw r11,(sp+20)
8004e60: 2b 8c 00 10 lw r12,(sp+16)
8004e64: 2b 8d 00 0c lw r13,(sp+12)
8004e68: 2b 8e 00 08 lw r14,(sp+8)
8004e6c: 37 9c 00 18 addi sp,sp,24
8004e70: c3 a0 00 00 ret
08004e74 <_CORE_mutex_Surrender>:
#else
Objects_Id id __attribute__((unused)),
CORE_mutex_API_mp_support_callout api_mutex_mp_support __attribute__((unused))
#endif
)
{
8004e74: 37 9c ff f4 addi sp,sp,-12
8004e78: 5b 8b 00 0c sw (sp+12),r11
8004e7c: 5b 8c 00 08 sw (sp+8),r12
8004e80: 5b 9d 00 04 sw (sp+4),ra
8004e84: b8 20 58 00 mv r11,r1
* allowed when the mutex in quetion is FIFO or simple Priority
* discipline. But Priority Ceiling or Priority Inheritance mutexes
* must be released by the thread which acquired them.
*/
if ( the_mutex->Attributes.only_owner_release ) {
8004e88: 41 62 00 44 lbu r2,(r11+68)
)
{
Thread_Control *the_thread;
Thread_Control *holder;
holder = the_mutex->holder;
8004e8c: 28 21 00 5c lw r1,(r1+92)
* allowed when the mutex in quetion is FIFO or simple Priority
* discipline. But Priority Ceiling or Priority Inheritance mutexes
* must be released by the thread which acquired them.
*/
if ( the_mutex->Attributes.only_owner_release ) {
8004e90: 44 40 00 06 be r2,r0,8004ea8 <_CORE_mutex_Surrender+0x34>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
8004e94: 78 02 08 01 mvhi r2,0x801
8004e98: 38 42 9d fc ori r2,r2,0x9dfc
if ( !_Thread_Is_executing( holder ) )
8004e9c: 28 42 00 0c lw r2,(r2+12)
return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE;
8004ea0: 34 0c 00 03 mvi r12,3
* discipline. But Priority Ceiling or Priority Inheritance mutexes
* must be released by the thread which acquired them.
*/
if ( the_mutex->Attributes.only_owner_release ) {
if ( !_Thread_Is_executing( holder ) )
8004ea4: 5c 22 00 37 bne r1,r2,8004f80 <_CORE_mutex_Surrender+0x10c>
return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE;
}
/* XXX already unlocked -- not right status */
if ( !the_mutex->nest_count )
8004ea8: 29 62 00 54 lw r2,(r11+84)
return CORE_MUTEX_STATUS_SUCCESSFUL;
8004eac: 34 0c 00 00 mvi r12,0
return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE;
}
/* XXX already unlocked -- not right status */
if ( !the_mutex->nest_count )
8004eb0: 44 40 00 34 be r2,r0,8004f80 <_CORE_mutex_Surrender+0x10c>
return CORE_MUTEX_STATUS_SUCCESSFUL;
the_mutex->nest_count--;
8004eb4: 34 42 ff ff addi r2,r2,-1
8004eb8: 59 62 00 54 sw (r11+84),r2
if ( the_mutex->nest_count != 0 ) {
8004ebc: 5c 40 00 31 bne r2,r0,8004f80 <_CORE_mutex_Surrender+0x10c>
}
} else
the_mutex->lock = CORE_MUTEX_UNLOCKED;
return CORE_MUTEX_STATUS_SUCCESSFUL;
}
8004ec0: 29 62 00 48 lw r2,(r11+72)
/*
* Formally release the mutex before possibly transferring it to a
* blocked thread.
*/
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
8004ec4: 34 03 00 02 mvi r3,2
8004ec8: 44 43 00 03 be r2,r3,8004ed4 <_CORE_mutex_Surrender+0x60>
8004ecc: 34 03 00 03 mvi r3,3
8004ed0: 5c 43 00 0a bne r2,r3,8004ef8 <_CORE_mutex_Surrender+0x84>
_CORE_mutex_Pop_priority( the_mutex, holder );
if ( pop_status != CORE_MUTEX_STATUS_SUCCESSFUL )
return pop_status;
holder->resource_count--;
8004ed4: 28 22 00 1c lw r2,(r1+28)
8004ed8: 34 42 ff ff addi r2,r2,-1
8004edc: 58 22 00 1c sw (r1+28),r2
/*
* Whether or not someone is waiting for the mutex, an
* inherited priority must be lowered if this is the last
* mutex (i.e. resource) this task has.
*/
if ( holder->resource_count == 0 &&
8004ee0: 5c 40 00 06 bne r2,r0,8004ef8 <_CORE_mutex_Surrender+0x84>
holder->real_priority != holder->current_priority ) {
8004ee4: 28 22 00 18 lw r2,(r1+24)
/*
* Whether or not someone is waiting for the mutex, an
* inherited priority must be lowered if this is the last
* mutex (i.e. resource) this task has.
*/
if ( holder->resource_count == 0 &&
8004ee8: 28 23 00 14 lw r3,(r1+20)
8004eec: 44 43 00 03 be r2,r3,8004ef8 <_CORE_mutex_Surrender+0x84>
holder->real_priority != holder->current_priority ) {
_Thread_Change_priority( holder, holder->real_priority, true );
8004ef0: 34 03 00 01 mvi r3,1
8004ef4: f8 00 04 8a calli 800611c <_Thread_Change_priority>
}
}
the_mutex->holder = NULL;
8004ef8: 59 60 00 5c sw (r11+92),r0
the_mutex->holder_id = 0;
8004efc: 59 60 00 60 sw (r11+96),r0
/*
* Now we check if another thread was waiting for this mutex. If so,
* transfer the mutex to that thread.
*/
if ( ( the_thread = _Thread_queue_Dequeue( &the_mutex->Wait_queue ) ) ) {
8004f00: b9 60 08 00 mv r1,r11
8004f04: f8 00 06 b2 calli 80069cc <_Thread_queue_Dequeue>
8004f08: b8 20 18 00 mv r3,r1
8004f0c: 44 20 00 1a be r1,r0,8004f74 <_CORE_mutex_Surrender+0x100>
} else
#endif
{
the_mutex->holder = the_thread;
the_mutex->holder_id = the_thread->Object.id;
8004f10: 28 22 00 08 lw r2,(r1+8)
} else
#endif
{
the_mutex->holder = the_thread;
8004f14: 59 61 00 5c sw (r11+92),r1
the_mutex->holder_id = the_thread->Object.id;
the_mutex->nest_count = 1;
switch ( the_mutex->Attributes.discipline ) {
8004f18: 34 04 00 02 mvi r4,2
} else
#endif
{
the_mutex->holder = the_thread;
the_mutex->holder_id = the_thread->Object.id;
8004f1c: 59 62 00 60 sw (r11+96),r2
the_mutex->nest_count = 1;
8004f20: 34 02 00 01 mvi r2,1
8004f24: 59 62 00 54 sw (r11+84),r2
switch ( the_mutex->Attributes.discipline ) {
8004f28: 29 62 00 48 lw r2,(r11+72)
8004f2c: 44 44 00 04 be r2,r4,8004f3c <_CORE_mutex_Surrender+0xc8>
8004f30: 34 04 00 03 mvi r4,3
8004f34: 5c 44 00 12 bne r2,r4,8004f7c <_CORE_mutex_Surrender+0x108>
8004f38: e0 00 00 05 bi 8004f4c <_CORE_mutex_Surrender+0xd8>
case CORE_MUTEX_DISCIPLINES_FIFO:
case CORE_MUTEX_DISCIPLINES_PRIORITY:
break;
case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
_CORE_mutex_Push_priority( the_mutex, the_thread );
the_thread->resource_count++;
8004f3c: 28 21 00 1c lw r1,(r1+28)
8004f40: 34 21 00 01 addi r1,r1,1
8004f44: 58 61 00 1c sw (r3+28),r1
8004f48: e0 00 00 0d bi 8004f7c <_CORE_mutex_Surrender+0x108>
break;
case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
_CORE_mutex_Push_priority( the_mutex, the_thread );
the_thread->resource_count++;
8004f4c: 28 22 00 1c lw r2,(r1+28)
if (the_mutex->Attributes.priority_ceiling <
8004f50: 28 23 00 14 lw r3,(r1+20)
}
}
} else
the_mutex->lock = CORE_MUTEX_UNLOCKED;
return CORE_MUTEX_STATUS_SUCCESSFUL;
8004f54: 34 0c 00 00 mvi r12,0
_CORE_mutex_Push_priority( the_mutex, the_thread );
the_thread->resource_count++;
break;
case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
_CORE_mutex_Push_priority( the_mutex, the_thread );
the_thread->resource_count++;
8004f58: 34 42 00 01 addi r2,r2,1
8004f5c: 58 22 00 1c sw (r1+28),r2
if (the_mutex->Attributes.priority_ceiling <
8004f60: 29 62 00 4c lw r2,(r11+76)
8004f64: 50 43 00 07 bgeu r2,r3,8004f80 <_CORE_mutex_Surrender+0x10c><== NEVER TAKEN
the_thread->current_priority){
_Thread_Change_priority(
8004f68: 34 03 00 00 mvi r3,0
8004f6c: f8 00 04 6c calli 800611c <_Thread_Change_priority>
8004f70: e0 00 00 04 bi 8004f80 <_CORE_mutex_Surrender+0x10c>
}
break;
}
}
} else
the_mutex->lock = CORE_MUTEX_UNLOCKED;
8004f74: 34 01 00 01 mvi r1,1
8004f78: 59 61 00 50 sw (r11+80),r1
return CORE_MUTEX_STATUS_SUCCESSFUL;
8004f7c: 34 0c 00 00 mvi r12,0
}
8004f80: b9 80 08 00 mv r1,r12
8004f84: 2b 9d 00 04 lw ra,(sp+4)
8004f88: 2b 8b 00 0c lw r11,(sp+12)
8004f8c: 2b 8c 00 08 lw r12,(sp+8)
8004f90: 37 9c 00 0c addi sp,sp,12
8004f94: c3 a0 00 00 ret
08004fec <_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
)
{
8004fec: 37 9c ff f8 addi sp,sp,-8
8004ff0: 5b 8b 00 08 sw (sp+8),r11
8004ff4: 5b 9d 00 04 sw (sp+4),ra
8004ff8: b8 20 58 00 mv r11,r1
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
8004ffc: f8 00 06 74 calli 80069cc <_Thread_queue_Dequeue>
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
8005000: 34 02 00 00 mvi r2,0
if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
8005004: 5c 20 00 0d bne r1,r0,8005038 <_CORE_semaphore_Surrender+0x4c>
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_semaphore_mp_support) ( the_thread, id );
#endif
} else {
_ISR_Disable( level );
8005008: 90 00 08 00 rcsr r1,IE
800500c: 34 02 ff fe mvi r2,-2
8005010: a0 22 10 00 and r2,r1,r2
8005014: d0 02 00 00 wcsr IE,r2
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
8005018: 29 63 00 48 lw r3,(r11+72)
800501c: 29 64 00 40 lw r4,(r11+64)
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
8005020: 34 02 00 04 mvi r2,4
(*api_semaphore_mp_support) ( the_thread, id );
#endif
} else {
_ISR_Disable( level );
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
8005024: 50 64 00 04 bgeu r3,r4,8005034 <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN
the_semaphore->count += 1;
8005028: 34 63 00 01 addi r3,r3,1
800502c: 59 63 00 48 sw (r11+72),r3
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
8005030: 34 02 00 00 mvi r2,0
_ISR_Disable( level );
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
_ISR_Enable( level );
8005034: d0 01 00 00 wcsr IE,r1
}
return status;
}
8005038: b8 40 08 00 mv r1,r2
800503c: 2b 9d 00 04 lw ra,(sp+4)
8005040: 2b 8b 00 08 lw r11,(sp+8)
8005044: 37 9c 00 08 addi sp,sp,8
8005048: c3 a0 00 00 ret
0800d6c8 <_Event_Seize>:
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
800d6c8: 37 9c ff f8 addi sp,sp,-8
800d6cc: 5b 8b 00 08 sw (sp+8),r11
800d6d0: 5b 9d 00 04 sw (sp+4),ra
rtems_event_set pending_events;
ISR_Level level;
RTEMS_API_Control *api;
Thread_blocking_operation_States sync_state;
executing = _Thread_Executing;
800d6d4: 78 05 08 01 mvhi r5,0x801
800d6d8: 38 a5 9d fc ori r5,r5,0x9dfc
800d6dc: 28 ab 00 0c lw r11,(r5+12)
executing->Wait.return_code = RTEMS_SUCCESSFUL;
800d6e0: 59 60 00 34 sw (r11+52),r0
api = executing->API_Extensions[ THREAD_API_RTEMS ];
800d6e4: 29 67 01 28 lw r7,(r11+296)
_ISR_Disable( level );
800d6e8: 90 00 30 00 rcsr r6,IE
800d6ec: 34 05 ff fe mvi r5,-2
800d6f0: a0 c5 28 00 and r5,r6,r5
800d6f4: d0 05 00 00 wcsr IE,r5
pending_events = api->pending_events;
800d6f8: 28 e8 00 00 lw r8,(r7+0)
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
rtems_event_set the_event_set,
rtems_event_set the_event_condition
)
{
return ( the_event_set & the_event_condition );
800d6fc: a0 28 28 00 and r5,r1,r8
seized_events = _Event_sets_Get( pending_events, event_in );
if ( !_Event_sets_Is_empty( seized_events ) &&
800d700: 44 a0 00 09 be r5,r0,800d724 <_Event_Seize+0x5c>
800d704: 44 a1 00 03 be r5,r1,800d710 <_Event_Seize+0x48>
*/
RTEMS_INLINE_ROUTINE bool _Options_Is_any (
rtems_option option_set
)
{
return (option_set & RTEMS_EVENT_ANY) ? true : false;
800d708: 20 49 00 02 andi r9,r2,0x2
(seized_events == event_in || _Options_Is_any( option_set )) ) {
800d70c: 45 20 00 06 be r9,r0,800d724 <_Event_Seize+0x5c> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
rtems_event_set the_event_set,
rtems_event_set the_mask
)
{
return ( the_event_set & ~(the_mask) );
800d710: a4 a0 08 00 not r1,r5
800d714: a0 28 40 00 and r8,r1,r8
api->pending_events =
800d718: 58 e8 00 00 sw (r7+0),r8
_Event_sets_Clear( pending_events, seized_events );
_ISR_Enable( level );
800d71c: d0 06 00 00 wcsr IE,r6
800d720: e0 00 00 06 bi 800d738 <_Event_Seize+0x70>
*/
RTEMS_INLINE_ROUTINE bool _Options_Is_no_wait (
rtems_option option_set
)
{
return (option_set & RTEMS_NO_WAIT) ? true : false;
800d724: 20 47 00 01 andi r7,r2,0x1
*event_out = seized_events;
return;
}
if ( _Options_Is_no_wait( option_set ) ) {
800d728: 44 e0 00 06 be r7,r0,800d740 <_Event_Seize+0x78>
_ISR_Enable( level );
800d72c: d0 06 00 00 wcsr IE,r6
executing->Wait.return_code = RTEMS_UNSATISFIED;
800d730: 34 01 00 0d mvi r1,13
800d734: 59 61 00 34 sw (r11+52),r1
*event_out = seized_events;
800d738: 58 85 00 00 sw (r4+0),r5
return;
800d73c: e0 00 00 27 bi 800d7d8 <_Event_Seize+0x110>
*
* 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;
800d740: 59 61 00 24 sw (r11+36),r1
executing->Wait.return_argument = event_out;
_Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
800d744: 78 01 08 01 mvhi r1,0x801
* set properly when we are marked as in the event critical section.
*
* 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;
800d748: 59 62 00 30 sw (r11+48),r2
executing->Wait.count = (uint32_t) event_in;
executing->Wait.return_argument = event_out;
_Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
800d74c: 38 21 a2 c8 ori r1,r1,0xa2c8
800d750: 34 02 00 01 mvi r2,1
* 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;
executing->Wait.return_argument = event_out;
800d754: 59 64 00 28 sw (r11+40),r4
_Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
800d758: 58 22 00 00 sw (r1+0),r2
_ISR_Enable( level );
800d75c: d0 06 00 00 wcsr IE,r6
if ( ticks ) {
800d760: 44 60 00 0d be r3,r0,800d794 <_Event_Seize+0xcc>
_Watchdog_Initialize(
800d764: 29 62 00 08 lw r2,(r11+8)
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
800d768: 78 01 08 00 mvhi r1,0x800
800d76c: 38 21 d9 90 ori r1,r1,0xd990
800d770: 59 61 00 64 sw (r11+100),r1
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800d774: 78 01 08 01 mvhi r1,0x801
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
the_watchdog->id = id;
800d778: 59 62 00 68 sw (r11+104),r2
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
800d77c: 59 60 00 50 sw (r11+80),r0
the_watchdog->routine = routine;
the_watchdog->id = id;
the_watchdog->user_data = user_data;
800d780: 59 60 00 6c sw (r11+108),r0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
800d784: 59 63 00 54 sw (r11+84),r3
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800d788: 38 21 99 e8 ori r1,r1,0x99e8
800d78c: 35 62 00 48 addi r2,r11,72
800d790: fb ff e8 7c calli 8007980 <_Watchdog_Insert>
NULL
);
_Watchdog_Insert_ticks( &executing->Timer, ticks );
}
_Thread_Set_state( executing, STATES_WAITING_FOR_EVENT );
800d794: b9 60 08 00 mv r1,r11
800d798: 34 02 01 00 mvi r2,256
800d79c: fb ff e6 75 calli 8007170 <_Thread_Set_state>
_ISR_Disable( level );
800d7a0: 90 00 18 00 rcsr r3,IE
800d7a4: 34 01 ff fe mvi r1,-2
800d7a8: a0 61 08 00 and r1,r3,r1
800d7ac: d0 01 00 00 wcsr IE,r1
sync_state = _Event_Sync_state;
800d7b0: 78 02 08 01 mvhi r2,0x801
800d7b4: 38 42 a2 c8 ori r2,r2,0xa2c8
800d7b8: 28 41 00 00 lw r1,(r2+0)
_Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
800d7bc: 58 40 00 00 sw (r2+0),r0
if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) {
800d7c0: 34 02 00 01 mvi r2,1
800d7c4: 5c 22 00 03 bne r1,r2,800d7d0 <_Event_Seize+0x108> <== NEVER TAKEN
_ISR_Enable( level );
800d7c8: d0 03 00 00 wcsr IE,r3
return;
800d7cc: e0 00 00 03 bi 800d7d8 <_Event_Seize+0x110>
* 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 );
800d7d0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800d7d4: f8 00 05 53 calli 800ed20 <_Thread_blocking_operation_Cancel><== NOT EXECUTED
}
800d7d8: 2b 9d 00 04 lw ra,(sp+4)
800d7dc: 2b 8b 00 08 lw r11,(sp+8)
800d7e0: 37 9c 00 08 addi sp,sp,8
800d7e4: c3 a0 00 00 ret
0800d850 <_Event_Surrender>:
*/
void _Event_Surrender(
Thread_Control *the_thread
)
{
800d850: 37 9c ff f8 addi sp,sp,-8
800d854: 5b 8b 00 08 sw (sp+8),r11
800d858: 5b 9d 00 04 sw (sp+4),ra
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 ];
800d85c: 28 24 01 28 lw r4,(r1+296)
option_set = (rtems_option) the_thread->Wait.option;
800d860: 28 28 00 30 lw r8,(r1+48)
*/
void _Event_Surrender(
Thread_Control *the_thread
)
{
800d864: b8 20 58 00 mv r11,r1
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
option_set = (rtems_option) the_thread->Wait.option;
_ISR_Disable( level );
800d868: 90 00 08 00 rcsr r1,IE
800d86c: 34 07 ff fe mvi r7,-2
800d870: a0 27 38 00 and r7,r1,r7
800d874: d0 07 00 00 wcsr IE,r7
pending_events = api->pending_events;
800d878: 28 85 00 00 lw r5,(r4+0)
event_condition = (rtems_event_set) the_thread->Wait.count;
800d87c: 29 66 00 24 lw r6,(r11+36)
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
rtems_event_set the_event_set,
rtems_event_set the_event_condition
)
{
return ( the_event_set & the_event_condition );
800d880: a0 c5 10 00 and r2,r6,r5
seized_events = _Event_sets_Get( pending_events, event_condition );
/*
* No events were seized in this operation
*/
if ( _Event_sets_Is_empty( seized_events ) ) {
800d884: 5c 40 00 03 bne r2,r0,800d890 <_Event_Surrender+0x40>
_ISR_Enable( level );
800d888: d0 01 00 00 wcsr IE,r1
return;
800d88c: e0 00 00 3d bi 800d980 <_Event_Surrender+0x130>
/*
* 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() &&
800d890: 78 03 08 01 mvhi r3,0x801
800d894: 38 63 9d fc ori r3,r3,0x9dfc
800d898: 28 69 00 08 lw r9,(r3+8)
800d89c: 45 20 00 1a be r9,r0,800d904 <_Event_Surrender+0xb4>
800d8a0: 28 63 00 0c lw r3,(r3+12)
800d8a4: 5d 63 00 18 bne r11,r3,800d904 <_Event_Surrender+0xb4>
_Thread_Is_executing( the_thread ) &&
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
800d8a8: 78 03 08 01 mvhi r3,0x801
800d8ac: 38 63 a2 c8 ori r3,r3,0xa2c8
800d8b0: 28 6a 00 00 lw r10,(r3+0)
/*
* If we are in an ISR and sending to the current thread, then
* we have a critical section issue to deal with.
*/
if ( _ISR_Is_in_progress() &&
_Thread_Is_executing( the_thread ) &&
800d8b4: 34 09 00 02 mvi r9,2
800d8b8: 45 49 00 04 be r10,r9,800d8c8 <_Event_Surrender+0x78> <== NEVER TAKEN
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
800d8bc: 28 69 00 00 lw r9,(r3+0)
* If we are in an ISR and sending to the current thread, then
* we have a critical section issue to deal with.
*/
if ( _ISR_Is_in_progress() &&
_Thread_Is_executing( the_thread ) &&
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
800d8c0: 34 03 00 01 mvi r3,1
800d8c4: 5d 23 00 10 bne r9,r3,800d904 <_Event_Surrender+0xb4> <== NEVER TAKEN
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
800d8c8: 44 46 00 03 be r2,r6,800d8d4 <_Event_Surrender+0x84> <== ALWAYS TAKEN
*/
RTEMS_INLINE_ROUTINE bool _Options_Is_any (
rtems_option option_set
)
{
return (option_set & RTEMS_EVENT_ANY) ? true : false;
800d8cc: 21 08 00 02 andi r8,r8,0x2 <== NOT EXECUTED
800d8d0: 45 00 00 0b be r8,r0,800d8fc <_Event_Surrender+0xac> <== NOT EXECUTED
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
rtems_event_set the_event_set,
rtems_event_set the_mask
)
{
return ( the_event_set & ~(the_mask) );
800d8d4: a4 40 18 00 not r3,r2
800d8d8: a0 65 28 00 and r5,r3,r5
api->pending_events = _Event_sets_Clear( pending_events,seized_events );
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800d8dc: 29 63 00 28 lw r3,(r11+40)
if ( _ISR_Is_in_progress() &&
_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 );
800d8e0: 58 85 00 00 sw (r4+0),r5
the_thread->Wait.count = 0;
800d8e4: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800d8e8: 58 62 00 00 sw (r3+0),r2
_Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
800d8ec: 78 02 08 01 mvhi r2,0x801
800d8f0: 38 42 a2 c8 ori r2,r2,0xa2c8
800d8f4: 34 03 00 03 mvi r3,3
800d8f8: 58 43 00 00 sw (r2+0),r3
}
_ISR_Enable( level );
800d8fc: d0 01 00 00 wcsr IE,r1
return;
800d900: e0 00 00 20 bi 800d980 <_Event_Surrender+0x130>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event (
States_Control the_states
)
{
return (the_states & STATES_WAITING_FOR_EVENT);
800d904: 29 63 00 10 lw r3,(r11+16)
800d908: 20 63 01 00 andi r3,r3,0x100
}
/*
* Otherwise, this is a normal send to another thread
*/
if ( _States_Is_waiting_for_event( the_thread->current_state ) ) {
800d90c: 44 60 00 1c be r3,r0,800d97c <_Event_Surrender+0x12c>
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
800d910: 44 46 00 03 be r2,r6,800d91c <_Event_Surrender+0xcc>
800d914: 21 08 00 02 andi r8,r8,0x2
800d918: 45 00 00 19 be r8,r0,800d97c <_Event_Surrender+0x12c> <== NEVER TAKEN
800d91c: a4 40 18 00 not r3,r2
800d920: a0 65 28 00 and r5,r3,r5
api->pending_events = _Event_sets_Clear( pending_events, seized_events );
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800d924: 29 63 00 28 lw r3,(r11+40)
/*
* 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 );
800d928: 58 85 00 00 sw (r4+0),r5
the_thread->Wait.count = 0;
800d92c: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800d930: 58 62 00 00 sw (r3+0),r2
_ISR_Flash( level );
800d934: d0 01 00 00 wcsr IE,r1
800d938: d0 07 00 00 wcsr IE,r7
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
800d93c: 29 63 00 50 lw r3,(r11+80)
800d940: 34 02 00 02 mvi r2,2
800d944: 44 62 00 03 be r3,r2,800d950 <_Event_Surrender+0x100>
_ISR_Enable( level );
800d948: d0 01 00 00 wcsr IE,r1
800d94c: e0 00 00 06 bi 800d964 <_Event_Surrender+0x114>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
800d950: 34 02 00 03 mvi r2,3
800d954: 59 62 00 50 sw (r11+80),r2
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
800d958: d0 01 00 00 wcsr IE,r1
(void) _Watchdog_Remove( &the_thread->Timer );
800d95c: 35 61 00 48 addi r1,r11,72
800d960: fb ff e8 65 calli 8007af4 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800d964: 78 03 08 01 mvhi r3,0x801
800d968: 38 63 81 44 ori r3,r3,0x8144
800d96c: 28 62 00 00 lw r2,(r3+0)
800d970: b9 60 08 00 mv r1,r11
800d974: f8 00 05 03 calli 800ed80 <_Thread_Clear_state>
800d978: e0 00 00 02 bi 800d980 <_Event_Surrender+0x130>
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
800d97c: d0 01 00 00 wcsr IE,r1
}
800d980: 2b 9d 00 04 lw ra,(sp+4)
800d984: 2b 8b 00 08 lw r11,(sp+8)
800d988: 37 9c 00 08 addi sp,sp,8
800d98c: c3 a0 00 00 ret
0800d990 <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *ignored
)
{
800d990: 37 9c ff f8 addi sp,sp,-8
800d994: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
ISR_Level level;
the_thread = _Thread_Get( id, &location );
800d998: 37 82 00 08 addi r2,sp,8
800d99c: fb ff e3 0f calli 80065d8 <_Thread_Get>
switch ( location ) {
800d9a0: 2b 82 00 08 lw r2,(sp+8)
800d9a4: 5c 40 00 1d bne r2,r0,800da18 <_Event_Timeout+0x88> <== NEVER TAKEN
*
* 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 );
800d9a8: 90 00 18 00 rcsr r3,IE
800d9ac: 34 02 ff fe mvi r2,-2
800d9b0: a0 62 10 00 and r2,r3,r2
800d9b4: d0 02 00 00 wcsr IE,r2
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
800d9b8: 78 02 08 01 mvhi r2,0x801
800d9bc: 38 42 9d fc ori r2,r2,0x9dfc
return;
}
#endif
the_thread->Wait.count = 0;
if ( _Thread_Is_executing( the_thread ) ) {
800d9c0: 28 42 00 0c lw r2,(r2+12)
_ISR_Enable( level );
return;
}
#endif
the_thread->Wait.count = 0;
800d9c4: 58 20 00 24 sw (r1+36),r0
if ( _Thread_Is_executing( the_thread ) ) {
800d9c8: 5c 22 00 08 bne r1,r2,800d9e8 <_Event_Timeout+0x58> <== ALWAYS TAKEN
if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
800d9cc: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED
800d9d0: 38 42 a2 c8 ori r2,r2,0xa2c8 <== NOT EXECUTED
800d9d4: 28 45 00 00 lw r5,(r2+0) <== NOT EXECUTED
800d9d8: 34 04 00 01 mvi r4,1 <== NOT EXECUTED
800d9dc: 5c a4 00 03 bne r5,r4,800d9e8 <_Event_Timeout+0x58> <== NOT EXECUTED
_Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
800d9e0: 34 04 00 02 mvi r4,2 <== NOT EXECUTED
800d9e4: 58 44 00 00 sw (r2+0),r4 <== NOT EXECUTED
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
800d9e8: 34 02 00 06 mvi r2,6
800d9ec: 58 22 00 34 sw (r1+52),r2
_ISR_Enable( level );
800d9f0: d0 03 00 00 wcsr IE,r3
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800d9f4: 78 03 08 01 mvhi r3,0x801
800d9f8: 38 63 81 44 ori r3,r3,0x8144
800d9fc: 28 62 00 00 lw r2,(r3+0)
800da00: f8 00 04 e0 calli 800ed80 <_Thread_Clear_state>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
800da04: 78 01 08 01 mvhi r1,0x801
800da08: 38 21 99 24 ori r1,r1,0x9924
800da0c: 28 22 00 00 lw r2,(r1+0)
800da10: 34 42 ff ff addi r2,r2,-1
800da14: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
800da18: 2b 9d 00 04 lw ra,(sp+4)
800da1c: 37 9c 00 08 addi sp,sp,8
800da20: c3 a0 00 00 ret
0800e630 <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
800e630: 37 9c ff b8 addi sp,sp,-72
800e634: 5b 8b 00 44 sw (sp+68),r11
800e638: 5b 8c 00 40 sw (sp+64),r12
800e63c: 5b 8d 00 3c sw (sp+60),r13
800e640: 5b 8e 00 38 sw (sp+56),r14
800e644: 5b 8f 00 34 sw (sp+52),r15
800e648: 5b 90 00 30 sw (sp+48),r16
800e64c: 5b 91 00 2c sw (sp+44),r17
800e650: 5b 92 00 28 sw (sp+40),r18
800e654: 5b 93 00 24 sw (sp+36),r19
800e658: 5b 94 00 20 sw (sp+32),r20
800e65c: 5b 95 00 1c sw (sp+28),r21
800e660: 5b 96 00 18 sw (sp+24),r22
800e664: 5b 97 00 14 sw (sp+20),r23
800e668: 5b 98 00 10 sw (sp+16),r24
800e66c: 5b 99 00 0c sw (sp+12),r25
800e670: 5b 9b 00 08 sw (sp+8),fp
800e674: 5b 9d 00 04 sw (sp+4),ra
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
800e678: 34 55 00 04 addi r21,r2,4
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
800e67c: b8 20 60 00 mv r12,r1
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
800e680: 28 2e 00 08 lw r14,(r1+8)
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;
uintptr_t const page_size = heap->page_size;
800e684: 28 33 00 10 lw r19,(r1+16)
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
800e688: b8 40 68 00 mv r13,r2
800e68c: b8 60 78 00 mv r15,r3
800e690: b8 80 90 00 mv r18,r4
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
/* Integer overflow occured */
return NULL;
800e694: 34 01 00 00 mvi r1,0
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
800e698: 54 55 00 53 bgu r2,r21,800e7e4 <_Heap_Allocate_aligned_with_boundary+0x1b4>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
800e69c: 44 80 00 04 be r4,r0,800e6ac <_Heap_Allocate_aligned_with_boundary+0x7c>
if ( boundary < alloc_size ) {
800e6a0: 54 44 00 51 bgu r2,r4,800e7e4 <_Heap_Allocate_aligned_with_boundary+0x1b4>
return NULL;
}
if ( alignment == 0 ) {
800e6a4: 5c 60 00 02 bne r3,r0,800e6ac <_Heap_Allocate_aligned_with_boundary+0x7c>
alignment = page_size;
800e6a8: ba 60 78 00 mv r15,r19
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;
800e6ac: 34 18 00 04 mvi r24,4
if ( boundary < alloc_size ) {
return NULL;
}
if ( alignment == 0 ) {
alignment = page_size;
800e6b0: 34 11 00 00 mvi r17,0
800e6b4: 34 1b ff fe mvi fp,-2
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;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
800e6b8: 36 79 00 07 addi r25,r19,7
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
800e6bc: cb 0d c0 00 sub r24,r24,r13
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
800e6c0: 34 17 ff f8 mvi r23,-8
800e6c4: e0 00 00 42 bi 800e7cc <_Heap_Allocate_aligned_with_boundary+0x19c>
/*
* 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 ) {
800e6c8: 29 cb 00 04 lw r11,(r14+4)
while ( block != free_list_tail ) {
_HAssert( _Heap_Is_prev_used( block ) );
/* Statistics */
++search_count;
800e6cc: 36 31 00 01 addi r17,r17,1
/*
* 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 ) {
800e6d0: 52 ab 00 3e bgeu r21,r11,800e7c8 <_Heap_Allocate_aligned_with_boundary+0x198>
800e6d4: 35 d4 00 08 addi r20,r14,8
if ( alignment == 0 ) {
800e6d8: 5d e0 00 03 bne r15,r0,800e6e4 <_Heap_Allocate_aligned_with_boundary+0xb4>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
800e6dc: ba 80 58 00 mv r11,r20
800e6e0: e0 00 00 30 bi 800e7a0 <_Heap_Allocate_aligned_with_boundary+0x170>
uintptr_t alignment,
uintptr_t boundary
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
800e6e4: 29 96 00 14 lw r22,(r12+20)
- 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;
800e6e8: a1 7b 58 00 and r11,r11,fp
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;
800e6ec: b5 cb 58 00 add r11,r14,r11
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;
800e6f0: cb 36 80 00 sub r16,r25,r22
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;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
800e6f4: b6 0b 80 00 add r16,r16,r11
+ 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;
800e6f8: b7 0b 58 00 add r11,r24,r11
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
800e6fc: b9 60 08 00 mv r1,r11
800e700: b9 e0 10 00 mv r2,r15
800e704: f8 00 22 dd calli 8017278 <__umodsi3>
800e708: c9 61 58 00 sub r11,r11,r1
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 ) {
800e70c: 52 0b 00 05 bgeu r16,r11,800e720 <_Heap_Allocate_aligned_with_boundary+0xf0>
800e710: ba 00 08 00 mv r1,r16
800e714: b9 e0 10 00 mv r2,r15
800e718: f8 00 22 d8 calli 8017278 <__umodsi3>
800e71c: ca 01 58 00 sub r11,r16,r1
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
800e720: 46 40 00 15 be r18,r0,800e774 <_Heap_Allocate_aligned_with_boundary+0x144>
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
800e724: b6 8d 08 00 add r1,r20,r13
/* 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;
800e728: b5 6d 80 00 add r16,r11,r13
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
800e72c: 5b 81 00 48 sw (sp+72),r1
800e730: e0 00 00 09 bi 800e754 <_Heap_Allocate_aligned_with_boundary+0x124>
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
800e734: 2b 82 00 48 lw r2,(sp+72)
800e738: 54 41 00 24 bgu r2,r1,800e7c8 <_Heap_Allocate_aligned_with_boundary+0x198>
return 0;
}
alloc_begin = boundary_line - alloc_size;
800e73c: c8 2d 58 00 sub r11,r1,r13
800e740: b9 60 08 00 mv r1,r11
800e744: b9 e0 10 00 mv r2,r15
800e748: f8 00 22 cc calli 8017278 <__umodsi3>
800e74c: c9 61 58 00 sub r11,r11,r1
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
800e750: b5 6d 80 00 add r16,r11,r13
800e754: ba 00 08 00 mv r1,r16
800e758: ba 40 10 00 mv r2,r18
800e75c: f8 00 22 c7 calli 8017278 <__umodsi3>
800e760: ca 01 08 00 sub r1,r16,r1
/* 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 ) {
800e764: f6 01 80 00 cmpgu r16,r16,r1
800e768: f4 2b 10 00 cmpgu r2,r1,r11
800e76c: a2 02 80 00 and r16,r16,r2
800e770: 5e 00 ff f1 bne r16,r0,800e734 <_Heap_Allocate_aligned_with_boundary+0x104>
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 ) {
800e774: 56 8b 00 15 bgu r20,r11,800e7c8 <_Heap_Allocate_aligned_with_boundary+0x198>
800e778: ba 60 10 00 mv r2,r19
800e77c: ca ee 80 00 sub r16,r23,r14
800e780: b9 60 08 00 mv r1,r11
800e784: f8 00 22 bd calli 8017278 <__umodsi3>
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
800e788: b6 0b 80 00 add r16,r16,r11
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;
800e78c: ca 01 08 00 sub r1,r16,r1
if ( free_size >= min_block_size || free_size == 0 ) {
800e790: 64 22 00 00 cmpei r2,r1,0
800e794: f0 36 08 00 cmpgeu r1,r1,r22
800e798: b8 41 08 00 or r1,r2,r1
800e79c: 44 20 00 0b be r1,r0,800e7c8 <_Heap_Allocate_aligned_with_boundary+0x198>
boundary
);
}
}
if ( alloc_begin != 0 ) {
800e7a0: 45 60 00 0a be r11,r0,800e7c8 <_Heap_Allocate_aligned_with_boundary+0x198><== NEVER TAKEN
block = block->next;
}
if ( alloc_begin != 0 ) {
/* Statistics */
stats->searches += search_count;
800e7a4: 29 81 00 4c lw r1,(r12+76)
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
800e7a8: b9 c0 10 00 mv r2,r14
800e7ac: b9 60 18 00 mv r3,r11
block = block->next;
}
if ( alloc_begin != 0 ) {
/* Statistics */
stats->searches += search_count;
800e7b0: b4 31 08 00 add r1,r1,r17
800e7b4: 59 81 00 4c sw (r12+76),r1
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
800e7b8: b9 a0 20 00 mv r4,r13
800e7bc: b9 80 08 00 mv r1,r12
800e7c0: fb ff db 3b calli 80054ac <_Heap_Block_allocate>
800e7c4: e0 00 00 04 bi 800e7d4 <_Heap_Allocate_aligned_with_boundary+0x1a4>
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
800e7c8: 29 ce 00 08 lw r14,(r14+8)
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
800e7cc: 5d cc ff bf bne r14,r12,800e6c8 <_Heap_Allocate_aligned_with_boundary+0x98>
800e7d0: 34 0b 00 00 mvi r11,0
boundary
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
800e7d4: 29 81 00 44 lw r1,(r12+68)
800e7d8: 50 31 00 02 bgeu r1,r17,800e7e0 <_Heap_Allocate_aligned_with_boundary+0x1b0>
stats->max_search = search_count;
800e7dc: 59 91 00 44 sw (r12+68),r17
}
return (void *) alloc_begin;
800e7e0: b9 60 08 00 mv r1,r11
}
800e7e4: 2b 9d 00 04 lw ra,(sp+4)
800e7e8: 2b 8b 00 44 lw r11,(sp+68)
800e7ec: 2b 8c 00 40 lw r12,(sp+64)
800e7f0: 2b 8d 00 3c lw r13,(sp+60)
800e7f4: 2b 8e 00 38 lw r14,(sp+56)
800e7f8: 2b 8f 00 34 lw r15,(sp+52)
800e7fc: 2b 90 00 30 lw r16,(sp+48)
800e800: 2b 91 00 2c lw r17,(sp+44)
800e804: 2b 92 00 28 lw r18,(sp+40)
800e808: 2b 93 00 24 lw r19,(sp+36)
800e80c: 2b 94 00 20 lw r20,(sp+32)
800e810: 2b 95 00 1c lw r21,(sp+28)
800e814: 2b 96 00 18 lw r22,(sp+24)
800e818: 2b 97 00 14 lw r23,(sp+20)
800e81c: 2b 98 00 10 lw r24,(sp+16)
800e820: 2b 99 00 0c lw r25,(sp+12)
800e824: 2b 9b 00 08 lw fp,(sp+8)
800e828: 37 9c 00 48 addi sp,sp,72
800e82c: c3 a0 00 00 ret
08009d80 <_Heap_Extend>:
Heap_Control *heap,
void *extend_area_begin_ptr,
uintptr_t extend_area_size,
uintptr_t *extended_size_ptr
)
{
8009d80: 37 9c ff b8 addi sp,sp,-72
8009d84: 5b 8b 00 40 sw (sp+64),r11
8009d88: 5b 8c 00 3c sw (sp+60),r12
8009d8c: 5b 8d 00 38 sw (sp+56),r13
8009d90: 5b 8e 00 34 sw (sp+52),r14
8009d94: 5b 8f 00 30 sw (sp+48),r15
8009d98: 5b 90 00 2c sw (sp+44),r16
8009d9c: 5b 91 00 28 sw (sp+40),r17
8009da0: 5b 92 00 24 sw (sp+36),r18
8009da4: 5b 93 00 20 sw (sp+32),r19
8009da8: 5b 94 00 1c sw (sp+28),r20
8009dac: 5b 95 00 18 sw (sp+24),r21
8009db0: 5b 96 00 14 sw (sp+20),r22
8009db4: 5b 97 00 10 sw (sp+16),r23
8009db8: 5b 98 00 0c sw (sp+12),r24
8009dbc: 5b 99 00 08 sw (sp+8),r25
8009dc0: 5b 9d 00 04 sw (sp+4),ra
8009dc4: b8 40 70 00 mv r14,r2
Heap_Block *start_block = first_block;
Heap_Block *merge_below_block = NULL;
Heap_Block *merge_above_block = NULL;
Heap_Block *link_below_block = NULL;
Heap_Block *link_above_block = NULL;
Heap_Block *extend_first_block = NULL;
8009dc8: 5b 80 00 48 sw (sp+72),r0
Heap_Block *extend_last_block = NULL;
8009dcc: 5b 80 00 44 sw (sp+68),r0
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr;
uintptr_t const extend_area_end = extend_area_begin + extend_area_size;
8009dd0: b5 c3 68 00 add r13,r14,r3
Heap_Control *heap,
void *extend_area_begin_ptr,
uintptr_t extend_area_size,
uintptr_t *extended_size_ptr
)
{
8009dd4: b8 80 a0 00 mv r20,r4
8009dd8: b8 20 58 00 mv r11,r1
8009ddc: b8 60 10 00 mv r2,r3
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const first_block = heap->first_block;
8009de0: 28 35 00 20 lw r21,(r1+32)
Heap_Block *merge_above_block = NULL;
Heap_Block *link_below_block = NULL;
Heap_Block *link_above_block = NULL;
Heap_Block *extend_first_block = NULL;
Heap_Block *extend_last_block = NULL;
uintptr_t const page_size = heap->page_size;
8009de4: 28 36 00 10 lw r22,(r1+16)
uintptr_t const min_block_size = heap->min_block_size;
8009de8: 28 24 00 14 lw r4,(r1+20)
uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr;
uintptr_t const extend_area_end = extend_area_begin + extend_area_size;
uintptr_t const free_size = stats->free_size;
8009dec: 28 37 00 30 lw r23,(r1+48)
uintptr_t extend_first_block_size = 0;
uintptr_t extended_size = 0;
bool extend_area_ok = false;
if ( extend_area_end < extend_area_begin ) {
return false;
8009df0: 34 0c 00 00 mvi r12,0
uintptr_t const free_size = stats->free_size;
uintptr_t extend_first_block_size = 0;
uintptr_t extended_size = 0;
bool extend_area_ok = false;
if ( extend_area_end < extend_area_begin ) {
8009df4: 55 cd 00 8e bgu r14,r13,800a02c <_Heap_Extend+0x2ac>
return false;
}
extend_area_ok = _Heap_Get_first_and_last_block(
8009df8: b9 c0 08 00 mv r1,r14
8009dfc: ba c0 18 00 mv r3,r22
8009e00: 37 85 00 48 addi r5,sp,72
8009e04: 37 86 00 44 addi r6,sp,68
8009e08: fb ff e8 22 calli 8003e90 <_Heap_Get_first_and_last_block>
page_size,
min_block_size,
&extend_first_block,
&extend_last_block
);
if (!extend_area_ok ) {
8009e0c: 44 20 00 88 be r1,r0,800a02c <_Heap_Extend+0x2ac>
8009e10: ba a0 78 00 mv r15,r21
8009e14: 34 11 00 00 mvi r17,0
8009e18: 34 13 00 00 mvi r19,0
8009e1c: 34 10 00 00 mvi r16,0
return false;
}
do {
uintptr_t const sub_area_begin = (start_block != first_block) ?
(uintptr_t) start_block : heap->area_begin;
8009e20: 29 61 00 18 lw r1,(r11+24)
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
8009e24: 34 18 ff fe mvi r24,-2
8009e28: e0 00 00 02 bi 8009e30 <_Heap_Extend+0xb0>
8009e2c: b9 e0 08 00 mv r1,r15
uintptr_t const sub_area_end = start_block->prev_size;
8009e30: 29 f2 00 00 lw r18,(r15+0)
Heap_Block *const end_block =
_Heap_Block_of_alloc_area( sub_area_end, page_size );
if (
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
8009e34: f5 a1 18 00 cmpgu r3,r13,r1
8009e38: f6 4e 10 00 cmpgu r2,r18,r14
(uintptr_t) start_block : heap->area_begin;
uintptr_t const sub_area_end = start_block->prev_size;
Heap_Block *const end_block =
_Heap_Block_of_alloc_area( sub_area_end, page_size );
if (
8009e3c: a0 62 10 00 and r2,r3,r2
8009e40: 5c 40 00 7a bne r2,r0,800a028 <_Heap_Extend+0x2a8>
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
}
if ( extend_area_end == sub_area_begin ) {
8009e44: 45 a1 00 03 be r13,r1,8009e50 <_Heap_Extend+0xd0>
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
8009e48: 56 4d 00 04 bgu r18,r13,8009e58 <_Heap_Extend+0xd8>
8009e4c: e0 00 00 04 bi 8009e5c <_Heap_Extend+0xdc>
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
}
if ( extend_area_end == sub_area_begin ) {
8009e50: b9 e0 80 00 mv r16,r15
8009e54: e0 00 00 02 bi 8009e5c <_Heap_Extend+0xdc>
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
8009e58: b9 e0 98 00 mv r19,r15
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
8009e5c: ba 40 08 00 mv r1,r18
8009e60: ba c0 10 00 mv r2,r22
8009e64: 36 59 ff f8 addi r25,r18,-8
8009e68: f8 00 21 59 calli 80123cc <__umodsi3>
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
8009e6c: cb 21 08 00 sub r1,r25,r1
link_below_block = start_block;
}
if ( sub_area_end == extend_area_begin ) {
8009e70: 5d d2 00 04 bne r14,r18,8009e80 <_Heap_Extend+0x100>
start_block->prev_size = extend_area_end;
8009e74: 59 ed 00 00 sw (r15+0),r13
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 )
8009e78: b8 20 60 00 mv r12,r1
8009e7c: e0 00 00 04 bi 8009e8c <_Heap_Extend+0x10c>
merge_above_block = end_block;
} else if ( sub_area_end < extend_area_begin ) {
8009e80: 55 d2 00 02 bgu r14,r18,8009e88 <_Heap_Extend+0x108>
8009e84: e0 00 00 02 bi 8009e8c <_Heap_Extend+0x10c>
8009e88: b8 20 88 00 mv r17,r1
- 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;
8009e8c: 28 2f 00 04 lw r15,(r1+4)
8009e90: a3 0f 78 00 and r15,r24,r15
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
8009e94: b4 2f 78 00 add r15,r1,r15
link_above_block = end_block;
}
start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) );
} while ( start_block != first_block );
8009e98: 5d f5 ff e5 bne r15,r21,8009e2c <_Heap_Extend+0xac>
if ( extend_area_begin < heap->area_begin ) {
8009e9c: 29 61 00 18 lw r1,(r11+24)
8009ea0: 51 c1 00 03 bgeu r14,r1,8009eac <_Heap_Extend+0x12c>
heap->area_begin = extend_area_begin;
8009ea4: 59 6e 00 18 sw (r11+24),r14
8009ea8: e0 00 00 04 bi 8009eb8 <_Heap_Extend+0x138>
} else if ( heap->area_end < extend_area_end ) {
8009eac: 29 61 00 1c lw r1,(r11+28)
8009eb0: 50 2d 00 02 bgeu r1,r13,8009eb8 <_Heap_Extend+0x138>
heap->area_end = extend_area_end;
8009eb4: 59 6d 00 1c sw (r11+28),r13
}
extend_first_block_size =
(uintptr_t) extend_last_block - (uintptr_t) extend_first_block;
8009eb8: 2b 81 00 44 lw r1,(sp+68)
8009ebc: 2b 82 00 48 lw r2,(sp+72)
heap->area_begin = extend_area_begin;
} else if ( heap->area_end < extend_area_end ) {
heap->area_end = extend_area_end;
}
extend_first_block_size =
8009ec0: c8 22 18 00 sub r3,r1,r2
(uintptr_t) extend_last_block - (uintptr_t) extend_first_block;
extend_first_block->prev_size = extend_area_end;
8009ec4: 58 4d 00 00 sw (r2+0),r13
extend_first_block->size_and_flag =
extend_first_block_size | HEAP_PREV_BLOCK_USED;
8009ec8: 38 64 00 01 ori r4,r3,0x1
extend_last_block->prev_size = extend_first_block_size;
8009ecc: 58 23 00 00 sw (r1+0),r3
extend_last_block->size_and_flag = 0;
if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) {
8009ed0: 29 63 00 20 lw r3,(r11+32)
extend_first_block_size =
(uintptr_t) extend_last_block - (uintptr_t) extend_first_block;
extend_first_block->prev_size = extend_area_end;
extend_first_block->size_and_flag =
8009ed4: 58 44 00 04 sw (r2+4),r4
extend_first_block_size | HEAP_PREV_BLOCK_USED;
extend_last_block->prev_size = extend_first_block_size;
extend_last_block->size_and_flag = 0;
8009ed8: 58 20 00 04 sw (r1+4),r0
if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) {
8009edc: 50 43 00 03 bgeu r2,r3,8009ee8 <_Heap_Extend+0x168>
heap->first_block = extend_first_block;
8009ee0: 59 62 00 20 sw (r11+32),r2
8009ee4: e0 00 00 04 bi 8009ef4 <_Heap_Extend+0x174>
} else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) {
8009ee8: 29 62 00 24 lw r2,(r11+36)
8009eec: 50 41 00 02 bgeu r2,r1,8009ef4 <_Heap_Extend+0x174>
heap->last_block = extend_last_block;
8009ef0: 59 61 00 24 sw (r11+36),r1
}
if ( merge_below_block != NULL ) {
8009ef4: 46 00 00 12 be r16,r0,8009f3c <_Heap_Extend+0x1bc>
Heap_Control *heap,
uintptr_t extend_area_begin,
Heap_Block *first_block
)
{
uintptr_t const page_size = heap->page_size;
8009ef8: 29 6f 00 10 lw r15,(r11+16)
uintptr_t const new_first_block_alloc_begin =
_Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size );
8009efc: 35 ce 00 08 addi r14,r14,8
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up(
uintptr_t value,
uintptr_t alignment
)
{
uintptr_t remainder = value % alignment;
8009f00: b9 c0 08 00 mv r1,r14
8009f04: b9 e0 10 00 mv r2,r15
8009f08: f8 00 21 31 calli 80123cc <__umodsi3>
if ( remainder != 0 ) {
8009f0c: 44 20 00 03 be r1,r0,8009f18 <_Heap_Extend+0x198> <== ALWAYS TAKEN
return value - remainder + alignment;
8009f10: b5 cf 70 00 add r14,r14,r15 <== NOT EXECUTED
8009f14: c9 c1 70 00 sub r14,r14,r1 <== NOT EXECUTED
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
8009f18: 2a 01 00 00 lw r1,(r16+0)
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const new_first_block_alloc_begin =
_Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size );
uintptr_t const new_first_block_begin =
8009f1c: 35 c2 ff f8 addi r2,r14,-8
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
8009f20: 59 c1 ff f8 sw (r14+-8),r1
uintptr_t const new_first_block_alloc_begin =
_Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size );
uintptr_t const new_first_block_begin =
new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE;
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
8009f24: ca 02 08 00 sub r1,r16,r2
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED;
8009f28: 38 21 00 01 ori r1,r1,0x1
8009f2c: 58 41 00 04 sw (r2+4),r1
_Heap_Free_block( heap, new_first_block );
8009f30: b9 60 08 00 mv r1,r11
8009f34: fb ff ff 86 calli 8009d4c <_Heap_Free_block>
8009f38: e0 00 00 06 bi 8009f50 <_Heap_Extend+0x1d0>
heap->last_block = extend_last_block;
}
if ( merge_below_block != NULL ) {
_Heap_Merge_below( heap, extend_area_begin, merge_below_block );
} else if ( link_below_block != NULL ) {
8009f3c: 46 70 00 05 be r19,r16,8009f50 <_Heap_Extend+0x1d0>
_Heap_Link_below(
8009f40: 2b 81 00 44 lw r1,(sp+68)
{
uintptr_t const last_block_begin = (uintptr_t) last_block;
uintptr_t const link_begin = (uintptr_t) link;
last_block->size_and_flag =
(link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED;
8009f44: ca 61 98 00 sub r19,r19,r1
8009f48: 3a 73 00 01 ori r19,r19,0x1
)
{
uintptr_t const last_block_begin = (uintptr_t) last_block;
uintptr_t const link_begin = (uintptr_t) link;
last_block->size_and_flag =
8009f4c: 58 33 00 04 sw (r1+4),r19
link_below_block,
extend_last_block
);
}
if ( merge_above_block != NULL ) {
8009f50: 45 80 00 14 be r12,r0,8009fa0 <_Heap_Extend+0x220>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
8009f54: 29 62 00 10 lw r2,(r11+16)
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const last_block_begin = (uintptr_t) last_block;
uintptr_t const last_block_new_size = _Heap_Align_down(
extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE,
8009f58: 35 ad ff f8 addi r13,r13,-8
uintptr_t extend_area_end
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const last_block_begin = (uintptr_t) last_block;
uintptr_t const last_block_new_size = _Heap_Align_down(
8009f5c: c9 ac 68 00 sub r13,r13,r12
8009f60: b9 a0 08 00 mv r1,r13
8009f64: f8 00 21 1a calli 80123cc <__umodsi3>
);
Heap_Block *const new_last_block =
_Heap_Block_at( last_block, last_block_new_size );
new_last_block->size_and_flag =
(last_block->size_and_flag - last_block_new_size)
8009f68: 29 83 00 04 lw r3,(r12+4)
8009f6c: c9 a1 08 00 sub r1,r13,r1
page_size
);
Heap_Block *const new_last_block =
_Heap_Block_at( last_block, last_block_new_size );
new_last_block->size_and_flag =
8009f70: b4 2c 10 00 add r2,r1,r12
(last_block->size_and_flag - last_block_new_size)
8009f74: c8 61 18 00 sub r3,r3,r1
| HEAP_PREV_BLOCK_USED;
8009f78: 38 63 00 01 ori r3,r3,0x1
page_size
);
Heap_Block *const new_last_block =
_Heap_Block_at( last_block, last_block_new_size );
new_last_block->size_and_flag =
8009f7c: 58 43 00 04 sw (r2+4),r3
RTEMS_INLINE_ROUTINE void _Heap_Block_set_size(
Heap_Block *block,
uintptr_t size
)
{
uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED;
8009f80: 29 82 00 04 lw r2,(r12+4)
8009f84: 20 42 00 01 andi r2,r2,0x1
block->size_and_flag = size | flag;
8009f88: b8 22 08 00 or r1,r1,r2
8009f8c: 59 81 00 04 sw (r12+4),r1
(last_block->size_and_flag - last_block_new_size)
| HEAP_PREV_BLOCK_USED;
_Heap_Block_set_size( last_block, last_block_new_size );
_Heap_Free_block( heap, last_block );
8009f90: b9 80 10 00 mv r2,r12
8009f94: b9 60 08 00 mv r1,r11
8009f98: fb ff ff 6d calli 8009d4c <_Heap_Free_block>
8009f9c: e0 00 00 0c bi 8009fcc <_Heap_Extend+0x24c>
);
}
if ( merge_above_block != NULL ) {
_Heap_Merge_above( heap, merge_above_block, extend_area_end );
} else if ( link_above_block != NULL ) {
8009fa0: 46 2c 00 0b be r17,r12,8009fcc <_Heap_Extend+0x24c>
RTEMS_INLINE_ROUTINE void _Heap_Block_set_size(
Heap_Block *block,
uintptr_t size
)
{
uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED;
8009fa4: 2a 21 00 04 lw r1,(r17+4)
)
{
uintptr_t const link_begin = (uintptr_t) link;
uintptr_t const first_block_begin = (uintptr_t) first_block;
_Heap_Block_set_size( link, first_block_begin - link_begin );
8009fa8: 2b 83 00 48 lw r3,(sp+72)
}
if ( merge_above_block != NULL ) {
_Heap_Merge_above( heap, merge_above_block, extend_area_end );
} else if ( link_above_block != NULL ) {
_Heap_Link_above(
8009fac: 2b 82 00 44 lw r2,(sp+68)
8009fb0: 20 21 00 01 andi r1,r1,0x1
)
{
uintptr_t const link_begin = (uintptr_t) link;
uintptr_t const first_block_begin = (uintptr_t) first_block;
_Heap_Block_set_size( link, first_block_begin - link_begin );
8009fb4: c8 71 18 00 sub r3,r3,r17
block->size_and_flag = size | flag;
8009fb8: b8 61 08 00 or r1,r3,r1
8009fbc: 5a 21 00 04 sw (r17+4),r1
last_block->size_and_flag |= HEAP_PREV_BLOCK_USED;
8009fc0: 28 41 00 04 lw r1,(r2+4)
8009fc4: 38 21 00 01 ori r1,r1,0x1
8009fc8: 58 41 00 04 sw (r2+4),r1
extend_first_block,
extend_last_block
);
}
if ( merge_below_block == NULL && merge_above_block == NULL ) {
8009fcc: 65 8c 00 00 cmpei r12,r12,0
8009fd0: 66 10 00 00 cmpei r16,r16,0
8009fd4: a1 90 60 00 and r12,r12,r16
8009fd8: 45 80 00 04 be r12,r0,8009fe8 <_Heap_Extend+0x268>
_Heap_Free_block( heap, extend_first_block );
8009fdc: 2b 82 00 48 lw r2,(sp+72)
8009fe0: b9 60 08 00 mv r1,r11
8009fe4: fb ff ff 5a calli 8009d4c <_Heap_Free_block>
*/
RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap )
{
_Heap_Block_set_size(
heap->last_block,
(uintptr_t) heap->first_block - (uintptr_t) heap->last_block
8009fe8: 29 61 00 24 lw r1,(r11+36)
* This feature will be used to terminate the scattered heap area list. See
* also _Heap_Extend().
*/
RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap )
{
_Heap_Block_set_size(
8009fec: 29 63 00 20 lw r3,(r11+32)
stats->size += extended_size;
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
8009ff0: 34 0c 00 01 mvi r12,1
RTEMS_INLINE_ROUTINE void _Heap_Block_set_size(
Heap_Block *block,
uintptr_t size
)
{
uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED;
8009ff4: 28 22 00 04 lw r2,(r1+4)
* This feature will be used to terminate the scattered heap area list. See
* also _Heap_Extend().
*/
RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap )
{
_Heap_Block_set_size(
8009ff8: c8 61 18 00 sub r3,r3,r1
RTEMS_INLINE_ROUTINE void _Heap_Block_set_size(
Heap_Block *block,
uintptr_t size
)
{
uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED;
8009ffc: 20 42 00 01 andi r2,r2,0x1
block->size_and_flag = size | flag;
800a000: b8 62 10 00 or r2,r3,r2
800a004: 58 22 00 04 sw (r1+4),r2
_Heap_Free_block( heap, extend_first_block );
}
_Heap_Set_last_block_size( heap );
extended_size = stats->free_size - free_size;
800a008: 29 61 00 30 lw r1,(r11+48)
/* Statistics */
stats->size += extended_size;
800a00c: 29 62 00 2c lw r2,(r11+44)
_Heap_Free_block( heap, extend_first_block );
}
_Heap_Set_last_block_size( heap );
extended_size = stats->free_size - free_size;
800a010: c8 37 08 00 sub r1,r1,r23
/* Statistics */
stats->size += extended_size;
800a014: b4 41 10 00 add r2,r2,r1
800a018: 59 62 00 2c sw (r11+44),r2
if ( extended_size_ptr != NULL )
800a01c: 46 80 00 04 be r20,r0,800a02c <_Heap_Extend+0x2ac> <== NEVER TAKEN
*extended_size_ptr = extended_size;
800a020: 5a 81 00 00 sw (r20+0),r1
800a024: e0 00 00 02 bi 800a02c <_Heap_Extend+0x2ac>
_Heap_Block_of_alloc_area( sub_area_end, page_size );
if (
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
800a028: 34 0c 00 00 mvi r12,0
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
}
800a02c: b9 80 08 00 mv r1,r12
800a030: 2b 9d 00 04 lw ra,(sp+4)
800a034: 2b 8b 00 40 lw r11,(sp+64)
800a038: 2b 8c 00 3c lw r12,(sp+60)
800a03c: 2b 8d 00 38 lw r13,(sp+56)
800a040: 2b 8e 00 34 lw r14,(sp+52)
800a044: 2b 8f 00 30 lw r15,(sp+48)
800a048: 2b 90 00 2c lw r16,(sp+44)
800a04c: 2b 91 00 28 lw r17,(sp+40)
800a050: 2b 92 00 24 lw r18,(sp+36)
800a054: 2b 93 00 20 lw r19,(sp+32)
800a058: 2b 94 00 1c lw r20,(sp+28)
800a05c: 2b 95 00 18 lw r21,(sp+24)
800a060: 2b 96 00 14 lw r22,(sp+20)
800a064: 2b 97 00 10 lw r23,(sp+16)
800a068: 2b 98 00 0c lw r24,(sp+12)
800a06c: 2b 99 00 08 lw r25,(sp+8)
800a070: 37 9c 00 48 addi sp,sp,72
800a074: c3 a0 00 00 ret
0800e830 <_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 )
{
800e830: 37 9c ff f4 addi sp,sp,-12
800e834: 5b 8b 00 0c sw (sp+12),r11
800e838: 5b 8c 00 08 sw (sp+8),r12
800e83c: 5b 9d 00 04 sw (sp+4),ra
800e840: b8 20 58 00 mv r11,r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
800e844: 34 4c ff f8 addi r12,r2,-8
800e848: b8 40 08 00 mv r1,r2
800e84c: 29 62 00 10 lw r2,(r11+16)
800e850: f8 00 22 8a calli 8017278 <__umodsi3>
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
800e854: 29 67 00 20 lw r7,(r11+32)
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
800e858: c9 81 18 00 sub r3,r12,r1
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;
800e85c: 34 01 00 00 mvi r1,0
800e860: 54 e3 00 03 bgu r7,r3,800e86c <_Heap_Free+0x3c>
800e864: 29 61 00 24 lw r1,(r11+36)
800e868: f0 23 08 00 cmpgeu r1,r1,r3
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 ) ) {
800e86c: b8 20 10 00 mv r2,r1
return false;
800e870: 34 01 00 00 mvi r1,0
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 ) ) {
800e874: 44 40 00 66 be r2,r0,800ea0c <_Heap_Free+0x1dc>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800e878: 28 66 00 04 lw r6,(r3+4)
- 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;
800e87c: 34 04 ff fe mvi r4,-2
800e880: a0 c4 20 00 and r4,r6,r4
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
800e884: b4 64 10 00 add r2,r3,r4
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;
800e888: 54 e2 00 03 bgu r7,r2,800e894 <_Heap_Free+0x64> <== NEVER TAKEN
800e88c: 29 61 00 24 lw r1,(r11+36)
800e890: f0 22 08 00 cmpgeu r1,r1,r2
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
800e894: b8 20 28 00 mv r5,r1
_HAssert( false );
return false;
800e898: 34 01 00 00 mvi r1,0
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
800e89c: 44 a0 00 5c be r5,r0,800ea0c <_Heap_Free+0x1dc> <== NEVER TAKEN
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800e8a0: 28 45 00 04 lw r5,(r2+4)
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;
800e8a4: 20 a8 00 01 andi r8,r5,0x1
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
_HAssert( false );
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
800e8a8: 45 00 00 59 be r8,r0,800ea0c <_Heap_Free+0x1dc> <== NEVER TAKEN
_HAssert( false );
return false;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
800e8ac: 29 69 00 24 lw r9,(r11+36)
- 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;
800e8b0: 34 01 ff fe mvi r1,-2
800e8b4: a0 a1 28 00 and r5,r5,r1
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
800e8b8: 34 08 00 00 mvi r8,0
800e8bc: 45 22 00 05 be r9,r2,800e8d0 <_Heap_Free+0xa0>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800e8c0: b4 45 08 00 add r1,r2,r5
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;
800e8c4: 28 28 00 04 lw r8,(r1+4)
800e8c8: 21 08 00 01 andi r8,r8,0x1
#include <rtems/system.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/heap.h>
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
800e8cc: 65 08 00 00 cmpei r8,r8,0
800e8d0: 20 c6 00 01 andi r6,r6,0x1
_HAssert( false );
return false;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
800e8d4: 21 08 00 ff andi r8,r8,0xff
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
if ( !_Heap_Is_prev_used( block ) ) {
800e8d8: 5c c0 00 24 bne r6,r0,800e968 <_Heap_Free+0x138>
uintptr_t const prev_size = block->prev_size;
800e8dc: 28 66 00 00 lw r6,(r3+0)
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;
800e8e0: 34 01 00 00 mvi r1,0
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
800e8e4: c8 66 18 00 sub r3,r3,r6
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;
800e8e8: 54 e3 00 02 bgu r7,r3,800e8f0 <_Heap_Free+0xc0> <== NEVER TAKEN
800e8ec: f1 23 08 00 cmpgeu r1,r9,r3
Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size );
if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) {
800e8f0: b8 20 38 00 mv r7,r1
_HAssert( false );
return( false );
800e8f4: 34 01 00 00 mvi r1,0
if ( !_Heap_Is_prev_used( block ) ) {
uintptr_t const prev_size = block->prev_size;
Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size );
if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) {
800e8f8: 44 e0 00 45 be r7,r0,800ea0c <_Heap_Free+0x1dc> <== NEVER TAKEN
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;
800e8fc: 28 67 00 04 lw r7,(r3+4)
800e900: 20 e7 00 01 andi r7,r7,0x1
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) ) {
800e904: 44 e0 00 42 be r7,r0,800ea0c <_Heap_Free+0x1dc> <== NEVER TAKEN
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
800e908: 45 00 00 0f be r8,r0,800e944 <_Heap_Free+0x114>
return _Heap_Free_list_tail(heap)->prev;
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
800e90c: 28 41 00 08 lw r1,(r2+8)
Heap_Block *prev = block->prev;
800e910: 28 42 00 0c lw r2,(r2+12)
uintptr_t const size = block_size + prev_size + next_block_size;
800e914: b4 85 28 00 add r5,r4,r5
800e918: b4 a6 30 00 add r6,r5,r6
prev->next = next;
800e91c: 58 41 00 08 sw (r2+8),r1
next->prev = prev;
800e920: 58 22 00 0c sw (r1+12),r2
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
800e924: 29 61 00 38 lw r1,(r11+56)
800e928: 34 21 ff ff addi r1,r1,-1
800e92c: 59 61 00 38 sw (r11+56),r1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800e930: 38 c1 00 01 ori r1,r6,0x1
800e934: 58 61 00 04 sw (r3+4),r1
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
800e938: b4 66 18 00 add r3,r3,r6
800e93c: 58 66 00 00 sw (r3+0),r6
800e940: e0 00 00 29 bi 800e9e4 <_Heap_Free+0x1b4>
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
800e944: b4 86 30 00 add r6,r4,r6
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800e948: 38 c1 00 01 ori r1,r6,0x1
800e94c: 58 61 00 04 sw (r3+4),r1
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
800e950: 28 43 00 04 lw r3,(r2+4)
800e954: 34 01 ff fe mvi r1,-2
next_block->prev_size = size;
800e958: 58 46 00 00 sw (r2+0),r6
_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;
800e95c: a0 61 08 00 and r1,r3,r1
800e960: 58 41 00 04 sw (r2+4),r1
800e964: e0 00 00 20 bi 800e9e4 <_Heap_Free+0x1b4>
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
800e968: 45 00 00 0d be r8,r0,800e99c <_Heap_Free+0x16c>
uintptr_t const size = block_size + next_block_size;
800e96c: b4 a4 08 00 add r1,r5,r4
RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace(
Heap_Block *old_block,
Heap_Block *new_block
)
{
Heap_Block *next = old_block->next;
800e970: 28 45 00 08 lw r5,(r2+8)
Heap_Block *prev = old_block->prev;
800e974: 28 42 00 0c lw r2,(r2+12)
new_block->next = next;
800e978: 58 65 00 08 sw (r3+8),r5
new_block->prev = prev;
800e97c: 58 62 00 0c sw (r3+12),r2
next->prev = new_block;
prev->next = new_block;
800e980: 58 43 00 08 sw (r2+8),r3
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800e984: 38 22 00 01 ori r2,r1,0x1
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
800e988: 58 a3 00 0c sw (r5+12),r3
800e98c: 58 62 00 04 sw (r3+4),r2
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
800e990: b4 61 18 00 add r3,r3,r1
800e994: 58 61 00 00 sw (r3+0),r1
800e998: e0 00 00 13 bi 800e9e4 <_Heap_Free+0x1b4>
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
800e99c: 29 61 00 08 lw r1,(r11+8)
new_block->next = next;
new_block->prev = block_before;
800e9a0: 58 6b 00 0c sw (r3+12),r11
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
800e9a4: 58 44 00 00 sw (r2+0),r4
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
800e9a8: 58 61 00 08 sw (r3+8),r1
new_block->prev = block_before;
block_before->next = new_block;
next->prev = new_block;
800e9ac: 58 23 00 0c sw (r1+12),r3
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;
800e9b0: 38 81 00 01 ori r1,r4,0x1
800e9b4: 58 61 00 04 sw (r3+4),r1
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
800e9b8: 59 63 00 08 sw (r11+8),r3
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
800e9bc: 28 43 00 04 lw r3,(r2+4)
800e9c0: 34 01 ff fe mvi r1,-2
800e9c4: a0 61 08 00 and r1,r3,r1
800e9c8: 58 41 00 04 sw (r2+4),r1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
800e9cc: 29 61 00 38 lw r1,(r11+56)
if ( stats->max_free_blocks < stats->free_blocks ) {
800e9d0: 29 62 00 3c lw r2,(r11+60)
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;
800e9d4: 34 21 00 01 addi r1,r1,1
800e9d8: 59 61 00 38 sw (r11+56),r1
if ( stats->max_free_blocks < stats->free_blocks ) {
800e9dc: 50 41 00 02 bgeu r2,r1,800e9e4 <_Heap_Free+0x1b4>
stats->max_free_blocks = stats->free_blocks;
800e9e0: 59 61 00 3c sw (r11+60),r1
}
}
/* Statistics */
--stats->used_blocks;
800e9e4: 29 61 00 40 lw r1,(r11+64)
800e9e8: 34 21 ff ff addi r1,r1,-1
800e9ec: 59 61 00 40 sw (r11+64),r1
++stats->frees;
800e9f0: 29 61 00 50 lw r1,(r11+80)
800e9f4: 34 21 00 01 addi r1,r1,1
800e9f8: 59 61 00 50 sw (r11+80),r1
stats->free_size += block_size;
800e9fc: 29 61 00 30 lw r1,(r11+48)
800ea00: b4 24 20 00 add r4,r1,r4
800ea04: 59 64 00 30 sw (r11+48),r4
return( true );
800ea08: 34 01 00 01 mvi r1,1
}
800ea0c: 2b 9d 00 04 lw ra,(sp+4)
800ea10: 2b 8b 00 0c lw r11,(sp+12)
800ea14: 2b 8c 00 08 lw r12,(sp+8)
800ea18: 37 9c 00 0c addi sp,sp,12
800ea1c: c3 a0 00 00 ret
0800eb7c <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
800eb7c: 37 9c ff ec addi sp,sp,-20
800eb80: 5b 8b 00 14 sw (sp+20),r11
800eb84: 5b 8c 00 10 sw (sp+16),r12
800eb88: 5b 8d 00 0c sw (sp+12),r13
800eb8c: 5b 8e 00 08 sw (sp+8),r14
800eb90: 5b 9d 00 04 sw (sp+4),ra
800eb94: b8 20 58 00 mv r11,r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
800eb98: 34 4e ff f8 addi r14,r2,-8
800eb9c: b8 40 08 00 mv r1,r2
800eba0: b8 40 60 00 mv r12,r2
800eba4: 29 62 00 10 lw r2,(r11+16)
800eba8: b8 60 68 00 mv r13,r3
800ebac: f8 00 21 b3 calli 8017278 <__umodsi3>
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
800ebb0: 29 62 00 20 lw r2,(r11+32)
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
800ebb4: c9 c1 20 00 sub r4,r14,r1
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;
800ebb8: 34 01 00 00 mvi r1,0
800ebbc: 54 44 00 03 bgu r2,r4,800ebc8 <_Heap_Size_of_alloc_area+0x4c>
800ebc0: 29 61 00 24 lw r1,(r11+36)
800ebc4: f0 24 08 00 cmpgeu r1,r1,r4
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 ) ) {
800ebc8: b8 20 18 00 mv r3,r1
return false;
800ebcc: 34 01 00 00 mvi r1,0
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 ) ) {
800ebd0: 44 60 00 13 be r3,r0,800ec1c <_Heap_Size_of_alloc_area+0xa0>
- 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;
800ebd4: 28 83 00 04 lw r3,(r4+4)
800ebd8: 34 01 ff fe mvi r1,-2
800ebdc: a0 23 08 00 and r1,r1,r3
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
800ebe0: b4 81 20 00 add r4,r4,r1
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;
800ebe4: 34 01 00 00 mvi r1,0
800ebe8: 54 44 00 03 bgu r2,r4,800ebf4 <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN
800ebec: 29 61 00 24 lw r1,(r11+36)
800ebf0: f0 24 08 00 cmpgeu r1,r1,r4
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
800ebf4: b8 20 10 00 mv r2,r1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
800ebf8: 34 01 00 00 mvi r1,0
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
800ebfc: 44 40 00 08 be r2,r0,800ec1c <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN
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;
800ec00: 28 82 00 04 lw r2,(r4+4)
800ec04: 20 42 00 01 andi r2,r2,0x1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
800ec08: 44 40 00 05 be r2,r0,800ec1c <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin;
800ec0c: c8 8c 20 00 sub r4,r4,r12
800ec10: 34 84 00 04 addi r4,r4,4
800ec14: 59 a4 00 00 sw (r13+0),r4
return true;
800ec18: 34 01 00 01 mvi r1,1
}
800ec1c: 2b 9d 00 04 lw ra,(sp+4)
800ec20: 2b 8b 00 14 lw r11,(sp+20)
800ec24: 2b 8c 00 10 lw r12,(sp+16)
800ec28: 2b 8d 00 0c lw r13,(sp+12)
800ec2c: 2b 8e 00 08 lw r14,(sp+8)
800ec30: 37 9c 00 14 addi sp,sp,20
800ec34: c3 a0 00 00 ret
08004c64 <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
8004c64: 37 9c ff a0 addi sp,sp,-96
8004c68: 5b 8b 00 50 sw (sp+80),r11
8004c6c: 5b 8c 00 4c sw (sp+76),r12
8004c70: 5b 8d 00 48 sw (sp+72),r13
8004c74: 5b 8e 00 44 sw (sp+68),r14
8004c78: 5b 8f 00 40 sw (sp+64),r15
8004c7c: 5b 90 00 3c sw (sp+60),r16
8004c80: 5b 91 00 38 sw (sp+56),r17
8004c84: 5b 92 00 34 sw (sp+52),r18
8004c88: 5b 93 00 30 sw (sp+48),r19
8004c8c: 5b 94 00 2c sw (sp+44),r20
8004c90: 5b 95 00 28 sw (sp+40),r21
8004c94: 5b 96 00 24 sw (sp+36),r22
8004c98: 5b 97 00 20 sw (sp+32),r23
8004c9c: 5b 98 00 1c sw (sp+28),r24
8004ca0: 5b 99 00 18 sw (sp+24),r25
8004ca4: 5b 9b 00 14 sw (sp+20),fp
8004ca8: 5b 9d 00 10 sw (sp+16),ra
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
8004cac: 78 0d 08 00 mvhi r13,0x800
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
8004cb0: 20 63 00 ff andi r3,r3,0xff
8004cb4: b8 20 60 00 mv r12,r1
8004cb8: b8 40 70 00 mv r14,r2
uintptr_t const page_size = heap->page_size;
8004cbc: 28 33 00 10 lw r19,(r1+16)
uintptr_t const min_block_size = heap->min_block_size;
8004cc0: 28 35 00 14 lw r21,(r1+20)
Heap_Block *const first_block = heap->first_block;
8004cc4: 28 34 00 20 lw r20,(r1+32)
Heap_Block *const last_block = heap->last_block;
8004cc8: 28 36 00 24 lw r22,(r1+36)
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
8004ccc: 39 ad 4b cc ori r13,r13,0x4bcc
8004cd0: 44 60 00 03 be r3,r0,8004cdc <_Heap_Walk+0x78>
8004cd4: 78 0d 08 00 mvhi r13,0x800
8004cd8: 39 ad 4b f0 ori r13,r13,0x4bf0
if ( !_System_state_Is_up( _System_state_Get() ) ) {
8004cdc: 78 03 08 01 mvhi r3,0x801
8004ce0: 38 63 6a 74 ori r3,r3,0x6a74
8004ce4: 28 67 00 00 lw r7,(r3+0)
8004ce8: 34 02 00 03 mvi r2,3
return true;
8004cec: 34 03 00 01 mvi r3,1
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
if ( !_System_state_Is_up( _System_state_Get() ) ) {
8004cf0: 5c e2 01 08 bne r7,r2,8005110 <_Heap_Walk+0x4ac> <== NEVER TAKEN
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)(
8004cf4: 29 81 00 08 lw r1,(r12+8)
8004cf8: 29 86 00 18 lw r6,(r12+24)
8004cfc: 29 87 00 1c lw r7,(r12+28)
8004d00: 5b 81 00 08 sw (sp+8),r1
8004d04: 29 81 00 0c lw r1,(r12+12)
8004d08: 78 03 08 01 mvhi r3,0x801
8004d0c: 5b 96 00 04 sw (sp+4),r22
8004d10: 5b 81 00 0c sw (sp+12),r1
8004d14: 34 02 00 00 mvi r2,0
8004d18: b9 c0 08 00 mv r1,r14
8004d1c: 38 63 41 d8 ori r3,r3,0x41d8
8004d20: ba 60 20 00 mv r4,r19
8004d24: ba a0 28 00 mv r5,r21
8004d28: ba 80 40 00 mv r8,r20
8004d2c: d9 a0 00 00 call r13
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
8004d30: 5e 60 00 06 bne r19,r0,8004d48 <_Heap_Walk+0xe4>
(*printer)( source, true, "page size is zero\n" );
8004d34: 78 03 08 01 mvhi r3,0x801
8004d38: b9 c0 08 00 mv r1,r14
8004d3c: 34 02 00 01 mvi r2,1
8004d40: 38 63 42 6c ori r3,r3,0x426c
8004d44: e0 00 00 25 bi 8004dd8 <_Heap_Walk+0x174>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
8004d48: 22 6f 00 07 andi r15,r19,0x7
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
8004d4c: 45 e0 00 07 be r15,r0,8004d68 <_Heap_Walk+0x104>
(*printer)(
8004d50: 78 03 08 01 mvhi r3,0x801
8004d54: b9 c0 08 00 mv r1,r14
8004d58: 34 02 00 01 mvi r2,1
8004d5c: 38 63 42 80 ori r3,r3,0x4280
8004d60: ba 60 20 00 mv r4,r19
8004d64: e0 00 01 04 bi 8005174 <_Heap_Walk+0x510>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004d68: ba a0 08 00 mv r1,r21
8004d6c: ba 60 10 00 mv r2,r19
8004d70: fb ff ef 82 calli 8000b78 <__umodsi3>
8004d74: b8 20 58 00 mv r11,r1
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
8004d78: 44 2f 00 07 be r1,r15,8004d94 <_Heap_Walk+0x130>
(*printer)(
8004d7c: 78 03 08 01 mvhi r3,0x801
8004d80: b9 c0 08 00 mv r1,r14
8004d84: 34 02 00 01 mvi r2,1
8004d88: 38 63 42 a0 ori r3,r3,0x42a0
8004d8c: ba a0 20 00 mv r4,r21
8004d90: e0 00 00 f9 bi 8005174 <_Heap_Walk+0x510>
8004d94: 36 81 00 08 addi r1,r20,8
8004d98: ba 60 10 00 mv r2,r19
8004d9c: fb ff ef 77 calli 8000b78 <__umodsi3>
);
return false;
}
if (
8004da0: 44 2b 00 07 be r1,r11,8004dbc <_Heap_Walk+0x158>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
8004da4: 78 03 08 01 mvhi r3,0x801
8004da8: b9 c0 08 00 mv r1,r14
8004dac: 34 02 00 01 mvi r2,1
8004db0: 38 63 42 c4 ori r3,r3,0x42c4
8004db4: ba 80 20 00 mv r4,r20
8004db8: e0 00 00 ef bi 8005174 <_Heap_Walk+0x510>
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;
8004dbc: 2a 82 00 04 lw r2,(r20+4)
8004dc0: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
8004dc4: 5c 41 00 07 bne r2,r1,8004de0 <_Heap_Walk+0x17c>
(*printer)(
8004dc8: 78 03 08 01 mvhi r3,0x801
8004dcc: b9 c0 08 00 mv r1,r14
8004dd0: 34 02 00 01 mvi r2,1
8004dd4: 38 63 42 f8 ori r3,r3,0x42f8
8004dd8: d9 a0 00 00 call r13
8004ddc: e0 00 00 40 bi 8004edc <_Heap_Walk+0x278>
- 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;
8004de0: 2a cf 00 04 lw r15,(r22+4)
8004de4: 34 02 ff fe mvi r2,-2
8004de8: a0 4f 78 00 and r15,r2,r15
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
8004dec: b6 cf 78 00 add r15,r22,r15
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;
8004df0: 29 e2 00 04 lw r2,(r15+4)
8004df4: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
8004df8: 5c 41 00 06 bne r2,r1,8004e10 <_Heap_Walk+0x1ac>
(*printer)(
8004dfc: 78 03 08 01 mvhi r3,0x801
8004e00: b9 c0 08 00 mv r1,r14
8004e04: 34 02 00 01 mvi r2,1
8004e08: 38 63 43 28 ori r3,r3,0x4328
8004e0c: e3 ff ff f3 bi 8004dd8 <_Heap_Walk+0x174>
);
return false;
}
if (
8004e10: 45 f4 00 06 be r15,r20,8004e28 <_Heap_Walk+0x1c4> <== ALWAYS TAKEN
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
8004e14: 78 03 08 01 mvhi r3,0x801 <== NOT EXECUTED
8004e18: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
8004e1c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8004e20: 38 63 43 40 ori r3,r3,0x4340 <== NOT EXECUTED
8004e24: e3 ff ff ed bi 8004dd8 <_Heap_Walk+0x174> <== NOT EXECUTED
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
8004e28: 29 92 00 10 lw r18,(r12+16)
block = next_block;
} while ( block != first_block );
return true;
}
8004e2c: 29 8b 00 08 lw r11,(r12+8)
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
8004e30: b9 80 80 00 mv r16,r12
- 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;
8004e34: 34 11 ff fe mvi r17,-2
8004e38: e0 00 00 2d bi 8004eec <_Heap_Walk+0x288>
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;
8004e3c: 29 83 00 20 lw r3,(r12+32)
8004e40: 34 01 00 00 mvi r1,0
8004e44: 54 6b 00 03 bgu r3,r11,8004e50 <_Heap_Walk+0x1ec>
8004e48: 29 81 00 24 lw r1,(r12+36)
8004e4c: f0 2b 08 00 cmpgeu r1,r1,r11
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 ) ) {
8004e50: 5c 20 00 06 bne r1,r0,8004e68 <_Heap_Walk+0x204>
(*printer)(
8004e54: 78 03 08 01 mvhi r3,0x801
8004e58: b9 c0 08 00 mv r1,r14
8004e5c: 34 02 00 01 mvi r2,1
8004e60: 38 63 43 70 ori r3,r3,0x4370
8004e64: e0 00 00 14 bi 8004eb4 <_Heap_Walk+0x250>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004e68: 35 61 00 08 addi r1,r11,8
8004e6c: ba 40 10 00 mv r2,r18
8004e70: fb ff ef 42 calli 8000b78 <__umodsi3>
);
return false;
}
if (
8004e74: 44 20 00 06 be r1,r0,8004e8c <_Heap_Walk+0x228>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
8004e78: 78 03 08 01 mvhi r3,0x801
8004e7c: b9 c0 08 00 mv r1,r14
8004e80: 34 02 00 01 mvi r2,1
8004e84: 38 63 43 90 ori r3,r3,0x4390
8004e88: e0 00 00 0b bi 8004eb4 <_Heap_Walk+0x250>
- 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;
8004e8c: 29 63 00 04 lw r3,(r11+4)
8004e90: a2 23 18 00 and r3,r17,r3
block = next_block;
} while ( block != first_block );
return true;
}
8004e94: b5 63 18 00 add r3,r11,r3
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;
8004e98: 28 63 00 04 lw r3,(r3+4)
8004e9c: 20 63 00 01 andi r3,r3,0x1
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
8004ea0: 44 61 00 07 be r3,r1,8004ebc <_Heap_Walk+0x258>
(*printer)(
8004ea4: 78 03 08 01 mvhi r3,0x801
8004ea8: b9 c0 08 00 mv r1,r14
8004eac: 34 02 00 01 mvi r2,1
8004eb0: 38 63 43 c0 ori r3,r3,0x43c0
8004eb4: b9 60 20 00 mv r4,r11
8004eb8: e0 00 00 af bi 8005174 <_Heap_Walk+0x510>
);
return false;
}
if ( free_block->prev != prev_block ) {
8004ebc: 29 65 00 0c lw r5,(r11+12)
8004ec0: 44 b0 00 09 be r5,r16,8004ee4 <_Heap_Walk+0x280>
(*printer)(
8004ec4: 78 03 08 01 mvhi r3,0x801
8004ec8: b9 c0 08 00 mv r1,r14
8004ecc: 34 02 00 01 mvi r2,1
8004ed0: 38 63 43 dc ori r3,r3,0x43dc
8004ed4: b9 60 20 00 mv r4,r11
8004ed8: d9 a0 00 00 call r13
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
8004edc: 34 03 00 00 mvi r3,0
8004ee0: e0 00 00 8c bi 8005110 <_Heap_Walk+0x4ac>
return false;
}
prev_block = free_block;
free_block = free_block->next;
8004ee4: b9 60 80 00 mv r16,r11
8004ee8: 29 6b 00 08 lw r11,(r11+8)
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 ) {
8004eec: 5d 6c ff d4 bne r11,r12,8004e3c <_Heap_Walk+0x1d8>
8004ef0: e0 00 00 03 bi 8004efc <_Heap_Walk+0x298>
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
8004ef4: ba 20 78 00 mv r15,r17
8004ef8: e0 00 00 15 bi 8004f4c <_Heap_Walk+0x2e8>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
8004efc: 78 01 08 01 mvhi r1,0x801
8004f00: 38 21 45 8c ori r1,r1,0x458c
8004f04: 5b 81 00 54 sw (sp+84),r1
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
(*printer)(
8004f08: 78 01 08 01 mvhi r1,0x801
8004f0c: 38 21 45 74 ori r1,r1,0x4574
8004f10: 5b 81 00 58 sw (sp+88),r1
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)(
8004f14: 78 01 08 01 mvhi r1,0x801
8004f18: 38 21 41 a0 ori r1,r1,0x41a0
8004f1c: 5b 81 00 5c sw (sp+92),r1
8004f20: 78 01 08 01 mvhi r1,0x801
8004f24: 38 21 41 bc ori r1,r1,0x41bc
8004f28: 78 1b 08 01 mvhi fp,0x801
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
8004f2c: 78 17 08 01 mvhi r23,0x801
8004f30: 78 19 08 01 mvhi r25,0x801
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
8004f34: 78 18 08 01 mvhi r24,0x801
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)(
8004f38: 5b 81 00 60 sw (sp+96),r1
8004f3c: 3b 7b 44 d0 ori fp,fp,0x44d0
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
8004f40: 3a f7 45 40 ori r23,r23,0x4540
8004f44: 3b 39 41 cc ori r25,r25,0x41cc
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
8004f48: 3b 18 41 b0 ori r24,r24,0x41b0
block = next_block;
} while ( block != first_block );
return true;
}
8004f4c: 29 f2 00 04 lw r18,(r15+4)
- 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;
8004f50: 34 01 ff fe mvi r1,-2
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;
8004f54: 29 84 00 20 lw r4,(r12+32)
- 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;
8004f58: a2 41 80 00 and r16,r18,r1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
8004f5c: b5 f0 88 00 add r17,r15,r16
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;
8004f60: 34 06 00 00 mvi r6,0
8004f64: 54 91 00 03 bgu r4,r17,8004f70 <_Heap_Walk+0x30c> <== NEVER TAKEN
8004f68: 29 86 00 24 lw r6,(r12+36)
8004f6c: f0 d1 30 00 cmpgeu r6,r6,r17
bool const prev_used = _Heap_Is_prev_used( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
uintptr_t const next_block_begin = (uintptr_t) next_block;
bool const is_not_last_block = block != last_block;
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
8004f70: 5c c0 00 06 bne r6,r0,8004f88 <_Heap_Walk+0x324>
(*printer)(
8004f74: 78 03 08 01 mvhi r3,0x801
8004f78: b9 c0 08 00 mv r1,r14
8004f7c: 34 02 00 01 mvi r2,1
8004f80: 38 63 44 10 ori r3,r3,0x4410
8004f84: e0 00 00 1f bi 8005000 <_Heap_Walk+0x39c>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004f88: ba 00 08 00 mv r1,r16
8004f8c: ba 60 10 00 mv r2,r19
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
bool const prev_used = _Heap_Is_prev_used( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
uintptr_t const next_block_begin = (uintptr_t) next_block;
bool const is_not_last_block = block != last_block;
8004f90: fd f6 58 00 cmpne r11,r15,r22
8004f94: fb ff ee f9 calli 8000b78 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
8004f98: 44 20 00 09 be r1,r0,8004fbc <_Heap_Walk+0x358>
8004f9c: 45 60 00 08 be r11,r0,8004fbc <_Heap_Walk+0x358>
(*printer)(
8004fa0: 78 03 08 01 mvhi r3,0x801
8004fa4: b9 c0 08 00 mv r1,r14
8004fa8: 34 02 00 01 mvi r2,1
8004fac: 38 63 44 40 ori r3,r3,0x4440
8004fb0: b9 e0 20 00 mv r4,r15
8004fb4: ba 00 28 00 mv r5,r16
8004fb8: e3 ff ff c8 bi 8004ed8 <_Heap_Walk+0x274>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
8004fbc: 52 15 00 0b bgeu r16,r21,8004fe8 <_Heap_Walk+0x384>
8004fc0: 45 60 00 0a be r11,r0,8004fe8 <_Heap_Walk+0x384> <== NEVER TAKEN
(*printer)(
8004fc4: 78 03 08 01 mvhi r3,0x801
8004fc8: b9 c0 08 00 mv r1,r14
8004fcc: 34 02 00 01 mvi r2,1
8004fd0: 38 63 44 70 ori r3,r3,0x4470
8004fd4: b9 e0 20 00 mv r4,r15
8004fd8: ba 00 28 00 mv r5,r16
8004fdc: ba a0 30 00 mv r6,r21
8004fe0: d9 a0 00 00 call r13
8004fe4: e3 ff ff be bi 8004edc <_Heap_Walk+0x278>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
8004fe8: 56 2f 00 09 bgu r17,r15,800500c <_Heap_Walk+0x3a8>
8004fec: 45 60 00 08 be r11,r0,800500c <_Heap_Walk+0x3a8>
(*printer)(
8004ff0: 78 03 08 01 mvhi r3,0x801
8004ff4: b9 c0 08 00 mv r1,r14
8004ff8: 34 02 00 01 mvi r2,1
8004ffc: 38 63 44 9c ori r3,r3,0x449c
8005000: b9 e0 20 00 mv r4,r15
8005004: ba 20 28 00 mv r5,r17
8005008: e3 ff ff b4 bi 8004ed8 <_Heap_Walk+0x274>
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;
800500c: 2a 24 00 04 lw r4,(r17+4)
8005010: 22 52 00 01 andi r18,r18,0x1
8005014: 20 84 00 01 andi r4,r4,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
8005018: 5c 80 00 2d bne r4,r0,80050cc <_Heap_Walk+0x468>
false,
"block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n",
block,
block_size,
block->prev,
block->prev == first_free_block ?
800501c: 29 e6 00 0c lw r6,(r15+12)
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)(
8005020: 29 85 00 08 lw r5,(r12+8)
block = next_block;
} while ( block != first_block );
return true;
}
8005024: 29 84 00 0c lw r4,(r12+12)
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)(
8005028: 2b 87 00 5c lw r7,(sp+92)
800502c: 44 c5 00 04 be r6,r5,800503c <_Heap_Walk+0x3d8>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
8005030: ba e0 38 00 mv r7,r23
8005034: 5c cc 00 02 bne r6,r12,800503c <_Heap_Walk+0x3d8>
8005038: bb 00 38 00 mv r7,r24
block->next,
block->next == last_free_block ?
800503c: 29 e8 00 08 lw r8,(r15+8)
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)(
8005040: 2b 89 00 60 lw r9,(sp+96)
8005044: 45 04 00 04 be r8,r4,8005054 <_Heap_Walk+0x3f0>
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
8005048: ba e0 48 00 mv r9,r23
800504c: 5d 0c 00 02 bne r8,r12,8005054 <_Heap_Walk+0x3f0>
8005050: bb 20 48 00 mv r9,r25
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)(
8005054: 5b 89 00 04 sw (sp+4),r9
8005058: b9 c0 08 00 mv r1,r14
800505c: 34 02 00 00 mvi r2,0
8005060: bb 60 18 00 mv r3,fp
8005064: b9 e0 20 00 mv r4,r15
8005068: ba 00 28 00 mv r5,r16
800506c: d9 a0 00 00 call r13
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
8005070: 2a 26 00 00 lw r6,(r17+0)
8005074: 46 06 00 0a be r16,r6,800509c <_Heap_Walk+0x438>
(*printer)(
8005078: 78 03 08 01 mvhi r3,0x801
800507c: b9 c0 08 00 mv r1,r14
8005080: 34 02 00 01 mvi r2,1
8005084: 38 63 45 08 ori r3,r3,0x4508
8005088: b9 e0 20 00 mv r4,r15
800508c: ba 00 28 00 mv r5,r16
8005090: ba 20 38 00 mv r7,r17
8005094: d9 a0 00 00 call r13
8005098: e3 ff ff 91 bi 8004edc <_Heap_Walk+0x278>
);
return false;
}
if ( !prev_used ) {
800509c: 5e 40 00 06 bne r18,r0,80050b4 <_Heap_Walk+0x450>
(*printer)(
80050a0: 78 03 08 01 mvhi r3,0x801
80050a4: b9 c0 08 00 mv r1,r14
80050a8: 34 02 00 01 mvi r2,1
80050ac: 38 63 45 44 ori r3,r3,0x4544
80050b0: e0 00 00 30 bi 8005170 <_Heap_Walk+0x50c>
block = next_block;
} while ( block != first_block );
return true;
}
80050b4: 29 85 00 08 lw r5,(r12+8)
80050b8: e0 00 00 03 bi 80050c4 <_Heap_Walk+0x460>
{
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 ) {
80050bc: 44 af 00 13 be r5,r15,8005108 <_Heap_Walk+0x4a4>
return true;
}
free_block = free_block->next;
80050c0: 28 a5 00 08 lw r5,(r5+8)
)
{
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 ) {
80050c4: 5c ac ff fe bne r5,r12,80050bc <_Heap_Walk+0x458>
80050c8: e0 00 00 26 bi 8005160 <_Heap_Walk+0x4fc>
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
80050cc: 46 40 00 08 be r18,r0,80050ec <_Heap_Walk+0x488>
(*printer)(
80050d0: 2b 83 00 58 lw r3,(sp+88)
80050d4: b9 c0 08 00 mv r1,r14
80050d8: 34 02 00 00 mvi r2,0
80050dc: b9 e0 20 00 mv r4,r15
80050e0: ba 00 28 00 mv r5,r16
80050e4: d9 a0 00 00 call r13
80050e8: e0 00 00 08 bi 8005108 <_Heap_Walk+0x4a4>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
80050ec: 2b 83 00 54 lw r3,(sp+84)
80050f0: 29 e6 00 00 lw r6,(r15+0)
80050f4: b9 c0 08 00 mv r1,r14
80050f8: 34 02 00 00 mvi r2,0
80050fc: b9 e0 20 00 mv r4,r15
8005100: ba 00 28 00 mv r5,r16
8005104: d9 a0 00 00 call r13
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
8005108: 5e 91 ff 7b bne r20,r17,8004ef4 <_Heap_Walk+0x290>
return true;
800510c: 34 03 00 01 mvi r3,1
}
8005110: b8 60 08 00 mv r1,r3
8005114: 2b 9d 00 10 lw ra,(sp+16)
8005118: 2b 8b 00 50 lw r11,(sp+80)
800511c: 2b 8c 00 4c lw r12,(sp+76)
8005120: 2b 8d 00 48 lw r13,(sp+72)
8005124: 2b 8e 00 44 lw r14,(sp+68)
8005128: 2b 8f 00 40 lw r15,(sp+64)
800512c: 2b 90 00 3c lw r16,(sp+60)
8005130: 2b 91 00 38 lw r17,(sp+56)
8005134: 2b 92 00 34 lw r18,(sp+52)
8005138: 2b 93 00 30 lw r19,(sp+48)
800513c: 2b 94 00 2c lw r20,(sp+44)
8005140: 2b 95 00 28 lw r21,(sp+40)
8005144: 2b 96 00 24 lw r22,(sp+36)
8005148: 2b 97 00 20 lw r23,(sp+32)
800514c: 2b 98 00 1c lw r24,(sp+28)
8005150: 2b 99 00 18 lw r25,(sp+24)
8005154: 2b 9b 00 14 lw fp,(sp+20)
8005158: 37 9c 00 60 addi sp,sp,96
800515c: c3 a0 00 00 ret
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
8005160: 78 03 08 01 mvhi r3,0x801
8005164: b9 c0 08 00 mv r1,r14
8005168: 34 02 00 01 mvi r2,1
800516c: 38 63 45 b4 ori r3,r3,0x45b4
8005170: b9 e0 20 00 mv r4,r15
8005174: d9 a0 00 00 call r13
8005178: e3 ff ff 59 bi 8004edc <_Heap_Walk+0x278>
08004574 <_IO_Manager_initialization>:
* workspace.
*
*/
void _IO_Manager_initialization(void)
{
8004574: 37 9c ff e8 addi sp,sp,-24
8004578: 5b 8b 00 18 sw (sp+24),r11
800457c: 5b 8c 00 14 sw (sp+20),r12
8004580: 5b 8d 00 10 sw (sp+16),r13
8004584: 5b 8e 00 0c sw (sp+12),r14
8004588: 5b 8f 00 08 sw (sp+8),r15
800458c: 5b 9d 00 04 sw (sp+4),ra
uint32_t index;
rtems_driver_address_table *driver_table;
uint32_t drivers_in_table;
uint32_t number_of_drivers;
driver_table = Configuration.Device_driver_table;
8004590: 78 01 08 01 mvhi r1,0x801
8004594: 38 21 90 ac ori r1,r1,0x90ac
drivers_in_table = Configuration.number_of_device_drivers;
8004598: 28 2d 00 30 lw r13,(r1+48)
number_of_drivers = Configuration.maximum_drivers;
800459c: 28 2b 00 2c lw r11,(r1+44)
uint32_t index;
rtems_driver_address_table *driver_table;
uint32_t drivers_in_table;
uint32_t number_of_drivers;
driver_table = Configuration.Device_driver_table;
80045a0: 28 2e 00 34 lw r14,(r1+52)
/*
* If the user claims there are less drivers than are actually in
* the table, then let's just go with the table's count.
*/
if ( number_of_drivers <= drivers_in_table )
80045a4: 51 ab 00 03 bgeu r13,r11,80045b0 <_IO_Manager_initialization+0x3c>
/*
* If the maximum number of driver is the same as the number in the
* table, then we do not have to copy the driver table. They can't
* register any dynamically.
*/
if ( number_of_drivers == drivers_in_table ) {
80045a8: 5d 6d 00 0a bne r11,r13,80045d0 <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN
80045ac: e0 00 00 02 bi 80045b4 <_IO_Manager_initialization+0x40> <== NOT EXECUTED
/*
* If the user claims there are less drivers than are actually in
* the table, then let's just go with the table's count.
*/
if ( number_of_drivers <= drivers_in_table )
80045b0: b9 a0 58 00 mv r11,r13
* If the maximum number of driver is the same as the number in the
* table, then we do not have to copy the driver table. They can't
* register any dynamically.
*/
if ( number_of_drivers == drivers_in_table ) {
_IO_Driver_address_table = driver_table;
80045b4: 78 01 08 01 mvhi r1,0x801
80045b8: 38 21 a2 44 ori r1,r1,0xa244
80045bc: 58 2e 00 00 sw (r1+0),r14
_IO_Number_of_drivers = number_of_drivers;
80045c0: 78 01 08 01 mvhi r1,0x801
80045c4: 38 21 a2 40 ori r1,r1,0xa240
80045c8: 58 2b 00 00 sw (r1+0),r11
return;
80045cc: e0 00 00 27 bi 8004668 <_IO_Manager_initialization+0xf4>
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
80045d0: 34 02 00 01 mvi r2,1
80045d4: b9 60 08 00 mv r1,r11
80045d8: f8 00 4a 3e calli 8016ed0 <__ashlsi3>
80045dc: 34 02 00 03 mvi r2,3
80045e0: b4 2b 08 00 add r1,r1,r11
80045e4: f8 00 4a 3b calli 8016ed0 <__ashlsi3>
80045e8: b8 20 78 00 mv r15,r1
* The application requested extra slots in the driver table, so we
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
_Workspace_Allocate_or_fatal_error(
80045ec: f8 00 0d 9c calli 8007c5c <_Workspace_Allocate_or_fatal_error>
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
80045f0: 78 02 08 01 mvhi r2,0x801
80045f4: 38 42 a2 40 ori r2,r2,0xa240
/*
* The application requested extra slots in the driver table, so we
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
80045f8: 78 0c 08 01 mvhi r12,0x801
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
80045fc: 58 4b 00 00 sw (r2+0),r11
memset(
8004600: b9 e0 18 00 mv r3,r15
/*
* The application requested extra slots in the driver table, so we
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
8004604: 39 8c a2 44 ori r12,r12,0xa244
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
memset(
8004608: 34 02 00 00 mvi r2,0
/*
* The application requested extra slots in the driver table, so we
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
800460c: 59 81 00 00 sw (r12+0),r1
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
memset(
8004610: f8 00 36 b1 calli 80120d4 <memset>
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
8004614: 34 03 00 00 mvi r3,0
8004618: 34 04 00 00 mvi r4,0
800461c: e0 00 00 12 bi 8004664 <_IO_Manager_initialization+0xf0>
_IO_Driver_address_table[index] = driver_table[index];
8004620: 29 82 00 00 lw r2,(r12+0)
* registration. The driver table is now allocated in the
* workspace.
*
*/
void _IO_Manager_initialization(void)
8004624: b5 c3 08 00 add r1,r14,r3
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
_IO_Driver_address_table[index] = driver_table[index];
8004628: 28 29 00 00 lw r9,(r1+0)
800462c: 28 28 00 04 lw r8,(r1+4)
8004630: 28 27 00 08 lw r7,(r1+8)
8004634: 28 26 00 0c lw r6,(r1+12)
8004638: 28 25 00 10 lw r5,(r1+16)
800463c: 28 21 00 14 lw r1,(r1+20)
8004640: b4 43 10 00 add r2,r2,r3
8004644: 58 49 00 00 sw (r2+0),r9
8004648: 58 48 00 04 sw (r2+4),r8
800464c: 58 47 00 08 sw (r2+8),r7
8004650: 58 46 00 0c sw (r2+12),r6
8004654: 58 45 00 10 sw (r2+16),r5
8004658: 58 41 00 14 sw (r2+20),r1
memset(
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
800465c: 34 84 00 01 addi r4,r4,1
8004660: 34 63 00 18 addi r3,r3,24
8004664: 55 a4 ff ef bgu r13,r4,8004620 <_IO_Manager_initialization+0xac>
_IO_Driver_address_table[index] = driver_table[index];
number_of_drivers = drivers_in_table;
}
8004668: 2b 9d 00 04 lw ra,(sp+4)
800466c: 2b 8b 00 18 lw r11,(sp+24)
8004670: 2b 8c 00 14 lw r12,(sp+20)
8004674: 2b 8d 00 10 lw r13,(sp+16)
8004678: 2b 8e 00 0c lw r14,(sp+12)
800467c: 2b 8f 00 08 lw r15,(sp+8)
8004680: 37 9c 00 18 addi sp,sp,24
8004684: c3 a0 00 00 ret
080056d8 <_Objects_Allocate>:
*/
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
80056d8: 37 9c ff ec addi sp,sp,-20
80056dc: 5b 8b 00 14 sw (sp+20),r11
80056e0: 5b 8c 00 10 sw (sp+16),r12
80056e4: 5b 8d 00 0c sw (sp+12),r13
80056e8: 5b 8e 00 08 sw (sp+8),r14
80056ec: 5b 9d 00 04 sw (sp+4),ra
80056f0: b8 20 58 00 mv r11,r1
* 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 )
80056f4: 28 21 00 18 lw r1,(r1+24)
return NULL;
80056f8: 34 0c 00 00 mvi r12,0
* 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 )
80056fc: 44 20 00 1e be r1,r0,8005774 <_Objects_Allocate+0x9c> <== NEVER TAKEN
/*
* 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 );
8005700: 35 6d 00 20 addi r13,r11,32
8005704: b9 a0 08 00 mv r1,r13
8005708: fb ff fd 3b calli 8004bf4 <_Chain_Get>
800570c: b8 20 60 00 mv r12,r1
8005710: b8 20 70 00 mv r14,r1
if ( information->auto_extend ) {
8005714: 41 61 00 12 lbu r1,(r11+18)
8005718: 44 20 00 17 be r1,r0,8005774 <_Objects_Allocate+0x9c>
/*
* If the list is empty then we are out of objects and need to
* extend information base.
*/
if ( !the_object ) {
800571c: 5d 80 00 07 bne r12,r0,8005738 <_Objects_Allocate+0x60>
_Objects_Extend_information( information );
8005720: b9 60 08 00 mv r1,r11
8005724: f8 00 00 32 calli 80057ec <_Objects_Extend_information>
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
8005728: b9 a0 08 00 mv r1,r13
800572c: fb ff fd 32 calli 8004bf4 <_Chain_Get>
8005730: b8 20 60 00 mv r12,r1
}
if ( the_object ) {
8005734: 44 2e 00 10 be r1,r14,8005774 <_Objects_Allocate+0x9c>
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
8005738: 2d 82 00 0a lhu r2,(r12+10)
800573c: 2d 61 00 0a lhu r1,(r11+10)
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
8005740: c8 41 08 00 sub r1,r2,r1
8005744: 2d 62 00 14 lhu r2,(r11+20)
8005748: f8 00 46 bc calli 8017238 <__udivsi3>
information->inactive_per_block[ block ]--;
800574c: 34 02 00 02 mvi r2,2
8005750: f8 00 45 e0 calli 8016ed0 <__ashlsi3>
8005754: 29 62 00 30 lw r2,(r11+48)
8005758: b4 41 08 00 add r1,r2,r1
800575c: 28 22 00 00 lw r2,(r1+0)
8005760: 34 42 ff ff addi r2,r2,-1
8005764: 58 22 00 00 sw (r1+0),r2
information->inactive--;
8005768: 2d 61 00 2c lhu r1,(r11+44)
800576c: 34 21 ff ff addi r1,r1,-1
8005770: 0d 61 00 2c sh (r11+44),r1
);
}
#endif
return the_object;
}
8005774: b9 80 08 00 mv r1,r12
8005778: 2b 9d 00 04 lw ra,(sp+4)
800577c: 2b 8b 00 14 lw r11,(sp+20)
8005780: 2b 8c 00 10 lw r12,(sp+16)
8005784: 2b 8d 00 0c lw r13,(sp+12)
8005788: 2b 8e 00 08 lw r14,(sp+8)
800578c: 37 9c 00 14 addi sp,sp,20
8005790: c3 a0 00 00 ret
0800ec84 <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint32_t the_class
)
{
800ec84: 37 9c ff ec addi sp,sp,-20
800ec88: 5b 8b 00 14 sw (sp+20),r11
800ec8c: 5b 8c 00 10 sw (sp+16),r12
800ec90: 5b 8d 00 0c sw (sp+12),r13
800ec94: 5b 8e 00 08 sw (sp+8),r14
800ec98: 5b 9d 00 04 sw (sp+4),ra
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
return NULL;
800ec9c: 34 0b 00 00 mvi r11,0
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint32_t the_class
)
{
800eca0: b8 20 70 00 mv r14,r1
800eca4: b8 40 60 00 mv r12,r2
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
800eca8: 44 40 00 16 be r2,r0,800ed00 <_Objects_Get_information+0x7c>
/*
* 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 );
800ecac: f8 00 09 4c calli 80111dc <_Objects_API_maximum_class>
if ( the_class_api_maximum == 0 )
800ecb0: 44 20 00 14 be r1,r0,800ed00 <_Objects_Get_information+0x7c>
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
800ecb4: 55 81 00 13 bgu r12,r1,800ed00 <_Objects_Get_information+0x7c>
return NULL;
if ( !_Objects_Information_table[ the_api ] )
800ecb8: 78 0d 08 01 mvhi r13,0x801
800ecbc: b9 c0 08 00 mv r1,r14
800ecc0: 34 02 00 02 mvi r2,2
800ecc4: 39 ad 98 c0 ori r13,r13,0x98c0
800ecc8: f8 00 20 82 calli 8016ed0 <__ashlsi3>
800eccc: b5 a1 08 00 add r1,r13,r1
800ecd0: 28 2d 00 00 lw r13,(r1+0)
800ecd4: 45 a0 00 0b be r13,r0,800ed00 <_Objects_Get_information+0x7c><== NEVER TAKEN
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
800ecd8: b9 80 08 00 mv r1,r12
800ecdc: 34 02 00 02 mvi r2,2
800ece0: f8 00 20 7c calli 8016ed0 <__ashlsi3>
800ece4: b5 a1 08 00 add r1,r13,r1
800ece8: 28 2b 00 00 lw r11,(r1+0)
if ( !info )
800ecec: 45 60 00 05 be r11,r0,800ed00 <_Objects_Get_information+0x7c><== NEVER TAKEN
* 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 )
800ecf0: 2d 61 00 10 lhu r1,(r11+16)
return NULL;
800ecf4: 7c 21 00 00 cmpnei r1,r1,0
800ecf8: c8 01 08 00 sub r1,r0,r1
800ecfc: a1 61 58 00 and r11,r11,r1
#endif
return info;
}
800ed00: b9 60 08 00 mv r1,r11
800ed04: 2b 9d 00 04 lw ra,(sp+4)
800ed08: 2b 8b 00 14 lw r11,(sp+20)
800ed0c: 2b 8c 00 10 lw r12,(sp+16)
800ed10: 2b 8d 00 0c lw r13,(sp+12)
800ed14: 2b 8e 00 08 lw r14,(sp+8)
800ed18: 37 9c 00 14 addi sp,sp,20
800ed1c: c3 a0 00 00 ret
080179e0 <_Objects_Get_no_protection>:
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
80179e0: 37 9c ff f4 addi sp,sp,-12
80179e4: 5b 8b 00 0c sw (sp+12),r11
80179e8: 5b 8c 00 08 sw (sp+8),r12
80179ec: 5b 9d 00 04 sw (sp+4),ra
80179f0: b8 20 20 00 mv r4,r1
/*
* 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;
80179f4: 28 21 00 08 lw r1,(r1+8)
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
80179f8: b8 60 58 00 mv r11,r3
/*
* 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;
80179fc: c8 41 08 00 sub r1,r2,r1
if ( information->maximum >= index ) {
8017a00: 2c 82 00 10 lhu r2,(r4+16)
/*
* 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;
8017a04: 34 21 00 01 addi r1,r1,1
if ( information->maximum >= index ) {
8017a08: 54 22 00 09 bgu r1,r2,8017a2c <_Objects_Get_no_protection+0x4c>
if ( (the_object = information->local_table[ index ]) != NULL ) {
8017a0c: 28 8c 00 1c lw r12,(r4+28)
8017a10: 34 02 00 02 mvi r2,2
8017a14: fb ff d9 43 calli 800df20 <__ashlsi3>
8017a18: b5 81 08 00 add r1,r12,r1
8017a1c: 28 21 00 00 lw r1,(r1+0)
8017a20: 44 20 00 03 be r1,r0,8017a2c <_Objects_Get_no_protection+0x4c><== NEVER TAKEN
*location = OBJECTS_LOCAL;
8017a24: 59 60 00 00 sw (r11+0),r0
return the_object;
8017a28: e0 00 00 04 bi 8017a38 <_Objects_Get_no_protection+0x58>
/*
* This isn't supported or required yet for Global objects so
* if it isn't local, we don't find it.
*/
*location = OBJECTS_ERROR;
8017a2c: 34 01 00 01 mvi r1,1
8017a30: 59 61 00 00 sw (r11+0),r1
return NULL;
8017a34: 34 01 00 00 mvi r1,0
}
8017a38: 2b 9d 00 04 lw ra,(sp+4)
8017a3c: 2b 8b 00 0c lw r11,(sp+12)
8017a40: 2b 8c 00 08 lw r12,(sp+8)
8017a44: 37 9c 00 0c addi sp,sp,12
8017a48: c3 a0 00 00 ret
080062c8 <_Objects_Id_to_name>:
*/
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
80062c8: 37 9c ff e8 addi sp,sp,-24
80062cc: 5b 8b 00 14 sw (sp+20),r11
80062d0: 5b 8c 00 10 sw (sp+16),r12
80062d4: 5b 8d 00 0c sw (sp+12),r13
80062d8: 5b 8e 00 08 sw (sp+8),r14
80062dc: 5b 9d 00 04 sw (sp+4),ra
80062e0: b8 40 70 00 mv r14,r2
/*
* Caller is trusted for name != NULL.
*/
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
80062e4: b8 20 58 00 mv r11,r1
80062e8: 5c 20 00 05 bne r1,r0,80062fc <_Objects_Id_to_name+0x34>
80062ec: 78 01 08 02 mvhi r1,0x802
80062f0: 38 21 0d cc ori r1,r1,0xdcc
80062f4: 28 21 00 0c lw r1,(r1+12)
80062f8: 28 2b 00 08 lw r11,(r1+8)
*/
RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API(
Objects_Id id
)
{
return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS);
80062fc: 34 02 00 18 mvi r2,24
8006300: b9 60 08 00 mv r1,r11
8006304: f8 00 57 78 calli 801c0e4 <__lshrsi3>
8006308: 20 21 00 07 andi r1,r1,0x7
*/
RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid(
uint32_t the_api
)
{
if ( !the_api || the_api > OBJECTS_APIS_LAST )
800630c: 34 23 ff ff addi r3,r1,-1
8006310: 34 02 00 02 mvi r2,2
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
8006314: 34 0d 00 03 mvi r13,3
8006318: 54 62 00 14 bgu r3,r2,8006368 <_Objects_Id_to_name+0xa0>
800631c: e0 00 00 1b bi 8006388 <_Objects_Id_to_name+0xc0>
*/
RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
Objects_Id id
)
{
return (uint32_t)
8006320: 34 02 00 1b mvi r2,27
8006324: b9 60 08 00 mv r1,r11
8006328: f8 00 57 6f calli 801c0e4 <__lshrsi3>
if ( !_Objects_Information_table[ the_api ] )
return OBJECTS_INVALID_ID;
the_class = _Objects_Get_class( tmpId );
information = _Objects_Information_table[ the_api ][ the_class ];
800632c: 34 02 00 02 mvi r2,2
8006330: fb ff ec c3 calli 800163c <__ashlsi3>
8006334: b5 81 08 00 add r1,r12,r1
8006338: 28 21 00 00 lw r1,(r1+0)
if ( !information )
800633c: 44 20 00 0b be r1,r0,8006368 <_Objects_Id_to_name+0xa0> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
8006340: 40 2c 00 38 lbu r12,(r1+56)
8006344: 5d 80 00 09 bne r12,r0,8006368 <_Objects_Id_to_name+0xa0> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#endif
the_object = _Objects_Get( information, tmpId, &ignored_location );
8006348: b9 60 10 00 mv r2,r11
800634c: 37 83 00 18 addi r3,sp,24
8006350: fb ff ff b8 calli 8006230 <_Objects_Get>
if ( !the_object )
8006354: 44 2c 00 05 be r1,r12,8006368 <_Objects_Id_to_name+0xa0>
return OBJECTS_INVALID_ID;
*name = the_object->name;
8006358: 28 21 00 0c lw r1,(r1+12)
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
800635c: 34 0d 00 00 mvi r13,0
the_object = _Objects_Get( information, tmpId, &ignored_location );
if ( !the_object )
return OBJECTS_INVALID_ID;
*name = the_object->name;
8006360: 59 c1 00 00 sw (r14+0),r1
_Thread_Enable_dispatch();
8006364: f8 00 02 5e calli 8006cdc <_Thread_Enable_dispatch>
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
}
8006368: b9 a0 08 00 mv r1,r13
800636c: 2b 9d 00 04 lw ra,(sp+4)
8006370: 2b 8b 00 14 lw r11,(sp+20)
8006374: 2b 8c 00 10 lw r12,(sp+16)
8006378: 2b 8d 00 0c lw r13,(sp+12)
800637c: 2b 8e 00 08 lw r14,(sp+8)
8006380: 37 9c 00 18 addi sp,sp,24
8006384: c3 a0 00 00 ret
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
if ( !_Objects_Information_table[ the_api ] )
8006388: 78 0c 08 02 mvhi r12,0x802
800638c: 34 02 00 02 mvi r2,2
8006390: 39 8c 08 90 ori r12,r12,0x890
8006394: fb ff ec aa calli 800163c <__ashlsi3>
8006398: b5 81 08 00 add r1,r12,r1
800639c: 28 2c 00 00 lw r12,(r1+0)
80063a0: 5d 80 ff e0 bne r12,r0,8006320 <_Objects_Id_to_name+0x58> <== ALWAYS TAKEN
80063a4: e3 ff ff f1 bi 8006368 <_Objects_Id_to_name+0xa0> <== NOT EXECUTED
08005d04 <_Objects_Initialize_information>:
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8005d04: 37 9c ff e4 addi sp,sp,-28
8005d08: 5b 8b 00 1c sw (sp+28),r11
8005d0c: 5b 8c 00 18 sw (sp+24),r12
8005d10: 5b 8d 00 14 sw (sp+20),r13
8005d14: 5b 8e 00 10 sw (sp+16),r14
8005d18: 5b 8f 00 0c sw (sp+12),r15
8005d1c: 5b 90 00 08 sw (sp+8),r16
8005d20: 5b 9d 00 04 sw (sp+4),ra
8005d24: b8 20 58 00 mv r11,r1
8005d28: 20 a5 ff ff andi r5,r5,0xffff
#if defined(RTEMS_MULTIPROCESSING)
uint32_t index;
#endif
information->the_api = the_api;
information->the_class = the_class;
8005d2c: 0d 63 00 04 sh (r11+4),r3
information->size = size;
8005d30: 58 25 00 18 sw (r1+24),r5
information->local_table = 0;
information->inactive_per_block = 0;
information->object_blocks = 0;
information->inactive = 0;
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
information->is_string = is_string;
8005d34: 30 26 00 38 sb (r1+56),r6
uint32_t maximum_per_allocation;
#if defined(RTEMS_MULTIPROCESSING)
uint32_t index;
#endif
information->the_api = the_api;
8005d38: 59 62 00 00 sw (r11+0),r2
information->the_class = the_class;
information->size = size;
information->local_table = 0;
8005d3c: 58 20 00 1c sw (r1+28),r0
information->inactive_per_block = 0;
8005d40: 58 20 00 30 sw (r1+48),r0
information->object_blocks = 0;
8005d44: 58 20 00 34 sw (r1+52),r0
information->inactive = 0;
8005d48: 0c 20 00 2c sh (r1+44),r0
/*
* Set the maximum value to 0. It will be updated when objects are
* added to the inactive set from _Objects_Extend_information()
*/
information->maximum = 0;
8005d4c: 0c 20 00 10 sh (r1+16),r0
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8005d50: b8 40 70 00 mv r14,r2
information->maximum = 0;
/*
* Register this Object Class in the Object Information Table.
*/
_Objects_Information_table[ the_api ][ the_class ] = information;
8005d54: b8 40 08 00 mv r1,r2
8005d58: 78 0f 08 01 mvhi r15,0x801
8005d5c: 34 02 00 02 mvi r2,2
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8005d60: b8 60 68 00 mv r13,r3
8005d64: b8 80 60 00 mv r12,r4
8005d68: b8 e0 80 00 mv r16,r7
information->maximum = 0;
/*
* Register this Object Class in the Object Information Table.
*/
_Objects_Information_table[ the_api ][ the_class ] = information;
8005d6c: 39 ef 98 c0 ori r15,r15,0x98c0
8005d70: f8 00 44 58 calli 8016ed0 <__ashlsi3>
8005d74: b5 e1 08 00 add r1,r15,r1
8005d78: 28 2f 00 00 lw r15,(r1+0)
8005d7c: 34 02 00 02 mvi r2,2
8005d80: b9 a0 08 00 mv r1,r13
8005d84: f8 00 44 53 calli 8016ed0 <__ashlsi3>
8005d88: b5 e1 08 00 add r1,r15,r1
8005d8c: 58 2b 00 00 sw (r1+0),r11
/*
* Are we operating in limited or unlimited (e.g. auto-extend) mode.
*/
information->auto_extend =
(maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false;
8005d90: 34 02 00 1f mvi r2,31
8005d94: b9 80 08 00 mv r1,r12
8005d98: f8 00 44 9c calli 8017008 <__lshrsi3>
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
8005d9c: 78 03 08 01 mvhi r3,0x801
8005da0: 38 63 81 38 ori r3,r3,0x8138
/*
* Are we operating in limited or unlimited (e.g. auto-extend) mode.
*/
information->auto_extend =
(maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false;
8005da4: 20 22 00 ff andi r2,r1,0xff
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
8005da8: 28 61 00 00 lw r1,(r3+0)
_Objects_Information_table[ the_api ][ the_class ] = information;
/*
* Are we operating in limited or unlimited (e.g. auto-extend) mode.
*/
information->auto_extend =
8005dac: 31 62 00 12 sb (r11+18),r2
(maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false;
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
8005db0: a1 81 60 00 and r12,r12,r1
/*
* Unlimited and maximum of zero is illogical.
*/
if ( information->auto_extend && maximum_per_allocation == 0) {
8005db4: 44 40 00 06 be r2,r0,8005dcc <_Objects_Initialize_information+0xc8>
8005db8: 5d 80 00 05 bne r12,r0,8005dcc <_Objects_Initialize_information+0xc8><== ALWAYS TAKEN
_Internal_error_Occurred(
8005dbc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
8005dc0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8005dc4: 34 03 00 13 mvi r3,19 <== NOT EXECUTED
8005dc8: fb ff fe 15 calli 800561c <_Internal_error_Occurred> <== NOT EXECUTED
information->allocation_size = maximum_per_allocation;
/*
* Provide a null local table entry for the case of any empty table.
*/
information->local_table = &null_local_table;
8005dcc: 78 01 08 01 mvhi r1,0x801
8005dd0: 38 21 96 e4 ori r1,r1,0x96e4
8005dd4: 59 61 00 1c sw (r11+28),r1
8005dd8: 34 02 00 18 mvi r2,24
8005ddc: b9 c0 08 00 mv r1,r14
}
/*
* The allocation unit is the maximum value
*/
information->allocation_size = maximum_per_allocation;
8005de0: 0d 6c 00 14 sh (r11+20),r12
8005de4: f8 00 44 3b calli 8016ed0 <__ashlsi3>
8005de8: 78 0e 00 01 mvhi r14,0x1
8005dec: b8 2e 70 00 or r14,r1,r14
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
8005df0: 34 02 00 1b mvi r2,27
8005df4: b9 a0 08 00 mv r1,r13
8005df8: f8 00 44 36 calli 8016ed0 <__ashlsi3>
information->local_table = &null_local_table;
/*
* Calculate minimum and maximum Id's
*/
minimum_index = (maximum_per_allocation == 0) ? 0 : 1;
8005dfc: 7d 82 00 00 cmpnei r2,r12,0
8005e00: b9 c1 08 00 or r1,r14,r1
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
8005e04: b8 22 08 00 or r1,r1,r2
information->minimum_id =
8005e08: 59 61 00 08 sw (r11+8),r1
/*
* Calculate the maximum name length
*/
name_length = maximum_name_length;
if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) )
8005e0c: 22 01 00 03 andi r1,r16,0x3
8005e10: ba 00 38 00 mv r7,r16
8005e14: 44 20 00 04 be r1,r0,8005e24 <_Objects_Initialize_information+0x120>
name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
8005e18: 36 07 00 04 addi r7,r16,4
8005e1c: 34 01 ff fc mvi r1,-4
8005e20: a0 e1 38 00 and r7,r7,r1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
8005e24: 35 61 00 24 addi r1,r11,36
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
8005e28: 59 61 00 20 sw (r11+32),r1
~(OBJECTS_NAME_ALIGNMENT-1);
information->name_length = name_length;
_Chain_Initialize_empty( &information->Inactive );
8005e2c: 35 61 00 20 addi r1,r11,32
if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) )
name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
~(OBJECTS_NAME_ALIGNMENT-1);
information->name_length = name_length;
8005e30: 0d 67 00 3a sh (r11+58),r7
the_chain->permanent_null = NULL;
8005e34: 59 60 00 24 sw (r11+36),r0
the_chain->last = _Chain_Head(the_chain);
8005e38: 59 61 00 28 sw (r11+40),r1
_Chain_Initialize_empty( &information->Inactive );
/*
* Initialize objects .. if there are any
*/
if ( maximum_per_allocation ) {
8005e3c: 45 80 00 03 be r12,r0,8005e48 <_Objects_Initialize_information+0x144>
/*
* Always have the maximum size available so the current performance
* figures are create are met. If the user moves past the maximum
* number then a performance hit is taken.
*/
_Objects_Extend_information( information );
8005e40: b9 60 08 00 mv r1,r11
8005e44: fb ff fe 6a calli 80057ec <_Objects_Extend_information>
_Chain_Initialize_empty( &information->global_table[ index ] );
}
else
information->global_table = NULL;
#endif
}
8005e48: 2b 9d 00 04 lw ra,(sp+4)
8005e4c: 2b 8b 00 1c lw r11,(sp+28)
8005e50: 2b 8c 00 18 lw r12,(sp+24)
8005e54: 2b 8d 00 14 lw r13,(sp+20)
8005e58: 2b 8e 00 10 lw r14,(sp+16)
8005e5c: 2b 8f 00 0c lw r15,(sp+12)
8005e60: 2b 90 00 08 lw r16,(sp+8)
8005e64: 37 9c 00 1c addi sp,sp,28
8005e68: c3 a0 00 00 ret
08004ed4 <_Objects_Set_name>:
bool _Objects_Set_name(
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
8004ed4: 37 9c ff ec addi sp,sp,-20
8004ed8: 5b 8b 00 14 sw (sp+20),r11
8004edc: 5b 8c 00 10 sw (sp+16),r12
8004ee0: 5b 8d 00 0c sw (sp+12),r13
8004ee4: 5b 8e 00 08 sw (sp+8),r14
8004ee8: 5b 9d 00 04 sw (sp+4),ra
8004eec: b8 20 70 00 mv r14,r1
8004ef0: b8 40 68 00 mv r13,r2
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
8004ef4: 2d c2 00 3a lhu r2,(r14+58)
8004ef8: b8 60 08 00 mv r1,r3
bool _Objects_Set_name(
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
8004efc: b8 60 58 00 mv r11,r3
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
8004f00: f8 00 27 64 calli 800ec90 <strnlen>
8004f04: b8 20 60 00 mv r12,r1
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
8004f08: 41 c1 00 38 lbu r1,(r14+56)
8004f0c: 44 20 00 12 be r1,r0,8004f54 <_Objects_Set_name+0x80>
char *d;
d = _Workspace_Allocate( length + 1 );
8004f10: 35 81 00 01 addi r1,r12,1
8004f14: f8 00 07 8b calli 8006d40 <_Workspace_Allocate>
8004f18: b8 20 70 00 mv r14,r1
if ( !d )
return false;
8004f1c: 34 03 00 00 mvi r3,0
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
char *d;
d = _Workspace_Allocate( length + 1 );
if ( !d )
8004f20: 44 20 00 26 be r1,r0,8004fb8 <_Objects_Set_name+0xe4> <== NEVER TAKEN
return false;
if ( the_object->name.name_p ) {
8004f24: 29 a1 00 0c lw r1,(r13+12)
8004f28: 44 20 00 03 be r1,r0,8004f34 <_Objects_Set_name+0x60>
_Workspace_Free( (void *)the_object->name.name_p );
8004f2c: f8 00 07 90 calli 8006d6c <_Workspace_Free>
the_object->name.name_p = NULL;
8004f30: 59 a0 00 0c sw (r13+12),r0
}
strncpy( d, name, length );
8004f34: b9 80 18 00 mv r3,r12
8004f38: b9 c0 08 00 mv r1,r14
8004f3c: b9 60 10 00 mv r2,r11
d[length] = '\0';
8004f40: b5 cc 60 00 add r12,r14,r12
if ( the_object->name.name_p ) {
_Workspace_Free( (void *)the_object->name.name_p );
the_object->name.name_p = NULL;
}
strncpy( d, name, length );
8004f44: f8 00 27 20 calli 800ebc4 <strncpy>
d[length] = '\0';
8004f48: 31 80 00 00 sb (r12+0),r0
the_object->name.name_p = d;
8004f4c: 59 ae 00 0c sw (r13+12),r14
8004f50: e0 00 00 19 bi 8004fb4 <_Objects_Set_name+0xe0>
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
8004f54: 41 61 00 00 lbu r1,(r11+0)
8004f58: 34 02 00 18 mvi r2,24
8004f5c: f8 00 57 9c calli 801adcc <__ashlsi3>
8004f60: 34 02 00 01 mvi r2,1
8004f64: b8 20 70 00 mv r14,r1
8004f68: 78 01 00 20 mvhi r1,0x20
8004f6c: 50 4c 00 04 bgeu r2,r12,8004f7c <_Objects_Set_name+0xa8>
8004f70: 41 61 00 01 lbu r1,(r11+1)
8004f74: 34 02 00 10 mvi r2,16
8004f78: f8 00 57 95 calli 801adcc <__ashlsi3>
8004f7c: 34 02 00 02 mvi r2,2
8004f80: b8 2e 70 00 or r14,r1,r14
8004f84: 34 01 20 00 mvi r1,8192
8004f88: 50 4c 00 04 bgeu r2,r12,8004f98 <_Objects_Set_name+0xc4>
8004f8c: 41 61 00 02 lbu r1,(r11+2)
8004f90: 34 02 00 08 mvi r2,8
8004f94: f8 00 57 8e calli 801adcc <__ashlsi3>
8004f98: 34 03 00 03 mvi r3,3
8004f9c: b9 c1 08 00 or r1,r14,r1
8004fa0: 34 02 00 20 mvi r2,32
8004fa4: 50 6c 00 02 bgeu r3,r12,8004fac <_Objects_Set_name+0xd8>
8004fa8: 41 62 00 03 lbu r2,(r11+3)
8004fac: b8 22 10 00 or r2,r1,r2
8004fb0: 59 a2 00 0c sw (r13+12),r2
((3 < length) ? s[ 3 ] : ' ')
);
}
return true;
8004fb4: 34 03 00 01 mvi r3,1
}
8004fb8: b8 60 08 00 mv r1,r3
8004fbc: 2b 9d 00 04 lw ra,(sp+4)
8004fc0: 2b 8b 00 14 lw r11,(sp+20)
8004fc4: 2b 8c 00 10 lw r12,(sp+16)
8004fc8: 2b 8d 00 0c lw r13,(sp+12)
8004fcc: 2b 8e 00 08 lw r14,(sp+8)
8004fd0: 37 9c 00 14 addi sp,sp,20
8004fd4: c3 a0 00 00 ret
08003fc0 <_POSIX_Condition_variables_Wait_support>:
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
8003fc0: 37 9c ff e0 addi sp,sp,-32
8003fc4: 5b 8b 00 1c sw (sp+28),r11
8003fc8: 5b 8c 00 18 sw (sp+24),r12
8003fcc: 5b 8d 00 14 sw (sp+20),r13
8003fd0: 5b 8e 00 10 sw (sp+16),r14
8003fd4: 5b 8f 00 0c sw (sp+12),r15
8003fd8: 5b 90 00 08 sw (sp+8),r16
8003fdc: 5b 9d 00 04 sw (sp+4),ra
8003fe0: b8 20 70 00 mv r14,r1
8003fe4: b8 40 58 00 mv r11,r2
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
8003fe8: b8 40 08 00 mv r1,r2
8003fec: 37 82 00 20 addi r2,sp,32
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
8003ff0: b8 60 80 00 mv r16,r3
8003ff4: 20 8f 00 ff andi r15,r4,0xff
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
8003ff8: f8 00 00 63 calli 8004184 <_POSIX_Mutex_Get>
return EINVAL;
8003ffc: 34 0c 00 16 mvi r12,22
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
8004000: 44 20 00 34 be r1,r0,80040d0 <_POSIX_Condition_variables_Wait_support+0x110>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
8004004: 78 05 08 01 mvhi r5,0x801
8004008: 38 a5 78 6c ori r5,r5,0x786c
800400c: 28 a1 00 00 lw r1,(r5+0)
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
8004010: 37 82 00 20 addi r2,sp,32
8004014: 34 21 ff ff addi r1,r1,-1
8004018: 58 a1 00 00 sw (r5+0),r1
800401c: b9 c0 08 00 mv r1,r14
8004020: fb ff ff 4f calli 8003d5c <_POSIX_Condition_variables_Get>
switch ( location ) {
8004024: 2b 84 00 20 lw r4,(sp+32)
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
8004028: b8 20 68 00 mv r13,r1
switch ( location ) {
800402c: 5c 80 00 29 bne r4,r0,80040d0 <_POSIX_Condition_variables_Wait_support+0x110>
case OBJECTS_LOCAL:
if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
8004030: 28 21 00 14 lw r1,(r1+20)
8004034: 44 24 00 05 be r1,r4,8004048 <_POSIX_Condition_variables_Wait_support+0x88>
8004038: 29 62 00 00 lw r2,(r11+0)
800403c: 44 22 00 03 be r1,r2,8004048 <_POSIX_Condition_variables_Wait_support+0x88>
_Thread_Enable_dispatch();
8004040: f8 00 0c ec calli 80073f0 <_Thread_Enable_dispatch>
return EINVAL;
8004044: e0 00 00 23 bi 80040d0 <_POSIX_Condition_variables_Wait_support+0x110>
}
(void) pthread_mutex_unlock( mutex );
8004048: b9 60 08 00 mv r1,r11
800404c: f8 00 01 18 calli 80044ac <pthread_mutex_unlock>
_Thread_Enable_dispatch();
return EINVAL;
}
*/
if ( !already_timedout ) {
8004050: 5d e0 00 1a bne r15,r0,80040b8 <_POSIX_Condition_variables_Wait_support+0xf8>
the_cond->Mutex = *mutex;
8004054: 29 61 00 00 lw r1,(r11+0)
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
8004058: 78 0c 08 01 mvhi r12,0x801
800405c: 39 8c 7d 44 ori r12,r12,0x7d44
8004060: 29 85 00 0c lw r5,(r12+12)
return EINVAL;
}
*/
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
8004064: 59 a1 00 14 sw (r13+20),r1
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;
8004068: 34 01 00 01 mvi r1,1
800406c: 59 a1 00 48 sw (r13+72),r1
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
8004070: 58 a0 00 34 sw (r5+52),r0
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
_Thread_Executing->Wait.id = *cond;
8004074: 29 c1 00 00 lw r1,(r14+0)
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;
8004078: 35 ad 00 18 addi r13,r13,24
_Thread_Executing->Wait.id = *cond;
_Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
800407c: 78 03 08 00 mvhi r3,0x800
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;
_Thread_Executing->Wait.id = *cond;
8004080: 58 a1 00 20 sw (r5+32),r1
_Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
8004084: ba 00 10 00 mv r2,r16
8004088: b9 a0 08 00 mv r1,r13
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;
800408c: 58 ad 00 44 sw (r5+68),r13
_Thread_Executing->Wait.id = *cond;
_Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
8004090: 38 63 7e c0 ori r3,r3,0x7ec0
8004094: f8 00 0e 14 calli 80078e4 <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
8004098: f8 00 0c d6 calli 80073f0 <_Thread_Enable_dispatch>
/*
* Switch ourself out because we blocked as a result of the
* _Thread_queue_Enqueue.
*/
status = _Thread_Executing->Wait.return_code;
800409c: 29 81 00 0c lw r1,(r12+12)
80040a0: 28 2c 00 34 lw r12,(r1+52)
if ( status && status != ETIMEDOUT )
80040a4: 7d 82 00 74 cmpnei r2,r12,116
80040a8: 7d 81 00 00 cmpnei r1,r12,0
80040ac: a0 41 08 00 and r1,r2,r1
80040b0: 44 2f 00 04 be r1,r15,80040c0 <_POSIX_Condition_variables_Wait_support+0x100><== ALWAYS TAKEN
80040b4: e0 00 00 07 bi 80040d0 <_POSIX_Condition_variables_Wait_support+0x110><== NOT EXECUTED
return status;
} else {
_Thread_Enable_dispatch();
80040b8: f8 00 0c ce calli 80073f0 <_Thread_Enable_dispatch>
status = ETIMEDOUT;
80040bc: 34 0c 00 74 mvi r12,116
/*
* When we get here the dispatch disable level is 0.
*/
mutex_status = pthread_mutex_lock( mutex );
80040c0: b9 60 08 00 mv r1,r11
80040c4: f8 00 00 c7 calli 80043e0 <pthread_mutex_lock>
if ( mutex_status )
80040c8: 44 20 00 02 be r1,r0,80040d0 <_POSIX_Condition_variables_Wait_support+0x110>
return EINVAL;
80040cc: 34 0c 00 16 mvi r12,22
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
80040d0: b9 80 08 00 mv r1,r12
80040d4: 2b 9d 00 04 lw ra,(sp+4)
80040d8: 2b 8b 00 1c lw r11,(sp+28)
80040dc: 2b 8c 00 18 lw r12,(sp+24)
80040e0: 2b 8d 00 14 lw r13,(sp+20)
80040e4: 2b 8e 00 10 lw r14,(sp+16)
80040e8: 2b 8f 00 0c lw r15,(sp+12)
80040ec: 2b 90 00 08 lw r16,(sp+8)
80040f0: 37 9c 00 20 addi sp,sp,32
80040f4: c3 a0 00 00 ret
08008f70 <_POSIX_Message_queue_Receive_support>:
size_t msg_len,
unsigned int *msg_prio,
bool wait,
Watchdog_Interval timeout
)
{
8008f70: 37 9c ff dc addi sp,sp,-36
8008f74: 5b 8b 00 18 sw (sp+24),r11
8008f78: 5b 8c 00 14 sw (sp+20),r12
8008f7c: 5b 8d 00 10 sw (sp+16),r13
8008f80: 5b 8e 00 0c sw (sp+12),r14
8008f84: 5b 8f 00 08 sw (sp+8),r15
8008f88: 5b 9d 00 04 sw (sp+4),ra
8008f8c: b8 20 58 00 mv r11,r1
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(
8008f90: 78 01 08 02 mvhi r1,0x802
8008f94: b8 40 60 00 mv r12,r2
8008f98: b8 60 78 00 mv r15,r3
8008f9c: b9 60 10 00 mv r2,r11
8008fa0: 38 21 92 28 ori r1,r1,0x9228
8008fa4: 37 83 00 24 addi r3,sp,36
8008fa8: 5b 86 00 1c sw (sp+28),r6
8008fac: b8 80 68 00 mv r13,r4
8008fb0: 20 ae 00 ff andi r14,r5,0xff
8008fb4: f8 00 0c b9 calli 800c298 <_Objects_Get>
Objects_Locations location;
size_t length_out;
bool do_wait;
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
8008fb8: 2b 82 00 24 lw r2,(sp+36)
8008fbc: 2b 86 00 1c lw r6,(sp+28)
8008fc0: 5c 40 00 2f bne r2,r0,800907c <_POSIX_Message_queue_Receive_support+0x10c><== NEVER TAKEN
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
8008fc4: 28 28 00 14 lw r8,(r1+20)
8008fc8: 34 02 00 01 mvi r2,1
8008fcc: 21 03 00 03 andi r3,r8,0x3
8008fd0: 5c 62 00 03 bne r3,r2,8008fdc <_POSIX_Message_queue_Receive_support+0x6c>
_Thread_Enable_dispatch();
8008fd4: f8 00 0f 2d calli 800cc88 <_Thread_Enable_dispatch>
8008fd8: e0 00 00 29 bi 800907c <_POSIX_Message_queue_Receive_support+0x10c>
rtems_set_errno_and_return_minus_one( EBADF );
}
the_mq = the_mq_fd->Queue;
8008fdc: 28 27 00 10 lw r7,(r1+16)
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
8008fe0: 28 e1 00 68 lw r1,(r7+104)
8008fe4: 51 e1 00 05 bgeu r15,r1,8008ff8 <_POSIX_Message_queue_Receive_support+0x88>
_Thread_Enable_dispatch();
8008fe8: f8 00 0f 28 calli 800cc88 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EMSGSIZE );
8008fec: f8 00 2e dd calli 8014b60 <__errno>
8008ff0: 34 02 00 7a mvi r2,122
8008ff4: e0 00 00 24 bi 8009084 <_POSIX_Message_queue_Receive_support+0x114>
/*
* Now if something goes wrong, we return a "length" of -1
* to indicate an error.
*/
length_out = -1;
8008ff8: 34 01 ff ff mvi r1,-1
8008ffc: 5b 81 00 20 sw (sp+32),r1
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
8009000: 34 05 00 00 mvi r5,0
8009004: 45 c0 00 03 be r14,r0,8009010 <_POSIX_Message_queue_Receive_support+0xa0><== NEVER TAKEN
do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true;
8009008: 21 05 40 00 andi r5,r8,0x4000
800900c: 64 a5 00 00 cmpei r5,r5,0
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
8009010: b9 60 10 00 mv r2,r11
timeout
);
_Thread_Enable_dispatch();
*msg_prio =
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
8009014: 78 0b 08 02 mvhi r11,0x802
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
8009018: 34 e1 00 1c addi r1,r7,28
800901c: b9 80 18 00 mv r3,r12
8009020: 37 84 00 20 addi r4,sp,32
timeout
);
_Thread_Enable_dispatch();
*msg_prio =
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
8009024: 39 6b 92 94 ori r11,r11,0x9294
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
8009028: f8 00 07 7c calli 800ae18 <_CORE_message_queue_Seize>
&length_out,
do_wait,
timeout
);
_Thread_Enable_dispatch();
800902c: f8 00 0f 17 calli 800cc88 <_Thread_Enable_dispatch>
*msg_prio =
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
8009030: 29 6c 00 0c lw r12,(r11+12)
RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
CORE_message_queue_Submit_types priority
)
{
/* absolute value without a library dependency */
return ((priority >= 0) ? priority : -priority);
8009034: 34 02 00 1f mvi r2,31
8009038: 29 81 00 24 lw r1,(r12+36)
800903c: f8 00 6c 6c calli 80241ec <__ashrsi3>
8009040: 29 82 00 24 lw r2,(r12+36)
8009044: 98 22 10 00 xor r2,r1,r2
8009048: c8 41 08 00 sub r1,r2,r1
do_wait,
timeout
);
_Thread_Enable_dispatch();
*msg_prio =
800904c: 59 a1 00 00 sw (r13+0),r1
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
if ( !_Thread_Executing->Wait.return_code )
8009050: 29 81 00 34 lw r1,(r12+52)
8009054: 5c 20 00 03 bne r1,r0,8009060 <_POSIX_Message_queue_Receive_support+0xf0>
return length_out;
8009058: 2b 81 00 20 lw r1,(sp+32)
800905c: e0 00 00 0c bi 800908c <_POSIX_Message_queue_Receive_support+0x11c>
rtems_set_errno_and_return_minus_one(
8009060: f8 00 2e c0 calli 8014b60 <__errno>
8009064: b8 20 60 00 mv r12,r1
8009068: 29 61 00 0c lw r1,(r11+12)
800906c: 28 21 00 34 lw r1,(r1+52)
8009070: f8 00 00 b9 calli 8009354 <_POSIX_Message_queue_Translate_core_message_queue_return_code>
8009074: 59 81 00 00 sw (r12+0),r1
8009078: e0 00 00 04 bi 8009088 <_POSIX_Message_queue_Receive_support+0x118>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
800907c: f8 00 2e b9 calli 8014b60 <__errno>
8009080: 34 02 00 09 mvi r2,9
8009084: 58 22 00 00 sw (r1+0),r2
8009088: 34 01 ff ff mvi r1,-1
}
800908c: 2b 9d 00 04 lw ra,(sp+4)
8009090: 2b 8b 00 18 lw r11,(sp+24)
8009094: 2b 8c 00 14 lw r12,(sp+20)
8009098: 2b 8d 00 10 lw r13,(sp+16)
800909c: 2b 8e 00 0c lw r14,(sp+12)
80090a0: 2b 8f 00 08 lw r15,(sp+8)
80090a4: 37 9c 00 24 addi sp,sp,36
80090a8: c3 a0 00 00 ret
08008544 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>:
#include <rtems/posix/pthread.h>
void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(
Thread_Control *the_thread
)
{
8008544: 37 9c ff fc addi sp,sp,-4
8008548: 5b 9d 00 04 sw (sp+4),ra
POSIX_API_Control *thread_support;
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
800854c: 28 22 01 2c lw r2,(r1+300)
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
8008550: 28 43 00 d4 lw r3,(r2+212)
8008554: 5c 60 00 0e bne r3,r0,800858c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48><== NEVER TAKEN
8008558: 28 44 00 d8 lw r4,(r2+216)
800855c: 34 03 00 01 mvi r3,1
8008560: 5c 83 00 0b bne r4,r3,800858c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48>
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
8008564: 28 42 00 dc lw r2,(r2+220)
8008568: 44 40 00 09 be r2,r0,800858c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
800856c: 78 02 08 01 mvhi r2,0x801
8008570: 38 42 58 5c ori r2,r2,0x585c
8008574: 28 43 00 00 lw r3,(r2+0)
8008578: 34 63 ff ff addi r3,r3,-1
800857c: 58 43 00 00 sw (r2+0),r3
thread_support->cancelation_requested ) {
_Thread_Unnest_dispatch();
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
8008580: 34 02 ff ff mvi r2,-1
8008584: f8 00 02 6b calli 8008f30 <_POSIX_Thread_Exit>
8008588: e0 00 00 02 bi 8008590 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x4c>
} else
_Thread_Enable_dispatch();
800858c: fb ff f2 c6 calli 80050a4 <_Thread_Enable_dispatch>
}
8008590: 2b 9d 00 04 lw ra,(sp+4)
8008594: 37 9c 00 04 addi sp,sp,4
8008598: c3 a0 00 00 ret
08009fe0 <_POSIX_Thread_Translate_sched_param>:
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
8009fe0: 37 9c ff e8 addi sp,sp,-24
8009fe4: 5b 8b 00 18 sw (sp+24),r11
8009fe8: 5b 8c 00 14 sw (sp+20),r12
8009fec: 5b 8d 00 10 sw (sp+16),r13
8009ff0: 5b 8e 00 0c sw (sp+12),r14
8009ff4: 5b 8f 00 08 sw (sp+8),r15
8009ff8: 5b 9d 00 04 sw (sp+4),ra
8009ffc: b8 20 68 00 mv r13,r1
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a000: 28 41 00 00 lw r1,(r2+0)
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
800a004: b8 40 58 00 mv r11,r2
800a008: b8 60 70 00 mv r14,r3
800a00c: b8 80 78 00 mv r15,r4
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a010: fb ff ff ec calli 8009fc0 <_POSIX_Priority_Is_valid>
return EINVAL;
800a014: 34 0c 00 16 mvi r12,22
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a018: 44 20 00 2a be r1,r0,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0><== NEVER TAKEN
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
800a01c: 59 c0 00 00 sw (r14+0),r0
*budget_callout = NULL;
800a020: 59 e0 00 00 sw (r15+0),r0
if ( policy == SCHED_OTHER ) {
800a024: 5d a0 00 04 bne r13,r0,800a034 <_POSIX_Thread_Translate_sched_param+0x54>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
800a028: 34 01 00 01 mvi r1,1
800a02c: 59 c1 00 00 sw (r14+0),r1
800a030: e0 00 00 23 bi 800a0bc <_POSIX_Thread_Translate_sched_param+0xdc>
return 0;
}
if ( policy == SCHED_FIFO ) {
800a034: 34 01 00 01 mvi r1,1
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
800a038: 34 0c 00 00 mvi r12,0
if ( policy == SCHED_OTHER ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
return 0;
}
if ( policy == SCHED_FIFO ) {
800a03c: 45 a1 00 21 be r13,r1,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
}
if ( policy == SCHED_RR ) {
800a040: 34 01 00 02 mvi r1,2
800a044: 5d a1 00 03 bne r13,r1,800a050 <_POSIX_Thread_Translate_sched_param+0x70>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
800a048: 59 cd 00 00 sw (r14+0),r13
return 0;
800a04c: e0 00 00 1d bi 800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0>
}
if ( policy == SCHED_SPORADIC ) {
800a050: 34 01 00 04 mvi r1,4
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
return 0;
}
return EINVAL;
800a054: 34 0c 00 16 mvi r12,22
if ( policy == SCHED_RR ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
return 0;
}
if ( policy == SCHED_SPORADIC ) {
800a058: 5d a1 00 1a bne r13,r1,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0>
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
800a05c: 29 61 00 08 lw r1,(r11+8)
800a060: 5c 20 00 03 bne r1,r0,800a06c <_POSIX_Thread_Translate_sched_param+0x8c>
800a064: 29 62 00 0c lw r2,(r11+12)
800a068: 44 41 00 16 be r2,r1,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0>
(param->sched_ss_repl_period.tv_nsec == 0) )
return EINVAL;
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
800a06c: 29 61 00 10 lw r1,(r11+16)
800a070: 5c 20 00 04 bne r1,r0,800a080 <_POSIX_Thread_Translate_sched_param+0xa0>
800a074: 29 62 00 14 lw r2,(r11+20)
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
800a078: 34 0c 00 16 mvi r12,22
if ( policy == SCHED_SPORADIC ) {
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
(param->sched_ss_repl_period.tv_nsec == 0) )
return EINVAL;
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
800a07c: 44 41 00 11 be r2,r1,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0>
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
800a080: 35 61 00 08 addi r1,r11,8
800a084: fb ff f4 8b calli 80072b0 <_Timespec_To_ticks>
800a088: b8 20 68 00 mv r13,r1
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
800a08c: 35 61 00 10 addi r1,r11,16
800a090: fb ff f4 88 calli 80072b0 <_Timespec_To_ticks>
return EINVAL;
800a094: 34 0c 00 16 mvi r12,22
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
800a098: 54 2d 00 0a bgu r1,r13,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0>
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
return EINVAL;
if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) )
800a09c: 29 61 00 04 lw r1,(r11+4)
800a0a0: fb ff ff c8 calli 8009fc0 <_POSIX_Priority_Is_valid>
800a0a4: 44 20 00 07 be r1,r0,800a0c0 <_POSIX_Thread_Translate_sched_param+0xe0>
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
800a0a8: 34 01 00 03 mvi r1,3
800a0ac: 59 c1 00 00 sw (r14+0),r1
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
800a0b0: 78 01 08 00 mvhi r1,0x800
800a0b4: 38 21 38 60 ori r1,r1,0x3860
800a0b8: 59 e1 00 00 sw (r15+0),r1
return 0;
800a0bc: 34 0c 00 00 mvi r12,0
}
return EINVAL;
}
800a0c0: b9 80 08 00 mv r1,r12
800a0c4: 2b 9d 00 04 lw ra,(sp+4)
800a0c8: 2b 8b 00 18 lw r11,(sp+24)
800a0cc: 2b 8c 00 14 lw r12,(sp+20)
800a0d0: 2b 8d 00 10 lw r13,(sp+16)
800a0d4: 2b 8e 00 0c lw r14,(sp+12)
800a0d8: 2b 8f 00 08 lw r15,(sp+8)
800a0dc: 37 9c 00 18 addi sp,sp,24
800a0e0: c3 a0 00 00 ret
080034e0 <_POSIX_Threads_Initialize_user_threads_body>:
*
* Output parameters: NONE
*/
void _POSIX_Threads_Initialize_user_threads_body(void)
{
80034e0: 37 9c ff ac addi sp,sp,-84
80034e4: 5b 8b 00 14 sw (sp+20),r11
80034e8: 5b 8c 00 10 sw (sp+16),r12
80034ec: 5b 8d 00 0c sw (sp+12),r13
80034f0: 5b 8e 00 08 sw (sp+8),r14
80034f4: 5b 9d 00 04 sw (sp+4),ra
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;
80034f8: 78 01 08 01 mvhi r1,0x801
80034fc: 38 21 f0 a8 ori r1,r1,0xf0a8
maximum = Configuration_POSIX_API.number_of_initialization_threads;
8003500: 28 2e 00 30 lw r14,(r1+48)
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;
8003504: 28 2c 00 34 lw r12,(r1+52)
maximum = Configuration_POSIX_API.number_of_initialization_threads;
if ( !user_threads || maximum == 0 )
8003508: 65 c2 00 00 cmpei r2,r14,0
800350c: 65 81 00 00 cmpei r1,r12,0
8003510: b8 41 08 00 or r1,r2,r1
8003514: 5c 20 00 18 bne r1,r0,8003574 <_POSIX_Threads_Initialize_user_threads_body+0x94><== NEVER TAKEN
8003518: 34 0d 00 00 mvi r13,0
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
800351c: 37 8b 00 18 addi r11,sp,24
8003520: b9 60 08 00 mv r1,r11
8003524: f8 00 1a f0 calli 800a0e4 <pthread_attr_init>
(void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
8003528: 34 02 00 02 mvi r2,2
800352c: b9 60 08 00 mv r1,r11
8003530: f8 00 1a fa calli 800a118 <pthread_attr_setinheritsched>
(void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
8003534: 29 82 00 04 lw r2,(r12+4)
8003538: b9 60 08 00 mv r1,r11
800353c: f8 00 1b 03 calli 800a148 <pthread_attr_setstacksize>
status = pthread_create(
8003540: 29 83 00 00 lw r3,(r12+0)
8003544: 37 81 00 54 addi r1,sp,84
8003548: b9 60 10 00 mv r2,r11
800354c: 34 04 00 00 mvi r4,0
8003550: fb ff fe ed calli 8003104 <pthread_create>
8003554: b8 20 18 00 mv r3,r1
&thread_id,
&attr,
user_threads[ index ].thread_entry,
NULL
);
if ( status )
8003558: 44 20 00 04 be r1,r0,8003568 <_POSIX_Threads_Initialize_user_threads_body+0x88><== ALWAYS TAKEN
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
800355c: 34 01 00 02 mvi r1,2 <== NOT EXECUTED
8003560: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8003564: f8 00 07 22 calli 80051ec <_Internal_error_Occurred> <== NOT EXECUTED
*
* Setting the attributes explicitly is critical, since we don't want
* to inherit the idle tasks attributes.
*/
for ( index=0 ; index < maximum ; index++ ) {
8003568: 35 ad 00 01 addi r13,r13,1
800356c: 35 8c 00 08 addi r12,r12,8
8003570: 55 cd ff ec bgu r14,r13,8003520 <_POSIX_Threads_Initialize_user_threads_body+0x40><== NEVER TAKEN
NULL
);
if ( status )
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
}
}
8003574: 2b 9d 00 04 lw ra,(sp+4)
8003578: 2b 8b 00 14 lw r11,(sp+20)
800357c: 2b 8c 00 10 lw r12,(sp+16)
8003580: 2b 8d 00 0c lw r13,(sp+12)
8003584: 2b 8e 00 08 lw r14,(sp+8)
8003588: 37 9c 00 54 addi sp,sp,84
800358c: c3 a0 00 00 ret
0800d3e4 <_POSIX_Threads_Sporadic_budget_TSR>:
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
800d3e4: 37 9c ff f4 addi sp,sp,-12
800d3e8: 5b 8b 00 0c sw (sp+12),r11
800d3ec: 5b 8c 00 08 sw (sp+8),r12
800d3f0: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
POSIX_API_Control *api;
the_thread = argument;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
800d3f4: 28 4c 01 2c lw r12,(r2+300)
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
800d3f8: b8 40 58 00 mv r11,r2
the_thread = argument;
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 );
800d3fc: 35 81 00 94 addi r1,r12,148
800d400: f8 00 07 d9 calli 800f364 <_Timespec_To_ticks>
the_thread->cpu_time_budget = ticks;
800d404: 59 61 00 78 sw (r11+120),r1
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
800d408: 78 01 08 01 mvhi r1,0x801
800d40c: 38 21 90 a8 ori r1,r1,0x90a8
800d410: 40 21 00 00 lbu r1,(r1+0)
800d414: 29 82 00 84 lw r2,(r12+132)
800d418: c8 22 10 00 sub r2,r1,r2
*/
#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 ) {
800d41c: 29 61 00 1c lw r1,(r11+28)
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
the_thread->cpu_time_budget = ticks;
new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority );
the_thread->real_priority = new_priority;
800d420: 59 62 00 18 sw (r11+24),r2
*/
#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 ) {
800d424: 5c 20 00 06 bne r1,r0,800d43c <_POSIX_Threads_Sporadic_budget_TSR+0x58><== NEVER TAKEN
/*
* If this would make them less important, then do not change it.
*/
if ( the_thread->current_priority > new_priority ) {
800d428: 29 61 00 14 lw r1,(r11+20)
800d42c: 50 41 00 04 bgeu r2,r1,800d43c <_POSIX_Threads_Sporadic_budget_TSR+0x58>
_Thread_Change_priority( the_thread, new_priority, true );
800d430: b9 60 08 00 mv r1,r11
800d434: 34 03 00 01 mvi r3,1
800d438: fb ff e3 39 calli 800611c <_Thread_Change_priority>
#endif
}
}
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period );
800d43c: 35 81 00 8c addi r1,r12,140
800d440: f8 00 07 c9 calli 800f364 <_Timespec_To_ticks>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
800d444: 59 81 00 b0 sw (r12+176),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800d448: 78 01 08 01 mvhi r1,0x801
800d44c: 38 21 99 e8 ori r1,r1,0x99e8
800d450: 35 82 00 a4 addi r2,r12,164
800d454: fb ff e9 4b calli 8007980 <_Watchdog_Insert>
_Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
}
800d458: 2b 9d 00 04 lw ra,(sp+4)
800d45c: 2b 8b 00 0c lw r11,(sp+12)
800d460: 2b 8c 00 08 lw r12,(sp+8)
800d464: 37 9c 00 0c addi sp,sp,12
800d468: c3 a0 00 00 ret
0800d46c <_POSIX_Threads_Sporadic_budget_callout>:
* _POSIX_Threads_Sporadic_budget_callout
*/
void _POSIX_Threads_Sporadic_budget_callout(
Thread_Control *the_thread
)
{
800d46c: 37 9c ff fc addi sp,sp,-4
800d470: 5b 9d 00 04 sw (sp+4),ra
/*
* 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 */
800d474: 34 02 ff ff mvi r2,-1
)
{
POSIX_API_Control *api;
uint32_t new_priority;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
800d478: 28 25 01 2c lw r5,(r1+300)
/*
* 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 */
800d47c: 58 22 00 78 sw (r1+120),r2
800d480: 78 02 08 01 mvhi r2,0x801
800d484: 38 42 90 a8 ori r2,r2,0x90a8
800d488: 40 44 00 00 lbu r4,(r2+0)
800d48c: 28 a2 00 88 lw r2,(r5+136)
800d490: c8 82 10 00 sub r2,r4,r2
*/
#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 ) {
800d494: 28 24 00 1c lw r4,(r1+28)
* while at low priority.
*/
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority);
the_thread->real_priority = new_priority;
800d498: 58 22 00 18 sw (r1+24),r2
*/
#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 ) {
800d49c: 5c 80 00 05 bne r4,r0,800d4b0 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN
/*
* 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 ) {
800d4a0: 28 23 00 14 lw r3,(r1+20)
800d4a4: 50 62 00 03 bgeu r3,r2,800d4b0 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN
_Thread_Change_priority( the_thread, new_priority, true );
800d4a8: 34 03 00 01 mvi r3,1
800d4ac: fb ff e3 1c calli 800611c <_Thread_Change_priority>
#if 0
printk( "lower priority\n" );
#endif
}
}
}
800d4b0: 2b 9d 00 04 lw ra,(sp+4)
800d4b4: 37 9c 00 04 addi sp,sp,4
800d4b8: c3 a0 00 00 ret
080031f8 <_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)
{
80031f8: 37 9c ff f8 addi sp,sp,-8
80031fc: 5b 8b 00 08 sw (sp+8),r11
8003200: 5b 9d 00 04 sw (sp+4),ra
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
8003204: 28 41 00 68 lw r1,(r2+104)
* This is the operation that is run when a timer expires
*/
void _POSIX_Timer_TSR(
Objects_Id timer __attribute__((unused)),
void *data)
{
8003208: b8 40 58 00 mv r11,r2
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
800320c: 34 21 00 01 addi r1,r1,1
8003210: 58 41 00 68 sw (r2+104),r1
/* The timer must be reprogrammed */
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
8003214: 28 41 00 54 lw r1,(r2+84)
8003218: 5c 20 00 03 bne r1,r0,8003224 <_POSIX_Timer_TSR+0x2c>
800321c: 28 42 00 58 lw r2,(r2+88)
8003220: 44 41 00 0d be r2,r1,8003254 <_POSIX_Timer_TSR+0x5c> <== NEVER TAKEN
( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) {
activated = _POSIX_Timer_Insert_helper(
8003224: 29 62 00 64 lw r2,(r11+100)
8003228: 29 63 00 08 lw r3,(r11+8)
800322c: 78 04 08 00 mvhi r4,0x800
8003230: 35 61 00 10 addi r1,r11,16
8003234: 38 84 31 f8 ori r4,r4,0x31f8
8003238: b9 60 28 00 mv r5,r11
800323c: f8 00 1a 2d calli 8009af0 <_POSIX_Timer_Insert_helper>
ptimer->ticks,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated )
8003240: 44 20 00 0b be r1,r0,800326c <_POSIX_Timer_TSR+0x74> <== NEVER TAKEN
return;
/* Store the time when the timer was started again */
_TOD_Get( &ptimer->time );
8003244: 35 61 00 6c addi r1,r11,108
8003248: f8 00 04 7f calli 8004444 <_TOD_Get>
/* The state really did not change but just to be safe */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
800324c: 34 01 00 03 mvi r1,3
8003250: e0 00 00 02 bi 8003258 <_POSIX_Timer_TSR+0x60>
} else {
/* Indicates that the timer is stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
8003254: 34 01 00 04 mvi r1,4 <== NOT EXECUTED
8003258: 31 61 00 3c sb (r11+60),r1
/*
* 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 ) ) {
800325c: 29 62 00 44 lw r2,(r11+68)
8003260: 29 61 00 38 lw r1,(r11+56)
8003264: f8 00 18 d3 calli 80095b0 <pthread_kill>
}
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
8003268: 59 60 00 68 sw (r11+104),r0
}
800326c: 2b 9d 00 04 lw ra,(sp+4)
8003270: 2b 8b 00 08 lw r11,(sp+8)
8003274: 37 9c 00 08 addi sp,sp,8
8003278: c3 a0 00 00 ret
08010b00 <_POSIX_signals_Check_signal>:
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8010b00: 37 9c ff d4 addi sp,sp,-44
8010b04: 5b 8b 00 20 sw (sp+32),r11
8010b08: 5b 8c 00 1c sw (sp+28),r12
8010b0c: 5b 8d 00 18 sw (sp+24),r13
8010b10: 5b 8e 00 14 sw (sp+20),r14
8010b14: 5b 8f 00 10 sw (sp+16),r15
8010b18: 5b 90 00 0c sw (sp+12),r16
8010b1c: 5b 91 00 08 sw (sp+8),r17
8010b20: 5b 9d 00 04 sw (sp+4),ra
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8010b24: 37 91 00 24 addi r17,sp,36
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8010b28: 20 64 00 ff andi r4,r3,0xff
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8010b2c: 34 05 00 01 mvi r5,1
8010b30: ba 20 18 00 mv r3,r17
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8010b34: b8 20 68 00 mv r13,r1
8010b38: b8 40 58 00 mv r11,r2
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8010b3c: f8 00 00 37 calli 8010c18 <_POSIX_signals_Clear_signals>
is_global, true ) )
return false;
8010b40: 34 10 00 00 mvi r16,0
)
{
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8010b44: 44 20 00 2a be r1,r0,8010bec <_POSIX_signals_Check_signal+0xec>
#endif
/*
* Just to prevent sending a signal which is currently being ignored.
*/
if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN )
8010b48: 34 02 00 01 mvi r2,1
8010b4c: b9 60 08 00 mv r1,r11
8010b50: f8 00 18 e0 calli 8016ed0 <__ashlsi3>
8010b54: b4 2b 78 00 add r15,r1,r11
8010b58: 78 0c 08 01 mvhi r12,0x801
8010b5c: b9 e0 08 00 mv r1,r15
8010b60: 34 02 00 02 mvi r2,2
8010b64: f8 00 18 db calli 8016ed0 <__ashlsi3>
8010b68: 39 8c 9e 20 ori r12,r12,0x9e20
8010b6c: b5 81 60 00 add r12,r12,r1
8010b70: 29 8e 00 08 lw r14,(r12+8)
8010b74: 34 01 00 01 mvi r1,1
8010b78: 45 c1 00 1d be r14,r1,8010bec <_POSIX_signals_Check_signal+0xec><== NEVER TAKEN
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
8010b7c: 34 02 00 01 mvi r2,1
8010b80: b9 60 08 00 mv r1,r11
8010b84: f8 00 18 d3 calli 8016ed0 <__ashlsi3>
8010b88: 34 02 00 02 mvi r2,2
8010b8c: b9 e0 08 00 mv r1,r15
8010b90: f8 00 18 d0 calli 8016ed0 <__ashlsi3>
return false;
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
8010b94: 29 b0 00 cc lw r16,(r13+204)
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
8010b98: 29 81 00 04 lw r1,(r12+4)
/*
* Here, the signal handler function executes
*/
switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
8010b9c: 34 02 00 01 mvi r2,1
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
8010ba0: b8 30 08 00 or r1,r1,r16
8010ba4: 59 a1 00 cc sw (r13+204),r1
/*
* Here, the signal handler function executes
*/
switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
8010ba8: b9 60 08 00 mv r1,r11
8010bac: f8 00 18 c9 calli 8016ed0 <__ashlsi3>
8010bb0: 34 02 00 02 mvi r2,2
8010bb4: b9 e0 08 00 mv r1,r15
8010bb8: f8 00 18 c6 calli 8016ed0 <__ashlsi3>
8010bbc: 29 82 00 00 lw r2,(r12+0)
8010bc0: 34 01 00 02 mvi r1,2
8010bc4: 5c 41 00 06 bne r2,r1,8010bdc <_POSIX_signals_Check_signal+0xdc>
case SA_SIGINFO:
(*_POSIX_signals_Vectors[ signo ].sa_sigaction)(
8010bc8: b9 60 08 00 mv r1,r11
8010bcc: ba 20 10 00 mv r2,r17
8010bd0: 34 03 00 00 mvi r3,0
8010bd4: d9 c0 00 00 call r14
signo,
&siginfo_struct,
NULL /* context is undefined per 1003.1b-1993, p. 66 */
);
break;
8010bd8: e0 00 00 03 bi 8010be4 <_POSIX_signals_Check_signal+0xe4>
default:
(*_POSIX_signals_Vectors[ signo ].sa_handler)( signo );
8010bdc: b9 60 08 00 mv r1,r11
8010be0: d9 c0 00 00 call r14
}
/*
* Restore the previous set of blocked signals
*/
api->signals_blocked = saved_signals_blocked;
8010be4: 59 b0 00 cc sw (r13+204),r16
return true;
8010be8: 34 10 00 01 mvi r16,1
}
8010bec: ba 00 08 00 mv r1,r16
8010bf0: 2b 9d 00 04 lw ra,(sp+4)
8010bf4: 2b 8b 00 20 lw r11,(sp+32)
8010bf8: 2b 8c 00 1c lw r12,(sp+28)
8010bfc: 2b 8d 00 18 lw r13,(sp+24)
8010c00: 2b 8e 00 14 lw r14,(sp+20)
8010c04: 2b 8f 00 10 lw r15,(sp+16)
8010c08: 2b 90 00 0c lw r16,(sp+12)
8010c0c: 2b 91 00 08 lw r17,(sp+8)
8010c10: 37 9c 00 2c addi sp,sp,44
8010c14: c3 a0 00 00 ret
08011340 <_POSIX_signals_Clear_process_signals>:
*/
void _POSIX_signals_Clear_process_signals(
int signo
)
{
8011340: 37 9c ff ec addi sp,sp,-20
8011344: 5b 8b 00 14 sw (sp+20),r11
8011348: 5b 8c 00 10 sw (sp+16),r12
801134c: 5b 8d 00 0c sw (sp+12),r13
8011350: 5b 8e 00 08 sw (sp+8),r14
8011354: 5b 9d 00 04 sw (sp+4),ra
8011358: b8 20 60 00 mv r12,r1
clear_signal = true;
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
801135c: 90 00 70 00 rcsr r14,IE
8011360: 34 01 ff fe mvi r1,-2
8011364: a1 c1 08 00 and r1,r14,r1
8011368: d0 01 00 00 wcsr IE,r1
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
801136c: 34 02 00 01 mvi r2,1
8011370: b9 80 08 00 mv r1,r12
8011374: f8 00 16 d7 calli 8016ed0 <__ashlsi3>
8011378: b4 2c 58 00 add r11,r1,r12
801137c: 34 02 00 02 mvi r2,2
8011380: 78 0d 08 01 mvhi r13,0x801
8011384: b9 60 08 00 mv r1,r11
8011388: f8 00 16 d2 calli 8016ed0 <__ashlsi3>
801138c: 39 ad 9e 20 ori r13,r13,0x9e20
8011390: b5 a1 08 00 add r1,r13,r1
8011394: 28 22 00 00 lw r2,(r1+0)
8011398: 34 01 00 02 mvi r1,2
801139c: 5c 41 00 13 bne r2,r1,80113e8 <_POSIX_signals_Clear_process_signals+0xa8>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
80113a0: 34 02 00 01 mvi r2,1
80113a4: b9 80 08 00 mv r1,r12
80113a8: f8 00 16 ca calli 8016ed0 <__ashlsi3>
80113ac: 34 02 00 02 mvi r2,2
80113b0: 78 0d 08 01 mvhi r13,0x801
80113b4: b9 60 08 00 mv r1,r11
80113b8: f8 00 16 c6 calli 8016ed0 <__ashlsi3>
80113bc: 39 ad a0 18 ori r13,r13,0xa018
80113c0: b5 a1 68 00 add r13,r13,r1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
80113c4: 34 02 00 01 mvi r2,1
80113c8: b9 80 08 00 mv r1,r12
80113cc: f8 00 16 c1 calli 8016ed0 <__ashlsi3>
80113d0: 34 02 00 02 mvi r2,2
80113d4: b9 60 08 00 mv r1,r11
80113d8: f8 00 16 be calli 8016ed0 <__ashlsi3>
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
80113dc: 29 a2 00 00 lw r2,(r13+0)
80113e0: 35 a1 00 04 addi r1,r13,4
80113e4: 5c 41 00 0a bne r2,r1,801140c <_POSIX_signals_Clear_process_signals+0xcc><== NEVER TAKEN
80113e8: 35 82 ff ff addi r2,r12,-1
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
80113ec: 78 0b 08 01 mvhi r11,0x801
80113f0: 34 01 00 01 mvi r1,1
80113f4: f8 00 16 b7 calli 8016ed0 <__ashlsi3>
80113f8: 39 6b a0 14 ori r11,r11,0xa014
80113fc: 29 62 00 00 lw r2,(r11+0)
8011400: a4 20 08 00 not r1,r1
8011404: a0 22 08 00 and r1,r1,r2
8011408: 59 61 00 00 sw (r11+0),r1
}
_ISR_Enable( level );
801140c: d0 0e 00 00 wcsr IE,r14
}
8011410: 2b 9d 00 04 lw ra,(sp+4)
8011414: 2b 8b 00 14 lw r11,(sp+20)
8011418: 2b 8c 00 10 lw r12,(sp+16)
801141c: 2b 8d 00 0c lw r13,(sp+12)
8011420: 2b 8e 00 08 lw r14,(sp+8)
8011424: 37 9c 00 14 addi sp,sp,20
8011428: c3 a0 00 00 ret
08003e60 <_POSIX_signals_Get_highest>:
#include <rtems/score/isr.h>
int _POSIX_signals_Get_highest(
sigset_t set
)
{
8003e60: 37 9c ff f0 addi sp,sp,-16
8003e64: 5b 8b 00 10 sw (sp+16),r11
8003e68: 5b 8c 00 0c sw (sp+12),r12
8003e6c: 5b 8d 00 08 sw (sp+8),r13
8003e70: 5b 9d 00 04 sw (sp+4),ra
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8003e74: 34 0b 00 1b mvi r11,27
#include <rtems/score/isr.h>
int _POSIX_signals_Get_highest(
sigset_t set
)
{
8003e78: b8 20 60 00 mv r12,r1
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8003e7c: 34 0d 00 20 mvi r13,32
8003e80: 34 01 00 01 mvi r1,1
8003e84: 35 62 ff ff addi r2,r11,-1
8003e88: f8 00 65 c1 calli 801d58c <__ashlsi3>
if ( set & signo_to_mask( signo ) ) {
8003e8c: a0 2c 08 00 and r1,r1,r12
8003e90: 5c 20 00 0c bne r1,r0,8003ec0 <_POSIX_signals_Get_highest+0x60><== NEVER TAKEN
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8003e94: 35 6b 00 01 addi r11,r11,1
8003e98: 5d 6d ff fa bne r11,r13,8003e80 <_POSIX_signals_Get_highest+0x20>
8003e9c: 34 0b 00 01 mvi r11,1
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
8003ea0: 34 0d 00 1b mvi r13,27
8003ea4: 34 01 00 01 mvi r1,1
8003ea8: 35 62 ff ff addi r2,r11,-1
8003eac: f8 00 65 b8 calli 801d58c <__ashlsi3>
if ( set & signo_to_mask( signo ) ) {
8003eb0: a0 2c 08 00 and r1,r1,r12
8003eb4: 5c 20 00 03 bne r1,r0,8003ec0 <_POSIX_signals_Get_highest+0x60>
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
8003eb8: 35 6b 00 01 addi r11,r11,1
8003ebc: 5d 6d ff fa bne r11,r13,8003ea4 <_POSIX_signals_Get_highest+0x44><== ALWAYS TAKEN
* a return 0. This routine will NOT be called unless a signal
* is pending in the set passed in.
*/
found_it:
return signo;
}
8003ec0: b9 60 08 00 mv r1,r11
8003ec4: 2b 9d 00 04 lw ra,(sp+4)
8003ec8: 2b 8b 00 10 lw r11,(sp+16)
8003ecc: 2b 8c 00 0c lw r12,(sp+12)
8003ed0: 2b 8d 00 08 lw r13,(sp+8)
8003ed4: 37 9c 00 10 addi sp,sp,16
8003ed8: c3 a0 00 00 ret
08025560 <_POSIX_signals_Unblock_thread>:
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
8025560: 37 9c ff ec addi sp,sp,-20
8025564: 5b 8b 00 14 sw (sp+20),r11
8025568: 5b 8c 00 10 sw (sp+16),r12
802556c: 5b 8d 00 0c sw (sp+12),r13
8025570: 5b 8e 00 08 sw (sp+8),r14
8025574: 5b 9d 00 04 sw (sp+4),ra
8025578: b8 20 58 00 mv r11,r1
802557c: b8 40 70 00 mv r14,r2
POSIX_API_Control *api;
sigset_t mask;
siginfo_t *the_info = NULL;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8025580: 28 2d 01 2c lw r13,(r1+300)
8025584: 34 42 ff ff addi r2,r2,-1
8025588: 34 01 00 01 mvi r1,1
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
802558c: b8 60 60 00 mv r12,r3
8025590: fb ff 72 6e calli 8001f48 <__ashlsi3>
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
8025594: 78 04 08 02 mvhi r4,0x802
8025598: 38 84 6d b4 ori r4,r4,0x6db4
802559c: 29 63 00 10 lw r3,(r11+16)
80255a0: 28 82 00 00 lw r2,(r4+0)
80255a4: a0 62 20 00 and r4,r3,r2
80255a8: 5c 82 00 1c bne r4,r2,8025618 <_POSIX_signals_Unblock_thread+0xb8>
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
80255ac: 29 62 00 30 lw r2,(r11+48)
80255b0: a0 22 10 00 and r2,r1,r2
80255b4: 5c 40 00 06 bne r2,r0,80255cc <_POSIX_signals_Unblock_thread+0x6c>
80255b8: 29 a2 00 cc lw r2,(r13+204)
80255bc: a4 40 10 00 not r2,r2
80255c0: a0 22 10 00 and r2,r1,r2
/*
* This should only be reached via pthread_kill().
*/
return false;
80255c4: 34 01 00 00 mvi r1,0
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
80255c8: 44 41 00 35 be r2,r1,802569c <_POSIX_signals_Unblock_thread+0x13c>
the_thread->Wait.return_code = EINTR;
80255cc: 34 01 00 04 mvi r1,4
80255d0: 59 61 00 34 sw (r11+52),r1
the_info = (siginfo_t *) the_thread->Wait.return_argument;
80255d4: 29 61 00 28 lw r1,(r11+40)
if ( !info ) {
80255d8: 5d 80 00 06 bne r12,r0,80255f0 <_POSIX_signals_Unblock_thread+0x90>
the_info->si_signo = signo;
the_info->si_code = SI_USER;
80255dc: 34 02 00 01 mvi r2,1
the_thread->Wait.return_code = EINTR;
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
80255e0: 58 2e 00 00 sw (r1+0),r14
the_info->si_code = SI_USER;
80255e4: 58 22 00 04 sw (r1+4),r2
the_info->si_value.sival_int = 0;
80255e8: 58 20 00 08 sw (r1+8),r0
80255ec: e0 00 00 07 bi 8025608 <_POSIX_signals_Unblock_thread+0xa8>
} else {
*the_info = *info;
80255f0: 29 83 00 00 lw r3,(r12+0)
80255f4: 29 82 00 04 lw r2,(r12+4)
80255f8: 29 84 00 08 lw r4,(r12+8)
80255fc: 58 23 00 00 sw (r1+0),r3
8025600: 58 22 00 04 sw (r1+4),r2
8025604: 58 24 00 08 sw (r1+8),r4
}
_Thread_queue_Extract_with_proxy( the_thread );
8025608: b9 60 08 00 mv r1,r11
802560c: fb ff 9c 0f calli 800c648 <_Thread_queue_Extract_with_proxy>
return true;
8025610: 34 01 00 01 mvi r1,1
8025614: e0 00 00 22 bi 802569c <_POSIX_signals_Unblock_thread+0x13c>
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
8025618: 29 a2 00 cc lw r2,(r13+204)
802561c: a4 40 10 00 not r2,r2
8025620: a0 22 10 00 and r2,r1,r2
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Context_Switch_necessary = true;
}
}
return false;
8025624: 34 01 00 00 mvi r1,0
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
8025628: 44 40 00 1d be r2,r0,802569c <_POSIX_signals_Unblock_thread+0x13c>
* it is not blocked, THEN
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) {
802562c: 78 02 10 00 mvhi r2,0x1000
8025630: a0 62 10 00 and r2,r3,r2
8025634: 44 40 00 11 be r2,r0,8025678 <_POSIX_signals_Unblock_thread+0x118>
the_thread->Wait.return_code = EINTR;
8025638: 34 02 00 04 mvi r2,4
802563c: 59 62 00 34 sw (r11+52),r2
*/
RTEMS_INLINE_ROUTINE bool _States_Is_delaying (
States_Control the_states
)
{
return (the_states & STATES_DELAYING);
8025640: 20 63 00 08 andi r3,r3,0x8
#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) ){
8025644: 44 60 00 16 be r3,r0,802569c <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN
if ( _Watchdog_Is_active( &the_thread->Timer ) )
8025648: 29 62 00 50 lw r2,(r11+80)
802564c: 34 01 00 02 mvi r1,2
8025650: 5c 41 00 03 bne r2,r1,802565c <_POSIX_signals_Unblock_thread+0xfc><== NEVER TAKEN
(void) _Watchdog_Remove( &the_thread->Timer );
8025654: 35 61 00 48 addi r1,r11,72
8025658: fb ff 9f 83 calli 800d464 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
802565c: 78 03 08 02 mvhi r3,0x802
8025660: 38 63 69 a0 ori r3,r3,0x69a0
8025664: 28 62 00 00 lw r2,(r3+0)
8025668: b9 60 08 00 mv r1,r11
802566c: fb ff 98 a2 calli 800b8f4 <_Thread_Clear_state>
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Context_Switch_necessary = true;
}
}
return false;
8025670: 34 01 00 00 mvi r1,0
8025674: e0 00 00 0a bi 802569c <_POSIX_signals_Unblock_thread+0x13c>
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 ) {
8025678: 5c 61 00 09 bne r3,r1,802569c <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
802567c: 78 02 08 02 mvhi r2,0x802
8025680: 38 42 9e ec ori r2,r2,0x9eec
8025684: 28 43 00 08 lw r3,(r2+8)
8025688: 44 61 00 05 be r3,r1,802569c <_POSIX_signals_Unblock_thread+0x13c>
802568c: 28 43 00 0c lw r3,(r2+12)
8025690: 5d 63 00 03 bne r11,r3,802569c <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN
_Context_Switch_necessary = true;
8025694: 34 03 00 01 mvi r3,1
8025698: 30 43 00 18 sb (r2+24),r3
}
}
return false;
}
802569c: 2b 9d 00 04 lw ra,(sp+4)
80256a0: 2b 8b 00 14 lw r11,(sp+20)
80256a4: 2b 8c 00 10 lw r12,(sp+16)
80256a8: 2b 8d 00 0c lw r13,(sp+12)
80256ac: 2b 8e 00 08 lw r14,(sp+8)
80256b0: 37 9c 00 14 addi sp,sp,20
80256b4: c3 a0 00 00 ret
080042dc <_RTEMS_tasks_Initialize_user_tasks_body>:
*
* Output parameters: NONE
*/
void _RTEMS_tasks_Initialize_user_tasks_body( void )
{
80042dc: 37 9c ff e8 addi sp,sp,-24
80042e0: 5b 8b 00 14 sw (sp+20),r11
80042e4: 5b 8c 00 10 sw (sp+16),r12
80042e8: 5b 8d 00 0c sw (sp+12),r13
80042ec: 5b 8e 00 08 sw (sp+8),r14
80042f0: 5b 9d 00 04 sw (sp+4),ra
rtems_initialization_tasks_table *user_tasks;
/*
* Move information into local variables
*/
user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table;
80042f4: 78 01 08 01 mvhi r1,0x801
80042f8: 38 21 90 74 ori r1,r1,0x9074
80042fc: 28 2b 00 2c lw r11,(r1+44)
maximum = Configuration_RTEMS_API.number_of_initialization_tasks;
8004300: 28 2e 00 28 lw r14,(r1+40)
/*
* Verify that we have a set of user tasks to iterate
*/
if ( !user_tasks )
8004304: 34 0d 00 00 mvi r13,0
8004308: 5d 60 00 1a bne r11,r0,8004370 <_RTEMS_tasks_Initialize_user_tasks_body+0x94>
800430c: e0 00 00 1a bi 8004374 <_RTEMS_tasks_Initialize_user_tasks_body+0x98>
/*
* Now iterate over the initialization tasks and create/start them.
*/
for ( index=0 ; index < maximum ; index++ ) {
return_value = rtems_task_create(
8004310: 29 61 00 00 lw r1,(r11+0)
8004314: 29 62 00 08 lw r2,(r11+8)
8004318: 29 63 00 04 lw r3,(r11+4)
800431c: 29 64 00 14 lw r4,(r11+20)
8004320: 29 65 00 0c lw r5,(r11+12)
8004324: 37 86 00 18 addi r6,sp,24
8004328: f8 00 26 3d calli 800dc1c <rtems_task_create>
800432c: b8 20 60 00 mv r12,r1
user_tasks[ index ].stack_size,
user_tasks[ index ].mode_set,
user_tasks[ index ].attribute_set,
&id
);
if ( !rtems_is_status_successful( return_value ) )
8004330: 44 20 00 05 be r1,r0,8004344 <_RTEMS_tasks_Initialize_user_tasks_body+0x68><== ALWAYS TAKEN
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
8004334: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8004338: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
800433c: b9 80 18 00 mv r3,r12 <== NOT EXECUTED
8004340: e0 00 00 0a bi 8004368 <_RTEMS_tasks_Initialize_user_tasks_body+0x8c><== NOT EXECUTED
return_value = rtems_task_start(
8004344: 29 63 00 18 lw r3,(r11+24)
8004348: 29 62 00 10 lw r2,(r11+16)
800434c: 2b 81 00 18 lw r1,(sp+24)
8004350: 35 6b 00 1c addi r11,r11,28
8004354: f8 00 00 0f calli 8004390 <rtems_task_start>
8004358: b8 20 18 00 mv r3,r1
id,
user_tasks[ index ].entry_point,
user_tasks[ index ].argument
);
if ( !rtems_is_status_successful( return_value ) )
800435c: 44 2c 00 04 be r1,r12,800436c <_RTEMS_tasks_Initialize_user_tasks_body+0x90>
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
8004360: 34 01 00 01 mvi r1,1
8004364: 34 02 00 01 mvi r2,1
8004368: f8 00 04 ad calli 800561c <_Internal_error_Occurred>
return;
/*
* Now iterate over the initialization tasks and create/start them.
*/
for ( index=0 ; index < maximum ; index++ ) {
800436c: 35 ad 00 01 addi r13,r13,1
8004370: 55 cd ff e8 bgu r14,r13,8004310 <_RTEMS_tasks_Initialize_user_tasks_body+0x34>
user_tasks[ index ].argument
);
if ( !rtems_is_status_successful( return_value ) )
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
}
}
8004374: 2b 9d 00 04 lw ra,(sp+4)
8004378: 2b 8b 00 14 lw r11,(sp+20)
800437c: 2b 8c 00 10 lw r12,(sp+16)
8004380: 2b 8d 00 0c lw r13,(sp+12)
8004384: 2b 8e 00 08 lw r14,(sp+8)
8004388: 37 9c 00 18 addi sp,sp,24
800438c: c3 a0 00 00 ret
0800e050 <_RTEMS_tasks_Post_switch_extension>:
*/
void _RTEMS_tasks_Post_switch_extension(
Thread_Control *executing
)
{
800e050: 37 9c ff f0 addi sp,sp,-16
800e054: 5b 8b 00 0c sw (sp+12),r11
800e058: 5b 8c 00 08 sw (sp+8),r12
800e05c: 5b 9d 00 04 sw (sp+4),ra
RTEMS_API_Control *api;
ASR_Information *asr;
rtems_signal_set signal_set;
Modes_Control prev_mode;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
800e060: 28 2b 01 28 lw r11,(r1+296)
if ( !api )
800e064: 45 60 00 1a be r11,r0,800e0cc <_RTEMS_tasks_Post_switch_extension+0x7c><== NEVER TAKEN
* Signal Processing
*/
asr = &api->Signal;
_ISR_Disable( level );
800e068: 90 00 08 00 rcsr r1,IE
800e06c: 34 02 ff fe mvi r2,-2
800e070: a0 22 10 00 and r2,r1,r2
800e074: d0 02 00 00 wcsr IE,r2
signal_set = asr->signals_posted;
800e078: 29 6c 00 14 lw r12,(r11+20)
asr->signals_posted = 0;
800e07c: 59 60 00 14 sw (r11+20),r0
_ISR_Enable( level );
800e080: d0 01 00 00 wcsr IE,r1
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
800e084: 45 80 00 12 be r12,r0,800e0cc <_RTEMS_tasks_Post_switch_extension+0x7c>
return;
asr->nest_level += 1;
800e088: 29 61 00 1c lw r1,(r11+28)
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
800e08c: 37 83 00 10 addi r3,sp,16
800e090: 38 02 ff ff mvu r2,0xffff
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
return;
asr->nest_level += 1;
800e094: 34 21 00 01 addi r1,r1,1
800e098: 59 61 00 1c sw (r11+28),r1
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
800e09c: 29 61 00 10 lw r1,(r11+16)
800e0a0: fb ff ff 5a calli 800de08 <rtems_task_mode>
(*asr->handler)( signal_set );
800e0a4: 29 62 00 0c lw r2,(r11+12)
800e0a8: b9 80 08 00 mv r1,r12
800e0ac: d8 40 00 00 call r2
asr->nest_level -= 1;
800e0b0: 29 61 00 1c lw r1,(r11+28)
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
800e0b4: 38 02 ff ff mvu r2,0xffff
800e0b8: 37 83 00 10 addi r3,sp,16
asr->nest_level += 1;
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
(*asr->handler)( signal_set );
asr->nest_level -= 1;
800e0bc: 34 21 ff ff addi r1,r1,-1
800e0c0: 59 61 00 1c sw (r11+28),r1
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
800e0c4: 2b 81 00 10 lw r1,(sp+16)
800e0c8: fb ff ff 50 calli 800de08 <rtems_task_mode>
}
800e0cc: 2b 9d 00 04 lw ra,(sp+4)
800e0d0: 2b 8b 00 0c lw r11,(sp+12)
800e0d4: 2b 8c 00 08 lw r12,(sp+8)
800e0d8: 37 9c 00 10 addi sp,sp,16
800e0dc: c3 a0 00 00 ret
08004698 <_Rate_monotonic_Timeout>:
void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
)
{
8004698: 37 9c ff f4 addi sp,sp,-12
800469c: 5b 8b 00 08 sw (sp+8),r11
80046a0: 5b 9d 00 04 sw (sp+4),ra
80046a4: b8 20 10 00 mv r2,r1
80046a8: 78 01 08 02 mvhi r1,0x802
80046ac: 38 21 08 90 ori r1,r1,0x890
80046b0: 37 83 00 0c addi r3,sp,12
80046b4: f8 00 08 e5 calli 8006a48 <_Objects_Get>
/*
* 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 ) {
80046b8: 2b 82 00 0c lw r2,(sp+12)
80046bc: b8 20 58 00 mv r11,r1
80046c0: 5c 40 00 22 bne r2,r0,8004748 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN
case OBJECTS_LOCAL:
the_thread = the_period->owner;
80046c4: 28 21 00 40 lw r1,(r1+64)
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period (
States_Control the_states
)
{
return (the_states & STATES_WAITING_FOR_PERIOD);
80046c8: 28 23 00 10 lw r3,(r1+16)
80046cc: 20 63 40 00 andi r3,r3,0x4000
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
80046d0: 44 62 00 09 be r3,r2,80046f4 <_Rate_monotonic_Timeout+0x5c>
80046d4: 28 23 00 20 lw r3,(r1+32)
80046d8: 29 62 00 08 lw r2,(r11+8)
80046dc: 5c 62 00 06 bne r3,r2,80046f4 <_Rate_monotonic_Timeout+0x5c>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
80046e0: 78 03 08 01 mvhi r3,0x801
80046e4: 38 63 e8 34 ori r3,r3,0xe834
80046e8: 28 62 00 00 lw r2,(r3+0)
80046ec: f8 00 0a 6c calli 800709c <_Thread_Clear_state>
80046f0: e0 00 00 06 bi 8004708 <_Rate_monotonic_Timeout+0x70>
_Thread_Unblock( the_thread );
_Rate_monotonic_Initiate_statistics( the_period );
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) {
80046f4: 29 62 00 38 lw r2,(r11+56)
80046f8: 34 01 00 01 mvi r1,1
80046fc: 5c 41 00 0c bne r2,r1,800472c <_Rate_monotonic_Timeout+0x94>
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
8004700: 34 01 00 03 mvi r1,3
8004704: 59 61 00 38 sw (r11+56),r1
_Rate_monotonic_Initiate_statistics( the_period );
8004708: b9 60 08 00 mv r1,r11
800470c: fb ff fe 2e calli 8003fc4 <_Rate_monotonic_Initiate_statistics>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8004710: 29 61 00 3c lw r1,(r11+60)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8004714: 35 62 00 10 addi r2,r11,16
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8004718: 59 61 00 1c sw (r11+28),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800471c: 78 01 08 02 mvhi r1,0x802
8004720: 38 21 0a 80 ori r1,r1,0xa80
8004724: f8 00 11 38 calli 8008c04 <_Watchdog_Insert>
8004728: e0 00 00 03 bi 8004734 <_Rate_monotonic_Timeout+0x9c>
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
800472c: 34 01 00 04 mvi r1,4
8004730: 59 61 00 38 sw (r11+56),r1
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
8004734: 78 01 08 02 mvhi r1,0x802
8004738: 38 21 09 bc ori r1,r1,0x9bc
800473c: 28 22 00 00 lw r2,(r1+0)
8004740: 34 42 ff ff addi r2,r2,-1
8004744: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
8004748: 2b 9d 00 04 lw ra,(sp+4)
800474c: 2b 8b 00 08 lw r11,(sp+8)
8004750: 37 9c 00 0c addi sp,sp,12
8004754: c3 a0 00 00 ret
08004058 <_Rate_monotonic_Update_statistics>:
void _Rate_monotonic_Update_statistics(
Rate_monotonic_Control *the_period
)
{
8004058: 37 9c ff e4 addi sp,sp,-28
800405c: 5b 8b 00 0c sw (sp+12),r11
8004060: 5b 8c 00 08 sw (sp+8),r12
8004064: 5b 9d 00 04 sw (sp+4),ra
8004068: b8 20 58 00 mv r11,r1
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
800406c: 28 21 00 54 lw r1,(r1+84)
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
8004070: 29 62 00 38 lw r2,(r11+56)
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8004074: 34 21 00 01 addi r1,r1,1
8004078: 59 61 00 54 sw (r11+84),r1
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
800407c: 34 01 00 04 mvi r1,4
8004080: 5c 41 00 04 bne r2,r1,8004090 <_Rate_monotonic_Update_statistics+0x38>
stats->missed_count++;
8004084: 29 61 00 58 lw r1,(r11+88)
8004088: 34 21 00 01 addi r1,r1,1
800408c: 59 61 00 58 sw (r11+88),r1
/*
* Grab status for time statistics.
*/
valid_status =
_Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
8004090: 37 8c 00 18 addi r12,sp,24
stats->missed_count++;
/*
* Grab status for time statistics.
*/
valid_status =
8004094: b9 60 08 00 mv r1,r11
8004098: 37 82 00 10 addi r2,sp,16
800409c: b9 80 18 00 mv r3,r12
80040a0: fb ff ff 90 calli 8003ee0 <_Rate_monotonic_Get_status>
_Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
if (!valid_status)
80040a4: 44 20 00 28 be r1,r0,8004144 <_Rate_monotonic_Update_statistics+0xec><== NEVER TAKEN
/*
* Update CPU time
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Add_to( &stats->total_cpu_time, &executed );
80040a8: b9 80 10 00 mv r2,r12
80040ac: 35 61 00 6c addi r1,r11,108
80040b0: f8 00 11 72 calli 8008678 <_Timespec_Add_to>
if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) )
80040b4: b9 80 08 00 mv r1,r12
80040b8: 35 62 00 5c addi r2,r11,92
80040bc: f8 00 11 cd calli 80087f0 <_Timespec_Less_than>
80040c0: 44 20 00 05 be r1,r0,80040d4 <_Rate_monotonic_Update_statistics+0x7c>
stats->min_cpu_time = executed;
80040c4: 2b 81 00 18 lw r1,(sp+24)
80040c8: 59 61 00 5c sw (r11+92),r1
80040cc: 2b 81 00 1c lw r1,(sp+28)
80040d0: 59 61 00 60 sw (r11+96),r1
if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
80040d4: 37 81 00 18 addi r1,sp,24
80040d8: 35 62 00 64 addi r2,r11,100
80040dc: f8 00 11 ba calli 80087c4 <_Timespec_Greater_than>
80040e0: 44 20 00 05 be r1,r0,80040f4 <_Rate_monotonic_Update_statistics+0x9c>
stats->max_cpu_time = executed;
80040e4: 2b 81 00 18 lw r1,(sp+24)
80040e8: 59 61 00 64 sw (r11+100),r1
80040ec: 2b 81 00 1c lw r1,(sp+28)
80040f0: 59 61 00 68 sw (r11+104),r1
/*
* Update Wall time
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Add_to( &stats->total_wall_time, &since_last_period );
80040f4: 37 8c 00 10 addi r12,sp,16
80040f8: b9 80 10 00 mv r2,r12
80040fc: 35 61 00 84 addi r1,r11,132
8004100: f8 00 11 5e calli 8008678 <_Timespec_Add_to>
if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
8004104: b9 80 08 00 mv r1,r12
8004108: 35 62 00 74 addi r2,r11,116
800410c: f8 00 11 b9 calli 80087f0 <_Timespec_Less_than>
8004110: 44 20 00 05 be r1,r0,8004124 <_Rate_monotonic_Update_statistics+0xcc>
stats->min_wall_time = since_last_period;
8004114: 2b 81 00 10 lw r1,(sp+16)
8004118: 59 61 00 74 sw (r11+116),r1
800411c: 2b 81 00 14 lw r1,(sp+20)
8004120: 59 61 00 78 sw (r11+120),r1
if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
8004124: 37 81 00 10 addi r1,sp,16
8004128: 35 62 00 7c addi r2,r11,124
800412c: f8 00 11 a6 calli 80087c4 <_Timespec_Greater_than>
8004130: 44 20 00 05 be r1,r0,8004144 <_Rate_monotonic_Update_statistics+0xec>
stats->max_wall_time = since_last_period;
8004134: 2b 81 00 10 lw r1,(sp+16)
8004138: 59 61 00 7c sw (r11+124),r1
800413c: 2b 81 00 14 lw r1,(sp+20)
8004140: 59 61 00 80 sw (r11+128),r1
stats->min_wall_time = since_last_period;
if ( since_last_period > stats->max_wall_time )
stats->max_wall_time = since_last_period;
#endif
}
8004144: 2b 9d 00 04 lw ra,(sp+4)
8004148: 2b 8b 00 0c lw r11,(sp+12)
800414c: 2b 8c 00 08 lw r12,(sp+8)
8004150: 37 9c 00 1c addi sp,sp,28
8004154: c3 a0 00 00 ret
0800504c <_TOD_Get>:
*/
void _TOD_Get(
struct timespec *time
)
{
800504c: 37 9c ff e4 addi sp,sp,-28
8005050: 5b 8b 00 0c sw (sp+12),r11
8005054: 5b 8c 00 08 sw (sp+8),r12
8005058: 5b 9d 00 04 sw (sp+4),ra
800505c: b8 20 58 00 mv r11,r1
/* assume time checked for NULL by caller */
/* _TOD_Now is the native current time */
nanoseconds = 0;
_ISR_Disable( level );
8005060: 90 00 60 00 rcsr r12,IE
8005064: 34 01 ff fe mvi r1,-2
8005068: a1 81 08 00 and r1,r12,r1
800506c: d0 01 00 00 wcsr IE,r1
now = _TOD_Now;
8005070: 78 02 08 01 mvhi r2,0x801
8005074: 38 42 99 ac ori r2,r2,0x99ac
8005078: 28 41 00 00 lw r1,(r2+0)
800507c: 5b 81 00 10 sw (sp+16),r1
8005080: 28 41 00 04 lw r1,(r2+4)
if ( _Watchdog_Nanoseconds_since_tick_handler )
8005084: 78 02 08 01 mvhi r2,0x801
8005088: 38 42 9a a8 ori r2,r2,0x9aa8
800508c: 28 43 00 00 lw r3,(r2+0)
/* assume time checked for NULL by caller */
/* _TOD_Now is the native current time */
nanoseconds = 0;
_ISR_Disable( level );
now = _TOD_Now;
8005090: 5b 81 00 14 sw (sp+20),r1
long nanoseconds;
/* assume time checked for NULL by caller */
/* _TOD_Now is the native current time */
nanoseconds = 0;
8005094: 34 02 00 00 mvi r2,0
_ISR_Disable( level );
now = _TOD_Now;
if ( _Watchdog_Nanoseconds_since_tick_handler )
8005098: 44 60 00 03 be r3,r0,80050a4 <_TOD_Get+0x58> <== ALWAYS TAKEN
nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
800509c: d8 60 00 00 call r3 <== NOT EXECUTED
80050a0: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
_ISR_Enable( level );
80050a4: d0 0c 00 00 wcsr IE,r12
_Timestamp_Set( &offset, 0, nanoseconds );
80050a8: 5b 82 00 1c sw (sp+28),r2
_Timestamp_Add_to( &now, &offset );
80050ac: 37 81 00 10 addi r1,sp,16
80050b0: 37 82 00 18 addi r2,sp,24
now = _TOD_Now;
if ( _Watchdog_Nanoseconds_since_tick_handler )
nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
_ISR_Enable( level );
_Timestamp_Set( &offset, 0, nanoseconds );
80050b4: 5b 80 00 18 sw (sp+24),r0
_Timestamp_Add_to( &now, &offset );
80050b8: f8 00 09 1f calli 8007534 <_Timespec_Add_to>
_Timestamp_To_timespec( &now, time );
80050bc: 2b 81 00 10 lw r1,(sp+16)
80050c0: 59 61 00 00 sw (r11+0),r1
80050c4: 2b 81 00 14 lw r1,(sp+20)
80050c8: 59 61 00 04 sw (r11+4),r1
}
80050cc: 2b 9d 00 04 lw ra,(sp+4)
80050d0: 2b 8b 00 0c lw r11,(sp+12)
80050d4: 2b 8c 00 08 lw r12,(sp+8)
80050d8: 37 9c 00 1c addi sp,sp,28
80050dc: c3 a0 00 00 ret
0800e59c <_TOD_Get_uptime>:
*/
void _TOD_Get_uptime(
Timestamp_Control *uptime
)
{
800e59c: 37 9c ff e4 addi sp,sp,-28
800e5a0: 5b 8b 00 0c sw (sp+12),r11
800e5a4: 5b 8c 00 08 sw (sp+8),r12
800e5a8: 5b 9d 00 04 sw (sp+4),ra
800e5ac: b8 20 58 00 mv r11,r1
/* assume time checked for NULL by caller */
/* _TOD_Uptime is in native timestamp format */
nanoseconds = 0;
_ISR_Disable( level );
800e5b0: 90 00 60 00 rcsr r12,IE
800e5b4: 34 01 ff fe mvi r1,-2
800e5b8: a1 81 08 00 and r1,r12,r1
800e5bc: d0 01 00 00 wcsr IE,r1
up = _TOD_Uptime;
800e5c0: 78 02 08 01 mvhi r2,0x801
800e5c4: 38 42 99 a0 ori r2,r2,0x99a0
800e5c8: 28 41 00 00 lw r1,(r2+0)
800e5cc: 5b 81 00 10 sw (sp+16),r1
800e5d0: 28 41 00 04 lw r1,(r2+4)
if ( _Watchdog_Nanoseconds_since_tick_handler )
800e5d4: 78 02 08 01 mvhi r2,0x801
800e5d8: 38 42 9a a8 ori r2,r2,0x9aa8
800e5dc: 28 43 00 00 lw r3,(r2+0)
/* assume time checked for NULL by caller */
/* _TOD_Uptime is in native timestamp format */
nanoseconds = 0;
_ISR_Disable( level );
up = _TOD_Uptime;
800e5e0: 5b 81 00 14 sw (sp+20),r1
long nanoseconds;
/* assume time checked for NULL by caller */
/* _TOD_Uptime is in native timestamp format */
nanoseconds = 0;
800e5e4: 34 02 00 00 mvi r2,0
_ISR_Disable( level );
up = _TOD_Uptime;
if ( _Watchdog_Nanoseconds_since_tick_handler )
800e5e8: 44 60 00 03 be r3,r0,800e5f4 <_TOD_Get_uptime+0x58> <== ALWAYS TAKEN
nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
800e5ec: d8 60 00 00 call r3 <== NOT EXECUTED
800e5f0: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
_ISR_Enable( level );
800e5f4: d0 0c 00 00 wcsr IE,r12
_Timestamp_Set( &offset, 0, nanoseconds );
800e5f8: 5b 82 00 1c sw (sp+28),r2
_Timestamp_Add_to( &up, &offset );
800e5fc: 37 81 00 10 addi r1,sp,16
800e600: 37 82 00 18 addi r2,sp,24
up = _TOD_Uptime;
if ( _Watchdog_Nanoseconds_since_tick_handler )
nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
_ISR_Enable( level );
_Timestamp_Set( &offset, 0, nanoseconds );
800e604: 5b 80 00 18 sw (sp+24),r0
_Timestamp_Add_to( &up, &offset );
800e608: fb ff e3 cb calli 8007534 <_Timespec_Add_to>
*uptime = up;
800e60c: 2b 81 00 10 lw r1,(sp+16)
800e610: 59 61 00 00 sw (r11+0),r1
800e614: 2b 81 00 14 lw r1,(sp+20)
800e618: 59 61 00 04 sw (r11+4),r1
}
800e61c: 2b 9d 00 04 lw ra,(sp+4)
800e620: 2b 8b 00 0c lw r11,(sp+12)
800e624: 2b 8c 00 08 lw r12,(sp+8)
800e628: 37 9c 00 1c addi sp,sp,28
800e62c: c3 a0 00 00 ret
080042c8 <_TOD_Validate>:
*/
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
80042c8: 37 9c ff f0 addi sp,sp,-16
80042cc: 5b 8b 00 10 sw (sp+16),r11
80042d0: 5b 8c 00 0c sw (sp+12),r12
80042d4: 5b 8d 00 08 sw (sp+8),r13
80042d8: 5b 9d 00 04 sw (sp+4),ra
80042dc: b8 20 58 00 mv r11,r1
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
80042e0: 78 01 08 02 mvhi r1,0x802
80042e4: 38 21 10 c4 ori r1,r1,0x10c4
80042e8: 28 22 00 0c lw r2,(r1+12)
(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) )
return false;
80042ec: 34 0c 00 00 mvi r12,0
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) ||
80042f0: 45 60 00 22 be r11,r0,8004378 <_TOD_Validate+0xb0> <== NEVER TAKEN
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
80042f4: 78 03 08 01 mvhi r3,0x801
80042f8: 38 63 e6 94 ori r3,r3,0xe694
80042fc: 28 61 00 00 lw r1,(r3+0)
8004300: f8 00 63 40 calli 801d000 <__udivsi3>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
8004304: 29 62 00 18 lw r2,(r11+24)
8004308: 50 41 00 1c bgeu r2,r1,8004378 <_TOD_Validate+0xb0>
(the_tod->ticks >= ticks_per_second) ||
800430c: 29 62 00 14 lw r2,(r11+20)
8004310: 34 01 00 3b mvi r1,59
8004314: 54 41 00 19 bgu r2,r1,8004378 <_TOD_Validate+0xb0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
8004318: 29 62 00 10 lw r2,(r11+16)
800431c: 54 41 00 17 bgu r2,r1,8004378 <_TOD_Validate+0xb0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
8004320: 29 62 00 0c lw r2,(r11+12)
8004324: 34 01 00 17 mvi r1,23
8004328: 54 41 00 14 bgu r2,r1,8004378 <_TOD_Validate+0xb0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
800432c: 29 61 00 04 lw r1,(r11+4)
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
8004330: 44 20 00 12 be r1,r0,8004378 <_TOD_Validate+0xb0> <== NEVER TAKEN
(the_tod->month == 0) ||
8004334: 34 02 00 0c mvi r2,12
8004338: 54 22 00 10 bgu r1,r2,8004378 <_TOD_Validate+0xb0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
800433c: 29 62 00 00 lw r2,(r11+0)
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
8004340: 34 03 07 c3 mvi r3,1987
8004344: 50 62 00 0d bgeu r3,r2,8004378 <_TOD_Validate+0xb0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
8004348: 29 6d 00 08 lw r13,(r11+8)
(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) ||
800434c: 45 a0 00 0b be r13,r0,8004378 <_TOD_Validate+0xb0> <== NEVER TAKEN
8004350: 78 0b 08 01 mvhi r11,0x801
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
8004354: 20 42 00 03 andi r2,r2,0x3
8004358: 39 6b ef 4c ori r11,r11,0xef4c
800435c: 5c 40 00 02 bne r2,r0,8004364 <_TOD_Validate+0x9c>
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
8004360: 34 21 00 0d addi r1,r1,13
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
8004364: 34 02 00 02 mvi r2,2
8004368: fb ff f3 d4 calli 80012b8 <__ashlsi3>
800436c: b5 61 08 00 add r1,r11,r1
8004370: 28 2c 00 00 lw r12,(r1+0)
* false - if the the_tod is invalid
*
* NOTE: This routine only works for leap-years through 2099.
*/
bool _TOD_Validate(
8004374: f1 8d 60 00 cmpgeu r12,r12,r13
if ( the_tod->day > days_in_month )
return false;
return true;
}
8004378: b9 80 08 00 mv r1,r12
800437c: 2b 9d 00 04 lw ra,(sp+4)
8004380: 2b 8b 00 10 lw r11,(sp+16)
8004384: 2b 8c 00 0c lw r12,(sp+12)
8004388: 2b 8d 00 08 lw r13,(sp+8)
800438c: 37 9c 00 10 addi sp,sp,16
8004390: c3 a0 00 00 ret
0800611c <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
800611c: 37 9c ff ec addi sp,sp,-20
8006120: 5b 8b 00 14 sw (sp+20),r11
8006124: 5b 8c 00 10 sw (sp+16),r12
8006128: 5b 8d 00 0c sw (sp+12),r13
800612c: 5b 8e 00 08 sw (sp+8),r14
8006130: 5b 9d 00 04 sw (sp+4),ra
8006134: b8 20 58 00 mv r11,r1
*/
/*
* Save original state
*/
original_state = the_thread->current_state;
8006138: 28 2e 00 10 lw r14,(r1+16)
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
800613c: b8 40 60 00 mv r12,r2
8006140: 20 6d 00 ff andi r13,r3,0xff
/*
* 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 );
8006144: f8 00 04 84 calli 8007354 <_Thread_Set_transient>
/*
* Do not bother recomputing all the priority related information if
* we are not REALLY changing priority.
*/
if ( the_thread->current_priority != new_priority )
8006148: 29 61 00 14 lw r1,(r11+20)
800614c: 44 2c 00 04 be r1,r12,800615c <_Thread_Change_priority+0x40>
_Thread_Set_priority( the_thread, new_priority );
8006150: b9 60 08 00 mv r1,r11
8006154: b9 80 10 00 mv r2,r12
8006158: f8 00 03 d4 calli 80070a8 <_Thread_Set_priority>
_ISR_Disable( level );
800615c: 90 00 60 00 rcsr r12,IE
8006160: 34 04 ff fe mvi r4,-2
8006164: a1 84 20 00 and r4,r12,r4
8006168: d0 04 00 00 wcsr IE,r4
/*
* 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;
800616c: 29 61 00 10 lw r1,(r11+16)
if ( state != STATES_TRANSIENT ) {
8006170: 34 03 00 04 mvi r3,4
8006174: 21 c2 00 04 andi r2,r14,0x4
8006178: 44 23 00 0f be r1,r3,80061b4 <_Thread_Change_priority+0x98>
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
800617c: 5c 40 00 04 bne r2,r0,800618c <_Thread_Change_priority+0x70><== NEVER TAKEN
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
8006180: 34 02 ff fb mvi r2,-5
8006184: a0 22 10 00 and r2,r1,r2
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
8006188: 59 62 00 10 sw (r11+16),r2
_ISR_Enable( level );
800618c: d0 0c 00 00 wcsr IE,r12
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
8006190: 78 03 08 01 mvhi r3,0x801
8006194: 38 63 81 3c ori r3,r3,0x813c
8006198: 28 62 00 00 lw r2,(r3+0)
800619c: a0 22 08 00 and r1,r1,r2
if ( _States_Is_waiting_on_thread_queue( state ) ) {
80061a0: 44 20 00 60 be r1,r0,8006320 <_Thread_Change_priority+0x204>
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
80061a4: 29 61 00 44 lw r1,(r11+68)
80061a8: b9 60 10 00 mv r2,r11
80061ac: f8 00 03 8a calli 8006fd4 <_Thread_queue_Requeue>
80061b0: e0 00 00 5c bi 8006320 <_Thread_Change_priority+0x204>
}
return;
}
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) ) {
80061b4: 5c 40 00 1c bne r2,r0,8006224 <_Thread_Change_priority+0x108><== NEVER TAKEN
RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map (
Priority_Information *the_priority_map
)
{
*the_priority_map->minor |= the_priority_map->ready_minor;
80061b8: 29 61 00 90 lw r1,(r11+144)
80061bc: 2d 63 00 96 lhu r3,(r11+150)
* 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 );
80061c0: 59 60 00 10 sw (r11+16),r0
80061c4: 2c 25 00 00 lhu r5,(r1+0)
80061c8: b8 a3 18 00 or r3,r5,r3
80061cc: 0c 23 00 00 sh (r1+0),r3
_Priority_Major_bit_map |= the_priority_map->ready_major;
80061d0: 78 01 08 01 mvhi r1,0x801
80061d4: 38 21 99 c4 ori r1,r1,0x99c4
80061d8: 2c 23 00 00 lhu r3,(r1+0)
80061dc: 2d 65 00 94 lhu r5,(r11+148)
80061e0: b8 a3 18 00 or r3,r5,r3
80061e4: 20 63 ff ff andi r3,r3,0xffff
80061e8: 0c 23 00 00 sh (r1+0),r3
80061ec: 29 61 00 8c lw r1,(r11+140)
_Priority_Add_to_bit_map( &the_thread->Priority_map );
if ( prepend_it )
80061f0: 45 a2 00 07 be r13,r2,800620c <_Thread_Change_priority+0xf0>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
80061f4: 28 22 00 00 lw r2,(r1+0)
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
80061f8: 59 61 00 04 sw (r11+4),r1
before_node = after_node->next;
after_node->next = the_node;
80061fc: 58 2b 00 00 sw (r1+0),r11
the_node->next = before_node;
8006200: 59 62 00 00 sw (r11+0),r2
before_node->previous = the_node;
8006204: 58 4b 00 04 sw (r2+4),r11
8006208: e0 00 00 07 bi 8006224 <_Thread_Change_priority+0x108>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
800620c: 34 22 00 04 addi r2,r1,4
Chain_Node *the_node
)
{
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
8006210: 59 62 00 00 sw (r11+0),r2
old_last_node = the_chain->last;
8006214: 28 22 00 08 lw r2,(r1+8)
the_chain->last = the_node;
8006218: 58 2b 00 08 sw (r1+8),r11
old_last_node->next = the_node;
800621c: 58 4b 00 00 sw (r2+0),r11
the_node->previous = old_last_node;
8006220: 59 62 00 04 sw (r11+4),r2
_Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node );
else
_Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
}
_ISR_Flash( level );
8006224: d0 0c 00 00 wcsr IE,r12
8006228: d0 04 00 00 wcsr IE,r4
*/
RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
{
_Thread_Heir = (Thread_Control *)
_Thread_Ready_chain[ _Priority_Get_highest() ].first;
800622c: 78 01 08 01 mvhi r1,0x801
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 );
8006230: 78 02 08 01 mvhi r2,0x801
8006234: 38 21 98 b8 ori r1,r1,0x98b8
8006238: 38 42 99 c4 ori r2,r2,0x99c4
800623c: 28 2e 00 00 lw r14,(r1+0)
8006240: 2c 41 00 00 lhu r1,(r2+0)
8006244: 78 0b 08 01 mvhi r11,0x801
8006248: 34 02 00 ff mvi r2,255
800624c: 20 21 ff ff andi r1,r1,0xffff
8006250: 39 6b 7f c4 ori r11,r11,0x7fc4
8006254: 54 22 00 05 bgu r1,r2,8006268 <_Thread_Change_priority+0x14c>
8006258: b5 61 58 00 add r11,r11,r1
800625c: 41 6d 00 00 lbu r13,(r11+0)
8006260: 35 ad 00 08 addi r13,r13,8
8006264: e0 00 00 05 bi 8006278 <_Thread_Change_priority+0x15c>
8006268: 34 02 00 08 mvi r2,8
800626c: f8 00 43 67 calli 8017008 <__lshrsi3>
8006270: b5 61 58 00 add r11,r11,r1
8006274: 41 6d 00 00 lbu r13,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
8006278: 34 02 00 01 mvi r2,1
800627c: 78 0b 08 01 mvhi r11,0x801
8006280: b9 a0 08 00 mv r1,r13
8006284: f8 00 43 13 calli 8016ed0 <__ashlsi3>
8006288: 39 6b 9a 38 ori r11,r11,0x9a38
800628c: b5 61 58 00 add r11,r11,r1
8006290: 2d 62 00 00 lhu r2,(r11+0)
8006294: 34 01 00 ff mvi r1,255
8006298: 78 0b 08 01 mvhi r11,0x801
800629c: 39 6b 7f c4 ori r11,r11,0x7fc4
80062a0: 54 41 00 05 bgu r2,r1,80062b4 <_Thread_Change_priority+0x198>
80062a4: b5 62 58 00 add r11,r11,r2
80062a8: 41 6b 00 00 lbu r11,(r11+0)
80062ac: 35 6b 00 08 addi r11,r11,8
80062b0: e0 00 00 06 bi 80062c8 <_Thread_Change_priority+0x1ac>
80062b4: b8 40 08 00 mv r1,r2
80062b8: 34 02 00 08 mvi r2,8
80062bc: f8 00 43 53 calli 8017008 <__lshrsi3>
80062c0: b5 61 58 00 add r11,r11,r1
80062c4: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
80062c8: 34 02 00 04 mvi r2,4
80062cc: b9 a0 08 00 mv r1,r13
80062d0: f8 00 43 00 calli 8016ed0 <__ashlsi3>
80062d4: b5 61 58 00 add r11,r11,r1
80062d8: 34 02 00 01 mvi r2,1
80062dc: b9 60 08 00 mv r1,r11
80062e0: f8 00 42 fc calli 8016ed0 <__ashlsi3>
80062e4: 34 02 00 02 mvi r2,2
80062e8: b4 2b 08 00 add r1,r1,r11
80062ec: f8 00 42 f9 calli 8016ed0 <__ashlsi3>
80062f0: b5 c1 08 00 add r1,r14,r1
* ready thread.
*/
RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
{
_Thread_Heir = (Thread_Control *)
80062f4: 28 23 00 00 lw r3,(r1+0)
80062f8: 78 01 08 01 mvhi r1,0x801
80062fc: 38 21 9d fc ori r1,r1,0x9dfc
* is also the heir thread, and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void )
{
return ( _Thread_Executing == _Thread_Heir );
8006300: 28 22 00 0c lw r2,(r1+12)
* ready thread.
*/
RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
{
_Thread_Heir = (Thread_Control *)
8006304: 58 23 00 10 sw (r1+16),r3
* 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() &&
8006308: 44 43 00 05 be r2,r3,800631c <_Thread_Change_priority+0x200>
800630c: 40 42 00 74 lbu r2,(r2+116)
8006310: 44 40 00 03 be r2,r0,800631c <_Thread_Change_priority+0x200>
_Thread_Executing->is_preemptible )
_Context_Switch_necessary = true;
8006314: 34 02 00 01 mvi r2,1
8006318: 30 22 00 18 sb (r1+24),r2
_ISR_Enable( level );
800631c: d0 0c 00 00 wcsr IE,r12
}
8006320: 2b 9d 00 04 lw ra,(sp+4)
8006324: 2b 8b 00 14 lw r11,(sp+20)
8006328: 2b 8c 00 10 lw r12,(sp+16)
800632c: 2b 8d 00 0c lw r13,(sp+12)
8006330: 2b 8e 00 08 lw r14,(sp+8)
8006334: 37 9c 00 14 addi sp,sp,20
8006338: c3 a0 00 00 ret
0800ed80 <_Thread_Clear_state>:
)
{
ISR_Level level;
States_Control current_state;
_ISR_Disable( level );
800ed80: 90 00 18 00 rcsr r3,IE
800ed84: 34 04 ff fe mvi r4,-2
800ed88: a0 64 20 00 and r4,r3,r4
800ed8c: d0 04 00 00 wcsr IE,r4
current_state = the_thread->current_state;
800ed90: 28 25 00 10 lw r5,(r1+16)
if ( current_state & state ) {
800ed94: a0 45 30 00 and r6,r2,r5
800ed98: 44 c0 00 29 be r6,r0,800ee3c <_Thread_Clear_state+0xbc>
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
800ed9c: a4 40 10 00 not r2,r2
800eda0: a0 45 10 00 and r2,r2,r5
current_state =
the_thread->current_state = _States_Clear( state, current_state );
800eda4: 58 22 00 10 sw (r1+16),r2
if ( _States_Is_ready( current_state ) ) {
800eda8: 5c 40 00 25 bne r2,r0,800ee3c <_Thread_Clear_state+0xbc>
RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map (
Priority_Information *the_priority_map
)
{
*the_priority_map->minor |= the_priority_map->ready_minor;
800edac: 28 22 00 90 lw r2,(r1+144)
800edb0: 2c 25 00 96 lhu r5,(r1+150)
800edb4: 2c 46 00 00 lhu r6,(r2+0)
800edb8: b8 c5 28 00 or r5,r6,r5
800edbc: 0c 45 00 00 sh (r2+0),r5
_Priority_Major_bit_map |= the_priority_map->ready_major;
800edc0: 78 02 08 01 mvhi r2,0x801
800edc4: 38 42 99 c4 ori r2,r2,0x99c4
800edc8: 2c 45 00 00 lhu r5,(r2+0)
800edcc: 2c 26 00 94 lhu r6,(r1+148)
800edd0: b8 c5 28 00 or r5,r6,r5
800edd4: 20 a5 ff ff andi r5,r5,0xffff
800edd8: 0c 45 00 00 sh (r2+0),r5
_Priority_Add_to_bit_map( &the_thread->Priority_map );
_Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
800eddc: 28 22 00 8c lw r2,(r1+140)
800ede0: 34 45 00 04 addi r5,r2,4
Chain_Node *the_node
)
{
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
800ede4: 58 25 00 00 sw (r1+0),r5
old_last_node = the_chain->last;
800ede8: 28 45 00 08 lw r5,(r2+8)
the_chain->last = the_node;
800edec: 58 41 00 08 sw (r2+8),r1
old_last_node->next = the_node;
800edf0: 58 a1 00 00 sw (r5+0),r1
the_node->previous = old_last_node;
800edf4: 58 25 00 04 sw (r1+4),r5
_ISR_Flash( level );
800edf8: d0 03 00 00 wcsr IE,r3
800edfc: d0 04 00 00 wcsr IE,r4
* 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 ) {
800ee00: 78 02 08 01 mvhi r2,0x801
800ee04: 38 42 9d fc ori r2,r2,0x9dfc
800ee08: 28 45 00 10 lw r5,(r2+16)
800ee0c: 28 24 00 14 lw r4,(r1+20)
800ee10: 28 a5 00 14 lw r5,(r5+20)
800ee14: 50 85 00 0a bgeu r4,r5,800ee3c <_Thread_Clear_state+0xbc>
_Thread_Heir = the_thread;
800ee18: 58 41 00 10 sw (r2+16),r1
if ( _Thread_Executing->is_preemptible ||
800ee1c: 28 41 00 0c lw r1,(r2+12)
800ee20: 40 21 00 74 lbu r1,(r1+116)
800ee24: 5c 20 00 02 bne r1,r0,800ee2c <_Thread_Clear_state+0xac>
800ee28: 5c 81 00 05 bne r4,r1,800ee3c <_Thread_Clear_state+0xbc> <== ALWAYS TAKEN
the_thread->current_priority == 0 )
_Context_Switch_necessary = true;
800ee2c: 78 01 08 01 mvhi r1,0x801
800ee30: 38 21 9d fc ori r1,r1,0x9dfc
800ee34: 34 02 00 01 mvi r2,1
800ee38: 30 22 00 18 sb (r1+24),r2
}
}
}
_ISR_Enable( level );
800ee3c: d0 03 00 00 wcsr IE,r3
}
800ee40: c3 a0 00 00 ret
0800bb68 <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
800bb68: 37 9c ff f8 addi sp,sp,-8
800bb6c: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
800bb70: 37 82 00 08 addi r2,sp,8
800bb74: f8 00 00 7c calli 800bd64 <_Thread_Get>
switch ( location ) {
800bb78: 2b 82 00 08 lw r2,(sp+8)
800bb7c: 5c 40 00 0a bne r2,r0,800bba4 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
800bb80: 78 03 08 02 mvhi r3,0x802
800bb84: 38 63 6b 54 ori r3,r3,0x6b54
800bb88: 28 62 00 00 lw r2,(r3+0)
800bb8c: fb ff ff 5a calli 800b8f4 <_Thread_Clear_state>
800bb90: 78 01 08 02 mvhi r1,0x802
800bb94: 38 21 9a 14 ori r1,r1,0x9a14
800bb98: 28 22 00 00 lw r2,(r1+0)
800bb9c: 34 42 ff ff addi r2,r2,-1
800bba0: 58 22 00 00 sw (r1+0),r2
| STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Thread_Unnest_dispatch();
break;
}
}
800bba4: 2b 9d 00 04 lw ra,(sp+4)
800bba8: 37 9c 00 08 addi sp,sp,8
800bbac: c3 a0 00 00 ret
08006424 <_Thread_Dispatch>:
* dispatch thread
* no dispatch thread
*/
void _Thread_Dispatch( void )
{
8006424: 37 9c ff c0 addi sp,sp,-64
8006428: 5b 8b 00 30 sw (sp+48),r11
800642c: 5b 8c 00 2c sw (sp+44),r12
8006430: 5b 8d 00 28 sw (sp+40),r13
8006434: 5b 8e 00 24 sw (sp+36),r14
8006438: 5b 8f 00 20 sw (sp+32),r15
800643c: 5b 90 00 1c sw (sp+28),r16
8006440: 5b 91 00 18 sw (sp+24),r17
8006444: 5b 92 00 14 sw (sp+20),r18
8006448: 5b 93 00 10 sw (sp+16),r19
800644c: 5b 94 00 0c sw (sp+12),r20
8006450: 5b 95 00 08 sw (sp+8),r21
8006454: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *executing;
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
8006458: 78 01 08 01 mvhi r1,0x801
800645c: 38 21 9d fc ori r1,r1,0x9dfc
8006460: 28 2d 00 0c lw r13,(r1+12)
_ISR_Disable( level );
8006464: 90 00 20 00 rcsr r4,IE
8006468: 34 01 ff fe mvi r1,-2
800646c: a0 81 08 00 and r1,r4,r1
8006470: d0 01 00 00 wcsr IE,r1
while ( _Context_Switch_necessary == true ) {
8006474: 78 0c 08 01 mvhi r12,0x801
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
8006478: 78 11 08 01 mvhi r17,0x801
#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;
800647c: 78 0f 08 01 mvhi r15,0x801
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
8006480: 78 0e 08 01 mvhi r14,0x801
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8006484: 78 10 08 01 mvhi r16,0x801
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Context_Switch_necessary == true ) {
8006488: 39 8c 9d fc ori r12,r12,0x9dfc
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
800648c: 3a 31 99 24 ori r17,r17,0x9924
8006490: 34 14 00 01 mvi r20,1
#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;
8006494: 39 ef 98 bc ori r15,r15,0x98bc
_ISR_Enable( level );
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
8006498: 37 93 00 3c addi r19,sp,60
_Timestamp_Subtract(
800649c: 39 ce 99 d4 ori r14,r14,0x99d4
80064a0: 37 92 00 34 addi r18,sp,52
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
80064a4: 3a 10 99 a8 ori r16,r16,0x99a8
#endif
#endif
executing = _Thread_Executing;
_ISR_Disable( level );
80064a8: 34 15 ff fe mvi r21,-2
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Context_Switch_necessary == true ) {
80064ac: e0 00 00 28 bi 800654c <_Thread_Dispatch+0x128>
heir = _Thread_Heir;
80064b0: 29 8b 00 10 lw r11,(r12+16)
_Thread_Dispatch_disable_level = 1;
80064b4: 5a 34 00 00 sw (r17+0),r20
_Context_Switch_necessary = false;
80064b8: 31 80 00 18 sb (r12+24),r0
_Thread_Executing = heir;
80064bc: 59 8b 00 0c sw (r12+12),r11
/*
* When the heir and executing are the same, then we are being
* requested to do the post switch dispatching. This is normally
* done to dispatch signals.
*/
if ( heir == executing )
80064c0: 45 6d 00 26 be r11,r13,8006558 <_Thread_Dispatch+0x134>
*/
#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 )
80064c4: 29 61 00 7c lw r1,(r11+124)
80064c8: 5c 34 00 03 bne r1,r20,80064d4 <_Thread_Dispatch+0xb0>
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
80064cc: 29 e1 00 00 lw r1,(r15+0)
80064d0: 59 61 00 78 sw (r11+120),r1
_ISR_Enable( level );
80064d4: d0 04 00 00 wcsr IE,r4
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
80064d8: ba 60 08 00 mv r1,r19
80064dc: f8 00 20 30 calli 800e59c <_TOD_Get_uptime>
_Timestamp_Subtract(
80064e0: b9 c0 08 00 mv r1,r14
80064e4: ba 60 10 00 mv r2,r19
80064e8: ba 40 18 00 mv r3,r18
80064ec: f8 00 04 2b calli 8007598 <_Timespec_Subtract>
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
80064f0: 35 a1 00 84 addi r1,r13,132
80064f4: ba 40 10 00 mv r2,r18
80064f8: f8 00 04 0f calli 8007534 <_Timespec_Add_to>
_Thread_Time_of_last_context_switch = uptime;
80064fc: 2b 81 00 3c lw r1,(sp+60)
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8006500: 2a 04 00 00 lw r4,(r16+0)
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
_Thread_Time_of_last_context_switch = uptime;
8006504: 59 c1 00 00 sw (r14+0),r1
8006508: 2b 81 00 40 lw r1,(sp+64)
800650c: 59 c1 00 04 sw (r14+4),r1
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8006510: 44 80 00 05 be r4,r0,8006524 <_Thread_Dispatch+0x100> <== NEVER TAKEN
executing->libc_reent = *_Thread_libc_reent;
8006514: 28 81 00 00 lw r1,(r4+0)
8006518: 59 a1 01 24 sw (r13+292),r1
*_Thread_libc_reent = heir->libc_reent;
800651c: 29 61 01 24 lw r1,(r11+292)
8006520: 58 81 00 00 sw (r4+0),r1
}
_User_extensions_Thread_switch( executing, heir );
8006524: b9 a0 08 00 mv r1,r13
8006528: b9 60 10 00 mv r2,r11
800652c: f8 00 04 fa calli 8007914 <_User_extensions_Thread_switch>
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
8006530: 35 a1 00 d0 addi r1,r13,208
8006534: 35 62 00 d0 addi r2,r11,208
8006538: f8 00 05 d8 calli 8007c98 <_CPU_Context_switch>
if ( executing->fp_context != NULL )
_Context_Restore_fp( &executing->fp_context );
#endif
#endif
executing = _Thread_Executing;
800653c: 29 8d 00 0c lw r13,(r12+12)
_ISR_Disable( level );
8006540: 90 00 20 00 rcsr r4,IE
8006544: a0 95 08 00 and r1,r4,r21
8006548: d0 01 00 00 wcsr IE,r1
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Context_Switch_necessary == true ) {
800654c: 41 81 00 18 lbu r1,(r12+24)
8006550: 20 21 00 ff andi r1,r1,0xff
8006554: 5c 20 ff d7 bne r1,r0,80064b0 <_Thread_Dispatch+0x8c>
_ISR_Disable( level );
}
post_switch:
_Thread_Dispatch_disable_level = 0;
8006558: 78 01 08 01 mvhi r1,0x801
800655c: 38 21 99 24 ori r1,r1,0x9924
8006560: 58 20 00 00 sw (r1+0),r0
_ISR_Enable( level );
8006564: d0 04 00 00 wcsr IE,r4
_API_extensions_Run_postswitch();
8006568: fb ff f9 3f calli 8004a64 <_API_extensions_Run_postswitch>
}
800656c: 2b 9d 00 04 lw ra,(sp+4)
8006570: 2b 8b 00 30 lw r11,(sp+48)
8006574: 2b 8c 00 2c lw r12,(sp+44)
8006578: 2b 8d 00 28 lw r13,(sp+40)
800657c: 2b 8e 00 24 lw r14,(sp+36)
8006580: 2b 8f 00 20 lw r15,(sp+32)
8006584: 2b 90 00 1c lw r16,(sp+28)
8006588: 2b 91 00 18 lw r17,(sp+24)
800658c: 2b 92 00 14 lw r18,(sp+20)
8006590: 2b 93 00 10 lw r19,(sp+16)
8006594: 2b 94 00 0c lw r20,(sp+12)
8006598: 2b 95 00 08 lw r21,(sp+8)
800659c: 37 9c 00 40 addi sp,sp,64
80065a0: c3 a0 00 00 ret
080065d8 <_Thread_Get>:
Thread_Control *_Thread_Get (
Objects_Id id,
Objects_Locations *location
)
{
80065d8: 37 9c ff e8 addi sp,sp,-24
80065dc: 5b 8b 00 18 sw (sp+24),r11
80065e0: 5b 8c 00 14 sw (sp+20),r12
80065e4: 5b 8d 00 10 sw (sp+16),r13
80065e8: 5b 8e 00 0c sw (sp+12),r14
80065ec: 5b 8f 00 08 sw (sp+8),r15
80065f0: 5b 9d 00 04 sw (sp+4),ra
80065f4: b8 20 68 00 mv r13,r1
80065f8: b8 40 58 00 mv r11,r2
uint32_t the_class;
Objects_Information **api_information;
Objects_Information *information;
Thread_Control *tp = (Thread_Control *) 0;
if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
80065fc: 5c 20 00 0b bne r1,r0,8006628 <_Thread_Get+0x50>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8006600: 78 01 08 01 mvhi r1,0x801
8006604: 38 21 99 24 ori r1,r1,0x9924
8006608: 28 22 00 00 lw r2,(r1+0)
800660c: 34 42 00 01 addi r2,r2,1
8006610: 58 22 00 00 sw (r1+0),r2
_Thread_Disable_dispatch();
*location = OBJECTS_LOCAL;
tp = _Thread_Executing;
8006614: 78 01 08 01 mvhi r1,0x801
8006618: 38 21 9d fc ori r1,r1,0x9dfc
Objects_Information *information;
Thread_Control *tp = (Thread_Control *) 0;
if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
_Thread_Disable_dispatch();
*location = OBJECTS_LOCAL;
800661c: 59 60 00 00 sw (r11+0),r0
tp = _Thread_Executing;
8006620: 28 21 00 0c lw r1,(r1+12)
goto done;
8006624: e0 00 00 1c bi 8006694 <_Thread_Get+0xbc>
*/
RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API(
Objects_Id id
)
{
return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS);
8006628: 34 02 00 18 mvi r2,24
800662c: f8 00 42 77 calli 8017008 <__lshrsi3>
8006630: 20 2f 00 07 andi r15,r1,0x7
*/
RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid(
uint32_t the_api
)
{
if ( !the_api || the_api > OBJECTS_APIS_LAST )
8006634: 35 e1 ff ff addi r1,r15,-1
8006638: 34 02 00 02 mvi r2,2
800663c: 50 41 00 1e bgeu r2,r1,80066b4 <_Thread_Get+0xdc>
}
the_api = _Objects_Get_API( id );
if ( !_Objects_Is_api_valid( the_api ) ) {
*location = OBJECTS_ERROR;
8006640: 34 01 00 01 mvi r1,1
8006644: 59 61 00 00 sw (r11+0),r1
8006648: e0 00 00 02 bi 8006650 <_Thread_Get+0x78>
goto done;
}
the_class = _Objects_Get_class( id );
if ( the_class != 1 ) { /* threads are always first class :) */
*location = OBJECTS_ERROR;
800664c: 59 62 00 00 sw (r11+0),r2
{
uint32_t the_api;
uint32_t the_class;
Objects_Information **api_information;
Objects_Information *information;
Thread_Control *tp = (Thread_Control *) 0;
8006650: 34 01 00 00 mvi r1,0
}
the_class = _Objects_Get_class( id );
if ( the_class != 1 ) { /* threads are always first class :) */
*location = OBJECTS_ERROR;
goto done;
8006654: e0 00 00 10 bi 8006694 <_Thread_Get+0xbc>
}
api_information = _Objects_Information_table[ the_api ];
8006658: 78 0e 08 01 mvhi r14,0x801
800665c: b9 e0 08 00 mv r1,r15
8006660: 34 02 00 02 mvi r2,2
8006664: f8 00 42 1b calli 8016ed0 <__ashlsi3>
8006668: 39 ce 98 c0 ori r14,r14,0x98c0
800666c: b5 c1 08 00 add r1,r14,r1
8006670: 28 21 00 00 lw r1,(r1+0)
if ( !api_information ) {
8006674: 44 20 00 03 be r1,r0,8006680 <_Thread_Get+0xa8> <== NEVER TAKEN
*location = OBJECTS_ERROR;
goto done;
}
information = api_information[ the_class ];
8006678: 28 21 00 04 lw r1,(r1+4)
if ( !information ) {
800667c: 5c 20 00 03 bne r1,r0,8006688 <_Thread_Get+0xb0>
*location = OBJECTS_ERROR;
8006680: 59 6c 00 00 sw (r11+0),r12
goto done;
8006684: e0 00 00 04 bi 8006694 <_Thread_Get+0xbc>
}
tp = (Thread_Control *) _Objects_Get( information, id, location );
8006688: b9 a0 10 00 mv r2,r13
800668c: b9 60 18 00 mv r3,r11
8006690: fb ff fd 77 calli 8005c6c <_Objects_Get>
done:
return tp;
}
8006694: 2b 9d 00 04 lw ra,(sp+4)
8006698: 2b 8b 00 18 lw r11,(sp+24)
800669c: 2b 8c 00 14 lw r12,(sp+20)
80066a0: 2b 8d 00 10 lw r13,(sp+16)
80066a4: 2b 8e 00 0c lw r14,(sp+12)
80066a8: 2b 8f 00 08 lw r15,(sp+8)
80066ac: 37 9c 00 18 addi sp,sp,24
80066b0: c3 a0 00 00 ret
*/
RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
Objects_Id id
)
{
return (uint32_t)
80066b4: 34 02 00 1b mvi r2,27
80066b8: b9 a0 08 00 mv r1,r13
80066bc: f8 00 42 53 calli 8017008 <__lshrsi3>
*location = OBJECTS_ERROR;
goto done;
}
the_class = _Objects_Get_class( id );
if ( the_class != 1 ) { /* threads are always first class :) */
80066c0: 34 02 00 01 mvi r2,1
80066c4: b8 20 60 00 mv r12,r1
80066c8: 44 22 ff e4 be r1,r2,8006658 <_Thread_Get+0x80>
80066cc: e3 ff ff e0 bi 800664c <_Thread_Get+0x74>
08011224 <_Thread_Handler>:
*
* Output parameters: NONE
*/
void _Thread_Handler( void )
{
8011224: 37 9c ff f4 addi sp,sp,-12
8011228: 5b 8b 00 0c sw (sp+12),r11
801122c: 5b 8c 00 08 sw (sp+8),r12
8011230: 5b 9d 00 04 sw (sp+4),ra
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static char doneConstructors;
char doneCons;
#endif
executing = _Thread_Executing;
8011234: 78 01 08 01 mvhi r1,0x801
8011238: 38 21 9d fc ori r1,r1,0x9dfc
801123c: 28 2b 00 0c lw r11,(r1+12)
/*
* have to put level into a register for those cpu's that use
* inline asm here
*/
level = executing->Start.isr_level;
8011240: 29 61 00 b8 lw r1,(r11+184)
_ISR_Set_level(level);
8011244: 64 21 00 00 cmpei r1,r1,0
8011248: d0 01 00 00 wcsr IE,r1
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
doneCons = doneConstructors;
801124c: 78 01 08 01 mvhi r1,0x801
8011250: 38 21 97 7c ori r1,r1,0x977c
8011254: 40 2c 00 00 lbu r12,(r1+0)
doneConstructors = 1;
8011258: 34 02 00 01 mvi r2,1
801125c: 30 22 00 00 sb (r1+0),r2
/*
* 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 );
8011260: b9 60 08 00 mv r1,r11
8011264: fb ff d9 20 calli 80076e4 <_User_extensions_Thread_begin>
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
8011268: fb ff d4 cf calli 80065a4 <_Thread_Enable_dispatch>
/*
* _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) */ {
801126c: 5d 80 00 02 bne r12,r0,8011274 <_Thread_Handler+0x50>
INIT_NAME ();
8011270: fb ff bb 64 calli 8000000 <RamBase>
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
8011274: 29 61 00 a0 lw r1,(r11+160)
8011278: 5c 20 00 04 bne r1,r0,8011288 <_Thread_Handler+0x64>
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
801127c: 29 62 00 9c lw r2,(r11+156)
8011280: 29 61 00 a8 lw r1,(r11+168)
8011284: e0 00 00 05 bi 8011298 <_Thread_Handler+0x74>
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
8011288: 34 02 00 01 mvi r2,1
801128c: 5c 22 00 05 bne r1,r2,80112a0 <_Thread_Handler+0x7c> <== NEVER TAKEN
executing->Wait.return_argument =
(*(Thread_Entry_pointer) executing->Start.entry_point)(
8011290: 29 62 00 9c lw r2,(r11+156)
8011294: 29 61 00 a4 lw r1,(r11+164)
8011298: d8 40 00 00 call r2
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
executing->Wait.return_argument =
801129c: 59 61 00 28 sw (r11+40),r1
* 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 );
80112a0: b9 60 08 00 mv r1,r11
80112a4: fb ff d9 28 calli 8007744 <_User_extensions_Thread_exitted>
_Internal_error_Occurred(
80112a8: 34 01 00 00 mvi r1,0
80112ac: 34 02 00 01 mvi r2,1
80112b0: 34 03 00 05 mvi r3,5
80112b4: fb ff d0 da calli 800561c <_Internal_error_Occurred>
0800a07c <_Thread_Resume>:
{
ISR_Level level;
States_Control current_state;
_ISR_Disable( level );
800a07c: 90 00 18 00 rcsr r3,IE
800a080: 34 04 ff fe mvi r4,-2
800a084: a0 64 20 00 and r4,r3,r4
800a088: d0 04 00 00 wcsr IE,r4
current_state = the_thread->current_state;
800a08c: 28 22 00 10 lw r2,(r1+16)
if ( current_state & STATES_SUSPENDED ) {
800a090: 20 45 00 02 andi r5,r2,0x2
800a094: 44 a0 00 29 be r5,r0,800a138 <_Thread_Resume+0xbc> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
800a098: 34 05 ff fd mvi r5,-3
800a09c: a0 45 10 00 and r2,r2,r5
current_state =
the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state);
800a0a0: 58 22 00 10 sw (r1+16),r2
if ( _States_Is_ready( current_state ) ) {
800a0a4: 5c 40 00 25 bne r2,r0,800a138 <_Thread_Resume+0xbc>
RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map (
Priority_Information *the_priority_map
)
{
*the_priority_map->minor |= the_priority_map->ready_minor;
800a0a8: 28 22 00 90 lw r2,(r1+144)
800a0ac: 2c 25 00 96 lhu r5,(r1+150)
800a0b0: 2c 46 00 00 lhu r6,(r2+0)
800a0b4: b8 c5 28 00 or r5,r6,r5
800a0b8: 0c 45 00 00 sh (r2+0),r5
_Priority_Major_bit_map |= the_priority_map->ready_major;
800a0bc: 78 02 08 01 mvhi r2,0x801
800a0c0: 38 42 9a 14 ori r2,r2,0x9a14
800a0c4: 2c 45 00 00 lhu r5,(r2+0)
800a0c8: 2c 26 00 94 lhu r6,(r1+148)
800a0cc: b8 c5 28 00 or r5,r6,r5
800a0d0: 20 a5 ff ff andi r5,r5,0xffff
800a0d4: 0c 45 00 00 sh (r2+0),r5
_Priority_Add_to_bit_map( &the_thread->Priority_map );
_Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
800a0d8: 28 22 00 8c lw r2,(r1+140)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
800a0dc: 34 45 00 04 addi r5,r2,4
Chain_Node *the_node
)
{
Chain_Node *old_last_node;
the_node->next = _Chain_Tail(the_chain);
800a0e0: 58 25 00 00 sw (r1+0),r5
old_last_node = the_chain->last;
800a0e4: 28 45 00 08 lw r5,(r2+8)
the_chain->last = the_node;
800a0e8: 58 41 00 08 sw (r2+8),r1
old_last_node->next = the_node;
800a0ec: 58 a1 00 00 sw (r5+0),r1
the_node->previous = old_last_node;
800a0f0: 58 25 00 04 sw (r1+4),r5
_ISR_Flash( level );
800a0f4: d0 03 00 00 wcsr IE,r3
800a0f8: d0 04 00 00 wcsr IE,r4
if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
800a0fc: 78 02 08 01 mvhi r2,0x801
800a100: 38 42 9e 4c ori r2,r2,0x9e4c
800a104: 28 45 00 10 lw r5,(r2+16)
800a108: 28 24 00 14 lw r4,(r1+20)
800a10c: 28 a5 00 14 lw r5,(r5+20)
800a110: 50 85 00 0a bgeu r4,r5,800a138 <_Thread_Resume+0xbc>
_Thread_Heir = the_thread;
800a114: 58 41 00 10 sw (r2+16),r1
if ( _Thread_Executing->is_preemptible ||
800a118: 28 41 00 0c lw r1,(r2+12)
800a11c: 40 21 00 74 lbu r1,(r1+116)
800a120: 5c 20 00 02 bne r1,r0,800a128 <_Thread_Resume+0xac>
800a124: 5c 81 00 05 bne r4,r1,800a138 <_Thread_Resume+0xbc> <== ALWAYS TAKEN
the_thread->current_priority == 0 )
_Context_Switch_necessary = true;
800a128: 78 01 08 01 mvhi r1,0x801
800a12c: 38 21 9e 4c ori r1,r1,0x9e4c
800a130: 34 02 00 01 mvi r2,1
800a134: 30 22 00 18 sb (r1+24),r2
}
}
}
_ISR_Enable( level );
800a138: d0 03 00 00 wcsr IE,r3
}
800a13c: c3 a0 00 00 ret
0800be28 <_Thread_Tickle_timeslice>:
*
* Output parameters: NONE
*/
void _Thread_Tickle_timeslice( void )
{
800be28: 37 9c ff f8 addi sp,sp,-8
800be2c: 5b 8b 00 08 sw (sp+8),r11
800be30: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *executing;
executing = _Thread_Executing;
800be34: 78 01 08 01 mvhi r1,0x801
800be38: 38 21 ae ac ori r1,r1,0xaeac
800be3c: 28 2b 00 0c lw r11,(r1+12)
/*
* If the thread is not preemptible or is not ready, then
* just return.
*/
if ( !executing->is_preemptible )
800be40: 41 61 00 74 lbu r1,(r11+116)
800be44: 44 20 00 1b be r1,r0,800beb0 <_Thread_Tickle_timeslice+0x88>
return;
if ( !_States_Is_ready( executing->current_state ) )
800be48: 29 61 00 10 lw r1,(r11+16)
800be4c: 5c 20 00 19 bne r1,r0,800beb0 <_Thread_Tickle_timeslice+0x88>
/*
* The cpu budget algorithm determines what happens next.
*/
switch ( executing->budget_algorithm ) {
800be50: 29 61 00 7c lw r1,(r11+124)
800be54: 44 20 00 17 be r1,r0,800beb0 <_Thread_Tickle_timeslice+0x88>
800be58: 34 02 00 02 mvi r2,2
800be5c: 50 41 00 04 bgeu r2,r1,800be6c <_Thread_Tickle_timeslice+0x44>
800be60: 34 02 00 03 mvi r2,3
800be64: 5c 22 00 13 bne r1,r2,800beb0 <_Thread_Tickle_timeslice+0x88><== NEVER TAKEN
800be68: e0 00 00 0b bi 800be94 <_Thread_Tickle_timeslice+0x6c>
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 ) {
800be6c: 29 61 00 78 lw r1,(r11+120)
800be70: 34 21 ff ff addi r1,r1,-1
800be74: 59 61 00 78 sw (r11+120),r1
800be78: 48 20 00 0e bg r1,r0,800beb0 <_Thread_Tickle_timeslice+0x88>
* at the priority of the currently executing thread, then the
* executing thread's timeslice is reset. Otherwise, the
* currently executing thread is placed at the rear of the
* FIFO for this priority and a new heir is selected.
*/
_Thread_Yield_processor();
800be7c: f8 00 00 11 calli 800bec0 <_Thread_Yield_processor>
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
800be80: 78 01 08 01 mvhi r1,0x801
800be84: 38 21 a9 6c ori r1,r1,0xa96c
800be88: 28 21 00 00 lw r1,(r1+0)
800be8c: 59 61 00 78 sw (r11+120),r1
800be90: e0 00 00 08 bi 800beb0 <_Thread_Tickle_timeslice+0x88>
}
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
if ( --executing->cpu_time_budget == 0 )
800be94: 29 61 00 78 lw r1,(r11+120)
800be98: 34 21 ff ff addi r1,r1,-1
800be9c: 59 61 00 78 sw (r11+120),r1
800bea0: 5c 20 00 04 bne r1,r0,800beb0 <_Thread_Tickle_timeslice+0x88>
(*executing->budget_callout)( executing );
800bea4: 29 62 00 80 lw r2,(r11+128)
800bea8: b9 60 08 00 mv r1,r11
800beac: d8 40 00 00 call r2
break;
#endif
}
}
800beb0: 2b 9d 00 04 lw ra,(sp+4)
800beb4: 2b 8b 00 08 lw r11,(sp+8)
800beb8: 37 9c 00 08 addi sp,sp,8
800bebc: c3 a0 00 00 ret
0800ed20 <_Thread_blocking_operation_Cancel>:
Thread_blocking_operation_States sync_state __attribute__((unused)),
#endif
Thread_Control *the_thread,
ISR_Level level
)
{
800ed20: 37 9c ff f8 addi sp,sp,-8
800ed24: 5b 8b 00 08 sw (sp+8),r11
800ed28: 5b 9d 00 04 sw (sp+4),ra
800ed2c: b8 40 58 00 mv r11,r2
#endif
/*
* The thread is not waiting on anything after this completes.
*/
the_thread->Wait.queue = NULL;
800ed30: 58 40 00 44 sw (r2+68),r0
/*
* If the sync state is timed out, this is very likely not needed.
* But better safe than sorry when it comes to critical sections.
*/
if ( _Watchdog_Is_active( &the_thread->Timer ) ) {
800ed34: 28 42 00 50 lw r2,(r2+80)
800ed38: 34 01 00 02 mvi r1,2
800ed3c: 5c 41 00 07 bne r2,r1,800ed58 <_Thread_blocking_operation_Cancel+0x38><== ALWAYS TAKEN
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
800ed40: 34 01 00 03 mvi r1,3 <== NOT EXECUTED
800ed44: 59 61 00 50 sw (r11+80),r1 <== NOT EXECUTED
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
800ed48: d0 03 00 00 wcsr IE,r3 <== NOT EXECUTED
(void) _Watchdog_Remove( &the_thread->Timer );
800ed4c: 35 61 00 48 addi r1,r11,72 <== NOT EXECUTED
800ed50: fb ff e3 69 calli 8007af4 <_Watchdog_Remove> <== NOT EXECUTED
800ed54: e0 00 00 02 bi 800ed5c <_Thread_blocking_operation_Cancel+0x3c><== NOT EXECUTED
} else
_ISR_Enable( level );
800ed58: d0 03 00 00 wcsr IE,r3
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800ed5c: 78 03 08 01 mvhi r3,0x801
800ed60: 38 63 81 44 ori r3,r3,0x8144
800ed64: 28 62 00 00 lw r2,(r3+0)
800ed68: b9 60 08 00 mv r1,r11
800ed6c: f8 00 00 05 calli 800ed80 <_Thread_Clear_state>
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
800ed70: 2b 9d 00 04 lw ra,(sp+4)
800ed74: 2b 8b 00 08 lw r11,(sp+8)
800ed78: 37 9c 00 08 addi sp,sp,8
800ed7c: c3 a0 00 00 ret
08006c54 <_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
)
{
8006c54: 37 9c ff c8 addi sp,sp,-56
8006c58: 5b 8b 00 38 sw (sp+56),r11
8006c5c: 5b 8c 00 34 sw (sp+52),r12
8006c60: 5b 8d 00 30 sw (sp+48),r13
8006c64: 5b 8e 00 2c sw (sp+44),r14
8006c68: 5b 8f 00 28 sw (sp+40),r15
8006c6c: 5b 90 00 24 sw (sp+36),r16
8006c70: 5b 91 00 20 sw (sp+32),r17
8006c74: 5b 92 00 1c sw (sp+28),r18
8006c78: 5b 93 00 18 sw (sp+24),r19
8006c7c: 5b 94 00 14 sw (sp+20),r20
8006c80: 5b 95 00 10 sw (sp+16),r21
8006c84: 5b 96 00 0c sw (sp+12),r22
8006c88: 5b 97 00 08 sw (sp+8),r23
8006c8c: 5b 9d 00 04 sw (sp+4),ra
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
8006c90: 28 50 00 14 lw r16,(r2+20)
Thread_blocking_operation_States _Thread_queue_Enqueue_priority (
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
ISR_Level *level_p
)
{
8006c94: b8 20 68 00 mv r13,r1
8006c98: 34 41 00 3c addi r1,r2,60
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
8006c9c: 58 41 00 38 sw (r2+56),r1
Chain_Node *previous_node;
Chain_Node *search_node;
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
8006ca0: 34 41 00 38 addi r1,r2,56
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
8006ca4: 58 41 00 40 sw (r2+64),r1
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
the_chain->permanent_null = NULL;
8006ca8: 58 40 00 3c sw (r2+60),r0
Thread_blocking_operation_States _Thread_queue_Enqueue_priority (
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
ISR_Level *level_p
)
{
8006cac: b8 40 58 00 mv r11,r2
RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number (
Priority_Control the_priority
)
{
return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
8006cb0: ba 00 08 00 mv r1,r16
8006cb4: 34 02 00 06 mvi r2,6
8006cb8: b8 60 a8 00 mv r21,r3
8006cbc: f8 00 40 d3 calli 8017008 <__lshrsi3>
_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 ];
8006cc0: 34 02 00 01 mvi r2,1
8006cc4: b8 20 70 00 mv r14,r1
8006cc8: f8 00 40 82 calli 8016ed0 <__ashlsi3>
8006ccc: 34 02 00 02 mvi r2,2
8006cd0: b4 2e 08 00 add r1,r1,r14
8006cd4: f8 00 40 7f calli 8016ed0 <__ashlsi3>
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
8006cd8: 78 12 08 01 mvhi r18,0x801
RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_reverse_search (
Priority_Control the_priority
)
{
return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK );
8006cdc: 22 02 00 20 andi r2,r16,0x20
_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 ];
8006ce0: b5 a1 b8 00 add r23,r13,r1
block_state = the_thread_queue->state;
8006ce4: 29 b3 00 38 lw r19,(r13+56)
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
8006ce8: 3a 52 90 a8 ori r18,r18,0x90a8
_ISR_Disable( level );
8006cec: 34 16 ff fe mvi r22,-2
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
block_state = the_thread_queue->state;
if ( _Thread_queue_Is_reverse_search( priority ) )
8006cf0: 5c 40 00 30 bne r2,r0,8006db0 <_Thread_queue_Enqueue_priority+0x15c>
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
8006cf4: 34 14 ff fe mvi r20,-2
8006cf8: 90 00 78 00 rcsr r15,IE
8006cfc: a1 f4 90 00 and r18,r15,r20
8006d00: d0 12 00 00 wcsr IE,r18
search_thread = (Thread_Control *) header->first;
8006d04: 34 02 00 01 mvi r2,1
8006d08: b9 c0 08 00 mv r1,r14
8006d0c: f8 00 40 71 calli 8016ed0 <__ashlsi3>
8006d10: b4 2e 08 00 add r1,r1,r14
8006d14: 34 02 00 02 mvi r2,2
8006d18: f8 00 40 6e calli 8016ed0 <__ashlsi3>
8006d1c: b5 a1 08 00 add r1,r13,r1
8006d20: 28 2c 00 00 lw r12,(r1+0)
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
8006d24: 34 11 ff ff mvi r17,-1
_ISR_Disable( level );
search_thread = (Thread_Control *) header->first;
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
8006d28: e0 00 00 0b bi 8006d54 <_Thread_queue_Enqueue_priority+0x100>
search_priority = search_thread->current_priority;
8006d2c: 29 91 00 14 lw r17,(r12+20)
if ( priority <= search_priority )
8006d30: 52 30 00 12 bgeu r17,r16,8006d78 <_Thread_queue_Enqueue_priority+0x124>
break;
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
8006d34: d0 0f 00 00 wcsr IE,r15
8006d38: d0 12 00 00 wcsr IE,r18
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
8006d3c: 29 81 00 10 lw r1,(r12+16)
8006d40: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
8006d44: 5c 20 00 03 bne r1,r0,8006d50 <_Thread_queue_Enqueue_priority+0xfc><== ALWAYS TAKEN
_ISR_Enable( level );
8006d48: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_forward_search;
8006d4c: e3 ff ff eb bi 8006cf8 <_Thread_queue_Enqueue_priority+0xa4><== NOT EXECUTED
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
8006d50: 29 8c 00 00 lw r12,(r12+0)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
8006d54: 34 02 00 01 mvi r2,1
8006d58: b9 c0 08 00 mv r1,r14
8006d5c: f8 00 40 5d calli 8016ed0 <__ashlsi3>
8006d60: b4 2e 08 00 add r1,r1,r14
8006d64: 34 02 00 02 mvi r2,2
8006d68: f8 00 40 5a calli 8016ed0 <__ashlsi3>
8006d6c: b5 a1 08 00 add r1,r13,r1
8006d70: 34 21 00 04 addi r1,r1,4
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 ) ) {
8006d74: 5d 81 ff ee bne r12,r1,8006d2c <_Thread_queue_Enqueue_priority+0xd8>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
8006d78: 29 a3 00 30 lw r3,(r13+48)
8006d7c: 34 02 00 01 mvi r2,1
8006d80: b9 e0 08 00 mv r1,r15
8006d84: 5c 62 00 3c bne r3,r2,8006e74 <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8006d88: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
8006d8c: 46 11 00 31 be r16,r17,8006e50 <_Thread_queue_Enqueue_priority+0x1fc>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
8006d90: 29 81 00 04 lw r1,(r12+4)
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8006d94: 59 6c 00 00 sw (r11+0),r12
the_node->previous = previous_node;
8006d98: 59 61 00 04 sw (r11+4),r1
previous_node->next = the_node;
8006d9c: 58 2b 00 00 sw (r1+0),r11
search_node->previous = the_node;
8006da0: 59 8b 00 04 sw (r12+4),r11
the_thread->Wait.queue = the_thread_queue;
8006da4: 59 6d 00 44 sw (r11+68),r13
_ISR_Enable( level );
8006da8: d0 0f 00 00 wcsr IE,r15
8006dac: e0 00 00 27 bi 8006e48 <_Thread_queue_Enqueue_priority+0x1f4>
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
8006db0: 42 51 00 00 lbu r17,(r18+0)
8006db4: 36 31 00 01 addi r17,r17,1
_ISR_Disable( level );
8006db8: 90 00 78 00 rcsr r15,IE
8006dbc: a1 f6 a0 00 and r20,r15,r22
8006dc0: d0 14 00 00 wcsr IE,r20
search_thread = (Thread_Control *) header->last;
8006dc4: 34 02 00 01 mvi r2,1
8006dc8: b9 c0 08 00 mv r1,r14
8006dcc: f8 00 40 41 calli 8016ed0 <__ashlsi3>
8006dd0: b4 2e 08 00 add r1,r1,r14
8006dd4: 34 02 00 02 mvi r2,2
8006dd8: f8 00 40 3e calli 8016ed0 <__ashlsi3>
8006ddc: b5 a1 08 00 add r1,r13,r1
8006de0: 28 2c 00 08 lw r12,(r1+8)
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
8006de4: e0 00 00 0b bi 8006e10 <_Thread_queue_Enqueue_priority+0x1bc>
search_priority = search_thread->current_priority;
8006de8: 29 91 00 14 lw r17,(r12+20)
if ( priority >= search_priority )
8006dec: 52 11 00 0a bgeu r16,r17,8006e14 <_Thread_queue_Enqueue_priority+0x1c0>
break;
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
8006df0: d0 0f 00 00 wcsr IE,r15
8006df4: d0 14 00 00 wcsr IE,r20
8006df8: 29 81 00 10 lw r1,(r12+16)
8006dfc: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
8006e00: 5c 20 00 03 bne r1,r0,8006e0c <_Thread_queue_Enqueue_priority+0x1b8><== ALWAYS TAKEN
_ISR_Enable( level );
8006e04: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_reverse_search;
8006e08: e3 ff ff ea bi 8006db0 <_Thread_queue_Enqueue_priority+0x15c><== NOT EXECUTED
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
8006e0c: 29 8c 00 04 lw r12,(r12+4)
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 ) ) {
8006e10: 5d 97 ff f6 bne r12,r23,8006de8 <_Thread_queue_Enqueue_priority+0x194>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
8006e14: 29 a3 00 30 lw r3,(r13+48)
8006e18: 34 02 00 01 mvi r2,1
8006e1c: b9 e0 08 00 mv r1,r15
8006e20: 5c 62 00 15 bne r3,r2,8006e74 <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8006e24: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
8006e28: 46 11 00 0a be r16,r17,8006e50 <_Thread_queue_Enqueue_priority+0x1fc>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
8006e2c: 29 81 00 00 lw r1,(r12+0)
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
8006e30: 59 6c 00 04 sw (r11+4),r12
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
8006e34: 59 61 00 00 sw (r11+0),r1
the_node->previous = search_node;
search_node->next = the_node;
8006e38: 59 8b 00 00 sw (r12+0),r11
next_node->previous = the_node;
8006e3c: 58 2b 00 04 sw (r1+4),r11
the_thread->Wait.queue = the_thread_queue;
8006e40: 59 6d 00 44 sw (r11+68),r13
_ISR_Enable( level );
8006e44: d0 0f 00 00 wcsr IE,r15
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
8006e48: 34 01 00 01 mvi r1,1
8006e4c: e0 00 00 0c bi 8006e7c <_Thread_queue_Enqueue_priority+0x228>
8006e50: 35 8c 00 3c addi r12,r12,60
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
previous_node = search_node->previous;
8006e54: 29 81 00 04 lw r1,(r12+4)
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8006e58: 59 6c 00 00 sw (r11+0),r12
the_node->previous = previous_node;
8006e5c: 59 61 00 04 sw (r11+4),r1
previous_node->next = the_node;
8006e60: 58 2b 00 00 sw (r1+0),r11
search_node->previous = the_node;
8006e64: 59 8b 00 04 sw (r12+4),r11
the_thread->Wait.queue = the_thread_queue;
8006e68: 59 6d 00 44 sw (r11+68),r13
_ISR_Enable( level );
8006e6c: d0 0f 00 00 wcsr IE,r15
8006e70: e3 ff ff f6 bi 8006e48 <_Thread_queue_Enqueue_priority+0x1f4>
* 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;
8006e74: 5a a1 00 00 sw (r21+0),r1 <== NOT EXECUTED
return the_thread_queue->sync_state;
8006e78: 29 a1 00 30 lw r1,(r13+48) <== NOT EXECUTED
}
8006e7c: 2b 9d 00 04 lw ra,(sp+4)
8006e80: 2b 8b 00 38 lw r11,(sp+56)
8006e84: 2b 8c 00 34 lw r12,(sp+52)
8006e88: 2b 8d 00 30 lw r13,(sp+48)
8006e8c: 2b 8e 00 2c lw r14,(sp+44)
8006e90: 2b 8f 00 28 lw r15,(sp+40)
8006e94: 2b 90 00 24 lw r16,(sp+36)
8006e98: 2b 91 00 20 lw r17,(sp+32)
8006e9c: 2b 92 00 1c lw r18,(sp+28)
8006ea0: 2b 93 00 18 lw r19,(sp+24)
8006ea4: 2b 94 00 14 lw r20,(sp+20)
8006ea8: 2b 95 00 10 lw r21,(sp+16)
8006eac: 2b 96 00 0c lw r22,(sp+12)
8006eb0: 2b 97 00 08 lw r23,(sp+8)
8006eb4: 37 9c 00 38 addi sp,sp,56
8006eb8: c3 a0 00 00 ret
0800f048 <_Thread_queue_Extract_priority_helper>:
void _Thread_queue_Extract_priority_helper(
Thread_queue_Control *the_thread_queue __attribute__((unused)),
Thread_Control *the_thread,
bool requeuing
)
{
800f048: 37 9c ff f8 addi sp,sp,-8
800f04c: 5b 8b 00 08 sw (sp+8),r11
800f050: 5b 9d 00 04 sw (sp+4),ra
800f054: b8 40 58 00 mv r11,r2
800f058: 20 63 00 ff andi r3,r3,0xff
Chain_Node *new_first_node;
Chain_Node *new_second_node;
Chain_Node *last_node;
the_node = (Chain_Node *) the_thread;
_ISR_Disable( level );
800f05c: 90 00 10 00 rcsr r2,IE
800f060: 34 01 ff fe mvi r1,-2
800f064: a0 41 08 00 and r1,r2,r1
800f068: d0 01 00 00 wcsr IE,r1
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
800f06c: 78 05 08 01 mvhi r5,0x801
800f070: 38 a5 81 3c ori r5,r5,0x813c
800f074: 29 64 00 10 lw r4,(r11+16)
800f078: 28 a1 00 00 lw r1,(r5+0)
800f07c: a0 81 08 00 and r1,r4,r1
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
800f080: 5c 20 00 03 bne r1,r0,800f08c <_Thread_queue_Extract_priority_helper+0x44>
_ISR_Enable( level );
800f084: d0 02 00 00 wcsr IE,r2
return;
800f088: e0 00 00 28 bi 800f128 <_Thread_queue_Extract_priority_helper+0xe0>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
800f08c: 29 61 00 38 lw r1,(r11+56)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
800f090: 35 66 00 3c addi r6,r11,60
/*
* The thread was actually waiting on a thread queue so let's remove it.
*/
next_node = the_node->next;
800f094: 29 64 00 00 lw r4,(r11+0)
previous_node = the_node->previous;
800f098: 29 65 00 04 lw r5,(r11+4)
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
800f09c: 44 26 00 0f be r1,r6,800f0d8 <_Thread_queue_Extract_priority_helper+0x90>
new_first_node = the_thread->Wait.Block2n.first;
new_first_thread = (Thread_Control *) new_first_node;
last_node = the_thread->Wait.Block2n.last;
800f0a0: 29 66 00 40 lw r6,(r11+64)
new_second_node = new_first_node->next;
800f0a4: 28 27 00 00 lw r7,(r1+0)
previous_node->next = new_first_node;
next_node->previous = new_first_node;
800f0a8: 58 81 00 04 sw (r4+4),r1
new_first_node = the_thread->Wait.Block2n.first;
new_first_thread = (Thread_Control *) new_first_node;
last_node = the_thread->Wait.Block2n.last;
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
800f0ac: 58 a1 00 00 sw (r5+0),r1
next_node->previous = new_first_node;
new_first_node->next = next_node;
800f0b0: 58 24 00 00 sw (r1+0),r4
new_first_node->previous = previous_node;
800f0b4: 58 25 00 04 sw (r1+4),r5
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
800f0b8: 44 26 00 0a be r1,r6,800f0e0 <_Thread_queue_Extract_priority_helper+0x98>
/* > two threads on 2-n */
new_second_node->previous =
_Chain_Head( &new_first_thread->Wait.Block2n );
800f0bc: 34 24 00 38 addi r4,r1,56
new_first_node->next = next_node;
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
/* > two threads on 2-n */
new_second_node->previous =
800f0c0: 58 e4 00 04 sw (r7+4),r4
_Chain_Head( &new_first_thread->Wait.Block2n );
new_first_thread->Wait.Block2n.first = new_second_node;
800f0c4: 58 27 00 38 sw (r1+56),r7
new_first_thread->Wait.Block2n.last = last_node;
800f0c8: 58 26 00 40 sw (r1+64),r6
800f0cc: 34 21 00 3c addi r1,r1,60
last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
800f0d0: 58 c1 00 00 sw (r6+0),r1
800f0d4: e0 00 00 03 bi 800f0e0 <_Thread_queue_Extract_priority_helper+0x98>
}
} else {
previous_node->next = next_node;
800f0d8: 58 a4 00 00 sw (r5+0),r4
next_node->previous = previous_node;
800f0dc: 58 85 00 04 sw (r4+4),r5
/*
* If we are not supposed to touch timers or the thread's state, return.
*/
if ( requeuing ) {
800f0e0: 44 60 00 03 be r3,r0,800f0ec <_Thread_queue_Extract_priority_helper+0xa4>
_ISR_Enable( level );
800f0e4: d0 02 00 00 wcsr IE,r2
return;
800f0e8: e0 00 00 10 bi 800f128 <_Thread_queue_Extract_priority_helper+0xe0>
}
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
800f0ec: 29 63 00 50 lw r3,(r11+80)
800f0f0: 34 01 00 02 mvi r1,2
800f0f4: 44 61 00 03 be r3,r1,800f100 <_Thread_queue_Extract_priority_helper+0xb8><== NEVER TAKEN
_ISR_Enable( level );
800f0f8: d0 02 00 00 wcsr IE,r2
800f0fc: e0 00 00 06 bi 800f114 <_Thread_queue_Extract_priority_helper+0xcc>
800f100: 34 01 00 03 mvi r1,3 <== NOT EXECUTED
800f104: 59 61 00 50 sw (r11+80),r1 <== NOT EXECUTED
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
800f108: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
(void) _Watchdog_Remove( &the_thread->Timer );
800f10c: 35 61 00 48 addi r1,r11,72 <== NOT EXECUTED
800f110: fb ff e2 79 calli 8007af4 <_Watchdog_Remove> <== NOT EXECUTED
800f114: 78 03 08 01 mvhi r3,0x801
800f118: 38 63 81 44 ori r3,r3,0x8144
800f11c: 28 62 00 00 lw r2,(r3+0)
800f120: b9 60 08 00 mv r1,r11
800f124: fb ff ff 17 calli 800ed80 <_Thread_Clear_state>
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
800f128: 2b 9d 00 04 lw ra,(sp+4)
800f12c: 2b 8b 00 08 lw r11,(sp+8)
800f130: 37 9c 00 08 addi sp,sp,8
800f134: c3 a0 00 00 ret
0800f178 <_Thread_queue_Process_timeout>:
#include <rtems/score/tqdata.h>
void _Thread_queue_Process_timeout(
Thread_Control *the_thread
)
{
800f178: 37 9c ff fc addi sp,sp,-4
800f17c: 5b 9d 00 04 sw (sp+4),ra
800f180: b8 20 10 00 mv r2,r1
Thread_queue_Control *the_thread_queue = the_thread->Wait.queue;
800f184: 28 21 00 44 lw r1,(r1+68)
* 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.
*/
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED &&
800f188: 28 24 00 30 lw r4,(r1+48)
800f18c: 44 80 00 0c be r4,r0,800f1bc <_Thread_queue_Process_timeout+0x44>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
800f190: 78 03 08 01 mvhi r3,0x801
800f194: 38 63 9d fc ori r3,r3,0x9dfc
800f198: 28 63 00 0c lw r3,(r3+12)
800f19c: 5c 43 00 08 bne r2,r3,800f1bc <_Thread_queue_Process_timeout+0x44>
_Thread_Is_executing( the_thread ) ) {
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
800f1a0: 34 03 00 03 mvi r3,3
800f1a4: 44 83 00 09 be r4,r3,800f1c8 <_Thread_queue_Process_timeout+0x50><== ALWAYS TAKEN
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
800f1a8: 28 23 00 3c lw r3,(r1+60) <== NOT EXECUTED
800f1ac: 58 43 00 34 sw (r2+52),r3 <== NOT EXECUTED
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
800f1b0: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
800f1b4: 58 22 00 30 sw (r1+48),r2 <== NOT EXECUTED
800f1b8: e0 00 00 04 bi 800f1c8 <_Thread_queue_Process_timeout+0x50><== NOT EXECUTED
}
} else {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
800f1bc: 28 23 00 3c lw r3,(r1+60)
800f1c0: 58 43 00 34 sw (r2+52),r3
_Thread_queue_Extract( the_thread->Wait.queue, the_thread );
800f1c4: f8 00 08 3d calli 80112b8 <_Thread_queue_Extract>
}
}
800f1c8: 2b 9d 00 04 lw ra,(sp+4)
800f1cc: 37 9c 00 04 addi sp,sp,4
800f1d0: c3 a0 00 00 ret
08006fd4 <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
8006fd4: 37 9c ff ec addi sp,sp,-20
8006fd8: 5b 8b 00 10 sw (sp+16),r11
8006fdc: 5b 8c 00 0c sw (sp+12),r12
8006fe0: 5b 8d 00 08 sw (sp+8),r13
8006fe4: 5b 9d 00 04 sw (sp+4),ra
8006fe8: b8 20 58 00 mv r11,r1
8006fec: b8 40 60 00 mv r12,r2
/*
* Just in case the thread really wasn't blocked on a thread queue
* when we get here.
*/
if ( !the_thread_queue )
8006ff0: 44 20 00 19 be r1,r0,8007054 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN
/*
* 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 ) {
8006ff4: 28 22 00 34 lw r2,(r1+52)
8006ff8: 34 01 00 01 mvi r1,1
8006ffc: 5c 41 00 16 bne r2,r1,8007054 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
8007000: 90 00 68 00 rcsr r13,IE
8007004: 34 01 ff fe mvi r1,-2
8007008: a1 a1 08 00 and r1,r13,r1
800700c: d0 01 00 00 wcsr IE,r1
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
8007010: 78 03 08 01 mvhi r3,0x801
8007014: 38 63 81 3c ori r3,r3,0x813c
8007018: 29 82 00 10 lw r2,(r12+16)
800701c: 28 61 00 00 lw r1,(r3+0)
8007020: a0 41 08 00 and r1,r2,r1
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
8007024: 44 20 00 0b be r1,r0,8007050 <_Thread_queue_Requeue+0x7c> <== NEVER TAKEN
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;
8007028: 34 01 00 01 mvi r1,1
800702c: 59 61 00 30 sw (r11+48),r1
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
8007030: b9 80 10 00 mv r2,r12
8007034: b9 60 08 00 mv r1,r11
8007038: 34 03 00 01 mvi r3,1
800703c: f8 00 20 03 calli 800f048 <_Thread_queue_Extract_priority_helper>
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
8007040: b9 60 08 00 mv r1,r11
8007044: b9 80 10 00 mv r2,r12
8007048: 37 83 00 14 addi r3,sp,20
800704c: fb ff ff 02 calli 8006c54 <_Thread_queue_Enqueue_priority>
}
_ISR_Enable( level );
8007050: d0 0d 00 00 wcsr IE,r13
}
}
8007054: 2b 9d 00 04 lw ra,(sp+4)
8007058: 2b 8b 00 10 lw r11,(sp+16)
800705c: 2b 8c 00 0c lw r12,(sp+12)
8007060: 2b 8d 00 08 lw r13,(sp+8)
8007064: 37 9c 00 14 addi sp,sp,20
8007068: c3 a0 00 00 ret
0800706c <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
800706c: 37 9c ff f8 addi sp,sp,-8
8007070: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
8007074: 37 82 00 08 addi r2,sp,8
8007078: fb ff fd 58 calli 80065d8 <_Thread_Get>
switch ( location ) {
800707c: 2b 82 00 08 lw r2,(sp+8)
8007080: 5c 40 00 07 bne r2,r0,800709c <_Thread_queue_Timeout+0x30> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
8007084: f8 00 20 3d calli 800f178 <_Thread_queue_Process_timeout>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
8007088: 78 01 08 01 mvhi r1,0x801
800708c: 38 21 99 24 ori r1,r1,0x9924
8007090: 28 22 00 00 lw r2,(r1+0)
8007094: 34 42 ff ff addi r2,r2,-1
8007098: 58 22 00 00 sw (r1+0),r2
_Thread_Unnest_dispatch();
break;
}
}
800709c: 2b 9d 00 04 lw ra,(sp+4)
80070a0: 37 9c 00 08 addi sp,sp,8
80070a4: c3 a0 00 00 ret
08014814 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
8014814: 37 9c ff a4 addi sp,sp,-92
8014818: 5b 8b 00 44 sw (sp+68),r11
801481c: 5b 8c 00 40 sw (sp+64),r12
8014820: 5b 8d 00 3c sw (sp+60),r13
8014824: 5b 8e 00 38 sw (sp+56),r14
8014828: 5b 8f 00 34 sw (sp+52),r15
801482c: 5b 90 00 30 sw (sp+48),r16
8014830: 5b 91 00 2c sw (sp+44),r17
8014834: 5b 92 00 28 sw (sp+40),r18
8014838: 5b 93 00 24 sw (sp+36),r19
801483c: 5b 94 00 20 sw (sp+32),r20
8014840: 5b 95 00 1c sw (sp+28),r21
8014844: 5b 96 00 18 sw (sp+24),r22
8014848: 5b 97 00 14 sw (sp+20),r23
801484c: 5b 98 00 10 sw (sp+16),r24
8014850: 5b 99 00 0c sw (sp+12),r25
8014854: 5b 9b 00 08 sw (sp+8),fp
8014858: 5b 9d 00 04 sw (sp+4),ra
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
801485c: 78 10 08 04 mvhi r16,0x804
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
8014860: b8 20 58 00 mv r11,r1
8014864: 37 8f 00 48 addi r15,sp,72
8014868: 37 81 00 54 addi r1,sp,84
801486c: 37 95 00 58 addi r21,sp,88
8014870: 37 91 00 4c addi r17,sp,76
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
8014874: 78 0e 08 04 mvhi r14,0x804
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
8014878: 5b 95 00 54 sw (sp+84),r21
the_chain->permanent_null = NULL;
801487c: 5b 80 00 58 sw (sp+88),r0
the_chain->last = _Chain_Head(the_chain);
8014880: 5b 81 00 5c sw (sp+92),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
8014884: 5b 91 00 48 sw (sp+72),r17
the_chain->permanent_null = NULL;
8014888: 5b 80 00 4c sw (sp+76),r0
the_chain->last = _Chain_Head(the_chain);
801488c: 5b 8f 00 50 sw (sp+80),r15
{
/*
* 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;
8014890: b8 20 d8 00 mv fp,r1
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
8014894: 3a 10 0d dc ori r16,r16,0xddc
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
8014898: 35 74 00 30 addi r20,r11,48
_Chain_Initialize_empty( &insert_chain );
_Chain_Initialize_empty( &fire_chain );
while ( true ) {
_Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain );
801489c: b9 e0 98 00 mv r19,r15
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
80148a0: 39 ce 0d 2c ori r14,r14,0xd2c
/*
* 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 );
80148a4: 35 6d 00 68 addi r13,r11,104
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
80148a8: 34 19 00 03 mvi r25,3
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
80148ac: 34 12 ff fe mvi r18,-2
_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;
80148b0: 34 18 00 01 mvi r24,1
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
80148b4: 35 77 00 08 addi r23,r11,8
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
80148b8: 35 76 00 40 addi r22,r11,64
{
/*
* 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;
80148bc: 59 7b 00 78 sw (r11+120),fp
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
80148c0: 2a 02 00 00 lw r2,(r16+0)
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
80148c4: 29 63 00 3c lw r3,(r11+60)
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
80148c8: ba 80 08 00 mv r1,r20
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
80148cc: 59 62 00 3c sw (r11+60),r2
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
80148d0: c8 43 10 00 sub r2,r2,r3
80148d4: ba 60 18 00 mv r3,r19
80148d8: f8 00 15 cf calli 801a014 <_Watchdog_Adjust_to_chain>
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
80148dc: 29 64 00 74 lw r4,(r11+116)
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
80148e0: 29 cc 00 00 lw r12,(r14+0)
/*
* 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 ) {
80148e4: 50 8c 00 06 bgeu r4,r12,80148fc <_Timer_server_Body+0xe8>
/*
* 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 );
80148e8: b9 a0 08 00 mv r1,r13
80148ec: c9 84 10 00 sub r2,r12,r4
80148f0: ba 60 18 00 mv r3,r19
80148f4: f8 00 15 c8 calli 801a014 <_Watchdog_Adjust_to_chain>
80148f8: e0 00 00 06 bi 8014910 <_Timer_server_Body+0xfc>
} else if ( snapshot < last_snapshot ) {
80148fc: 51 84 00 05 bgeu r12,r4,8014910 <_Timer_server_Body+0xfc>
/*
* 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 );
8014900: b9 a0 08 00 mv r1,r13
8014904: 34 02 00 01 mvi r2,1
8014908: c8 8c 18 00 sub r3,r4,r12
801490c: f8 00 15 8b calli 8019f38 <_Watchdog_Adjust>
}
watchdogs->last_snapshot = snapshot;
8014910: 59 6c 00 74 sw (r11+116),r12
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8014914: 34 0c 00 01 mvi r12,1
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
8014918: 29 62 00 78 lw r2,(r11+120)
801491c: b8 40 08 00 mv r1,r2
8014920: f8 00 03 80 calli 8015720 <_Chain_Get>
8014924: b8 20 10 00 mv r2,r1
if ( timer == NULL ) {
8014928: 44 20 00 09 be r1,r0,801494c <_Timer_server_Body+0x138>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
801492c: 28 23 00 38 lw r3,(r1+56)
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
8014930: ba 80 08 00 mv r1,r20
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8014934: 44 6c 00 03 be r3,r12,8014940 <_Timer_server_Body+0x12c>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
8014938: 5c 79 ff f8 bne r3,r25,8014918 <_Timer_server_Body+0x104> <== NEVER TAKEN
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
801493c: b9 a0 08 00 mv r1,r13
8014940: 34 42 00 10 addi r2,r2,16
8014944: f8 00 15 d9 calli 801a0a8 <_Watchdog_Insert>
8014948: e3 ff ff f4 bi 8014918 <_Timer_server_Body+0x104>
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
801494c: 90 00 10 00 rcsr r2,IE
8014950: a0 52 08 00 and r1,r2,r18
8014954: d0 01 00 00 wcsr IE,r1
if ( _Chain_Is_empty( insert_chain ) ) {
8014958: 2b 81 00 54 lw r1,(sp+84)
801495c: 5c 35 00 06 bne r1,r21,8014974 <_Timer_server_Body+0x160> <== NEVER TAKEN
ts->insert_chain = NULL;
8014960: 59 60 00 78 sw (r11+120),r0
_ISR_Enable( level );
8014964: d0 02 00 00 wcsr IE,r2
_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 ) ) {
8014968: 2b 81 00 48 lw r1,(sp+72)
801496c: 5c 31 00 04 bne r1,r17,801497c <_Timer_server_Body+0x168>
8014970: e0 00 00 15 bi 80149c4 <_Timer_server_Body+0x1b0>
ts->insert_chain = NULL;
_ISR_Enable( level );
break;
} else {
_ISR_Enable( level );
8014974: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
8014978: e3 ff ff d2 bi 80148c0 <_Timer_server_Body+0xac> <== 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 );
801497c: 90 00 20 00 rcsr r4,IE
8014980: a0 92 08 00 and r1,r4,r18
8014984: d0 01 00 00 wcsr IE,r1
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
8014988: 2b 82 00 48 lw r2,(sp+72)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
801498c: 44 51 00 0c be r2,r17,80149bc <_Timer_server_Body+0x1a8>
{
Chain_Node *return_node;
Chain_Node *new_first;
return_node = the_chain->first;
new_first = return_node->next;
8014990: 28 41 00 00 lw r1,(r2+0)
the_chain->first = new_first;
8014994: 5b 81 00 48 sw (sp+72),r1
new_first->previous = _Chain_Head(the_chain);
8014998: 58 2f 00 04 sw (r1+4),r15
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
801499c: 44 40 00 08 be r2,r0,80149bc <_Timer_server_Body+0x1a8> <== NEVER TAKEN
watchdog->state = WATCHDOG_INACTIVE;
80149a0: 58 40 00 08 sw (r2+8),r0
_ISR_Enable( level );
80149a4: d0 04 00 00 wcsr IE,r4
/*
* 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 );
80149a8: 28 43 00 1c lw r3,(r2+28)
80149ac: 28 41 00 20 lw r1,(r2+32)
80149b0: 28 42 00 24 lw r2,(r2+36)
80149b4: d8 60 00 00 call r3
}
80149b8: e3 ff ff f1 bi 801497c <_Timer_server_Body+0x168>
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
_ISR_Enable( level );
} else {
_ISR_Enable( level );
80149bc: d0 04 00 00 wcsr IE,r4
80149c0: e3 ff ff bf bi 80148bc <_Timer_server_Body+0xa8>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
80149c4: 31 60 00 7c sb (r11+124),r0
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
80149c8: fb ff ff 53 calli 8014714 <_Thread_Disable_dispatch>
_Thread_Set_state( ts->thread, STATES_DELAYING );
80149cc: 29 61 00 00 lw r1,(r11+0)
80149d0: 34 02 00 08 mvi r2,8
80149d4: f8 00 12 3f calli 80192d0 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
80149d8: b9 60 08 00 mv r1,r11
80149dc: fb ff ff 54 calli 801472c <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
80149e0: b9 60 08 00 mv r1,r11
80149e4: fb ff ff 6f calli 80147a0 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
80149e8: f8 00 0e e3 calli 8018574 <_Thread_Enable_dispatch>
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
80149ec: ba e0 08 00 mv r1,r23
_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;
80149f0: 31 78 00 7c sb (r11+124),r24
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
80149f4: f8 00 16 0a calli 801a21c <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
80149f8: ba c0 08 00 mv r1,r22
80149fc: f8 00 16 08 calli 801a21c <_Watchdog_Remove>
8014a00: e3 ff ff af bi 80148bc <_Timer_server_Body+0xa8>
08014a04 <_Timer_server_Schedule_operation_method>:
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
8014a04: 37 9c ff f4 addi sp,sp,-12
8014a08: 5b 8b 00 0c sw (sp+12),r11
8014a0c: 5b 8c 00 08 sw (sp+8),r12
8014a10: 5b 9d 00 04 sw (sp+4),ra
8014a14: b8 20 58 00 mv r11,r1
if ( ts->insert_chain == NULL ) {
8014a18: 28 21 00 78 lw r1,(r1+120)
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
8014a1c: b8 40 60 00 mv r12,r2
if ( ts->insert_chain == NULL ) {
8014a20: 5c 20 00 43 bne r1,r0,8014b2c <_Timer_server_Schedule_operation_method+0x128>
* is the reference point for the delta chain. Thus if we do not update the
* reference point we have to add DT to the initial delta of the watchdog
* being inserted. This could result in an integer overflow.
*/
_Thread_Disable_dispatch();
8014a24: fb ff ff 3c calli 8014714 <_Thread_Disable_dispatch>
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8014a28: 29 81 00 38 lw r1,(r12+56)
8014a2c: 34 02 00 01 mvi r2,1
8014a30: 5c 22 00 1d bne r1,r2,8014aa4 <_Timer_server_Schedule_operation_method+0xa0>
/*
* We have to advance the last known ticks value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
8014a34: 90 00 10 00 rcsr r2,IE
8014a38: 34 01 ff fe mvi r1,-2
8014a3c: a0 41 08 00 and r1,r2,r1
8014a40: d0 01 00 00 wcsr IE,r1
snapshot = _Watchdog_Ticks_since_boot;
8014a44: 78 01 08 04 mvhi r1,0x804
8014a48: 38 21 0d dc ori r1,r1,0xddc
8014a4c: 28 23 00 00 lw r3,(r1+0)
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
8014a50: 29 61 00 30 lw r1,(r11+48)
last_snapshot = ts->Interval_watchdogs.last_snapshot;
8014a54: 29 65 00 3c lw r5,(r11+60)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
8014a58: 35 64 00 34 addi r4,r11,52
if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) {
8014a5c: 44 24 00 07 be r1,r4,8014a78 <_Timer_server_Schedule_operation_method+0x74>
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
8014a60: 28 26 00 10 lw r6,(r1+16)
first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain );
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
8014a64: c8 65 28 00 sub r5,r3,r5
delta_interval = first_watchdog->delta_interval;
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
8014a68: 34 04 00 00 mvi r4,0
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
if (delta_interval > delta) {
8014a6c: 50 a6 00 02 bgeu r5,r6,8014a74 <_Timer_server_Schedule_operation_method+0x70>
delta_interval -= delta;
8014a70: c8 c5 20 00 sub r4,r6,r5
} else {
delta_interval = 0;
}
first_watchdog->delta_interval = delta_interval;
8014a74: 58 24 00 10 sw (r1+16),r4
}
ts->Interval_watchdogs.last_snapshot = snapshot;
8014a78: 59 63 00 3c sw (r11+60),r3
_ISR_Enable( level );
8014a7c: d0 02 00 00 wcsr IE,r2
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
8014a80: 35 61 00 30 addi r1,r11,48
8014a84: 35 82 00 10 addi r2,r12,16
8014a88: f8 00 15 88 calli 801a0a8 <_Watchdog_Insert>
if ( !ts->active ) {
8014a8c: 41 61 00 7c lbu r1,(r11+124)
8014a90: 20 21 00 ff andi r1,r1,0xff
8014a94: 5c 20 00 24 bne r1,r0,8014b24 <_Timer_server_Schedule_operation_method+0x120>
_Timer_server_Reset_interval_system_watchdog( ts );
8014a98: b9 60 08 00 mv r1,r11
8014a9c: fb ff ff 24 calli 801472c <_Timer_server_Reset_interval_system_watchdog>
8014aa0: e0 00 00 21 bi 8014b24 <_Timer_server_Schedule_operation_method+0x120>
}
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
8014aa4: 34 02 00 03 mvi r2,3
8014aa8: 5c 22 00 1f bne r1,r2,8014b24 <_Timer_server_Schedule_operation_method+0x120>
/*
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
8014aac: 90 00 30 00 rcsr r6,IE
8014ab0: 34 01 ff fe mvi r1,-2
8014ab4: a0 c1 08 00 and r1,r6,r1
8014ab8: d0 01 00 00 wcsr IE,r1
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
8014abc: 29 62 00 68 lw r2,(r11+104)
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
8014ac0: 78 01 08 04 mvhi r1,0x804
last_snapshot = ts->TOD_watchdogs.last_snapshot;
8014ac4: 29 65 00 74 lw r5,(r11+116)
/*
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
8014ac8: 38 21 0d 2c ori r1,r1,0xd2c
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
8014acc: 35 63 00 6c addi r3,r11,108
8014ad0: 28 21 00 00 lw r1,(r1+0)
last_snapshot = ts->TOD_watchdogs.last_snapshot;
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
8014ad4: 44 43 00 0a be r2,r3,8014afc <_Timer_server_Schedule_operation_method+0xf8>
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
8014ad8: 28 44 00 10 lw r4,(r2+16)
}
} else {
/*
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
8014adc: b4 85 18 00 add r3,r4,r5
delta_interval += delta;
8014ae0: c8 61 18 00 sub r3,r3,r1
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
last_snapshot = ts->TOD_watchdogs.last_snapshot;
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
if ( snapshot > last_snapshot ) {
8014ae4: 50 a1 00 05 bgeu r5,r1,8014af8 <_Timer_server_Schedule_operation_method+0xf4>
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
8014ae8: c8 25 28 00 sub r5,r1,r5
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
8014aec: 34 03 00 00 mvi r3,0
if ( snapshot > last_snapshot ) {
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
if (delta_interval > delta) {
8014af0: 50 a4 00 02 bgeu r5,r4,8014af8 <_Timer_server_Schedule_operation_method+0xf4><== NEVER TAKEN
delta_interval -= delta;
8014af4: c8 85 18 00 sub r3,r4,r5
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
delta_interval += delta;
}
first_watchdog->delta_interval = delta_interval;
8014af8: 58 43 00 10 sw (r2+16),r3
}
ts->TOD_watchdogs.last_snapshot = snapshot;
8014afc: 59 61 00 74 sw (r11+116),r1
_ISR_Enable( level );
8014b00: d0 06 00 00 wcsr IE,r6
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
8014b04: 35 61 00 68 addi r1,r11,104
8014b08: 35 82 00 10 addi r2,r12,16
8014b0c: f8 00 15 67 calli 801a0a8 <_Watchdog_Insert>
if ( !ts->active ) {
8014b10: 41 61 00 7c lbu r1,(r11+124)
8014b14: 20 21 00 ff andi r1,r1,0xff
8014b18: 5c 20 00 03 bne r1,r0,8014b24 <_Timer_server_Schedule_operation_method+0x120>
_Timer_server_Reset_tod_system_watchdog( ts );
8014b1c: b9 60 08 00 mv r1,r11
8014b20: fb ff ff 20 calli 80147a0 <_Timer_server_Reset_tod_system_watchdog>
}
}
_Thread_Enable_dispatch();
8014b24: f8 00 0e 94 calli 8018574 <_Thread_Enable_dispatch>
8014b28: e0 00 00 03 bi 8014b34 <_Timer_server_Schedule_operation_method+0x130>
* server is not preemptible, so we must be in interrupt context here. No
* thread dispatch will happen until the timer server finishes its
* critical section. We have to use the protected chain methods because
* we may be interrupted by a higher priority interrupt.
*/
_Chain_Append( ts->insert_chain, &timer->Object.Node );
8014b2c: 29 61 00 78 lw r1,(r11+120)
8014b30: f8 00 02 e6 calli 80156c8 <_Chain_Append>
}
}
8014b34: 2b 9d 00 04 lw ra,(sp+4)
8014b38: 2b 8b 00 0c lw r11,(sp+12)
8014b3c: 2b 8c 00 08 lw r12,(sp+8)
8014b40: 37 9c 00 0c addi sp,sp,12
8014b44: c3 a0 00 00 ret
080075e0 <_User_extensions_Handler_initialization>:
#include <rtems/score/userext.h>
#include <rtems/score/wkspace.h>
#include <string.h>
void _User_extensions_Handler_initialization(void)
{
80075e0: 37 9c ff ec addi sp,sp,-20
80075e4: 5b 8b 00 14 sw (sp+20),r11
80075e8: 5b 8c 00 10 sw (sp+16),r12
80075ec: 5b 8d 00 0c sw (sp+12),r13
80075f0: 5b 8e 00 08 sw (sp+8),r14
80075f4: 5b 9d 00 04 sw (sp+4),ra
User_extensions_Control *extension;
uint32_t i;
uint32_t number_of_extensions;
User_extensions_Table *initial_extensions;
number_of_extensions = Configuration.number_of_initial_extensions;
80075f8: 78 02 08 01 mvhi r2,0x801
80075fc: 38 42 90 ac ori r2,r2,0x90ac
8007600: 28 4e 00 38 lw r14,(r2+56)
initial_extensions = Configuration.User_extension_table;
8007604: 28 4b 00 3c lw r11,(r2+60)
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
8007608: 78 03 08 01 mvhi r3,0x801
800760c: 78 02 08 01 mvhi r2,0x801
8007610: 38 42 9a ac ori r2,r2,0x9aac
8007614: 38 63 9a b0 ori r3,r3,0x9ab0
8007618: 58 43 00 00 sw (r2+0),r3
the_chain->permanent_null = NULL;
800761c: 58 40 00 04 sw (r2+4),r0
the_chain->last = _Chain_Head(the_chain);
8007620: 58 42 00 08 sw (r2+8),r2
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
8007624: 78 03 08 01 mvhi r3,0x801
8007628: 78 02 08 01 mvhi r2,0x801
800762c: 38 42 99 28 ori r2,r2,0x9928
8007630: 38 63 99 2c ori r3,r3,0x992c
8007634: 58 43 00 00 sw (r2+0),r3
the_chain->permanent_null = NULL;
8007638: 58 40 00 04 sw (r2+4),r0
the_chain->last = _Chain_Head(the_chain);
800763c: 58 42 00 08 sw (r2+8),r2
_Chain_Initialize_empty( &_User_extensions_List );
_Chain_Initialize_empty( &_User_extensions_Switches_list );
if ( initial_extensions ) {
8007640: 45 60 00 22 be r11,r0,80076c8 <_User_extensions_Handler_initialization+0xe8><== NEVER TAKEN
extension = (User_extensions_Control *)
_Workspace_Allocate_or_fatal_error(
number_of_extensions * sizeof( User_extensions_Control )
8007644: 34 02 00 34 mvi r2,52
8007648: b9 c0 08 00 mv r1,r14
800764c: f8 00 3e 96 calli 80170a4 <__mulsi3>
8007650: b8 20 68 00 mv r13,r1
_Chain_Initialize_empty( &_User_extensions_List );
_Chain_Initialize_empty( &_User_extensions_Switches_list );
if ( initial_extensions ) {
extension = (User_extensions_Control *)
_Workspace_Allocate_or_fatal_error(
8007654: f8 00 01 82 calli 8007c5c <_Workspace_Allocate_or_fatal_error>
number_of_extensions * sizeof( User_extensions_Control )
);
memset (
8007658: b9 a0 18 00 mv r3,r13
800765c: 34 02 00 00 mvi r2,0
_Chain_Initialize_empty( &_User_extensions_List );
_Chain_Initialize_empty( &_User_extensions_Switches_list );
if ( initial_extensions ) {
extension = (User_extensions_Control *)
_Workspace_Allocate_or_fatal_error(
8007660: b8 20 60 00 mv r12,r1
extension,
0,
number_of_extensions * sizeof( User_extensions_Control )
);
for ( i = 0 ; i < number_of_extensions ; i++ ) {
8007664: 34 0d 00 00 mvi r13,0
extension = (User_extensions_Control *)
_Workspace_Allocate_or_fatal_error(
number_of_extensions * sizeof( User_extensions_Control )
);
memset (
8007668: f8 00 2a 9b calli 80120d4 <memset>
extension,
0,
number_of_extensions * sizeof( User_extensions_Control )
);
for ( i = 0 ; i < number_of_extensions ; i++ ) {
800766c: e0 00 00 16 bi 80076c4 <_User_extensions_Handler_initialization+0xe4>
RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table(
User_extensions_Control *extension,
const User_extensions_Table *extension_table
)
{
extension->Callouts = *extension_table;
8007670: 29 61 00 1c lw r1,(r11+28)
8007674: 29 68 00 00 lw r8,(r11+0)
8007678: 29 67 00 04 lw r7,(r11+4)
800767c: 29 66 00 08 lw r6,(r11+8)
8007680: 29 65 00 0c lw r5,(r11+12)
8007684: 29 64 00 10 lw r4,(r11+16)
8007688: 29 63 00 14 lw r3,(r11+20)
800768c: 29 62 00 18 lw r2,(r11+24)
8007690: 59 81 00 30 sw (r12+48),r1
8007694: 59 88 00 14 sw (r12+20),r8
8007698: 59 87 00 18 sw (r12+24),r7
800769c: 59 86 00 1c sw (r12+28),r6
80076a0: 59 85 00 20 sw (r12+32),r5
80076a4: 59 84 00 24 sw (r12+36),r4
80076a8: 59 83 00 28 sw (r12+40),r3
80076ac: 59 82 00 2c sw (r12+44),r2
_User_extensions_Add_set( extension );
80076b0: b9 80 08 00 mv r1,r12
80076b4: f8 00 1f 4a calli 800f3dc <_User_extensions_Add_set>
_User_extensions_Add_set_with_table (extension, &initial_extensions[i]);
extension++;
80076b8: 35 8c 00 34 addi r12,r12,52
extension,
0,
number_of_extensions * sizeof( User_extensions_Control )
);
for ( i = 0 ; i < number_of_extensions ; i++ ) {
80076bc: 35 ad 00 01 addi r13,r13,1
80076c0: 35 6b 00 20 addi r11,r11,32
80076c4: 55 cd ff eb bgu r14,r13,8007670 <_User_extensions_Handler_initialization+0x90>
_User_extensions_Add_set_with_table (extension, &initial_extensions[i]);
extension++;
}
}
}
80076c8: 2b 9d 00 04 lw ra,(sp+4)
80076cc: 2b 8b 00 14 lw r11,(sp+20)
80076d0: 2b 8c 00 10 lw r12,(sp+16)
80076d4: 2b 8d 00 0c lw r13,(sp+12)
80076d8: 2b 8e 00 08 lw r14,(sp+8)
80076dc: 37 9c 00 14 addi sp,sp,20
80076e0: c3 a0 00 00 ret
08008a20 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
8008a20: 37 9c ff e4 addi sp,sp,-28
8008a24: 5b 8b 00 1c sw (sp+28),r11
8008a28: 5b 8c 00 18 sw (sp+24),r12
8008a2c: 5b 8d 00 14 sw (sp+20),r13
8008a30: 5b 8e 00 10 sw (sp+16),r14
8008a34: 5b 8f 00 0c sw (sp+12),r15
8008a38: 5b 90 00 08 sw (sp+8),r16
8008a3c: 5b 9d 00 04 sw (sp+4),ra
8008a40: b8 20 60 00 mv r12,r1
8008a44: b8 60 58 00 mv r11,r3
ISR_Level level;
_ISR_Disable( level );
8008a48: 90 00 08 00 rcsr r1,IE
8008a4c: 34 03 ff fe mvi r3,-2
8008a50: a0 23 18 00 and r3,r1,r3
8008a54: d0 03 00 00 wcsr IE,r3
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
8008a58: 29 83 00 00 lw r3,(r12+0)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
8008a5c: 35 8e 00 04 addi r14,r12,4
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
8008a60: 44 6e 00 1d be r3,r14,8008ad4 <_Watchdog_Adjust+0xb4>
switch ( direction ) {
8008a64: 44 40 00 04 be r2,r0,8008a74 <_Watchdog_Adjust+0x54>
8008a68: 34 04 00 01 mvi r4,1
8008a6c: 5c 44 00 1a bne r2,r4,8008ad4 <_Watchdog_Adjust+0xb4> <== NEVER TAKEN
8008a70: e0 00 00 04 bi 8008a80 <_Watchdog_Adjust+0x60>
if ( units < _Watchdog_First( header )->delta_interval ) {
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
8008a74: 34 10 00 01 mvi r16,1
_ISR_Enable( level );
_Watchdog_Tickle( header );
_ISR_Disable( level );
8008a78: 34 0f ff fe mvi r15,-2
8008a7c: e0 00 00 15 bi 8008ad0 <_Watchdog_Adjust+0xb0>
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
8008a80: 28 62 00 10 lw r2,(r3+16)
8008a84: b4 4b 58 00 add r11,r2,r11
8008a88: 58 6b 00 10 sw (r3+16),r11
break;
8008a8c: e0 00 00 12 bi 8008ad4 <_Watchdog_Adjust+0xb4>
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) header->first );
8008a90: 29 82 00 00 lw r2,(r12+0)
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
8008a94: 28 4d 00 10 lw r13,(r2+16)
8008a98: 51 6d 00 04 bgeu r11,r13,8008aa8 <_Watchdog_Adjust+0x88>
_Watchdog_First( header )->delta_interval -= units;
8008a9c: c9 ab 58 00 sub r11,r13,r11
8008aa0: 58 4b 00 10 sw (r2+16),r11
break;
8008aa4: e0 00 00 0c bi 8008ad4 <_Watchdog_Adjust+0xb4>
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
8008aa8: 58 50 00 10 sw (r2+16),r16
_ISR_Enable( level );
8008aac: d0 01 00 00 wcsr IE,r1
_Watchdog_Tickle( header );
8008ab0: b9 80 08 00 mv r1,r12
8008ab4: f8 00 00 98 calli 8008d14 <_Watchdog_Tickle>
_ISR_Disable( level );
8008ab8: 90 00 08 00 rcsr r1,IE
8008abc: a0 2f 10 00 and r2,r1,r15
8008ac0: d0 02 00 00 wcsr IE,r2
if ( _Chain_Is_empty( header ) )
8008ac4: 29 82 00 00 lw r2,(r12+0)
8008ac8: 44 4e 00 03 be r2,r14,8008ad4 <_Watchdog_Adjust+0xb4>
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
8008acc: c9 6d 58 00 sub r11,r11,r13
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
8008ad0: 5d 60 ff f0 bne r11,r0,8008a90 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN
}
break;
}
}
_ISR_Enable( level );
8008ad4: d0 01 00 00 wcsr IE,r1
}
8008ad8: 2b 9d 00 04 lw ra,(sp+4)
8008adc: 2b 8b 00 1c lw r11,(sp+28)
8008ae0: 2b 8c 00 18 lw r12,(sp+24)
8008ae4: 2b 8d 00 14 lw r13,(sp+20)
8008ae8: 2b 8e 00 10 lw r14,(sp+16)
8008aec: 2b 8f 00 0c lw r15,(sp+12)
8008af0: 2b 90 00 08 lw r16,(sp+8)
8008af4: 37 9c 00 1c addi sp,sp,28
8008af8: c3 a0 00 00 ret
08007af4 <_Watchdog_Remove>:
{
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
8007af4: 90 00 28 00 rcsr r5,IE
8007af8: 34 02 ff fe mvi r2,-2
8007afc: a0 a2 10 00 and r2,r5,r2
8007b00: d0 02 00 00 wcsr IE,r2
previous_state = the_watchdog->state;
8007b04: 28 23 00 08 lw r3,(r1+8)
switch ( previous_state ) {
8007b08: 34 02 00 01 mvi r2,1
8007b0c: 44 62 00 05 be r3,r2,8007b20 <_Watchdog_Remove+0x2c>
8007b10: 44 60 00 1b be r3,r0,8007b7c <_Watchdog_Remove+0x88>
8007b14: 34 02 00 03 mvi r2,3
8007b18: 54 62 00 19 bgu r3,r2,8007b7c <_Watchdog_Remove+0x88> <== NEVER TAKEN
8007b1c: e0 00 00 03 bi 8007b28 <_Watchdog_Remove+0x34>
/*
* It is not actually on the chain so just change the state and
* the Insert operation we interrupted will be aborted.
*/
the_watchdog->state = WATCHDOG_INACTIVE;
8007b20: 58 20 00 08 sw (r1+8),r0
break;
8007b24: e0 00 00 16 bi 8007b7c <_Watchdog_Remove+0x88>
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
_ISR_Enable( level );
return( previous_state );
}
8007b28: 28 22 00 00 lw r2,(r1+0)
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
8007b2c: 58 20 00 08 sw (r1+8),r0
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
8007b30: 28 44 00 00 lw r4,(r2+0)
8007b34: 44 80 00 05 be r4,r0,8007b48 <_Watchdog_Remove+0x54>
next_watchdog->delta_interval += the_watchdog->delta_interval;
8007b38: 28 46 00 10 lw r6,(r2+16)
8007b3c: 28 24 00 10 lw r4,(r1+16)
8007b40: b4 c4 20 00 add r4,r6,r4
8007b44: 58 44 00 10 sw (r2+16),r4
if ( _Watchdog_Sync_count )
8007b48: 78 04 08 01 mvhi r4,0x801
8007b4c: 38 84 9a 58 ori r4,r4,0x9a58
8007b50: 28 84 00 00 lw r4,(r4+0)
8007b54: 44 80 00 07 be r4,r0,8007b70 <_Watchdog_Remove+0x7c>
_Watchdog_Sync_level = _ISR_Nest_level;
8007b58: 78 04 08 01 mvhi r4,0x801
8007b5c: 38 84 9d fc ori r4,r4,0x9dfc
8007b60: 28 86 00 08 lw r6,(r4+8)
8007b64: 78 04 08 01 mvhi r4,0x801
8007b68: 38 84 99 cc ori r4,r4,0x99cc
8007b6c: 58 86 00 00 sw (r4+0),r6
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
8007b70: 28 24 00 04 lw r4,(r1+4)
next->previous = previous;
8007b74: 58 44 00 04 sw (r2+4),r4
previous->next = next;
8007b78: 58 82 00 00 sw (r4+0),r2
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
8007b7c: 78 02 08 01 mvhi r2,0x801
8007b80: 38 42 9a 5c ori r2,r2,0x9a5c
8007b84: 28 42 00 00 lw r2,(r2+0)
8007b88: 58 22 00 18 sw (r1+24),r2
_ISR_Enable( level );
8007b8c: d0 05 00 00 wcsr IE,r5
return( previous_state );
}
8007b90: b8 60 08 00 mv r1,r3
8007b94: c3 a0 00 00 ret
0800861c <_Watchdog_Report_chain>:
void _Watchdog_Report_chain(
const char *name,
Chain_Control *header
)
{
800861c: 37 9c ff ec addi sp,sp,-20
8008620: 5b 8b 00 14 sw (sp+20),r11
8008624: 5b 8c 00 10 sw (sp+16),r12
8008628: 5b 8d 00 0c sw (sp+12),r13
800862c: 5b 8e 00 08 sw (sp+8),r14
8008630: 5b 9d 00 04 sw (sp+4),ra
8008634: b8 20 70 00 mv r14,r1
8008638: b8 40 60 00 mv r12,r2
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
800863c: 90 00 68 00 rcsr r13,IE
8008640: 34 01 ff fe mvi r1,-2
8008644: a1 a1 08 00 and r1,r13,r1
8008648: d0 01 00 00 wcsr IE,r1
printk( "Watchdog Chain: %s %p\n", name, header );
800864c: 78 01 08 01 mvhi r1,0x801
8008650: b9 80 18 00 mv r3,r12
8008654: 38 21 ea 6c ori r1,r1,0xea6c
8008658: b9 c0 10 00 mv r2,r14
800865c: fb ff eb 7b calli 8003448 <printk>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
8008660: 29 8b 00 00 lw r11,(r12+0)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
8008664: 35 8c 00 04 addi r12,r12,4
if ( !_Chain_Is_empty( header ) ) {
8008668: 45 6c 00 0b be r11,r12,8008694 <_Watchdog_Report_chain+0x78>
node != _Chain_Tail(header) ;
node = node->next )
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
800866c: b9 60 10 00 mv r2,r11
8008670: 34 01 00 00 mvi r1,0
8008674: f8 00 00 13 calli 80086c0 <_Watchdog_Report>
_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 )
8008678: 29 6b 00 00 lw r11,(r11+0)
Chain_Node *node;
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = header->first ;
800867c: 5d 6c ff fc bne r11,r12,800866c <_Watchdog_Report_chain+0x50><== NEVER TAKEN
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
8008680: 78 01 08 01 mvhi r1,0x801
8008684: 38 21 ea 84 ori r1,r1,0xea84
8008688: b9 c0 10 00 mv r2,r14
800868c: fb ff eb 6f calli 8003448 <printk>
8008690: e0 00 00 04 bi 80086a0 <_Watchdog_Report_chain+0x84>
} else {
printk( "Chain is empty\n" );
8008694: 78 01 08 01 mvhi r1,0x801
8008698: 38 21 ea 94 ori r1,r1,0xea94
800869c: fb ff eb 6b calli 8003448 <printk>
}
_ISR_Enable( level );
80086a0: d0 0d 00 00 wcsr IE,r13
}
80086a4: 2b 9d 00 04 lw ra,(sp+4)
80086a8: 2b 8b 00 14 lw r11,(sp+20)
80086ac: 2b 8c 00 10 lw r12,(sp+16)
80086b0: 2b 8d 00 0c lw r13,(sp+12)
80086b4: 2b 8e 00 08 lw r14,(sp+8)
80086b8: 37 9c 00 14 addi sp,sp,20
80086bc: c3 a0 00 00 ret
0800c630 <_Watchdog_Tickle>:
*/
void _Watchdog_Tickle(
Chain_Control *header
)
{
800c630: 37 9c ff e4 addi sp,sp,-28
800c634: 5b 8b 00 1c sw (sp+28),r11
800c638: 5b 8c 00 18 sw (sp+24),r12
800c63c: 5b 8d 00 14 sw (sp+20),r13
800c640: 5b 8e 00 10 sw (sp+16),r14
800c644: 5b 8f 00 0c sw (sp+12),r15
800c648: 5b 90 00 08 sw (sp+8),r16
800c64c: 5b 9d 00 04 sw (sp+4),ra
800c650: b8 20 60 00 mv r12,r1
* See the comment in watchdoginsert.c and watchdogadjust.c
* about why it's safe not to declare header a pointer to
* volatile data - till, 2003/7
*/
_ISR_Disable( level );
800c654: 90 00 18 00 rcsr r3,IE
800c658: 34 01 ff fe mvi r1,-2
800c65c: a0 61 08 00 and r1,r3,r1
800c660: d0 01 00 00 wcsr IE,r1
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
800c664: 29 8b 00 00 lw r11,(r12+0)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
800c668: 35 8e 00 04 addi r14,r12,4
800c66c: b8 60 10 00 mv r2,r3
if ( _Chain_Is_empty( header ) )
800c670: 45 6e 00 1a be r11,r14,800c6d8 <_Watchdog_Tickle+0xa8>
* to be inserted has already had its delta_interval adjusted to 0, and
* so is added to the head of the chain with a delta_interval of 0.
*
* Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc)
*/
if (the_watchdog->delta_interval != 0) {
800c674: 29 61 00 10 lw r1,(r11+16)
800c678: 44 20 00 04 be r1,r0,800c688 <_Watchdog_Tickle+0x58>
the_watchdog->delta_interval--;
800c67c: 34 21 ff ff addi r1,r1,-1
800c680: 59 61 00 10 sw (r11+16),r1
if ( the_watchdog->delta_interval != 0 )
800c684: 5c 20 00 15 bne r1,r0,800c6d8 <_Watchdog_Tickle+0xa8>
*/
void _Watchdog_Tickle(
Chain_Control *header
)
{
800c688: b8 60 68 00 mv r13,r3
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
_ISR_Enable( level );
switch( watchdog_state ) {
800c68c: 34 10 00 02 mvi r16,2
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
800c690: 34 0f ff fe mvi r15,-2
800c694: e0 00 00 02 bi 800c69c <_Watchdog_Tickle+0x6c>
800c698: b8 40 68 00 mv r13,r2
if ( the_watchdog->delta_interval != 0 )
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
800c69c: b9 60 08 00 mv r1,r11
800c6a0: fb ff ff bb calli 800c58c <_Watchdog_Remove>
_ISR_Enable( level );
800c6a4: d0 0d 00 00 wcsr IE,r13
switch( watchdog_state ) {
800c6a8: 5c 30 00 05 bne r1,r16,800c6bc <_Watchdog_Tickle+0x8c> <== NEVER TAKEN
case WATCHDOG_ACTIVE:
(*the_watchdog->routine)(
800c6ac: 29 63 00 1c lw r3,(r11+28)
800c6b0: 29 61 00 20 lw r1,(r11+32)
800c6b4: 29 62 00 24 lw r2,(r11+36)
800c6b8: d8 60 00 00 call r3
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
800c6bc: 90 00 10 00 rcsr r2,IE
800c6c0: a0 4f 08 00 and r1,r2,r15
800c6c4: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
800c6c8: 29 8b 00 00 lw r11,(r12+0)
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
800c6cc: 45 6e 00 03 be r11,r14,800c6d8 <_Watchdog_Tickle+0xa8>
}
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
800c6d0: 29 61 00 10 lw r1,(r11+16)
800c6d4: 44 20 ff f1 be r1,r0,800c698 <_Watchdog_Tickle+0x68>
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
800c6d8: d0 02 00 00 wcsr IE,r2
}
800c6dc: 2b 9d 00 04 lw ra,(sp+4)
800c6e0: 2b 8b 00 1c lw r11,(sp+28)
800c6e4: 2b 8c 00 18 lw r12,(sp+24)
800c6e8: 2b 8d 00 14 lw r13,(sp+20)
800c6ec: 2b 8e 00 10 lw r14,(sp+16)
800c6f0: 2b 8f 00 0c lw r15,(sp+12)
800c6f4: 2b 90 00 08 lw r16,(sp+8)
800c6f8: 37 9c 00 1c addi sp,sp,28
800c6fc: c3 a0 00 00 ret
08002e24 <clock_gettime>:
int clock_gettime(
clockid_t clock_id,
struct timespec *tp
)
{
8002e24: 37 9c ff fc addi sp,sp,-4
8002e28: 5b 9d 00 04 sw (sp+4),ra
8002e2c: b8 20 18 00 mv r3,r1
8002e30: b8 40 08 00 mv r1,r2
if ( !tp )
8002e34: 44 40 00 11 be r2,r0,8002e78 <clock_gettime+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
8002e38: 34 02 00 01 mvi r2,1
8002e3c: 5c 62 00 03 bne r3,r2,8002e48 <clock_gettime+0x24>
_TOD_Get(tp);
8002e40: f8 00 06 ff calli 8004a3c <_TOD_Get>
8002e44: e0 00 00 06 bi 8002e5c <clock_gettime+0x38>
return 0;
}
#ifdef CLOCK_MONOTONIC
if ( clock_id == CLOCK_MONOTONIC ) {
8002e48: 34 02 00 04 mvi r2,4
8002e4c: 44 62 00 03 be r3,r2,8002e58 <clock_gettime+0x34> <== NEVER TAKEN
return 0;
}
#endif
#ifdef _POSIX_CPUTIME
if ( clock_id == CLOCK_PROCESS_CPUTIME ) {
8002e50: 34 02 00 02 mvi r2,2
8002e54: 5c 62 00 04 bne r3,r2,8002e64 <clock_gettime+0x40>
_TOD_Get_uptime_as_timespec( tp );
8002e58: f8 00 07 1e calli 8004ad0 <_TOD_Get_uptime_as_timespec>
return 0;
8002e5c: 34 01 00 00 mvi r1,0
8002e60: e0 00 00 0a bi 8002e88 <clock_gettime+0x64>
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
if ( clock_id == CLOCK_THREAD_CPUTIME )
8002e64: 34 01 00 03 mvi r1,3
8002e68: 5c 61 00 04 bne r3,r1,8002e78 <clock_gettime+0x54>
rtems_set_errno_and_return_minus_one( ENOSYS );
8002e6c: f8 00 2a c4 calli 800d97c <__errno>
8002e70: 34 02 00 58 mvi r2,88
8002e74: e0 00 00 03 bi 8002e80 <clock_gettime+0x5c>
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
8002e78: f8 00 2a c1 calli 800d97c <__errno>
8002e7c: 34 02 00 16 mvi r2,22
8002e80: 58 22 00 00 sw (r1+0),r2
8002e84: 34 01 ff ff mvi r1,-1
return 0;
}
8002e88: 2b 9d 00 04 lw ra,(sp+4)
8002e8c: 37 9c 00 04 addi sp,sp,4
8002e90: c3 a0 00 00 ret
08002e94 <clock_settime>:
int clock_settime(
clockid_t clock_id,
const struct timespec *tp
)
{
8002e94: 37 9c ff fc addi sp,sp,-4
8002e98: 5b 9d 00 04 sw (sp+4),ra
if ( !tp )
8002e9c: 44 40 00 1a be r2,r0,8002f04 <clock_settime+0x70> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
8002ea0: 34 03 00 01 mvi r3,1
8002ea4: 5c 23 00 11 bne r1,r3,8002ee8 <clock_settime+0x54>
if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 )
8002ea8: 78 04 08 01 mvhi r4,0x801
8002eac: 38 84 e4 a4 ori r4,r4,0xe4a4
8002eb0: 28 43 00 00 lw r3,(r2+0)
8002eb4: 28 81 00 00 lw r1,(r4+0)
8002eb8: 54 61 00 02 bgu r3,r1,8002ec0 <clock_settime+0x2c>
8002ebc: e0 00 00 12 bi 8002f04 <clock_settime+0x70>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8002ec0: 78 01 08 02 mvhi r1,0x802
8002ec4: 38 21 08 ac ori r1,r1,0x8ac
8002ec8: 28 23 00 00 lw r3,(r1+0)
8002ecc: 34 63 00 01 addi r3,r3,1
8002ed0: 58 23 00 00 sw (r1+0),r3
rtems_set_errno_and_return_minus_one( EINVAL );
_Thread_Disable_dispatch();
_TOD_Set( tp );
8002ed4: b8 40 08 00 mv r1,r2
8002ed8: f8 00 07 1b calli 8004b44 <_TOD_Set>
_Thread_Enable_dispatch();
8002edc: f8 00 0c 43 calli 8005fe8 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
8002ee0: 34 01 00 00 mvi r1,0
8002ee4: e0 00 00 0c bi 8002f14 <clock_settime+0x80>
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
}
#ifdef _POSIX_CPUTIME
else if ( clock_id == CLOCK_PROCESS_CPUTIME )
8002ee8: 34 02 00 02 mvi r2,2
8002eec: 44 22 00 03 be r1,r2,8002ef8 <clock_settime+0x64>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME )
8002ef0: 34 02 00 03 mvi r2,3
8002ef4: 5c 22 00 04 bne r1,r2,8002f04 <clock_settime+0x70>
rtems_set_errno_and_return_minus_one( ENOSYS );
8002ef8: f8 00 2a a1 calli 800d97c <__errno>
8002efc: 34 02 00 58 mvi r2,88
8002f00: e0 00 00 03 bi 8002f0c <clock_settime+0x78>
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
8002f04: f8 00 2a 9e calli 800d97c <__errno>
8002f08: 34 02 00 16 mvi r2,22
8002f0c: 58 22 00 00 sw (r1+0),r2
8002f10: 34 01 ff ff mvi r1,-1
return 0;
}
8002f14: 2b 9d 00 04 lw ra,(sp+4)
8002f18: 37 9c 00 04 addi sp,sp,4
8002f1c: c3 a0 00 00 ret
08025240 <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
8025240: 37 9c ff dc addi sp,sp,-36
8025244: 5b 8b 00 18 sw (sp+24),r11
8025248: 5b 8c 00 14 sw (sp+20),r12
802524c: 5b 8d 00 10 sw (sp+16),r13
8025250: 5b 8e 00 0c sw (sp+12),r14
8025254: 5b 8f 00 08 sw (sp+8),r15
8025258: 5b 9d 00 04 sw (sp+4),ra
802525c: b8 20 60 00 mv r12,r1
8025260: b8 40 58 00 mv r11,r2
8025264: b8 60 68 00 mv r13,r3
POSIX_signals_Siginfo_node *psiginfo;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
8025268: fb ff fe e8 calli 8024e08 <getpid>
802526c: 45 81 00 04 be r12,r1,802527c <killinfo+0x3c>
rtems_set_errno_and_return_minus_one( ESRCH );
8025270: fb ff b7 c7 calli 801318c <__errno>
8025274: 34 02 00 03 mvi r2,3
8025278: e0 00 00 04 bi 8025288 <killinfo+0x48>
/*
* Validate the signal passed.
*/
if ( !sig )
802527c: 5d 60 00 06 bne r11,r0,8025294 <killinfo+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
8025280: fb ff b7 c3 calli 801318c <__errno>
8025284: 34 02 00 16 mvi r2,22
8025288: 58 22 00 00 sw (r1+0),r2
802528c: 34 01 ff ff mvi r1,-1
8025290: e0 00 00 a1 bi 8025514 <killinfo+0x2d4>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
8025294: 35 6f ff ff addi r15,r11,-1
if ( !is_valid_signo(sig) )
8025298: 34 01 00 1f mvi r1,31
802529c: 50 2f 00 02 bgeu r1,r15,80252a4 <killinfo+0x64>
80252a0: e3 ff ff f8 bi 8025280 <killinfo+0x40>
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 )
80252a4: 34 02 00 01 mvi r2,1
80252a8: b9 60 08 00 mv r1,r11
80252ac: fb ff 73 27 calli 8001f48 <__ashlsi3>
80252b0: 34 02 00 02 mvi r2,2
80252b4: 78 0c 08 02 mvhi r12,0x802
80252b8: b4 2b 08 00 add r1,r1,r11
80252bc: fb ff 73 23 calli 8001f48 <__ashlsi3>
80252c0: 39 8c 9f 10 ori r12,r12,0x9f10
80252c4: b5 81 08 00 add r1,r12,r1
80252c8: 28 22 00 08 lw r2,(r1+8)
80252cc: 34 0e 00 01 mvi r14,1
return 0;
80252d0: 34 01 00 00 mvi r1,0
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 )
80252d4: 44 4e 00 90 be r2,r14,8025514 <killinfo+0x2d4>
/*
* 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 ) )
80252d8: 65 62 00 04 cmpei r2,r11,4
80252dc: 65 61 00 08 cmpei r1,r11,8
80252e0: b8 41 08 00 or r1,r2,r1
80252e4: 5c 20 00 03 bne r1,r0,80252f0 <killinfo+0xb0>
80252e8: 34 01 00 0b mvi r1,11
80252ec: 5d 61 00 05 bne r11,r1,8025300 <killinfo+0xc0>
return pthread_kill( pthread_self(), sig );
80252f0: f8 00 01 37 calli 80257cc <pthread_self>
80252f4: b9 60 10 00 mv r2,r11
80252f8: f8 00 00 f0 calli 80256b8 <pthread_kill>
80252fc: e0 00 00 86 bi 8025514 <killinfo+0x2d4>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
8025300: 34 01 00 01 mvi r1,1
8025304: b9 e0 10 00 mv r2,r15
8025308: fb ff 73 10 calli 8001f48 <__ashlsi3>
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
802530c: 5b 8b 00 1c sw (sp+28),r11
siginfo->si_code = SI_USER;
8025310: 5b 8e 00 20 sw (sp+32),r14
8025314: b8 20 60 00 mv r12,r1
if ( !value ) {
8025318: 5d a0 00 03 bne r13,r0,8025324 <killinfo+0xe4>
siginfo->si_value.sival_int = 0;
802531c: 5b 80 00 24 sw (sp+36),r0
8025320: e0 00 00 03 bi 802532c <killinfo+0xec>
} else {
siginfo->si_value = *value;
8025324: 29 a1 00 00 lw r1,(r13+0)
8025328: 5b 81 00 24 sw (sp+36),r1
802532c: 78 01 08 02 mvhi r1,0x802
8025330: 38 21 9a 14 ori r1,r1,0x9a14
8025334: 28 22 00 00 lw r2,(r1+0)
8025338: 34 42 00 01 addi r2,r2,1
802533c: 58 22 00 00 sw (r1+0),r2
/*
* 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;
8025340: 78 01 08 02 mvhi r1,0x802
8025344: 38 21 9e ec ori r1,r1,0x9eec
8025348: 28 23 00 0c lw r3,(r1+12)
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
802534c: 28 61 01 2c lw r1,(r3+300)
8025350: 28 21 00 cc lw r1,(r1+204)
8025354: a4 20 08 00 not r1,r1
8025358: a1 81 08 00 and r1,r12,r1
802535c: 5c 20 00 3e bne r1,r0,8025454 <killinfo+0x214>
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = the_chain->first ;
8025360: 78 01 08 02 mvhi r1,0x802
8025364: 38 21 a0 9c ori r1,r1,0xa09c
8025368: 28 22 00 00 lw r2,(r1+0)
802536c: 78 01 08 02 mvhi r1,0x802
8025370: 38 21 a0 a0 ori r1,r1,0xa0a0
8025374: e0 00 00 0b bi 80253a0 <killinfo+0x160>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
8025378: 28 44 00 30 lw r4,(r2+48)
for ( the_node = the_chain->first ;
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
802537c: b8 40 18 00 mv r3,r2
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8025380: 28 45 01 2c lw r5,(r2+300)
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
8025384: a1 84 20 00 and r4,r12,r4
8025388: 5c 80 00 33 bne r4,r0,8025454 <killinfo+0x214>
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
802538c: 28 a5 00 cc lw r5,(r5+204)
8025390: a4 a0 28 00 not r5,r5
8025394: a1 85 28 00 and r5,r12,r5
8025398: 5c a4 00 2f bne r5,r4,8025454 <killinfo+0x214>
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 ) {
802539c: 28 42 00 00 lw r2,(r2+0)
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = the_chain->first ;
80253a0: 5c 41 ff f6 bne r2,r1,8025378 <killinfo+0x138>
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
80253a4: 78 01 08 02 mvhi r1,0x802
80253a8: 38 21 90 c0 ori r1,r1,0x90c0
80253ac: 40 21 00 00 lbu r1,(r1+0)
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
80253b0: 78 02 08 02 mvhi r2,0x802
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
80253b4: 78 04 08 02 mvhi r4,0x802
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
80253b8: 38 42 99 b0 ori r2,r2,0x99b0
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
80253bc: 34 21 00 01 addi r1,r1,1
80253c0: 38 84 99 b8 ori r4,r4,0x99b8
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
80253c4: 34 4d 00 10 addi r13,r2,16
*
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
80253c8: 34 03 00 00 mvi r3,0
*/
RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal (
States_Control the_states
)
{
return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL);
80253cc: 78 08 10 00 mvhi r8,0x1000
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
/*
* This can occur when no one is interested and an API is not configured.
*/
if ( !_Objects_Information_table[ the_api ] )
80253d0: 28 85 00 00 lw r5,(r4+0)
80253d4: 44 a0 00 1d be r5,r0,8025448 <killinfo+0x208> <== NEVER TAKEN
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
80253d8: 28 a5 00 04 lw r5,(r5+4)
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
80253dc: 34 06 00 01 mvi r6,1
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
80253e0: 2c ae 00 10 lhu r14,(r5+16)
80253e4: 28 a7 00 1c lw r7,(r5+28)
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
80253e8: e0 00 00 17 bi 8025444 <killinfo+0x204>
the_thread = (Thread_Control *) object_table[ index ];
80253ec: 28 e2 00 04 lw r2,(r7+4)
if ( !the_thread )
80253f0: 44 40 00 13 be r2,r0,802543c <killinfo+0x1fc>
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
80253f4: 28 45 00 14 lw r5,(r2+20)
80253f8: 54 a1 00 11 bgu r5,r1,802543c <killinfo+0x1fc>
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
80253fc: 28 49 01 2c lw r9,(r2+300)
8025400: 29 29 00 cc lw r9,(r9+204)
8025404: a5 20 48 00 not r9,r9
8025408: a1 89 48 00 and r9,r12,r9
802540c: 45 20 00 0c be r9,r0,802543c <killinfo+0x1fc>
*
* 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 ) {
8025410: 54 25 00 09 bgu r1,r5,8025434 <killinfo+0x1f4>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( !_States_Is_ready( interested->current_state ) ) {
8025414: 28 69 00 10 lw r9,(r3+16)
8025418: 45 20 00 09 be r9,r0,802543c <killinfo+0x1fc> <== NEVER TAKEN
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
802541c: 28 4a 00 10 lw r10,(r2+16)
8025420: 45 40 00 05 be r10,r0,8025434 <killinfo+0x1f4>
8025424: a1 28 48 00 and r9,r9,r8
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
8025428: 5d 20 00 05 bne r9,r0,802543c <killinfo+0x1fc>
802542c: a1 48 50 00 and r10,r10,r8
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
8025430: 45 49 00 03 be r10,r9,802543c <killinfo+0x1fc>
*/
if ( !_States_Is_ready( interested->current_state ) ) {
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
8025434: b8 a0 08 00 mv r1,r5
8025438: b8 40 18 00 mv r3,r2
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
802543c: 34 c6 00 01 addi r6,r6,1
8025440: 34 e7 00 04 addi r7,r7,4
8025444: 51 c6 ff ea bgeu r14,r6,80253ec <killinfo+0x1ac>
8025448: 34 84 00 04 addi r4,r4,4
* + 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++) {
802544c: 5c 8d ff e1 bne r4,r13,80253d0 <killinfo+0x190>
}
}
}
}
if ( interested ) {
8025450: 44 60 00 06 be r3,r0,8025468 <killinfo+0x228>
/*
* 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 ) ) {
8025454: b8 60 08 00 mv r1,r3
8025458: b9 60 10 00 mv r2,r11
802545c: 37 83 00 1c addi r3,sp,28
8025460: f8 00 00 40 calli 8025560 <_POSIX_signals_Unblock_thread>
8025464: 5c 20 00 2a bne r1,r0,802550c <killinfo+0x2cc>
/*
* 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 );
8025468: b9 80 08 00 mv r1,r12
802546c: f8 00 00 32 calli 8025534 <_POSIX_signals_Set_process_signals>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
8025470: 34 02 00 01 mvi r2,1
8025474: b9 60 08 00 mv r1,r11
8025478: fb ff 72 b4 calli 8001f48 <__ashlsi3>
802547c: b4 2b 68 00 add r13,r1,r11
8025480: 34 02 00 02 mvi r2,2
8025484: 78 0c 08 02 mvhi r12,0x802
8025488: b9 a0 08 00 mv r1,r13
802548c: fb ff 72 af calli 8001f48 <__ashlsi3>
8025490: 39 8c 9f 10 ori r12,r12,0x9f10
8025494: b5 81 08 00 add r1,r12,r1
8025498: 28 22 00 00 lw r2,(r1+0)
802549c: 34 01 00 02 mvi r1,2
80254a0: 5c 41 00 1b bne r2,r1,802550c <killinfo+0x2cc>
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
80254a4: 78 01 08 02 mvhi r1,0x802
80254a8: 38 21 a0 90 ori r1,r1,0xa090
80254ac: fb ff 92 b4 calli 8009f7c <_Chain_Get>
80254b0: b8 20 60 00 mv r12,r1
if ( !psiginfo ) {
80254b4: 5c 20 00 05 bne r1,r0,80254c8 <killinfo+0x288>
_Thread_Enable_dispatch();
80254b8: fb ff 9a 1e calli 800bd30 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
80254bc: fb ff b7 34 calli 801318c <__errno>
80254c0: 34 02 00 0b mvi r2,11
80254c4: e3 ff ff 71 bi 8025288 <killinfo+0x48>
}
psiginfo->Info = *siginfo;
80254c8: 2b 81 00 1c lw r1,(sp+28)
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
80254cc: 34 02 00 01 mvi r2,1
if ( !psiginfo ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
80254d0: 59 81 00 08 sw (r12+8),r1
80254d4: 2b 81 00 20 lw r1,(sp+32)
80254d8: 59 81 00 0c sw (r12+12),r1
80254dc: 2b 81 00 24 lw r1,(sp+36)
80254e0: 59 81 00 10 sw (r12+16),r1
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
80254e4: b9 60 08 00 mv r1,r11
80254e8: fb ff 72 98 calli 8001f48 <__ashlsi3>
80254ec: 34 02 00 02 mvi r2,2
80254f0: b9 a0 08 00 mv r1,r13
80254f4: fb ff 72 95 calli 8001f48 <__ashlsi3>
80254f8: 78 02 08 02 mvhi r2,0x802
80254fc: 38 42 a1 08 ori r2,r2,0xa108
8025500: b4 22 08 00 add r1,r1,r2
8025504: b9 80 10 00 mv r2,r12
8025508: fb ff 92 87 calli 8009f24 <_Chain_Append>
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
802550c: fb ff 9a 09 calli 800bd30 <_Thread_Enable_dispatch>
return 0;
8025510: 34 01 00 00 mvi r1,0
}
8025514: 2b 9d 00 04 lw ra,(sp+4)
8025518: 2b 8b 00 18 lw r11,(sp+24)
802551c: 2b 8c 00 14 lw r12,(sp+20)
8025520: 2b 8d 00 10 lw r13,(sp+16)
8025524: 2b 8e 00 0c lw r14,(sp+12)
8025528: 2b 8f 00 08 lw r15,(sp+8)
802552c: 37 9c 00 24 addi sp,sp,36
8025530: c3 a0 00 00 ret
080079bc <pthread_attr_setschedpolicy>:
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
80079bc: 34 03 00 16 mvi r3,22
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
80079c0: 44 20 00 0c be r1,r0,80079f0 <pthread_attr_setschedpolicy+0x34>
80079c4: 28 24 00 00 lw r4,(r1+0)
80079c8: 44 80 00 0a be r4,r0,80079f0 <pthread_attr_setschedpolicy+0x34>
return EINVAL;
switch ( policy ) {
80079cc: 48 02 00 08 bg r0,r2,80079ec <pthread_attr_setschedpolicy+0x30>
80079d0: 34 03 00 02 mvi r3,2
80079d4: 4c 62 00 03 bge r3,r2,80079e0 <pthread_attr_setschedpolicy+0x24>
80079d8: 34 03 00 04 mvi r3,4
80079dc: 5c 43 00 04 bne r2,r3,80079ec <pthread_attr_setschedpolicy+0x30><== NEVER TAKEN
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
80079e0: 58 22 00 14 sw (r1+20),r2
return 0;
80079e4: 34 03 00 00 mvi r3,0
80079e8: e0 00 00 02 bi 80079f0 <pthread_attr_setschedpolicy+0x34>
default:
return ENOTSUP;
80079ec: 34 03 00 86 mvi r3,134
}
}
80079f0: b8 60 08 00 mv r1,r3
80079f4: c3 a0 00 00 ret
08003484 <pthread_barrier_init>:
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
8003484: 37 9c ff dc addi sp,sp,-36
8003488: 5b 8b 00 14 sw (sp+20),r11
800348c: 5b 8c 00 10 sw (sp+16),r12
8003490: 5b 8d 00 0c sw (sp+12),r13
8003494: 5b 8e 00 08 sw (sp+8),r14
8003498: 5b 9d 00 04 sw (sp+4),ra
/*
* Error check parameters
*/
if ( !barrier )
return EINVAL;
800349c: 34 04 00 16 mvi r4,22
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
80034a0: b8 20 68 00 mv r13,r1
80034a4: b8 60 58 00 mv r11,r3
const pthread_barrierattr_t *the_attr;
/*
* Error check parameters
*/
if ( !barrier )
80034a8: 44 20 00 2a be r1,r0,8003550 <pthread_barrier_init+0xcc>
return EINVAL;
if ( count == 0 )
80034ac: 44 60 00 29 be r3,r0,8003550 <pthread_barrier_init+0xcc>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
80034b0: 5c 40 00 05 bne r2,r0,80034c4 <pthread_barrier_init+0x40>
the_attr = attr;
} else {
(void) pthread_barrierattr_init( &my_attr );
80034b4: 37 8c 00 18 addi r12,sp,24
80034b8: b9 80 08 00 mv r1,r12
80034bc: fb ff ff bb calli 80033a8 <pthread_barrierattr_init>
the_attr = &my_attr;
80034c0: b9 80 10 00 mv r2,r12
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
80034c4: 28 41 00 00 lw r1,(r2+0)
return EINVAL;
80034c8: 34 04 00 16 mvi r4,22
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
80034cc: 44 20 00 21 be r1,r0,8003550 <pthread_barrier_init+0xcc>
return EINVAL;
switch ( the_attr->process_shared ) {
80034d0: 28 4e 00 04 lw r14,(r2+4)
80034d4: 5d c0 00 1f bne r14,r0,8003550 <pthread_barrier_init+0xcc> <== NEVER TAKEN
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
80034d8: 78 02 08 01 mvhi r2,0x801
80034dc: 38 42 68 6c ori r2,r2,0x686c
80034e0: 28 41 00 00 lw r1,(r2+0)
}
/*
* Convert from POSIX attributes to Core Barrier attributes
*/
the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE;
80034e4: 5b 80 00 20 sw (sp+32),r0
the_attributes.maximum_count = count;
80034e8: 5b 8b 00 24 sw (sp+36),r11
80034ec: 34 21 00 01 addi r1,r1,1
80034f0: 58 41 00 00 sw (r2+0),r1
* the inactive chain of free barrier control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void )
{
return (POSIX_Barrier_Control *)
_Objects_Allocate( &_POSIX_Barrier_Information );
80034f4: 78 0c 08 01 mvhi r12,0x801
80034f8: 39 8c 6b cc ori r12,r12,0x6bcc
80034fc: b9 80 08 00 mv r1,r12
8003500: f8 00 07 e4 calli 8005490 <_Objects_Allocate>
8003504: b8 20 58 00 mv r11,r1
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_barrier = _POSIX_Barrier_Allocate();
if ( !the_barrier ) {
8003508: 5c 2e 00 04 bne r1,r14,8003518 <pthread_barrier_init+0x94>
_Thread_Enable_dispatch();
800350c: f8 00 0b 62 calli 8006294 <_Thread_Enable_dispatch>
return EAGAIN;
8003510: 34 04 00 0b mvi r4,11
8003514: e0 00 00 0f bi 8003550 <pthread_barrier_init+0xcc>
}
_CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes );
8003518: 34 21 00 10 addi r1,r1,16
800351c: 37 82 00 20 addi r2,sp,32
8003520: f8 00 04 e7 calli 80048bc <_CORE_barrier_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8003524: 29 6e 00 08 lw r14,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8003528: 29 8c 00 1c lw r12,(r12+28)
800352c: 34 02 00 02 mvi r2,2
8003530: 21 c1 ff ff andi r1,r14,0xffff
8003534: f8 00 3d e1 calli 8012cb8 <__ashlsi3>
8003538: b5 81 08 00 add r1,r12,r1
800353c: 58 2b 00 00 sw (r1+0),r11
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
8003540: 59 60 00 0c sw (r11+12),r0
);
/*
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
8003544: 59 ae 00 00 sw (r13+0),r14
_Thread_Enable_dispatch();
8003548: f8 00 0b 53 calli 8006294 <_Thread_Enable_dispatch>
return 0;
800354c: 34 04 00 00 mvi r4,0
}
8003550: b8 80 08 00 mv r1,r4
8003554: 2b 9d 00 04 lw ra,(sp+4)
8003558: 2b 8b 00 14 lw r11,(sp+20)
800355c: 2b 8c 00 10 lw r12,(sp+16)
8003560: 2b 8d 00 0c lw r13,(sp+12)
8003564: 2b 8e 00 08 lw r14,(sp+8)
8003568: 37 9c 00 24 addi sp,sp,36
800356c: c3 a0 00 00 ret
08002d00 <pthread_cleanup_push>:
void pthread_cleanup_push(
void (*routine)( void * ),
void *arg
)
{
8002d00: 37 9c ff f4 addi sp,sp,-12
8002d04: 5b 8b 00 0c sw (sp+12),r11
8002d08: 5b 8c 00 08 sw (sp+8),r12
8002d0c: 5b 9d 00 04 sw (sp+4),ra
8002d10: b8 20 58 00 mv r11,r1
8002d14: b8 40 60 00 mv r12,r2
/*
* 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 )
8002d18: 44 20 00 13 be r1,r0,8002d64 <pthread_cleanup_push+0x64>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8002d1c: 78 03 08 01 mvhi r3,0x801
8002d20: 38 63 68 54 ori r3,r3,0x6854
8002d24: 28 61 00 00 lw r1,(r3+0)
8002d28: 34 21 00 01 addi r1,r1,1
8002d2c: 58 61 00 00 sw (r3+0),r1
return;
_Thread_Disable_dispatch();
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
8002d30: 34 01 00 10 mvi r1,16
8002d34: f8 00 11 44 calli 8007244 <_Workspace_Allocate>
8002d38: b8 20 10 00 mv r2,r1
if ( handler ) {
8002d3c: 44 20 00 09 be r1,r0,8002d60 <pthread_cleanup_push+0x60> <== NEVER TAKEN
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
8002d40: 78 03 08 01 mvhi r3,0x801
8002d44: 38 63 6d 2c ori r3,r3,0x6d2c
8002d48: 28 61 00 0c lw r1,(r3+12)
handler_stack = &thread_support->Cancellation_Handlers;
8002d4c: 28 21 01 2c lw r1,(r1+300)
handler->routine = routine;
8002d50: 58 4b 00 08 sw (r2+8),r11
handler->arg = arg;
8002d54: 58 4c 00 0c sw (r2+12),r12
_Chain_Append( handler_stack, &handler->Node );
8002d58: 34 21 00 e0 addi r1,r1,224
8002d5c: f8 00 04 f7 calli 8004138 <_Chain_Append>
}
_Thread_Enable_dispatch();
8002d60: f8 00 0b 3c calli 8005a50 <_Thread_Enable_dispatch>
}
8002d64: 2b 9d 00 04 lw ra,(sp+4)
8002d68: 2b 8b 00 0c lw r11,(sp+12)
8002d6c: 2b 8c 00 08 lw r12,(sp+8)
8002d70: 37 9c 00 0c addi sp,sp,12
8002d74: c3 a0 00 00 ret
08003dc8 <pthread_cond_init>:
int pthread_cond_init(
pthread_cond_t *cond,
const pthread_condattr_t *attr
)
{
8003dc8: 37 9c ff ec addi sp,sp,-20
8003dcc: 5b 8b 00 14 sw (sp+20),r11
8003dd0: 5b 8c 00 10 sw (sp+16),r12
8003dd4: 5b 8d 00 0c sw (sp+12),r13
8003dd8: 5b 8e 00 08 sw (sp+8),r14
8003ddc: 5b 9d 00 04 sw (sp+4),ra
8003de0: b8 20 70 00 mv r14,r1
8003de4: b8 40 58 00 mv r11,r2
POSIX_Condition_variables_Control *the_cond;
const pthread_condattr_t *the_attr;
if ( attr ) the_attr = attr;
8003de8: 5c 40 00 03 bne r2,r0,8003df4 <pthread_cond_init+0x2c>
else the_attr = &_POSIX_Condition_variables_Default_attributes;
8003dec: 78 0b 08 01 mvhi r11,0x801
8003df0: 39 6b 5a d0 ori r11,r11,0x5ad0
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
8003df4: 29 63 00 04 lw r3,(r11+4)
8003df8: 34 02 00 01 mvi r2,1
return EINVAL;
8003dfc: 34 01 00 16 mvi r1,22
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
8003e00: 44 62 00 24 be r3,r2,8003e90 <pthread_cond_init+0xc8> <== NEVER TAKEN
return EINVAL;
if ( !the_attr->is_initialized )
8003e04: 29 62 00 00 lw r2,(r11+0)
8003e08: 44 40 00 22 be r2,r0,8003e90 <pthread_cond_init+0xc8>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8003e0c: 78 02 08 01 mvhi r2,0x801
8003e10: 38 42 78 6c ori r2,r2,0x786c
8003e14: 28 41 00 00 lw r1,(r2+0)
8003e18: 34 21 00 01 addi r1,r1,1
8003e1c: 58 41 00 00 sw (r2+0),r1
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
*_POSIX_Condition_variables_Allocate( void )
{
return (POSIX_Condition_variables_Control *)
_Objects_Allocate( &_POSIX_Condition_variables_Information );
8003e20: 78 0d 08 01 mvhi r13,0x801
8003e24: 39 ad 7c 64 ori r13,r13,0x7c64
8003e28: b9 a0 08 00 mv r1,r13
8003e2c: f8 00 09 84 calli 800643c <_Objects_Allocate>
8003e30: b8 20 60 00 mv r12,r1
_Thread_Disable_dispatch();
the_cond = _POSIX_Condition_variables_Allocate();
if ( !the_cond ) {
8003e34: 5c 20 00 04 bne r1,r0,8003e44 <pthread_cond_init+0x7c>
_Thread_Enable_dispatch();
8003e38: f8 00 0d 6e calli 80073f0 <_Thread_Enable_dispatch>
return ENOMEM;
8003e3c: 34 01 00 0c mvi r1,12
8003e40: e0 00 00 14 bi 8003e90 <pthread_cond_init+0xc8>
}
the_cond->process_shared = the_attr->process_shared;
8003e44: 29 61 00 04 lw r1,(r11+4)
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
/* XXX some more initialization might need to go here */
_Thread_queue_Initialize(
8003e48: 34 03 08 00 mvi r3,2048
8003e4c: 34 04 00 74 mvi r4,116
if ( !the_cond ) {
_Thread_Enable_dispatch();
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
8003e50: 59 81 00 10 sw (r12+16),r1
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
/* XXX some more initialization might need to go here */
_Thread_queue_Initialize(
8003e54: 34 02 00 00 mvi r2,0
8003e58: 35 81 00 18 addi r1,r12,24
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
8003e5c: 59 80 00 14 sw (r12+20),r0
/* XXX some more initialization might need to go here */
_Thread_queue_Initialize(
8003e60: f8 00 0f bd calli 8007d54 <_Thread_queue_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8003e64: 29 8b 00 08 lw r11,(r12+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8003e68: 29 ad 00 1c lw r13,(r13+28)
8003e6c: 34 02 00 02 mvi r2,2
8003e70: 21 61 ff ff andi r1,r11,0xffff
8003e74: f8 00 3f 47 calli 8013b90 <__ashlsi3>
8003e78: b5 a1 10 00 add r2,r13,r1
8003e7c: 58 4c 00 00 sw (r2+0),r12
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
8003e80: 59 80 00 0c sw (r12+12),r0
&_POSIX_Condition_variables_Information,
&the_cond->Object,
0
);
*cond = the_cond->Object.id;
8003e84: 59 cb 00 00 sw (r14+0),r11
_Thread_Enable_dispatch();
8003e88: f8 00 0d 5a calli 80073f0 <_Thread_Enable_dispatch>
return 0;
8003e8c: 34 01 00 00 mvi r1,0
}
8003e90: 2b 9d 00 04 lw ra,(sp+4)
8003e94: 2b 8b 00 14 lw r11,(sp+20)
8003e98: 2b 8c 00 10 lw r12,(sp+16)
8003e9c: 2b 8d 00 0c lw r13,(sp+12)
8003ea0: 2b 8e 00 08 lw r14,(sp+8)
8003ea4: 37 9c 00 14 addi sp,sp,20
8003ea8: c3 a0 00 00 ret
08003c3c <pthread_condattr_destroy>:
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
if ( !attr || attr->is_initialized == false )
return EINVAL;
8003c3c: 34 02 00 16 mvi r2,22
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
if ( !attr || attr->is_initialized == false )
8003c40: 44 20 00 05 be r1,r0,8003c54 <pthread_condattr_destroy+0x18>
8003c44: 28 23 00 00 lw r3,(r1+0)
8003c48: 44 60 00 03 be r3,r0,8003c54 <pthread_condattr_destroy+0x18><== NEVER TAKEN
return EINVAL;
attr->is_initialized = false;
8003c4c: 58 20 00 00 sw (r1+0),r0
return 0;
8003c50: 34 02 00 00 mvi r2,0
}
8003c54: b8 40 08 00 mv r1,r2
8003c58: c3 a0 00 00 ret
08003104 <pthread_create>:
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
8003104: 37 9c ff a0 addi sp,sp,-96
8003108: 5b 8b 00 3c sw (sp+60),r11
800310c: 5b 8c 00 38 sw (sp+56),r12
8003110: 5b 8d 00 34 sw (sp+52),r13
8003114: 5b 8e 00 30 sw (sp+48),r14
8003118: 5b 8f 00 2c sw (sp+44),r15
800311c: 5b 90 00 28 sw (sp+40),r16
8003120: 5b 91 00 24 sw (sp+36),r17
8003124: 5b 92 00 20 sw (sp+32),r18
8003128: 5b 93 00 1c sw (sp+28),r19
800312c: 5b 94 00 18 sw (sp+24),r20
8003130: 5b 95 00 14 sw (sp+20),r21
8003134: 5b 9d 00 10 sw (sp+16),ra
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
return EFAULT;
8003138: 34 0d 00 0e mvi r13,14
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
800313c: b8 20 88 00 mv r17,r1
8003140: b8 60 80 00 mv r16,r3
8003144: b8 80 90 00 mv r18,r4
int schedpolicy = SCHED_RR;
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
8003148: 44 60 00 a5 be r3,r0,80033dc <pthread_create+0x2d8>
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
800314c: b8 40 58 00 mv r11,r2
8003150: 5c 40 00 03 bne r2,r0,800315c <pthread_create+0x58>
8003154: 78 0b 08 01 mvhi r11,0x801
8003158: 39 6b d3 04 ori r11,r11,0xd304
if ( !the_attr->is_initialized )
800315c: 29 61 00 00 lw r1,(r11+0)
return EINVAL;
8003160: 34 0d 00 16 mvi r13,22
if ( !start_routine )
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
if ( !the_attr->is_initialized )
8003164: 44 20 00 9e be r1,r0,80033dc <pthread_create+0x2d8>
* 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) )
8003168: 29 61 00 04 lw r1,(r11+4)
800316c: 44 20 00 06 be r1,r0,8003184 <pthread_create+0x80>
8003170: 78 02 08 01 mvhi r2,0x801
8003174: 38 42 f0 e0 ori r2,r2,0xf0e0
8003178: 29 63 00 08 lw r3,(r11+8)
800317c: 28 41 00 00 lw r1,(r2+0)
8003180: 54 23 00 97 bgu r1,r3,80033dc <pthread_create+0x2d8>
* 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 ) {
8003184: 29 62 00 10 lw r2,(r11+16)
8003188: 34 01 00 01 mvi r1,1
800318c: 44 41 00 05 be r2,r1,80031a0 <pthread_create+0x9c>
8003190: 34 01 00 02 mvi r1,2
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
break;
default:
return EINVAL;
8003194: 34 0d 00 16 mvi r13,22
* 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 ) {
8003198: 5c 41 00 91 bne r2,r1,80033dc <pthread_create+0x2d8>
800319c: e0 00 00 14 bi 80031ec <pthread_create+0xe8>
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
80031a0: 78 02 08 01 mvhi r2,0x801
80031a4: 38 42 fd 34 ori r2,r2,0xfd34
80031a8: 28 41 00 0c lw r1,(r2+12)
80031ac: 28 22 01 2c lw r2,(r1+300)
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
80031b0: 28 48 00 84 lw r8,(r2+132)
80031b4: 28 47 00 88 lw r7,(r2+136)
80031b8: 28 46 00 8c lw r6,(r2+140)
80031bc: 28 45 00 90 lw r5,(r2+144)
80031c0: 28 44 00 94 lw r4,(r2+148)
80031c4: 28 43 00 98 lw r3,(r2+152)
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
schedpolicy = api->schedpolicy;
80031c8: 28 4f 00 80 lw r15,(r2+128)
schedparam = api->schedparam;
80031cc: 28 41 00 9c lw r1,(r2+156)
80031d0: 5b 88 00 40 sw (sp+64),r8
80031d4: 5b 87 00 44 sw (sp+68),r7
80031d8: 5b 86 00 48 sw (sp+72),r6
80031dc: 5b 85 00 4c sw (sp+76),r5
80031e0: 5b 84 00 50 sw (sp+80),r4
80031e4: 5b 83 00 54 sw (sp+84),r3
80031e8: e0 00 00 0f bi 8003224 <pthread_create+0x120>
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
80031ec: 29 67 00 18 lw r7,(r11+24)
80031f0: 29 66 00 1c lw r6,(r11+28)
80031f4: 29 65 00 20 lw r5,(r11+32)
80031f8: 29 64 00 24 lw r4,(r11+36)
80031fc: 29 63 00 28 lw r3,(r11+40)
8003200: 29 62 00 2c lw r2,(r11+44)
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
8003204: 29 6f 00 14 lw r15,(r11+20)
schedparam = the_attr->schedparam;
8003208: 29 61 00 30 lw r1,(r11+48)
800320c: 5b 87 00 40 sw (sp+64),r7
8003210: 5b 86 00 44 sw (sp+68),r6
8003214: 5b 85 00 48 sw (sp+72),r5
8003218: 5b 84 00 4c sw (sp+76),r4
800321c: 5b 83 00 50 sw (sp+80),r3
8003220: 5b 82 00 54 sw (sp+84),r2
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
8003224: 29 6c 00 0c lw r12,(r11+12)
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
8003228: 5b 81 00 58 sw (sp+88),r1
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
return ENOTSUP;
800322c: 34 0d 00 86 mvi r13,134
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
8003230: 5d 80 00 6b bne r12,r0,80033dc <pthread_create+0x2d8>
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
8003234: 2b 81 00 40 lw r1,(sp+64)
return EINVAL;
8003238: 34 0d 00 16 mvi r13,22
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
800323c: f8 00 1b 61 calli 8009fc0 <_POSIX_Priority_Is_valid>
8003240: 44 2c 00 67 be r1,r12,80033dc <pthread_create+0x2d8> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
8003244: 78 02 08 01 mvhi r2,0x801
8003248: 38 42 f0 e4 ori r2,r2,0xf0e4
800324c: 40 54 00 00 lbu r20,(r2+0)
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
8003250: b9 e0 08 00 mv r1,r15
8003254: 37 82 00 40 addi r2,sp,64
8003258: 37 83 00 60 addi r3,sp,96
800325c: 37 84 00 5c addi r4,sp,92
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
return EINVAL;
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
8003260: 2b 93 00 40 lw r19,(sp+64)
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
8003264: f8 00 1b 5f calli 8009fe0 <_POSIX_Thread_Translate_sched_param>
8003268: b8 20 68 00 mv r13,r1
schedpolicy,
&schedparam,
&budget_algorithm,
&budget_callout
);
if ( rc )
800326c: 5c 20 00 5c bne r1,r0,80033dc <pthread_create+0x2d8>
#endif
/*
* Lock the allocator mutex for protection
*/
_RTEMS_Lock_allocator();
8003270: 78 0c 08 01 mvhi r12,0x801
8003274: 39 8c f9 00 ori r12,r12,0xf900
8003278: 29 81 00 00 lw r1,(r12+0)
800327c: f8 00 04 f5 calli 8004650 <_API_Mutex_Lock>
* _POSIX_Threads_Allocate
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
8003280: 78 02 08 01 mvhi r2,0x801
8003284: b8 40 08 00 mv r1,r2
8003288: 38 21 fa 3c ori r1,r1,0xfa3c
800328c: f8 00 08 07 calli 80052a8 <_Objects_Allocate>
8003290: b8 20 70 00 mv r14,r1
* Allocate the thread control block.
*
* NOTE: Global threads are not currently supported.
*/
the_thread = _POSIX_Threads_Allocate();
if ( !the_thread ) {
8003294: 5c 2d 00 03 bne r1,r13,80032a0 <pthread_create+0x19c>
_RTEMS_Unlock_allocator();
8003298: 29 81 00 00 lw r1,(r12+0)
800329c: e0 00 00 21 bi 8003320 <pthread_create+0x21c>
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
80032a0: 78 02 08 01 mvhi r2,0x801
80032a4: 38 42 f0 e0 ori r2,r2,0xf0e0
80032a8: 28 41 00 00 lw r1,(r2+0)
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
80032ac: 29 6c 00 08 lw r12,(r11+8)
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
80032b0: 34 02 00 01 mvi r2,1
80032b4: f8 00 61 9b calli 801b920 <__ashlsi3>
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
80032b8: 29 75 00 04 lw r21,(r11+4)
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
80032bc: b8 20 28 00 mv r5,r1
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
80032c0: 50 2c 00 02 bgeu r1,r12,80032c8 <pthread_create+0x1c4>
80032c4: b9 80 28 00 mv r5,r12
80032c8: 2b 81 00 5c lw r1,(sp+92)
80032cc: 78 0c 08 01 mvhi r12,0x801
80032d0: 2b 88 00 60 lw r8,(sp+96)
80032d4: 39 8c fa 3c ori r12,r12,0xfa3c
80032d8: 5b 81 00 04 sw (sp+4),r1
80032dc: b8 a0 20 00 mv r4,r5
80032e0: b9 80 08 00 mv r1,r12
80032e4: b9 c0 10 00 mv r2,r14
80032e8: ba a0 18 00 mv r3,r21
80032ec: 34 05 00 00 mvi r5,0
80032f0: ca 93 30 00 sub r6,r20,r19
80032f4: 34 07 00 01 mvi r7,1
80032f8: 5b 80 00 08 sw (sp+8),r0
80032fc: 5b 80 00 0c sw (sp+12),r0
8003300: f8 00 0b c0 calli 8006200 <_Thread_Initialize>
budget_callout,
0, /* isr level */
name /* posix threads don't have a name */
);
if ( !status ) {
8003304: 5c 20 00 0a bne r1,r0,800332c <pthread_create+0x228>
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
8003308: b9 80 08 00 mv r1,r12
800330c: b9 c0 10 00 mv r2,r14
8003310: f8 00 08 e2 calli 8005698 <_Objects_Free>
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
8003314: 78 01 08 01 mvhi r1,0x801
8003318: 38 21 f9 00 ori r1,r1,0xf900
800331c: 28 21 00 00 lw r1,(r1+0)
8003320: f8 00 04 e9 calli 80046c4 <_API_Mutex_Unlock>
return EAGAIN;
8003324: 34 0d 00 0b mvi r13,11
8003328: e0 00 00 2d bi 80033dc <pthread_create+0x2d8>
}
/*
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
800332c: 29 cc 01 2c lw r12,(r14+300)
api->Attributes = *the_attr;
8003330: b9 60 10 00 mv r2,r11
8003334: 34 03 00 3c mvi r3,60
8003338: b9 80 08 00 mv r1,r12
800333c: f8 00 2a e7 calli 800ded8 <memcpy>
api->detachstate = the_attr->detachstate;
8003340: 29 61 00 38 lw r1,(r11+56)
api->schedparam = schedparam;
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003344: 34 02 00 01 mvi r2,1
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
8003348: 59 8f 00 80 sw (r12+128),r15
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
800334c: 59 81 00 3c sw (r12+60),r1
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
8003350: 2b 81 00 40 lw r1,(sp+64)
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003354: ba 00 18 00 mv r3,r16
8003358: ba 40 20 00 mv r4,r18
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
800335c: 59 81 00 84 sw (r12+132),r1
8003360: 2b 81 00 44 lw r1,(sp+68)
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003364: 34 05 00 00 mvi r5,0
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
8003368: 59 81 00 88 sw (r12+136),r1
800336c: 2b 81 00 48 lw r1,(sp+72)
8003370: 59 81 00 8c sw (r12+140),r1
8003374: 2b 81 00 4c lw r1,(sp+76)
8003378: 59 81 00 90 sw (r12+144),r1
800337c: 2b 81 00 50 lw r1,(sp+80)
8003380: 59 81 00 94 sw (r12+148),r1
8003384: 2b 81 00 54 lw r1,(sp+84)
8003388: 59 81 00 98 sw (r12+152),r1
800338c: 2b 81 00 58 lw r1,(sp+88)
8003390: 59 81 00 9c sw (r12+156),r1
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003394: b9 c0 08 00 mv r1,r14
8003398: f8 00 0f 1b calli 8007004 <_Thread_Start>
_RTEMS_Unlock_allocator();
return EINVAL;
}
#endif
if ( schedpolicy == SCHED_SPORADIC ) {
800339c: 34 01 00 04 mvi r1,4
80033a0: 5d e1 00 09 bne r15,r1,80033c4 <pthread_create+0x2c0>
_Watchdog_Insert_ticks(
80033a4: 35 81 00 8c addi r1,r12,140
80033a8: f8 00 0f c2 calli 80072b0 <_Timespec_To_ticks>
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80033ac: 78 02 08 01 mvhi r2,0x801
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80033b0: 59 81 00 b0 sw (r12+176),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80033b4: b8 40 08 00 mv r1,r2
80033b8: 38 21 f9 20 ori r1,r1,0xf920
80033bc: 35 82 00 a4 addi r2,r12,164
80033c0: f8 00 10 f1 calli 8007784 <_Watchdog_Insert>
}
/*
* Return the id and indicate we successfully created the thread
*/
*thread = the_thread->Object.id;
80033c4: 29 c1 00 08 lw r1,(r14+8)
80033c8: 5a 21 00 00 sw (r17+0),r1
_RTEMS_Unlock_allocator();
80033cc: 78 01 08 01 mvhi r1,0x801
80033d0: 38 21 f9 00 ori r1,r1,0xf900
80033d4: 28 21 00 00 lw r1,(r1+0)
80033d8: f8 00 04 bb calli 80046c4 <_API_Mutex_Unlock>
return 0;
}
80033dc: b9 a0 08 00 mv r1,r13
80033e0: 2b 9d 00 10 lw ra,(sp+16)
80033e4: 2b 8b 00 3c lw r11,(sp+60)
80033e8: 2b 8c 00 38 lw r12,(sp+56)
80033ec: 2b 8d 00 34 lw r13,(sp+52)
80033f0: 2b 8e 00 30 lw r14,(sp+48)
80033f4: 2b 8f 00 2c lw r15,(sp+44)
80033f8: 2b 90 00 28 lw r16,(sp+40)
80033fc: 2b 91 00 24 lw r17,(sp+36)
8003400: 2b 92 00 20 lw r18,(sp+32)
8003404: 2b 93 00 1c lw r19,(sp+28)
8003408: 2b 94 00 18 lw r20,(sp+24)
800340c: 2b 95 00 14 lw r21,(sp+20)
8003410: 37 9c 00 60 addi sp,sp,96
8003414: c3 a0 00 00 ret
08010ea0 <pthread_exit>:
void pthread_exit(
void *value_ptr
)
{
8010ea0: 37 9c ff fc addi sp,sp,-4
8010ea4: 5b 9d 00 04 sw (sp+4),ra
_POSIX_Thread_Exit( _Thread_Executing, value_ptr );
8010ea8: 78 03 08 01 mvhi r3,0x801
8010eac: 38 63 9d fc ori r3,r3,0x9dfc
}
void pthread_exit(
void *value_ptr
)
{
8010eb0: b8 20 10 00 mv r2,r1
_POSIX_Thread_Exit( _Thread_Executing, value_ptr );
8010eb4: 28 61 00 0c lw r1,(r3+12)
8010eb8: fb ff ff d4 calli 8010e08 <_POSIX_Thread_Exit>
}
8010ebc: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8010ec0: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
8010ec4: c3 a0 00 00 ret <== NOT EXECUTED
08002fa4 <pthread_key_create>:
int pthread_key_create(
pthread_key_t *key,
void (*destructor)( void * )
)
{
8002fa4: 37 9c ff e0 addi sp,sp,-32
8002fa8: 5b 8b 00 20 sw (sp+32),r11
8002fac: 5b 8c 00 1c sw (sp+28),r12
8002fb0: 5b 8d 00 18 sw (sp+24),r13
8002fb4: 5b 8e 00 14 sw (sp+20),r14
8002fb8: 5b 8f 00 10 sw (sp+16),r15
8002fbc: 5b 90 00 0c sw (sp+12),r16
8002fc0: 5b 91 00 08 sw (sp+8),r17
8002fc4: 5b 9d 00 04 sw (sp+4),ra
8002fc8: 78 03 08 01 mvhi r3,0x801
8002fcc: 38 63 68 bc ori r3,r3,0x68bc
8002fd0: b8 20 78 00 mv r15,r1
8002fd4: 28 61 00 00 lw r1,(r3+0)
8002fd8: b8 40 60 00 mv r12,r2
8002fdc: 34 21 00 01 addi r1,r1,1
8002fe0: 58 61 00 00 sw (r3+0),r1
* the inactive chain of free keys control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
{
return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
8002fe4: 78 03 08 01 mvhi r3,0x801
8002fe8: b8 60 08 00 mv r1,r3
8002fec: 38 21 6c 74 ori r1,r1,0x6c74
8002ff0: f8 00 08 72 calli 80051b8 <_Objects_Allocate>
8002ff4: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch();
the_key = _POSIX_Keys_Allocate();
if ( !the_key ) {
8002ff8: 5c 20 00 04 bne r1,r0,8003008 <pthread_key_create+0x64>
_Thread_Enable_dispatch();
8002ffc: f8 00 0c 5c calli 800616c <_Thread_Enable_dispatch>
return EAGAIN;
8003000: 34 01 00 0b mvi r1,11
8003004: e0 00 00 3b bi 80030f0 <pthread_key_create+0x14c>
}
the_key->destructor = destructor;
8003008: 78 0d 08 01 mvhi r13,0x801
800300c: 58 2c 00 10 sw (r1+16),r12
8003010: 39 ad 68 5c ori r13,r13,0x685c
8003014: b8 20 70 00 mv r14,r1
* APIs are optional.
*
* NOTE: Currently RTEMS Classic API tasks are always enabled.
*/
for ( the_api = 1;
8003018: 34 0c 00 01 mvi r12,1
800301c: 34 10 00 04 mvi r16,4
the_api <= OBJECTS_APIS_LAST;
the_api++ ) {
if ( _Objects_Information_table[ the_api ] ) {
8003020: 29 a2 00 00 lw r2,(r13+0)
8003024: 44 40 00 21 be r2,r0,80030a8 <pthread_key_create+0x104> <== NEVER TAKEN
true,
INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY
);
#endif
bytes_to_allocate = sizeof( void * ) *
(_Objects_Information_table[ the_api ][ 1 ]->maximum + 1);
8003028: 28 41 00 04 lw r1,(r2+4)
800302c: 2c 22 00 10 lhu r2,(r1+16)
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY
);
#endif
bytes_to_allocate = sizeof( void * ) *
8003030: 34 41 00 01 addi r1,r2,1
8003034: 34 02 00 02 mvi r2,2
8003038: f8 00 41 fb calli 8013824 <__ashlsi3>
800303c: b8 20 88 00 mv r17,r1
(_Objects_Information_table[ the_api ][ 1 ]->maximum + 1);
table = _Workspace_Allocate( bytes_to_allocate );
8003040: f8 00 12 ab calli 8007aec <_Workspace_Allocate>
if ( !table ) {
8003044: 5c 20 00 14 bne r1,r0,8003094 <pthread_key_create+0xf0>
int _EXFUN(pthread_once,
(pthread_once_t *__once_control, void (*__init_routine)(void)));
/* Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 */
int _EXFUN(pthread_key_create,
8003048: 35 81 00 03 addi r1,r12,3
800304c: 34 02 00 02 mvi r2,2
8003050: f8 00 41 f5 calli 8013824 <__ashlsi3>
8003054: b5 61 08 00 add r1,r11,r1
for ( --the_api;
8003058: 35 8d ff ff addi r13,r12,-1
800305c: 34 2c 00 04 addi r12,r1,4
8003060: e0 00 00 05 bi 8003074 <pthread_key_create+0xd0>
the_api >= 1;
the_api-- )
_Workspace_Free( the_key->Values[ the_api ] );
8003064: 29 81 00 00 lw r1,(r12+0)
(_Objects_Information_table[ the_api ][ 1 ]->maximum + 1);
table = _Workspace_Allocate( bytes_to_allocate );
if ( !table ) {
for ( --the_api;
the_api >= 1;
the_api-- )
8003068: 35 ad ff ff addi r13,r13,-1
800306c: 35 8c ff fc addi r12,r12,-4
_Workspace_Free( the_key->Values[ the_api ] );
8003070: f8 00 12 aa calli 8007b18 <_Workspace_Free>
#endif
bytes_to_allocate = sizeof( void * ) *
(_Objects_Information_table[ the_api ][ 1 ]->maximum + 1);
table = _Workspace_Allocate( bytes_to_allocate );
if ( !table ) {
for ( --the_api;
8003074: 5d a0 ff fc bne r13,r0,8003064 <pthread_key_create+0xc0>
*/
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
POSIX_Keys_Control *the_key
)
{
_Objects_Free( &_POSIX_Keys_Information, &the_key->Object );
8003078: 78 01 08 01 mvhi r1,0x801
800307c: 38 21 6c 74 ori r1,r1,0x6c74
8003080: b9 60 10 00 mv r2,r11
8003084: f8 00 09 5f calli 8005600 <_Objects_Free>
the_api >= 1;
the_api-- )
_Workspace_Free( the_key->Values[ the_api ] );
_POSIX_Keys_Free( the_key );
_Thread_Enable_dispatch();
8003088: f8 00 0c 39 calli 800616c <_Thread_Enable_dispatch>
return ENOMEM;
800308c: 34 01 00 0c mvi r1,12
8003090: e0 00 00 18 bi 80030f0 <pthread_key_create+0x14c>
}
the_key->Values[ the_api ] = table;
8003094: 59 c1 00 18 sw (r14+24),r1
memset( table, '\0', bytes_to_allocate );
8003098: 34 02 00 00 mvi r2,0
800309c: ba 20 18 00 mv r3,r17
80030a0: f8 00 2c 26 calli 800e138 <memset>
80030a4: e0 00 00 02 bi 80030ac <pthread_key_create+0x108>
} else {
the_key->Values[ the_api ] = NULL;
80030a8: 59 c0 00 18 sw (r14+24),r0 <== NOT EXECUTED
* NOTE: Currently RTEMS Classic API tasks are always enabled.
*/
for ( the_api = 1;
the_api <= OBJECTS_APIS_LAST;
the_api++ ) {
80030ac: 35 8c 00 01 addi r12,r12,1
80030b0: 35 ad 00 04 addi r13,r13,4
80030b4: 35 ce 00 04 addi r14,r14,4
* APIs are optional.
*
* NOTE: Currently RTEMS Classic API tasks are always enabled.
*/
for ( the_api = 1;
80030b8: 5d 90 ff da bne r12,r16,8003020 <pthread_key_create+0x7c>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
80030bc: 29 6c 00 08 lw r12,(r11+8)
*key = the_key->Object.id;
_Thread_Enable_dispatch();
return 0;
}
80030c0: 78 02 08 01 mvhi r2,0x801
80030c4: 38 42 6c 74 ori r2,r2,0x6c74
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
80030c8: 28 4d 00 1c lw r13,(r2+28)
80030cc: 21 81 ff ff andi r1,r12,0xffff
80030d0: 34 02 00 02 mvi r2,2
80030d4: f8 00 41 d4 calli 8013824 <__ashlsi3>
80030d8: b5 a1 10 00 add r2,r13,r1
80030dc: 58 4b 00 00 sw (r2+0),r11
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
80030e0: 59 60 00 0c sw (r11+12),r0
}
_Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 );
*key = the_key->Object.id;
80030e4: 59 ec 00 00 sw (r15+0),r12
_Thread_Enable_dispatch();
80030e8: f8 00 0c 21 calli 800616c <_Thread_Enable_dispatch>
return 0;
80030ec: 34 01 00 00 mvi r1,0
}
80030f0: 2b 9d 00 04 lw ra,(sp+4)
80030f4: 2b 8b 00 20 lw r11,(sp+32)
80030f8: 2b 8c 00 1c lw r12,(sp+28)
80030fc: 2b 8d 00 18 lw r13,(sp+24)
8003100: 2b 8e 00 14 lw r14,(sp+20)
8003104: 2b 8f 00 10 lw r15,(sp+16)
8003108: 2b 90 00 0c lw r16,(sp+12)
800310c: 2b 91 00 08 lw r17,(sp+8)
8003110: 37 9c 00 20 addi sp,sp,32
8003114: c3 a0 00 00 ret
08003118 <pthread_key_delete>:
*/
int pthread_key_delete(
pthread_key_t key
)
{
8003118: 37 9c ff ec addi sp,sp,-20
800311c: 5b 8b 00 10 sw (sp+16),r11
8003120: 5b 8c 00 0c sw (sp+12),r12
8003124: 5b 8d 00 08 sw (sp+8),r13
8003128: 5b 9d 00 04 sw (sp+4),ra
pthread_key_t id,
Objects_Locations *location
)
{
return (POSIX_Keys_Control *)
_Objects_Get( &_POSIX_Keys_Information, (Objects_Id) id, location );
800312c: 78 0b 08 01 mvhi r11,0x801
8003130: 39 6b 6c 74 ori r11,r11,0x6c74
8003134: b8 20 10 00 mv r2,r1
8003138: 37 83 00 14 addi r3,sp,20
800313c: b9 60 08 00 mv r1,r11
8003140: f8 00 09 bd calli 8005834 <_Objects_Get>
8003144: b8 20 60 00 mv r12,r1
register POSIX_Keys_Control *the_key;
Objects_Locations location;
uint32_t the_api;
the_key = _POSIX_Keys_Get( key, &location );
switch ( location ) {
8003148: 2b 81 00 14 lw r1,(sp+20)
800314c: 5c 20 00 13 bne r1,r0,8003198 <pthread_key_delete+0x80>
case OBJECTS_LOCAL:
_Objects_Close( &_POSIX_Keys_Information, &the_key->Object );
8003150: b9 60 08 00 mv r1,r11
8003154: b9 80 10 00 mv r2,r12
8003158: f8 00 08 47 calli 8005274 <_Objects_Close>
800315c: b9 80 68 00 mv r13,r12
8003160: 34 0b 00 03 mvi r11,3
for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ )
if ( the_key->Values[ the_api ] )
8003164: 29 a1 00 18 lw r1,(r13+24)
8003168: 44 20 00 02 be r1,r0,8003170 <pthread_key_delete+0x58> <== NEVER TAKEN
_Workspace_Free( the_key->Values[ the_api ] );
800316c: f8 00 12 6b calli 8007b18 <_Workspace_Free>
8003170: 35 6b ff ff addi r11,r11,-1
8003174: 35 ad 00 04 addi r13,r13,4
switch ( location ) {
case OBJECTS_LOCAL:
_Objects_Close( &_POSIX_Keys_Information, &the_key->Object );
for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ )
8003178: 5d 60 ff fb bne r11,r0,8003164 <pthread_key_delete+0x4c>
*/
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
POSIX_Keys_Control *the_key
)
{
_Objects_Free( &_POSIX_Keys_Information, &the_key->Object );
800317c: 78 01 08 01 mvhi r1,0x801
8003180: 38 21 6c 74 ori r1,r1,0x6c74
8003184: b9 80 10 00 mv r2,r12
8003188: f8 00 09 1e calli 8005600 <_Objects_Free>
* NOTE: The destructor is not called and it is the responsibility
* of the application to free the memory.
*/
_POSIX_Keys_Free( the_key );
_Thread_Enable_dispatch();
800318c: f8 00 0b f8 calli 800616c <_Thread_Enable_dispatch>
return 0;
8003190: 34 01 00 00 mvi r1,0
8003194: e0 00 00 02 bi 800319c <pthread_key_delete+0x84>
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
8003198: 34 01 00 16 mvi r1,22
}
800319c: 2b 9d 00 04 lw ra,(sp+4)
80031a0: 2b 8b 00 10 lw r11,(sp+16)
80031a4: 2b 8c 00 0c lw r12,(sp+12)
80031a8: 2b 8d 00 08 lw r13,(sp+8)
80031ac: 37 9c 00 14 addi sp,sp,20
80031b0: c3 a0 00 00 ret
080029d4 <pthread_mutexattr_gettype>:
const pthread_mutexattr_t *attr,
int *type
)
{
if ( !attr )
return EINVAL;
80029d4: 34 03 00 16 mvi r3,22
int pthread_mutexattr_gettype(
const pthread_mutexattr_t *attr,
int *type
)
{
if ( !attr )
80029d8: 44 20 00 07 be r1,r0,80029f4 <pthread_mutexattr_gettype+0x20>
return EINVAL;
if ( !attr->is_initialized )
80029dc: 28 24 00 00 lw r4,(r1+0)
80029e0: 44 80 00 05 be r4,r0,80029f4 <pthread_mutexattr_gettype+0x20>
return EINVAL;
if ( !type )
80029e4: 44 40 00 04 be r2,r0,80029f4 <pthread_mutexattr_gettype+0x20><== NEVER TAKEN
return EINVAL;
*type = attr->type;
80029e8: 28 21 00 10 lw r1,(r1+16)
return 0;
80029ec: 34 03 00 00 mvi r3,0
return EINVAL;
if ( !type )
return EINVAL;
*type = attr->type;
80029f0: 58 41 00 00 sw (r2+0),r1
return 0;
}
80029f4: b8 60 08 00 mv r1,r3
80029f8: c3 a0 00 00 ret
08005200 <pthread_mutexattr_setpshared>:
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
8005200: 34 03 00 16 mvi r3,22
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
8005204: 44 20 00 07 be r1,r0,8005220 <pthread_mutexattr_setpshared+0x20>
8005208: 28 24 00 00 lw r4,(r1+0)
800520c: 44 80 00 05 be r4,r0,8005220 <pthread_mutexattr_setpshared+0x20>
return EINVAL;
switch ( pshared ) {
8005210: 34 04 00 01 mvi r4,1
8005214: 54 44 00 03 bgu r2,r4,8005220 <pthread_mutexattr_setpshared+0x20><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
8005218: 58 22 00 04 sw (r1+4),r2
return 0;
800521c: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
8005220: b8 60 08 00 mv r1,r3
8005224: c3 a0 00 00 ret
08002a48 <pthread_mutexattr_settype>:
pthread_mutexattr_t *attr,
int type
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
8002a48: 34 03 00 16 mvi r3,22
int pthread_mutexattr_settype(
pthread_mutexattr_t *attr,
int type
)
{
if ( !attr || !attr->is_initialized )
8002a4c: 44 20 00 07 be r1,r0,8002a68 <pthread_mutexattr_settype+0x20>
8002a50: 28 24 00 00 lw r4,(r1+0)
8002a54: 44 80 00 05 be r4,r0,8002a68 <pthread_mutexattr_settype+0x20><== NEVER TAKEN
return EINVAL;
switch ( type ) {
8002a58: 34 04 00 03 mvi r4,3
8002a5c: 54 44 00 03 bgu r2,r4,8002a68 <pthread_mutexattr_settype+0x20>
case PTHREAD_MUTEX_NORMAL:
case PTHREAD_MUTEX_RECURSIVE:
case PTHREAD_MUTEX_ERRORCHECK:
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
8002a60: 58 22 00 10 sw (r1+16),r2
return 0;
8002a64: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
8002a68: b8 60 08 00 mv r1,r3
8002a6c: c3 a0 00 00 ret
08003908 <pthread_once>:
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
8003908: 37 9c ff ec addi sp,sp,-20
800390c: 5b 8b 00 10 sw (sp+16),r11
8003910: 5b 8c 00 0c sw (sp+12),r12
8003914: 5b 8d 00 08 sw (sp+8),r13
8003918: 5b 9d 00 04 sw (sp+4),ra
800391c: b8 20 58 00 mv r11,r1
8003920: b8 40 60 00 mv r12,r2
if ( !once_control || !init_routine )
8003924: 64 21 00 00 cmpei r1,r1,0
8003928: 64 42 00 00 cmpei r2,r2,0
800392c: b8 41 10 00 or r2,r2,r1
return EINVAL;
8003930: 34 01 00 16 mvi r1,22
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
if ( !once_control || !init_routine )
8003934: 5c 40 00 13 bne r2,r0,8003980 <pthread_once+0x78>
return EINVAL;
if ( !once_control->init_executed ) {
8003938: 29 6d 00 04 lw r13,(r11+4)
once_control->init_executed = true;
(*init_routine)();
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
}
return 0;
800393c: 34 01 00 00 mvi r1,0
)
{
if ( !once_control || !init_routine )
return EINVAL;
if ( !once_control->init_executed ) {
8003940: 5d a2 00 10 bne r13,r2,8003980 <pthread_once+0x78>
rtems_mode saveMode;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
8003944: 34 01 01 00 mvi r1,256
8003948: 34 02 01 00 mvi r2,256
800394c: 37 83 00 14 addi r3,sp,20
8003950: f8 00 01 93 calli 8003f9c <rtems_task_mode>
if ( !once_control->init_executed ) {
8003954: 29 61 00 04 lw r1,(r11+4)
8003958: 5c 2d 00 05 bne r1,r13,800396c <pthread_once+0x64> <== NEVER TAKEN
once_control->is_initialized = true;
800395c: 34 01 00 01 mvi r1,1
8003960: 59 61 00 00 sw (r11+0),r1
once_control->init_executed = true;
8003964: 59 61 00 04 sw (r11+4),r1
(*init_routine)();
8003968: d9 80 00 00 call r12
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
800396c: 2b 81 00 14 lw r1,(sp+20)
8003970: 34 02 01 00 mvi r2,256
8003974: 37 83 00 14 addi r3,sp,20
8003978: f8 00 01 89 calli 8003f9c <rtems_task_mode>
}
return 0;
800397c: 34 01 00 00 mvi r1,0
}
8003980: 2b 9d 00 04 lw ra,(sp+4)
8003984: 2b 8b 00 10 lw r11,(sp+16)
8003988: 2b 8c 00 0c lw r12,(sp+12)
800398c: 2b 8d 00 08 lw r13,(sp+8)
8003990: 37 9c 00 14 addi sp,sp,20
8003994: c3 a0 00 00 ret
080040d4 <pthread_rwlock_init>:
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
80040d4: 37 9c ff e0 addi sp,sp,-32
80040d8: 5b 8b 00 14 sw (sp+20),r11
80040dc: 5b 8c 00 10 sw (sp+16),r12
80040e0: 5b 8d 00 0c sw (sp+12),r13
80040e4: 5b 8e 00 08 sw (sp+8),r14
80040e8: 5b 9d 00 04 sw (sp+4),ra
/*
* Error check parameters
*/
if ( !rwlock )
return EINVAL;
80040ec: 34 03 00 16 mvi r3,22
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
80040f0: b8 20 68 00 mv r13,r1
const pthread_rwlockattr_t *the_attr;
/*
* Error check parameters
*/
if ( !rwlock )
80040f4: 44 20 00 27 be r1,r0,8004190 <pthread_rwlock_init+0xbc>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
80040f8: 5c 40 00 05 bne r2,r0,800410c <pthread_rwlock_init+0x38>
the_attr = attr;
} else {
(void) pthread_rwlockattr_init( &default_attr );
80040fc: 37 8b 00 18 addi r11,sp,24
8004100: b9 60 08 00 mv r1,r11
8004104: f8 00 02 fe calli 8004cfc <pthread_rwlockattr_init>
the_attr = &default_attr;
8004108: b9 60 10 00 mv r2,r11
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
800410c: 28 41 00 00 lw r1,(r2+0)
return EINVAL;
8004110: 34 03 00 16 mvi r3,22
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
8004114: 44 20 00 1f be r1,r0,8004190 <pthread_rwlock_init+0xbc> <== NEVER TAKEN
return EINVAL;
switch ( the_attr->process_shared ) {
8004118: 28 4e 00 04 lw r14,(r2+4)
800411c: 5d c0 00 1d bne r14,r0,8004190 <pthread_rwlock_init+0xbc> <== NEVER TAKEN
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8004120: 78 02 08 01 mvhi r2,0x801
8004124: 38 42 78 6c ori r2,r2,0x786c
8004128: 28 41 00 00 lw r1,(r2+0)
800412c: 34 21 00 01 addi r1,r1,1
8004130: 58 41 00 00 sw (r2+0),r1
* the inactive chain of free RWLock control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void )
{
return (POSIX_RWLock_Control *)
_Objects_Allocate( &_POSIX_RWLock_Information );
8004134: 78 0c 08 01 mvhi r12,0x801
8004138: 39 8c 7a 0c ori r12,r12,0x7a0c
800413c: b9 80 08 00 mv r1,r12
8004140: f8 00 09 a2 calli 80067c8 <_Objects_Allocate>
8004144: b8 20 58 00 mv r11,r1
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_rwlock = _POSIX_RWLock_Allocate();
if ( !the_rwlock ) {
8004148: 5c 2e 00 04 bne r1,r14,8004158 <pthread_rwlock_init+0x84>
_Thread_Enable_dispatch();
800414c: f8 00 0d 20 calli 80075cc <_Thread_Enable_dispatch>
return EAGAIN;
8004150: 34 03 00 0b mvi r3,11
8004154: e0 00 00 0f bi 8004190 <pthread_rwlock_init+0xbc>
}
_CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes );
8004158: 34 21 00 10 addi r1,r1,16
800415c: 37 82 00 20 addi r2,sp,32
8004160: f8 00 06 dd calli 8005cd4 <_CORE_RWLock_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8004164: 29 6e 00 08 lw r14,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8004168: 29 8c 00 1c lw r12,(r12+28)
800416c: 34 02 00 02 mvi r2,2
8004170: 21 c1 ff ff andi r1,r14,0xffff
8004174: f8 00 3f f6 calli 801414c <__ashlsi3>
8004178: b5 81 08 00 add r1,r12,r1
800417c: 58 2b 00 00 sw (r1+0),r11
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
8004180: 59 60 00 0c sw (r11+12),r0
&_POSIX_RWLock_Information,
&the_rwlock->Object,
0
);
*rwlock = the_rwlock->Object.id;
8004184: 59 ae 00 00 sw (r13+0),r14
_Thread_Enable_dispatch();
8004188: f8 00 0d 11 calli 80075cc <_Thread_Enable_dispatch>
return 0;
800418c: 34 03 00 00 mvi r3,0
}
8004190: b8 60 08 00 mv r1,r3
8004194: 2b 9d 00 04 lw ra,(sp+4)
8004198: 2b 8b 00 14 lw r11,(sp+20)
800419c: 2b 8c 00 10 lw r12,(sp+16)
80041a0: 2b 8d 00 0c lw r13,(sp+12)
80041a4: 2b 8e 00 08 lw r14,(sp+8)
80041a8: 37 9c 00 20 addi sp,sp,32
80041ac: c3 a0 00 00 ret
08004238 <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004238: 37 9c ff e0 addi sp,sp,-32
800423c: 5b 8b 00 18 sw (sp+24),r11
8004240: 5b 8c 00 14 sw (sp+20),r12
8004244: 5b 8d 00 10 sw (sp+16),r13
8004248: 5b 8e 00 0c sw (sp+12),r14
800424c: 5b 8f 00 08 sw (sp+8),r15
8004250: 5b 9d 00 04 sw (sp+4),ra
8004254: b8 20 70 00 mv r14,r1
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
return EINVAL;
8004258: 34 0b 00 16 mvi r11,22
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
800425c: b8 40 08 00 mv r1,r2
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
8004260: 45 c0 00 25 be r14,r0,80042f4 <pthread_rwlock_timedrdlock+0xbc>
*
* 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 );
8004264: 37 82 00 1c addi r2,sp,28
8004268: f8 00 1b d5 calli 800b1bc <_POSIX_Absolute_timeout_to_ticks>
800426c: 29 c2 00 00 lw r2,(r14+0)
8004270: b8 20 60 00 mv r12,r1
8004274: 78 01 08 01 mvhi r1,0x801
8004278: 38 21 7a 0c ori r1,r1,0x7a0c
800427c: 37 83 00 20 addi r3,sp,32
8004280: f8 00 0a b7 calli 8006d5c <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
8004284: 2b 8f 00 20 lw r15,(sp+32)
8004288: 5d e0 00 1b bne r15,r0,80042f4 <pthread_rwlock_timedrdlock+0xbc>
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,
800428c: 65 8d 00 03 cmpei r13,r12,3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
8004290: 29 c2 00 00 lw r2,(r14+0)
8004294: 2b 84 00 1c lw r4,(sp+28)
8004298: 34 21 00 10 addi r1,r1,16
800429c: b9 a0 18 00 mv r3,r13
80042a0: 34 05 00 00 mvi r5,0
80042a4: f8 00 06 99 calli 8005d08 <_CORE_RWLock_Obtain_for_reading>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
80042a8: f8 00 0c c9 calli 80075cc <_Thread_Enable_dispatch>
if ( !do_wait ) {
80042ac: 5d af 00 0a bne r13,r15,80042d4 <pthread_rwlock_timedrdlock+0x9c>
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
80042b0: 78 01 08 01 mvhi r1,0x801
80042b4: 38 21 7d 44 ori r1,r1,0x7d44
80042b8: 28 21 00 0c lw r1,(r1+12)
80042bc: 34 02 00 02 mvi r2,2
80042c0: 28 21 00 34 lw r1,(r1+52)
80042c4: 5c 22 00 04 bne r1,r2,80042d4 <pthread_rwlock_timedrdlock+0x9c>
switch (status) {
80042c8: 45 8d 00 0b be r12,r13,80042f4 <pthread_rwlock_timedrdlock+0xbc><== NEVER TAKEN
80042cc: 55 81 00 02 bgu r12,r1,80042d4 <pthread_rwlock_timedrdlock+0x9c><== NEVER TAKEN
80042d0: e0 00 00 08 bi 80042f0 <pthread_rwlock_timedrdlock+0xb8>
}
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
(CORE_RWLock_Status) _Thread_Executing->Wait.return_code
80042d4: 78 01 08 01 mvhi r1,0x801
80042d8: 38 21 7d 44 ori r1,r1,0x7d44
80042dc: 28 21 00 0c lw r1,(r1+12)
break;
}
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
80042e0: 28 21 00 34 lw r1,(r1+52)
80042e4: f8 00 00 45 calli 80043f8 <_POSIX_RWLock_Translate_core_RWLock_return_code>
80042e8: b8 20 58 00 mv r11,r1
80042ec: e0 00 00 02 bi 80042f4 <pthread_rwlock_timedrdlock+0xbc>
switch (status) {
case POSIX_ABSOLUTE_TIMEOUT_INVALID:
return EINVAL;
case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST:
case POSIX_ABSOLUTE_TIMEOUT_IS_NOW:
return ETIMEDOUT;
80042f0: 34 0b 00 74 mvi r11,116
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
80042f4: b9 60 08 00 mv r1,r11
80042f8: 2b 9d 00 04 lw ra,(sp+4)
80042fc: 2b 8b 00 18 lw r11,(sp+24)
8004300: 2b 8c 00 14 lw r12,(sp+20)
8004304: 2b 8d 00 10 lw r13,(sp+16)
8004308: 2b 8e 00 0c lw r14,(sp+12)
800430c: 2b 8f 00 08 lw r15,(sp+8)
8004310: 37 9c 00 20 addi sp,sp,32
8004314: c3 a0 00 00 ret
08004318 <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004318: 37 9c ff e0 addi sp,sp,-32
800431c: 5b 8b 00 18 sw (sp+24),r11
8004320: 5b 8c 00 14 sw (sp+20),r12
8004324: 5b 8d 00 10 sw (sp+16),r13
8004328: 5b 8e 00 0c sw (sp+12),r14
800432c: 5b 8f 00 08 sw (sp+8),r15
8004330: 5b 9d 00 04 sw (sp+4),ra
8004334: b8 20 70 00 mv r14,r1
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
return EINVAL;
8004338: 34 0b 00 16 mvi r11,22
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
800433c: b8 40 08 00 mv r1,r2
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
8004340: 45 c0 00 25 be r14,r0,80043d4 <pthread_rwlock_timedwrlock+0xbc>
*
* 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 );
8004344: 37 82 00 1c addi r2,sp,28
8004348: f8 00 1b 9d calli 800b1bc <_POSIX_Absolute_timeout_to_ticks>
800434c: 29 c2 00 00 lw r2,(r14+0)
8004350: b8 20 60 00 mv r12,r1
8004354: 78 01 08 01 mvhi r1,0x801
8004358: 38 21 7a 0c ori r1,r1,0x7a0c
800435c: 37 83 00 20 addi r3,sp,32
8004360: f8 00 0a 7f calli 8006d5c <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
8004364: 2b 8f 00 20 lw r15,(sp+32)
8004368: 5d e0 00 1b bne r15,r0,80043d4 <pthread_rwlock_timedwrlock+0xbc>
(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,
800436c: 65 8d 00 03 cmpei r13,r12,3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
8004370: 29 c2 00 00 lw r2,(r14+0)
8004374: 2b 84 00 1c lw r4,(sp+28)
8004378: 34 21 00 10 addi r1,r1,16
800437c: b9 a0 18 00 mv r3,r13
8004380: 34 05 00 00 mvi r5,0
8004384: f8 00 06 a3 calli 8005e10 <_CORE_RWLock_Obtain_for_writing>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
8004388: f8 00 0c 91 calli 80075cc <_Thread_Enable_dispatch>
if ( !do_wait &&
800438c: 5d af 00 0a bne r13,r15,80043b4 <pthread_rwlock_timedwrlock+0x9c>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
8004390: 78 01 08 01 mvhi r1,0x801
8004394: 38 21 7d 44 ori r1,r1,0x7d44
8004398: 28 21 00 0c lw r1,(r1+12)
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
800439c: 34 02 00 02 mvi r2,2
80043a0: 28 21 00 34 lw r1,(r1+52)
80043a4: 5c 22 00 04 bne r1,r2,80043b4 <pthread_rwlock_timedwrlock+0x9c>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
switch (status) {
80043a8: 45 8d 00 0b be r12,r13,80043d4 <pthread_rwlock_timedwrlock+0xbc><== NEVER TAKEN
80043ac: 55 81 00 02 bgu r12,r1,80043b4 <pthread_rwlock_timedwrlock+0x9c><== NEVER TAKEN
80043b0: e0 00 00 08 bi 80043d0 <pthread_rwlock_timedwrlock+0xb8>
break;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
(CORE_RWLock_Status) _Thread_Executing->Wait.return_code
80043b4: 78 01 08 01 mvhi r1,0x801
80043b8: 38 21 7d 44 ori r1,r1,0x7d44
80043bc: 28 21 00 0c lw r1,(r1+12)
case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE:
break;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
80043c0: 28 21 00 34 lw r1,(r1+52)
80043c4: f8 00 00 0d calli 80043f8 <_POSIX_RWLock_Translate_core_RWLock_return_code>
80043c8: b8 20 58 00 mv r11,r1
80043cc: e0 00 00 02 bi 80043d4 <pthread_rwlock_timedwrlock+0xbc>
switch (status) {
case POSIX_ABSOLUTE_TIMEOUT_INVALID:
return EINVAL;
case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST:
case POSIX_ABSOLUTE_TIMEOUT_IS_NOW:
return ETIMEDOUT;
80043d0: 34 0b 00 74 mvi r11,116
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
80043d4: b9 60 08 00 mv r1,r11
80043d8: 2b 9d 00 04 lw ra,(sp+4)
80043dc: 2b 8b 00 18 lw r11,(sp+24)
80043e0: 2b 8c 00 14 lw r12,(sp+20)
80043e4: 2b 8d 00 10 lw r13,(sp+16)
80043e8: 2b 8e 00 0c lw r14,(sp+12)
80043ec: 2b 8f 00 08 lw r15,(sp+8)
80043f0: 37 9c 00 20 addi sp,sp,32
80043f4: c3 a0 00 00 ret
08004d1c <pthread_rwlockattr_setpshared>:
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
return EINVAL;
8004d1c: 34 03 00 16 mvi r3,22
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
8004d20: 44 20 00 07 be r1,r0,8004d3c <pthread_rwlockattr_setpshared+0x20>
return EINVAL;
if ( !attr->is_initialized )
8004d24: 28 24 00 00 lw r4,(r1+0)
8004d28: 44 80 00 05 be r4,r0,8004d3c <pthread_rwlockattr_setpshared+0x20>
return EINVAL;
switch ( pshared ) {
8004d2c: 34 04 00 01 mvi r4,1
8004d30: 54 44 00 03 bgu r2,r4,8004d3c <pthread_rwlockattr_setpshared+0x20><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
8004d34: 58 22 00 04 sw (r1+4),r2
return 0;
8004d38: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
8004d3c: b8 60 08 00 mv r1,r3
8004d40: c3 a0 00 00 ret
08006158 <pthread_setschedparam>:
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
8006158: 37 9c ff dc addi sp,sp,-36
800615c: 5b 8b 00 18 sw (sp+24),r11
8006160: 5b 8c 00 14 sw (sp+20),r12
8006164: 5b 8d 00 10 sw (sp+16),r13
8006168: 5b 8e 00 0c sw (sp+12),r14
800616c: 5b 8f 00 08 sw (sp+8),r15
8006170: 5b 9d 00 04 sw (sp+4),ra
/*
* Check all the parameters
*/
if ( !param )
return EINVAL;
8006174: 34 0e 00 16 mvi r14,22
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
8006178: b8 20 58 00 mv r11,r1
800617c: b8 40 78 00 mv r15,r2
8006180: b8 60 60 00 mv r12,r3
int rc;
/*
* Check all the parameters
*/
if ( !param )
8006184: 44 60 00 46 be r3,r0,800629c <pthread_setschedparam+0x144>
return EINVAL;
rc = _POSIX_Thread_Translate_sched_param(
8006188: b8 40 08 00 mv r1,r2
800618c: 37 84 00 20 addi r4,sp,32
8006190: b8 60 10 00 mv r2,r3
8006194: 37 83 00 24 addi r3,sp,36
8006198: f8 00 19 bc calli 800c888 <_POSIX_Thread_Translate_sched_param>
800619c: b8 20 70 00 mv r14,r1
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( rc )
80061a0: 5c 20 00 3f bne r1,r0,800629c <pthread_setschedparam+0x144>
80061a4: 78 03 08 01 mvhi r3,0x801
80061a8: b8 60 08 00 mv r1,r3
80061ac: 38 21 aa 9c ori r1,r1,0xaa9c
80061b0: b9 60 10 00 mv r2,r11
80061b4: 37 83 00 1c addi r3,sp,28
80061b8: f8 00 07 a6 calli 8008050 <_Objects_Get>
80061bc: b8 20 68 00 mv r13,r1
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _POSIX_Threads_Get( thread, &location );
switch ( location ) {
80061c0: 2b 81 00 1c lw r1,(sp+28)
80061c4: 5c 2e 00 35 bne r1,r14,8006298 <pthread_setschedparam+0x140>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
80061c8: 29 ab 01 2c lw r11,(r13+300)
if ( api->schedpolicy == SCHED_SPORADIC )
80061cc: 34 01 00 04 mvi r1,4
80061d0: 29 62 00 80 lw r2,(r11+128)
80061d4: 5c 41 00 03 bne r2,r1,80061e0 <pthread_setschedparam+0x88>
(void) _Watchdog_Remove( &api->Sporadic_timer );
80061d8: 35 61 00 a4 addi r1,r11,164
80061dc: f8 00 0f f9 calli 800a1c0 <_Watchdog_Remove>
api->schedpolicy = policy;
80061e0: 59 6f 00 80 sw (r11+128),r15
api->schedparam = *param;
80061e4: 29 81 00 14 lw r1,(r12+20)
80061e8: 29 82 00 00 lw r2,(r12+0)
80061ec: 29 86 00 04 lw r6,(r12+4)
80061f0: 29 85 00 08 lw r5,(r12+8)
80061f4: 29 84 00 0c lw r4,(r12+12)
80061f8: 29 83 00 10 lw r3,(r12+16)
80061fc: 29 87 00 18 lw r7,(r12+24)
8006200: 59 61 00 98 sw (r11+152),r1
the_thread->budget_algorithm = budget_algorithm;
8006204: 2b 81 00 24 lw r1,(sp+36)
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
api->schedpolicy = policy;
api->schedparam = *param;
8006208: 59 62 00 84 sw (r11+132),r2
800620c: 59 66 00 88 sw (r11+136),r6
8006210: 59 65 00 8c sw (r11+140),r5
8006214: 59 64 00 90 sw (r11+144),r4
8006218: 59 63 00 94 sw (r11+148),r3
800621c: 59 67 00 9c sw (r11+156),r7
the_thread->budget_algorithm = budget_algorithm;
8006220: 59 a1 00 7c sw (r13+124),r1
the_thread->budget_callout = budget_callout;
8006224: 2b 81 00 20 lw r1,(sp+32)
8006228: 59 a1 00 80 sw (r13+128),r1
switch ( api->schedpolicy ) {
800622c: 48 0f 00 19 bg r0,r15,8006290 <pthread_setschedparam+0x138><== NEVER TAKEN
8006230: 34 01 00 02 mvi r1,2
8006234: 4c 2f 00 04 bge r1,r15,8006244 <pthread_setschedparam+0xec>
8006238: 34 01 00 04 mvi r1,4
800623c: 5d e1 00 15 bne r15,r1,8006290 <pthread_setschedparam+0x138><== NEVER TAKEN
8006240: e0 00 00 0e bi 8006278 <pthread_setschedparam+0x120>
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
8006244: 78 01 08 01 mvhi r1,0x801
8006248: 38 21 a8 54 ori r1,r1,0xa854
800624c: 28 21 00 00 lw r1,(r1+0)
the_thread->real_priority =
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
8006250: 34 03 00 01 mvi r3,1
switch ( api->schedpolicy ) {
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
8006254: 59 a1 00 78 sw (r13+120),r1
8006258: 78 01 08 01 mvhi r1,0x801
800625c: 38 21 a0 e4 ori r1,r1,0xa0e4
8006260: 40 21 00 00 lbu r1,(r1+0)
8006264: c8 22 10 00 sub r2,r1,r2
the_thread->real_priority =
8006268: 59 a2 00 18 sw (r13+24),r2
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
800626c: b9 a0 08 00 mv r1,r13
8006270: f8 00 08 72 calli 8008438 <_Thread_Change_priority>
the_thread,
the_thread->real_priority,
true
);
break;
8006274: e0 00 00 07 bi 8006290 <pthread_setschedparam+0x138>
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
8006278: 59 62 00 a0 sw (r11+160),r2
_Watchdog_Remove( &api->Sporadic_timer );
800627c: 35 61 00 a4 addi r1,r11,164
8006280: f8 00 0f d0 calli 800a1c0 <_Watchdog_Remove>
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
8006284: 34 01 00 00 mvi r1,0
8006288: b9 a0 10 00 mv r2,r13
800628c: fb ff ff 62 calli 8006014 <_POSIX_Threads_Sporadic_budget_TSR>
break;
}
_Thread_Enable_dispatch();
8006290: f8 00 09 be calli 8008988 <_Thread_Enable_dispatch>
return 0;
8006294: e0 00 00 02 bi 800629c <pthread_setschedparam+0x144>
#endif
case OBJECTS_ERROR:
break;
}
return ESRCH;
8006298: 34 0e 00 03 mvi r14,3
}
800629c: b9 c0 08 00 mv r1,r14
80062a0: 2b 9d 00 04 lw ra,(sp+4)
80062a4: 2b 8b 00 18 lw r11,(sp+24)
80062a8: 2b 8c 00 14 lw r12,(sp+20)
80062ac: 2b 8d 00 10 lw r13,(sp+16)
80062b0: 2b 8e 00 0c lw r14,(sp+12)
80062b4: 2b 8f 00 08 lw r15,(sp+8)
80062b8: 37 9c 00 24 addi sp,sp,36
80062bc: c3 a0 00 00 ret
08003648 <pthread_testcancel>:
*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
void pthread_testcancel( void )
{
8003648: 37 9c ff f8 addi sp,sp,-8
800364c: 5b 8b 00 08 sw (sp+8),r11
8003650: 5b 9d 00 04 sw (sp+4),ra
* 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() )
8003654: 78 01 08 01 mvhi r1,0x801
8003658: 38 21 6d 2c ori r1,r1,0x6d2c
800365c: 28 22 00 08 lw r2,(r1+8)
8003660: 5c 40 00 14 bne r2,r0,80036b0 <pthread_testcancel+0x68> <== NEVER TAKEN
return;
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
8003664: 28 21 00 0c lw r1,(r1+12)
8003668: 28 22 01 2c lw r2,(r1+300)
800366c: 78 01 08 01 mvhi r1,0x801
8003670: 38 21 68 54 ori r1,r1,0x6854
8003674: 28 23 00 00 lw r3,(r1+0)
8003678: 34 63 00 01 addi r3,r3,1
800367c: 58 23 00 00 sw (r1+0),r3
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
8003680: 28 41 00 d4 lw r1,(r2+212)
*/
void pthread_testcancel( void )
{
POSIX_API_Control *thread_support;
bool cancel = false;
8003684: 34 0b 00 00 mvi r11,0
return;
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
8003688: 5c 2b 00 03 bne r1,r11,8003694 <pthread_testcancel+0x4c> <== NEVER TAKEN
/* 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));
800368c: 28 4b 00 dc lw r11,(r2+220)
8003690: 7d 6b 00 00 cmpnei r11,r11,0
thread_support->cancelation_requested )
cancel = true;
_Thread_Enable_dispatch();
8003694: f8 00 08 ef calli 8005a50 <_Thread_Enable_dispatch>
if ( cancel )
8003698: 45 60 00 06 be r11,r0,80036b0 <pthread_testcancel+0x68>
_POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED );
800369c: 78 01 08 01 mvhi r1,0x801
80036a0: 38 21 6d 2c ori r1,r1,0x6d2c
80036a4: 28 21 00 0c lw r1,(r1+12)
80036a8: 34 02 ff ff mvi r2,-1
80036ac: f8 00 18 af calli 8009968 <_POSIX_Thread_Exit>
}
80036b0: 2b 9d 00 04 lw ra,(sp+4)
80036b4: 2b 8b 00 08 lw r11,(sp+8)
80036b8: 37 9c 00 08 addi sp,sp,8
80036bc: c3 a0 00 00 ret
08010b48 <rtems_clock_set_nanoseconds_extension>:
* error code - if unsuccessful
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
8010b48: b8 20 18 00 mv r3,r1
if ( !routine )
return RTEMS_INVALID_ADDRESS;
8010b4c: 34 01 00 09 mvi r1,9
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
if ( !routine )
8010b50: 44 60 00 05 be r3,r0,8010b64 <rtems_clock_set_nanoseconds_extension+0x1c><== ALWAYS TAKEN
return RTEMS_INVALID_ADDRESS;
_Watchdog_Nanoseconds_since_tick_handler = routine;
8010b54: 78 02 08 04 mvhi r2,0x804 <== NOT EXECUTED
8010b58: 38 42 0e 28 ori r2,r2,0xe28 <== NOT EXECUTED
8010b5c: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED
return RTEMS_SUCCESSFUL;
8010b60: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
8010b64: c3 a0 00 00 ret
08010f5c <rtems_io_control>:
rtems_status_code rtems_io_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *argument
)
{
8010f5c: 37 9c ff ec addi sp,sp,-20
8010f60: 5b 8b 00 10 sw (sp+16),r11
8010f64: 5b 8c 00 0c sw (sp+12),r12
8010f68: 5b 8d 00 08 sw (sp+8),r13
8010f6c: 5b 9d 00 04 sw (sp+4),ra
rtems_device_driver_entry callout;
if ( major >= _IO_Number_of_drivers )
8010f70: 78 04 08 01 mvhi r4,0x801
8010f74: 38 84 a2 40 ori r4,r4,0xa240
rtems_status_code rtems_io_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *argument
)
{
8010f78: b8 40 60 00 mv r12,r2
rtems_device_driver_entry callout;
if ( major >= _IO_Number_of_drivers )
8010f7c: 28 82 00 00 lw r2,(r4+0)
rtems_status_code rtems_io_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *argument
)
{
8010f80: b8 20 58 00 mv r11,r1
rtems_device_driver_entry callout;
if ( major >= _IO_Number_of_drivers )
return RTEMS_INVALID_NUMBER;
8010f84: 34 04 00 0a mvi r4,10
void *argument
)
{
rtems_device_driver_entry callout;
if ( major >= _IO_Number_of_drivers )
8010f88: 50 22 00 13 bgeu r1,r2,8010fd4 <rtems_io_control+0x78> <== NEVER TAKEN
return RTEMS_INVALID_NUMBER;
callout = _IO_Driver_address_table[major].control_entry;
8010f8c: 78 04 08 01 mvhi r4,0x801
8010f90: 38 84 a2 44 ori r4,r4,0xa244
8010f94: 34 02 00 01 mvi r2,1
8010f98: 28 8d 00 00 lw r13,(r4+0)
8010f9c: 5b 83 00 14 sw (sp+20),r3
8010fa0: f8 00 17 cc calli 8016ed0 <__ashlsi3>
8010fa4: b4 2b 08 00 add r1,r1,r11
8010fa8: 34 02 00 03 mvi r2,3
8010fac: f8 00 17 c9 calli 8016ed0 <__ashlsi3>
8010fb0: b5 a1 08 00 add r1,r13,r1
8010fb4: 28 25 00 14 lw r5,(r1+20)
return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
8010fb8: 34 04 00 00 mvi r4,0
8010fbc: 2b 83 00 14 lw r3,(sp+20)
8010fc0: 44 a0 00 05 be r5,r0,8010fd4 <rtems_io_control+0x78>
8010fc4: b9 60 08 00 mv r1,r11
8010fc8: b9 80 10 00 mv r2,r12
8010fcc: d8 a0 00 00 call r5
8010fd0: b8 20 20 00 mv r4,r1
}
8010fd4: b8 80 08 00 mv r1,r4
8010fd8: 2b 9d 00 04 lw ra,(sp+4)
8010fdc: 2b 8b 00 10 lw r11,(sp+16)
8010fe0: 2b 8c 00 0c lw r12,(sp+12)
8010fe4: 2b 8d 00 08 lw r13,(sp+8)
8010fe8: 37 9c 00 14 addi sp,sp,20
8010fec: c3 a0 00 00 ret
080060c0 <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)
{
80060c0: 37 9c ff e4 addi sp,sp,-28
80060c4: 5b 8b 00 1c sw (sp+28),r11
80060c8: 5b 8c 00 18 sw (sp+24),r12
80060cc: 5b 8d 00 14 sw (sp+20),r13
80060d0: 5b 8e 00 10 sw (sp+16),r14
80060d4: 5b 8f 00 0c sw (sp+12),r15
80060d8: 5b 90 00 08 sw (sp+8),r16
80060dc: 5b 9d 00 04 sw (sp+4),ra
80060e0: b8 20 78 00 mv r15,r1
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
80060e4: 44 20 00 18 be r1,r0,8006144 <rtems_iterate_over_all_threads+0x84><== NEVER TAKEN
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
80060e8: 78 02 08 02 mvhi r2,0x802
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
80060ec: 78 0b 08 02 mvhi r11,0x802
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
80060f0: 38 42 96 38 ori r2,r2,0x9638
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
80060f4: 39 6b 96 3c ori r11,r11,0x963c
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
80060f8: 34 50 00 10 addi r16,r2,16
if ( !routine )
return;
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
if ( !_Objects_Information_table[ api_index ] )
80060fc: 29 61 00 00 lw r1,(r11+0)
8006100: 44 20 00 0f be r1,r0,800613c <rtems_iterate_over_all_threads+0x7c><== NEVER TAKEN
continue;
information = _Objects_Information_table[ api_index ][ 1 ];
8006104: 28 2c 00 04 lw r12,(r1+4)
if ( !information )
8006108: 34 0e 00 04 mvi r14,4
800610c: 34 0d 00 01 mvi r13,1
8006110: 5d 80 00 09 bne r12,r0,8006134 <rtems_iterate_over_all_threads+0x74>
8006114: e0 00 00 0a bi 800613c <rtems_iterate_over_all_threads+0x7c>
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
8006118: 29 81 00 1c lw r1,(r12+28)
800611c: b4 2e 08 00 add r1,r1,r14
8006120: 28 21 00 00 lw r1,(r1+0)
if ( !the_thread )
8006124: 44 20 00 02 be r1,r0,800612c <rtems_iterate_over_all_threads+0x6c>
continue;
(*routine)(the_thread);
8006128: d9 e0 00 00 call r15
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
800612c: 35 ad 00 01 addi r13,r13,1
8006130: 35 ce 00 04 addi r14,r14,4
8006134: 2d 81 00 10 lhu r1,(r12+16)
8006138: 50 2d ff f8 bgeu r1,r13,8006118 <rtems_iterate_over_all_threads+0x58>
800613c: 35 6b 00 04 addi r11,r11,4
Objects_Information *information;
if ( !routine )
return;
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
8006140: 5d 70 ff ef bne r11,r16,80060fc <rtems_iterate_over_all_threads+0x3c>
(*routine)(the_thread);
}
}
}
8006144: 2b 9d 00 04 lw ra,(sp+4)
8006148: 2b 8b 00 1c lw r11,(sp+28)
800614c: 2b 8c 00 18 lw r12,(sp+24)
8006150: 2b 8d 00 14 lw r13,(sp+20)
8006154: 2b 8e 00 10 lw r14,(sp+16)
8006158: 2b 8f 00 0c lw r15,(sp+12)
800615c: 2b 90 00 08 lw r16,(sp+8)
8006160: 37 9c 00 1c addi sp,sp,28
8006164: c3 a0 00 00 ret
08011a64 <rtems_partition_create>:
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
8011a64: 37 9c ff d8 addi sp,sp,-40
8011a68: 5b 8b 00 28 sw (sp+40),r11
8011a6c: 5b 8c 00 24 sw (sp+36),r12
8011a70: 5b 8d 00 20 sw (sp+32),r13
8011a74: 5b 8e 00 1c sw (sp+28),r14
8011a78: 5b 8f 00 18 sw (sp+24),r15
8011a7c: 5b 90 00 14 sw (sp+20),r16
8011a80: 5b 91 00 10 sw (sp+16),r17
8011a84: 5b 92 00 0c sw (sp+12),r18
8011a88: 5b 93 00 08 sw (sp+8),r19
8011a8c: 5b 9d 00 04 sw (sp+4),ra
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
8011a90: 34 07 00 03 mvi r7,3
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
8011a94: b8 20 88 00 mv r17,r1
8011a98: b8 40 70 00 mv r14,r2
8011a9c: b8 60 78 00 mv r15,r3
8011aa0: b8 80 60 00 mv r12,r4
8011aa4: b8 a0 98 00 mv r19,r5
8011aa8: b8 c0 80 00 mv r16,r6
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
8011aac: 44 20 00 36 be r1,r0,8011b84 <rtems_partition_create+0x120>
return RTEMS_INVALID_NAME;
if ( !starting_address )
return RTEMS_INVALID_ADDRESS;
8011ab0: 34 07 00 09 mvi r7,9
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !starting_address )
8011ab4: 44 40 00 34 be r2,r0,8011b84 <rtems_partition_create+0x120>
return RTEMS_INVALID_ADDRESS;
if ( !id )
8011ab8: 44 c0 00 33 be r6,r0,8011b84 <rtems_partition_create+0x120><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
8011abc: 64 82 00 00 cmpei r2,r4,0
8011ac0: 64 61 00 00 cmpei r1,r3,0
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
8011ac4: 34 07 00 08 mvi r7,8
return RTEMS_INVALID_ADDRESS;
if ( !id )
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
8011ac8: b8 41 08 00 or r1,r2,r1
8011acc: 5c 20 00 2e bne r1,r0,8011b84 <rtems_partition_create+0x120>
8011ad0: 54 83 00 2d bgu r4,r3,8011b84 <rtems_partition_create+0x120>
*/
RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned (
uint32_t buffer_size
)
{
return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0);
8011ad4: 20 81 00 07 andi r1,r4,0x7
8011ad8: 5c 20 00 2b bne r1,r0,8011b84 <rtems_partition_create+0x120>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
8011adc: 21 d2 00 07 andi r18,r14,0x7
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
return RTEMS_INVALID_ADDRESS;
8011ae0: 34 07 00 09 mvi r7,9
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
8011ae4: 5e 41 00 28 bne r18,r1,8011b84 <rtems_partition_create+0x120>
8011ae8: 78 02 08 04 mvhi r2,0x804
8011aec: 38 42 0c a4 ori r2,r2,0xca4
8011af0: 28 41 00 00 lw r1,(r2+0)
8011af4: 34 21 00 01 addi r1,r1,1
8011af8: 58 41 00 00 sw (r2+0),r1
* 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 );
8011afc: 78 0d 08 04 mvhi r13,0x804
8011b00: 39 ad 0a f8 ori r13,r13,0xaf8
8011b04: b9 a0 08 00 mv r1,r13
8011b08: f8 00 16 17 calli 8017364 <_Objects_Allocate>
8011b0c: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
8011b10: 5c 32 00 04 bne r1,r18,8011b20 <rtems_partition_create+0xbc>
_Thread_Enable_dispatch();
8011b14: f8 00 1a 98 calli 8018574 <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
8011b18: 34 07 00 05 mvi r7,5
8011b1c: e0 00 00 1a bi 8011b84 <rtems_partition_create+0x120>
}
#endif
the_partition->starting_address = starting_address;
the_partition->length = length;
the_partition->buffer_size = buffer_size;
8011b20: 58 2c 00 18 sw (r1+24),r12
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
_Chain_Initialize( &the_partition->Memory, starting_address,
length / buffer_size, buffer_size );
8011b24: b9 80 10 00 mv r2,r12
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
8011b28: 58 2e 00 10 sw (r1+16),r14
the_partition->length = length;
8011b2c: 58 2f 00 14 sw (r1+20),r15
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
8011b30: 58 33 00 1c sw (r1+28),r19
the_partition->number_of_used_blocks = 0;
8011b34: 58 20 00 20 sw (r1+32),r0
_Chain_Initialize( &the_partition->Memory, starting_address,
8011b38: 34 32 00 24 addi r18,r1,36
length / buffer_size, buffer_size );
8011b3c: b9 e0 08 00 mv r1,r15
8011b40: f8 00 7d 80 calli 8031140 <__udivsi3>
8011b44: b8 20 18 00 mv r3,r1
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,
8011b48: b9 80 20 00 mv r4,r12
8011b4c: ba 40 08 00 mv r1,r18
8011b50: b9 c0 10 00 mv r2,r14
8011b54: f8 00 0f 02 calli 801575c <_Chain_Initialize>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8011b58: 29 6c 00 08 lw r12,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8011b5c: 29 ad 00 1c lw r13,(r13+28)
8011b60: 34 02 00 02 mvi r2,2
8011b64: 21 81 ff ff andi r1,r12,0xffff
8011b68: fb ff f0 ee calli 800df20 <__ashlsi3>
8011b6c: b5 a1 08 00 add r1,r13,r1
8011b70: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8011b74: 59 71 00 0c sw (r11+12),r17
&_Partition_Information,
&the_partition->Object,
(Objects_Name) name
);
*id = the_partition->Object.id;
8011b78: 5a 0c 00 00 sw (r16+0),r12
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
8011b7c: f8 00 1a 7e calli 8018574 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8011b80: 34 07 00 00 mvi r7,0
}
8011b84: b8 e0 08 00 mv r1,r7
8011b88: 2b 9d 00 04 lw ra,(sp+4)
8011b8c: 2b 8b 00 28 lw r11,(sp+40)
8011b90: 2b 8c 00 24 lw r12,(sp+36)
8011b94: 2b 8d 00 20 lw r13,(sp+32)
8011b98: 2b 8e 00 1c lw r14,(sp+28)
8011b9c: 2b 8f 00 18 lw r15,(sp+24)
8011ba0: 2b 90 00 14 lw r16,(sp+20)
8011ba4: 2b 91 00 10 lw r17,(sp+16)
8011ba8: 2b 92 00 0c lw r18,(sp+12)
8011bac: 2b 93 00 08 lw r19,(sp+8)
8011bb0: 37 9c 00 28 addi sp,sp,40
8011bb4: c3 a0 00 00 ret
0800b8b4 <rtems_rate_monotonic_get_statistics>:
rtems_status_code rtems_rate_monotonic_get_statistics(
rtems_id id,
rtems_rate_monotonic_period_statistics *statistics
)
{
800b8b4: 37 9c ff f4 addi sp,sp,-12
800b8b8: 5b 8b 00 08 sw (sp+8),r11
800b8bc: 5b 9d 00 04 sw (sp+4),ra
800b8c0: b8 20 18 00 mv r3,r1
800b8c4: b8 40 58 00 mv r11,r2
Rate_monotonic_Control *the_period;
rtems_rate_monotonic_period_statistics *dst;
Rate_monotonic_Statistics *src;
if ( !statistics )
return RTEMS_INVALID_ADDRESS;
800b8c8: 34 01 00 09 mvi r1,9
Objects_Locations location;
Rate_monotonic_Control *the_period;
rtems_rate_monotonic_period_statistics *dst;
Rate_monotonic_Statistics *src;
if ( !statistics )
800b8cc: 44 40 00 28 be r2,r0,800b96c <rtems_rate_monotonic_get_statistics+0xb8><== NEVER TAKEN
800b8d0: 78 01 08 02 mvhi r1,0x802
800b8d4: b8 60 10 00 mv r2,r3
800b8d8: 38 21 08 90 ori r1,r1,0x890
800b8dc: 37 83 00 0c addi r3,sp,12
800b8e0: fb ff ec 5a calli 8006a48 <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
800b8e4: 2b 82 00 0c lw r2,(sp+12)
800b8e8: 5c 40 00 20 bne r2,r0,800b968 <rtems_rate_monotonic_get_statistics+0xb4>
case OBJECTS_LOCAL:
dst = statistics;
src = &the_period->Statistics;
dst->count = src->count;
800b8ec: 28 22 00 54 lw r2,(r1+84)
800b8f0: 59 62 00 00 sw (r11+0),r2
dst->missed_count = src->missed_count;
800b8f4: 28 22 00 58 lw r2,(r1+88)
800b8f8: 59 62 00 04 sw (r11+4),r2
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_To_timespec( &src->min_cpu_time, &dst->min_cpu_time );
800b8fc: 28 22 00 5c lw r2,(r1+92)
800b900: 59 62 00 08 sw (r11+8),r2
800b904: 28 22 00 60 lw r2,(r1+96)
800b908: 59 62 00 0c sw (r11+12),r2
_Timestamp_To_timespec( &src->max_cpu_time, &dst->max_cpu_time );
800b90c: 28 22 00 64 lw r2,(r1+100)
800b910: 59 62 00 10 sw (r11+16),r2
800b914: 28 22 00 68 lw r2,(r1+104)
800b918: 59 62 00 14 sw (r11+20),r2
_Timestamp_To_timespec( &src->total_cpu_time, &dst->total_cpu_time );
800b91c: 28 22 00 6c lw r2,(r1+108)
800b920: 59 62 00 18 sw (r11+24),r2
800b924: 28 22 00 70 lw r2,(r1+112)
800b928: 59 62 00 1c sw (r11+28),r2
_Timestamp_To_timespec( &src->min_wall_time, &dst->min_wall_time );
800b92c: 28 22 00 74 lw r2,(r1+116)
800b930: 59 62 00 20 sw (r11+32),r2
800b934: 28 22 00 78 lw r2,(r1+120)
800b938: 59 62 00 24 sw (r11+36),r2
_Timestamp_To_timespec( &src->max_wall_time, &dst->max_wall_time );
800b93c: 28 22 00 7c lw r2,(r1+124)
800b940: 59 62 00 28 sw (r11+40),r2
800b944: 28 22 00 80 lw r2,(r1+128)
800b948: 59 62 00 2c sw (r11+44),r2
_Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time );
800b94c: 28 22 00 84 lw r2,(r1+132)
800b950: 28 21 00 88 lw r1,(r1+136)
800b954: 59 62 00 30 sw (r11+48),r2
800b958: 59 61 00 34 sw (r11+52),r1
dst->min_wall_time = src->min_wall_time;
dst->max_wall_time = src->max_wall_time;
dst->total_wall_time = src->total_wall_time;
#endif
_Thread_Enable_dispatch();
800b95c: fb ff ee ad calli 8007410 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
800b960: 34 01 00 00 mvi r1,0
800b964: e0 00 00 02 bi 800b96c <rtems_rate_monotonic_get_statistics+0xb8>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
800b968: 34 01 00 04 mvi r1,4
}
800b96c: 2b 9d 00 04 lw ra,(sp+4)
800b970: 2b 8b 00 08 lw r11,(sp+8)
800b974: 37 9c 00 0c addi sp,sp,12
800b978: c3 a0 00 00 ret
08004158 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
8004158: 37 9c ff e8 addi sp,sp,-24
800415c: 5b 8b 00 14 sw (sp+20),r11
8004160: 5b 8c 00 10 sw (sp+16),r12
8004164: 5b 8d 00 0c sw (sp+12),r13
8004168: 5b 8e 00 08 sw (sp+8),r14
800416c: 5b 9d 00 04 sw (sp+4),ra
8004170: b8 20 70 00 mv r14,r1
Objects_Id id,
Objects_Locations *location
)
{
return (Rate_monotonic_Control *)
_Objects_Get( &_Rate_monotonic_Information, id, location );
8004174: 78 01 08 02 mvhi r1,0x802
8004178: b8 40 60 00 mv r12,r2
800417c: 38 21 08 90 ori r1,r1,0x890
8004180: b9 c0 10 00 mv r2,r14
8004184: 37 83 00 18 addi r3,sp,24
8004188: f8 00 0a 30 calli 8006a48 <_Objects_Get>
800418c: b8 20 58 00 mv r11,r1
rtems_rate_monotonic_period_states local_state;
ISR_Level level;
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
8004190: 2b 81 00 18 lw r1,(sp+24)
8004194: 5c 20 00 5f bne r1,r0,8004310 <rtems_rate_monotonic_period+0x1b8>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
8004198: 78 03 08 02 mvhi r3,0x802
800419c: 38 63 0e 94 ori r3,r3,0xe94
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
80041a0: 29 62 00 40 lw r2,(r11+64)
80041a4: 28 61 00 0c lw r1,(r3+12)
80041a8: 44 41 00 04 be r2,r1,80041b8 <rtems_rate_monotonic_period+0x60>
_Thread_Enable_dispatch();
80041ac: f8 00 0c 99 calli 8007410 <_Thread_Enable_dispatch>
return RTEMS_NOT_OWNER_OF_RESOURCE;
80041b0: 34 0b 00 17 mvi r11,23
80041b4: e0 00 00 58 bi 8004314 <rtems_rate_monotonic_period+0x1bc>
}
if ( length == RTEMS_PERIOD_STATUS ) {
80041b8: 5d 80 00 0d bne r12,r0,80041ec <rtems_rate_monotonic_period+0x94>
switch ( the_period->state ) {
80041bc: 29 61 00 38 lw r1,(r11+56)
80041c0: 34 02 00 04 mvi r2,4
80041c4: 34 0b 00 00 mvi r11,0
80041c8: 54 22 00 07 bgu r1,r2,80041e4 <rtems_rate_monotonic_period+0x8c><== NEVER TAKEN
80041cc: 78 0b 08 01 mvhi r11,0x801
80041d0: 34 02 00 02 mvi r2,2
80041d4: 39 6b e6 c8 ori r11,r11,0xe6c8
80041d8: fb ff f4 33 calli 80012a4 <__ashlsi3>
80041dc: b5 61 08 00 add r1,r11,r1
80041e0: 28 2b 00 00 lw r11,(r1+0)
case RATE_MONOTONIC_ACTIVE:
default: /* unreached -- only to remove warnings */
return_value = RTEMS_SUCCESSFUL;
break;
}
_Thread_Enable_dispatch();
80041e4: f8 00 0c 8b calli 8007410 <_Thread_Enable_dispatch>
return( return_value );
80041e8: e0 00 00 4b bi 8004314 <rtems_rate_monotonic_period+0x1bc>
}
_ISR_Disable( level );
80041ec: 90 00 68 00 rcsr r13,IE
80041f0: 34 01 ff fe mvi r1,-2
80041f4: a1 a1 08 00 and r1,r13,r1
80041f8: d0 01 00 00 wcsr IE,r1
switch ( the_period->state ) {
80041fc: 29 63 00 38 lw r3,(r11+56)
8004200: 34 01 00 02 mvi r1,2
8004204: 44 61 00 16 be r3,r1,800425c <rtems_rate_monotonic_period+0x104>
8004208: 34 01 00 04 mvi r1,4
800420c: 44 61 00 33 be r3,r1,80042d8 <rtems_rate_monotonic_period+0x180>
8004210: 5c 60 00 40 bne r3,r0,8004310 <rtems_rate_monotonic_period+0x1b8><== NEVER TAKEN
case RATE_MONOTONIC_INACTIVE: {
_ISR_Enable( level );
8004214: d0 0d 00 00 wcsr IE,r13
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
8004218: b9 60 08 00 mv r1,r11
800421c: fb ff ff 6a calli 8003fc4 <_Rate_monotonic_Initiate_statistics>
the_period->state = RATE_MONOTONIC_ACTIVE;
8004220: 34 01 00 02 mvi r1,2
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
8004224: 78 03 08 00 mvhi r3,0x800
8004228: 59 61 00 38 sw (r11+56),r1
800422c: 38 63 46 98 ori r3,r3,0x4698
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8004230: 78 01 08 02 mvhi r1,0x802
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8004234: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8004238: 59 63 00 2c sw (r11+44),r3
the_watchdog->id = id;
800423c: 59 6e 00 30 sw (r11+48),r14
the_watchdog->user_data = user_data;
8004240: 59 60 00 34 sw (r11+52),r0
_Rate_monotonic_Timeout,
id,
NULL
);
the_period->next_length = length;
8004244: 59 6c 00 3c sw (r11+60),r12
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8004248: 59 6c 00 1c sw (r11+28),r12
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800424c: 38 21 0a 80 ori r1,r1,0xa80
8004250: 35 62 00 10 addi r2,r11,16
8004254: f8 00 12 6c calli 8008c04 <_Watchdog_Insert>
8004258: e0 00 00 1d bi 80042cc <rtems_rate_monotonic_period+0x174>
case RATE_MONOTONIC_ACTIVE:
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
800425c: b9 60 08 00 mv r1,r11
8004260: fb ff ff 7e calli 8004058 <_Rate_monotonic_Update_statistics>
/*
* 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;
8004264: 34 01 00 01 mvi r1,1
8004268: 59 61 00 38 sw (r11+56),r1
the_period->next_length = length;
800426c: 59 6c 00 3c sw (r11+60),r12
_ISR_Enable( level );
8004270: d0 0d 00 00 wcsr IE,r13
_Thread_Executing->Wait.id = the_period->Object.id;
8004274: 78 01 08 02 mvhi r1,0x802
8004278: 38 21 0e 94 ori r1,r1,0xe94
800427c: 29 62 00 08 lw r2,(r11+8)
8004280: 28 21 00 0c lw r1,(r1+12)
8004284: 58 22 00 20 sw (r1+32),r2
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
8004288: 34 02 40 00 mvi r2,16384
800428c: f8 00 0f 43 calli 8007f98 <_Thread_Set_state>
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
8004290: 90 00 08 00 rcsr r1,IE
8004294: 34 02 ff fe mvi r2,-2
8004298: a0 22 10 00 and r2,r1,r2
800429c: d0 02 00 00 wcsr IE,r2
local_state = the_period->state;
the_period->state = RATE_MONOTONIC_ACTIVE;
80042a0: 34 03 00 02 mvi r3,2
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
local_state = the_period->state;
80042a4: 29 62 00 38 lw r2,(r11+56)
the_period->state = RATE_MONOTONIC_ACTIVE;
80042a8: 59 63 00 38 sw (r11+56),r3
_ISR_Enable( level );
80042ac: d0 01 00 00 wcsr IE,r1
/*
* 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 )
80042b0: 34 01 00 03 mvi r1,3
80042b4: 5c 41 00 06 bne r2,r1,80042cc <rtems_rate_monotonic_period+0x174>
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
80042b8: 78 01 08 02 mvhi r1,0x802
80042bc: 38 21 0e 94 ori r1,r1,0xe94
80042c0: 28 21 00 0c lw r1,(r1+12)
80042c4: 34 02 40 00 mvi r2,16384
80042c8: f8 00 0b 75 calli 800709c <_Thread_Clear_state>
_Thread_Enable_dispatch();
80042cc: f8 00 0c 51 calli 8007410 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
80042d0: 34 0b 00 00 mvi r11,0
80042d4: e0 00 00 10 bi 8004314 <rtems_rate_monotonic_period+0x1bc>
case RATE_MONOTONIC_EXPIRED:
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
80042d8: b9 60 08 00 mv r1,r11
80042dc: fb ff ff 5f calli 8004058 <_Rate_monotonic_Update_statistics>
_ISR_Enable( level );
80042e0: d0 0d 00 00 wcsr IE,r13
the_period->state = RATE_MONOTONIC_ACTIVE;
80042e4: 34 01 00 02 mvi r1,2
80042e8: 59 61 00 38 sw (r11+56),r1
80042ec: 78 01 08 02 mvhi r1,0x802
80042f0: 35 62 00 10 addi r2,r11,16
the_period->next_length = length;
80042f4: 59 6c 00 3c sw (r11+60),r12
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80042f8: 59 6c 00 1c sw (r11+28),r12
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80042fc: 38 21 0a 80 ori r1,r1,0xa80
8004300: f8 00 12 41 calli 8008c04 <_Watchdog_Insert>
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
return RTEMS_TIMEOUT;
8004304: 34 0b 00 06 mvi r11,6
the_period->state = RATE_MONOTONIC_ACTIVE;
the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
8004308: f8 00 0c 42 calli 8007410 <_Thread_Enable_dispatch>
return RTEMS_TIMEOUT;
800430c: e0 00 00 02 bi 8004314 <rtems_rate_monotonic_period+0x1bc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8004310: 34 0b 00 04 mvi r11,4
}
8004314: b9 60 08 00 mv r1,r11
8004318: 2b 9d 00 04 lw ra,(sp+4)
800431c: 2b 8b 00 14 lw r11,(sp+20)
8004320: 2b 8c 00 10 lw r12,(sp+16)
8004324: 2b 8d 00 0c lw r13,(sp+12)
8004328: 2b 8e 00 08 lw r14,(sp+8)
800432c: 37 9c 00 18 addi sp,sp,24
8004330: c3 a0 00 00 ret
08004334 <rtems_rate_monotonic_report_statistics_with_plugin>:
*/
void rtems_rate_monotonic_report_statistics_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
8004334: 37 9c ff 5c addi sp,sp,-164
8004338: 5b 8b 00 44 sw (sp+68),r11
800433c: 5b 8c 00 40 sw (sp+64),r12
8004340: 5b 8d 00 3c sw (sp+60),r13
8004344: 5b 8e 00 38 sw (sp+56),r14
8004348: 5b 8f 00 34 sw (sp+52),r15
800434c: 5b 90 00 30 sw (sp+48),r16
8004350: 5b 91 00 2c sw (sp+44),r17
8004354: 5b 92 00 28 sw (sp+40),r18
8004358: 5b 93 00 24 sw (sp+36),r19
800435c: 5b 94 00 20 sw (sp+32),r20
8004360: 5b 95 00 1c sw (sp+28),r21
8004364: 5b 96 00 18 sw (sp+24),r22
8004368: 5b 97 00 14 sw (sp+20),r23
800436c: 5b 98 00 10 sw (sp+16),r24
8004370: 5b 99 00 0c sw (sp+12),r25
8004374: 5b 9b 00 08 sw (sp+8),fp
8004378: 5b 9d 00 04 sw (sp+4),ra
800437c: b8 20 60 00 mv r12,r1
8004380: b8 40 58 00 mv r11,r2
rtems_id id;
rtems_rate_monotonic_period_statistics the_stats;
rtems_rate_monotonic_period_status the_status;
char name[5];
if ( !print )
8004384: 44 40 00 72 be r2,r0,800454c <rtems_rate_monotonic_report_statistics_with_plugin+0x218><== NEVER TAKEN
return;
(*print)( context, "Period information by period\n" );
8004388: 78 02 08 01 mvhi r2,0x801
800438c: 38 42 e6 dc ori r2,r2,0xe6dc
8004390: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)( context, "--- CPU times are in seconds ---\n" );
8004394: 78 02 08 01 mvhi r2,0x801
8004398: 38 42 e6 fc ori r2,r2,0xe6fc
800439c: b9 80 08 00 mv r1,r12
80043a0: d9 60 00 00 call r11
(*print)( context, "--- Wall times are in seconds ---\n" );
80043a4: 78 02 08 01 mvhi r2,0x801
80043a8: 38 42 e7 20 ori r2,r2,0xe720
80043ac: b9 80 08 00 mv r1,r12
80043b0: d9 60 00 00 call r11
Be sure to test the various cases.
(*print)( context,"\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
*/
(*print)( context, " ID OWNER COUNT MISSED "
80043b4: 78 02 08 01 mvhi r2,0x801
80043b8: 38 42 e7 44 ori r2,r2,0xe744
80043bc: b9 80 08 00 mv r1,r12
80043c0: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
" "
#endif
" WALL TIME\n"
);
(*print)( context, " "
80043c4: 78 02 08 01 mvhi r2,0x801
80043c8: b9 80 08 00 mv r1,r12
80043cc: 38 42 e7 90 ori r2,r2,0xe790
80043d0: d9 60 00 00 call r11
/*
* 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 ;
80043d4: 78 01 08 02 mvhi r1,0x802
80043d8: 38 21 08 90 ori r1,r1,0x890
rtems_object_get_name( the_status.owner, sizeof(name), name );
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
80043dc: 78 11 08 01 mvhi r17,0x801
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,
80043e0: 78 10 08 01 mvhi r16,0x801
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,
80043e4: 78 0f 08 01 mvhi r15,0x801
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
80043e8: 78 0e 08 01 mvhi r14,0x801
/*
* 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 ;
80043ec: 28 2d 00 08 lw r13,(r1+8)
id <= _Rate_monotonic_Information.maximum_id ;
80043f0: b8 20 a0 00 mv r20,r1
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
80043f4: 37 99 00 48 addi r25,sp,72
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 );
80043f8: 37 98 00 80 addi r24,sp,128
#if defined(RTEMS_DEBUG)
if ( status != RTEMS_SUCCESSFUL )
continue;
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
80043fc: 37 93 00 a0 addi r19,sp,160
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8004400: 3a 31 e7 dc ori r17,r17,0xe7dc
{
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
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;
8004404: 37 97 00 60 addi r23,sp,96
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
8004408: 37 92 00 98 addi r18,sp,152
(*print)( context,
800440c: 3a 10 e7 f4 ori r16,r16,0xe7f4
{
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
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;
8004410: 37 96 00 78 addi r22,sp,120
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
8004414: 39 ef e8 14 ori r15,r15,0xe814
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
8004418: 39 ce dd 20 ori r14,r14,0xdd20
/*
* 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 ;
800441c: e0 00 00 4a bi 8004544 <rtems_rate_monotonic_report_statistics_with_plugin+0x210>
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
8004420: b9 a0 08 00 mv r1,r13
8004424: bb 20 10 00 mv r2,r25
8004428: f8 00 1d 23 calli 800b8b4 <rtems_rate_monotonic_get_statistics>
800442c: b8 20 a8 00 mv r21,r1
if ( status != RTEMS_SUCCESSFUL )
8004430: 5c 20 00 44 bne r1,r0,8004540 <rtems_rate_monotonic_report_statistics_with_plugin+0x20c>
continue;
/* If the above passed, so should this but check it anyway */
status = rtems_rate_monotonic_get_status( id, &the_status );
8004434: bb 00 10 00 mv r2,r24
8004438: b9 a0 08 00 mv r1,r13
800443c: f8 00 1d 50 calli 800b97c <rtems_rate_monotonic_get_status>
#if defined(RTEMS_DEBUG)
if ( status != RTEMS_SUCCESSFUL )
continue;
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
8004440: 2b 81 00 80 lw r1,(sp+128)
8004444: 34 02 00 05 mvi r2,5
8004448: ba 60 18 00 mv r3,r19
800444c: f8 00 00 c3 calli 8004758 <rtems_object_get_name>
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8004450: 2b 85 00 48 lw r5,(sp+72)
8004454: 2b 86 00 4c lw r6,(sp+76)
8004458: ba 20 10 00 mv r2,r17
800445c: b9 80 08 00 mv r1,r12
8004460: b9 a0 18 00 mv r3,r13
8004464: ba 60 20 00 mv r4,r19
8004468: d9 60 00 00 call r11
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
800446c: 2b 82 00 48 lw r2,(sp+72)
8004470: 5c 55 00 05 bne r2,r21,8004484 <rtems_rate_monotonic_report_statistics_with_plugin+0x150>
(*print)( context, "\n" );
8004474: b9 80 08 00 mv r1,r12
8004478: b9 c0 10 00 mv r2,r14
800447c: d9 60 00 00 call r11
continue;
8004480: e0 00 00 30 bi 8004540 <rtems_rate_monotonic_report_statistics_with_plugin+0x20c>
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 );
8004484: ba 40 18 00 mv r3,r18
8004488: ba e0 08 00 mv r1,r23
800448c: f8 00 10 94 calli 80086dc <_Timespec_Divide_by_integer>
(*print)( context,
8004490: 2b 81 00 54 lw r1,(sp+84)
8004494: 34 02 03 e8 mvi r2,1000
8004498: f8 00 61 1d calli 801c90c <__divsi3>
800449c: b8 20 d8 00 mv fp,r1
80044a0: 2b 81 00 5c lw r1,(sp+92)
80044a4: 34 02 03 e8 mvi r2,1000
80044a8: f8 00 61 19 calli 801c90c <__divsi3>
80044ac: b8 20 a8 00 mv r21,r1
80044b0: 2b 81 00 9c lw r1,(sp+156)
80044b4: 34 02 03 e8 mvi r2,1000
80044b8: f8 00 61 15 calli 801c90c <__divsi3>
80044bc: 2b 85 00 58 lw r5,(sp+88)
80044c0: 2b 87 00 98 lw r7,(sp+152)
80044c4: 2b 83 00 50 lw r3,(sp+80)
80044c8: b8 20 40 00 mv r8,r1
80044cc: bb 60 20 00 mv r4,fp
80044d0: ba a0 30 00 mv r6,r21
80044d4: ba 00 10 00 mv r2,r16
80044d8: b9 80 08 00 mv r1,r12
80044dc: d9 60 00 00 call r11
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);
80044e0: 2b 82 00 48 lw r2,(sp+72)
80044e4: ba 40 18 00 mv r3,r18
80044e8: ba c0 08 00 mv r1,r22
80044ec: f8 00 10 7c calli 80086dc <_Timespec_Divide_by_integer>
(*print)( context,
80044f0: 2b 81 00 6c lw r1,(sp+108)
80044f4: 34 02 03 e8 mvi r2,1000
80044f8: f8 00 61 05 calli 801c90c <__divsi3>
80044fc: b8 20 d8 00 mv fp,r1
8004500: 2b 81 00 74 lw r1,(sp+116)
8004504: 34 02 03 e8 mvi r2,1000
8004508: f8 00 61 01 calli 801c90c <__divsi3>
800450c: b8 20 a8 00 mv r21,r1
8004510: 2b 81 00 9c lw r1,(sp+156)
8004514: 34 02 03 e8 mvi r2,1000
8004518: f8 00 60 fd calli 801c90c <__divsi3>
800451c: 2b 83 00 68 lw r3,(sp+104)
8004520: 2b 85 00 70 lw r5,(sp+112)
8004524: 2b 87 00 98 lw r7,(sp+152)
8004528: b8 20 40 00 mv r8,r1
800452c: b9 e0 10 00 mv r2,r15
8004530: b9 80 08 00 mv r1,r12
8004534: bb 60 20 00 mv r4,fp
8004538: ba a0 30 00 mv r6,r21
800453c: d9 60 00 00 call r11
* 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++ ) {
8004540: 35 ad 00 01 addi r13,r13,1
/*
* 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 ;
8004544: 2a 81 00 0c lw r1,(r20+12)
8004548: 50 2d ff b6 bgeu r1,r13,8004420 <rtems_rate_monotonic_report_statistics_with_plugin+0xec>
the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall
);
#endif
}
}
}
800454c: 2b 9d 00 04 lw ra,(sp+4)
8004550: 2b 8b 00 44 lw r11,(sp+68)
8004554: 2b 8c 00 40 lw r12,(sp+64)
8004558: 2b 8d 00 3c lw r13,(sp+60)
800455c: 2b 8e 00 38 lw r14,(sp+56)
8004560: 2b 8f 00 34 lw r15,(sp+52)
8004564: 2b 90 00 30 lw r16,(sp+48)
8004568: 2b 91 00 2c lw r17,(sp+44)
800456c: 2b 92 00 28 lw r18,(sp+40)
8004570: 2b 93 00 24 lw r19,(sp+36)
8004574: 2b 94 00 20 lw r20,(sp+32)
8004578: 2b 95 00 1c lw r21,(sp+28)
800457c: 2b 96 00 18 lw r22,(sp+24)
8004580: 2b 97 00 14 lw r23,(sp+20)
8004584: 2b 98 00 10 lw r24,(sp+16)
8004588: 2b 99 00 0c lw r25,(sp+12)
800458c: 2b 9b 00 08 lw fp,(sp+8)
8004590: 37 9c 00 a4 addi sp,sp,164
8004594: c3 a0 00 00 ret
08003df4 <rtems_semaphore_create>:
uint32_t count,
rtems_attribute attribute_set,
rtems_task_priority priority_ceiling,
rtems_id *id
)
{
8003df4: 37 9c ff c8 addi sp,sp,-56
8003df8: 5b 8b 00 20 sw (sp+32),r11
8003dfc: 5b 8c 00 1c sw (sp+28),r12
8003e00: 5b 8d 00 18 sw (sp+24),r13
8003e04: 5b 8e 00 14 sw (sp+20),r14
8003e08: 5b 8f 00 10 sw (sp+16),r15
8003e0c: 5b 90 00 0c sw (sp+12),r16
8003e10: 5b 91 00 08 sw (sp+8),r17
8003e14: 5b 9d 00 04 sw (sp+4),ra
8003e18: b8 20 80 00 mv r16,r1
8003e1c: b8 40 70 00 mv r14,r2
8003e20: b8 60 60 00 mv r12,r3
8003e24: b8 80 88 00 mv r17,r4
8003e28: b8 a0 78 00 mv r15,r5
CORE_mutex_Attributes the_mutex_attr;
CORE_semaphore_Attributes the_semaphore_attr;
CORE_mutex_Status mutex_status;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
8003e2c: 34 01 00 03 mvi r1,3
register Semaphore_Control *the_semaphore;
CORE_mutex_Attributes the_mutex_attr;
CORE_semaphore_Attributes the_semaphore_attr;
CORE_mutex_Status mutex_status;
if ( !rtems_is_name_valid( name ) )
8003e30: 46 00 00 64 be r16,r0,8003fc0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
return RTEMS_INVALID_NAME;
if ( !id )
return RTEMS_INVALID_ADDRESS;
8003e34: 34 01 00 09 mvi r1,9
CORE_mutex_Status mutex_status;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !id )
8003e38: 44 a0 00 62 be r5,r0,8003fc0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
* id - semaphore id
* RTEMS_SUCCESSFUL - if successful
* error code - if unsuccessful
*/
rtems_status_code rtems_semaphore_create(
8003e3c: 20 62 00 c0 andi r2,r3,0xc0
return RTEMS_NOT_DEFINED;
} else
#endif
if ( _Attributes_Is_inherit_priority( attribute_set ) ||
8003e40: 44 40 00 09 be r2,r0,8003e64 <rtems_semaphore_create+0x70>
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore(
rtems_attribute attribute_set
)
{
return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE);
8003e44: 20 64 00 30 andi r4,r3,0x30
_Attributes_Is_priority_ceiling( attribute_set ) ) {
if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) &&
8003e48: 34 03 00 10 mvi r3,16
_Attributes_Is_priority( attribute_set ) ) )
return RTEMS_NOT_DEFINED;
8003e4c: 34 01 00 0b mvi r1,11
#endif
if ( _Attributes_Is_inherit_priority( attribute_set ) ||
_Attributes_Is_priority_ceiling( attribute_set ) ) {
if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) &&
8003e50: 5c 83 00 5c bne r4,r3,8003fc0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_PRIORITY ) ? true : false;
8003e54: 21 83 00 04 andi r3,r12,0x4
8003e58: 44 60 00 5a be r3,r0,8003fc0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
_Attributes_Is_priority( attribute_set ) ) )
return RTEMS_NOT_DEFINED;
}
if ( _Attributes_Is_inherit_priority( attribute_set ) &&
8003e5c: 34 03 00 c0 mvi r3,192
8003e60: 44 43 00 58 be r2,r3,8003fc0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore(
rtems_attribute attribute_set
)
{
return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE);
8003e64: 21 8d 00 30 andi r13,r12,0x30
_Attributes_Is_priority_ceiling( attribute_set ) )
return RTEMS_NOT_DEFINED;
if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) )
8003e68: 45 a0 00 04 be r13,r0,8003e78 <rtems_semaphore_create+0x84>
8003e6c: 34 02 00 01 mvi r2,1
return RTEMS_INVALID_NUMBER;
8003e70: 34 01 00 0a mvi r1,10
if ( _Attributes_Is_inherit_priority( attribute_set ) &&
_Attributes_Is_priority_ceiling( attribute_set ) )
return RTEMS_NOT_DEFINED;
if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) )
8003e74: 55 c2 00 53 bgu r14,r2,8003fc0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8003e78: 78 06 08 01 mvhi r6,0x801
8003e7c: 38 c6 99 24 ori r6,r6,0x9924
8003e80: 28 c1 00 00 lw r1,(r6+0)
8003e84: 34 21 00 01 addi r1,r1,1
8003e88: 58 c1 00 00 sw (r6+0),r1
* This function allocates a semaphore control block from
* the inactive chain of free semaphore control blocks.
*/
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )
{
return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information );
8003e8c: 78 01 08 01 mvhi r1,0x801
8003e90: 38 21 98 78 ori r1,r1,0x9878
8003e94: f8 00 06 11 calli 80056d8 <_Objects_Allocate>
8003e98: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* prevents deletion */
the_semaphore = _Semaphore_Allocate();
if ( !the_semaphore ) {
8003e9c: 5c 20 00 04 bne r1,r0,8003eac <rtems_semaphore_create+0xb8>
_Thread_Enable_dispatch();
8003ea0: f8 00 09 c1 calli 80065a4 <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
8003ea4: 34 01 00 05 mvi r1,5
8003ea8: e0 00 00 46 bi 8003fc0 <rtems_semaphore_create+0x1cc>
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_semaphore->attribute_set = attribute_set;
8003eac: 58 2c 00 10 sw (r1+16),r12
8003eb0: 21 81 00 04 andi r1,r12,0x4
/*
* Initialize it as a counting semaphore.
*/
if ( _Attributes_Is_counting_semaphore( attribute_set ) ) {
8003eb4: 5d a0 00 0f bne r13,r0,8003ef0 <rtems_semaphore_create+0xfc>
/*
* This effectively disables limit checking.
*/
the_semaphore_attr.maximum_count = 0xFFFFFFFF;
8003eb8: 34 02 ff ff mvi r2,-1
8003ebc: 5b 82 00 34 sw (sp+52),r2
if ( _Attributes_Is_priority( attribute_set ) )
8003ec0: 44 2d 00 04 be r1,r13,8003ed0 <rtems_semaphore_create+0xdc>
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY;
8003ec4: 34 01 00 01 mvi r1,1
8003ec8: 5b 81 00 38 sw (sp+56),r1
8003ecc: e0 00 00 02 bi 8003ed4 <rtems_semaphore_create+0xe0>
else
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
8003ed0: 5b 80 00 38 sw (sp+56),r0
* The following are just to make Purify happy.
*/
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM;
_CORE_semaphore_Initialize(
8003ed4: 35 61 00 14 addi r1,r11,20
8003ed8: 37 82 00 34 addi r2,sp,52
8003edc: b9 c0 18 00 mv r3,r14
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* The following are just to make Purify happy.
*/
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
8003ee0: 5b 80 00 24 sw (sp+36),r0
the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM;
8003ee4: 5b 80 00 30 sw (sp+48),r0
_CORE_semaphore_Initialize(
8003ee8: f8 00 04 32 calli 8004fb0 <_CORE_semaphore_Initialize>
8003eec: e0 00 00 28 bi 8003f8c <rtems_semaphore_create+0x198>
} else {
/*
* It is either simple binary semaphore or a more powerful mutex
* style binary semaphore. This is the mutex style.
*/
if ( _Attributes_Is_priority( attribute_set ) )
8003ef0: 44 20 00 04 be r1,r0,8003f00 <rtems_semaphore_create+0x10c>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY;
8003ef4: 34 01 00 01 mvi r1,1
8003ef8: 5b 81 00 2c sw (sp+44),r1
8003efc: e0 00 00 02 bi 8003f04 <rtems_semaphore_create+0x110>
else
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
8003f00: 5b 80 00 2c sw (sp+44),r0
if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
8003f04: 34 01 00 10 mvi r1,16
8003f08: 5d a1 00 11 bne r13,r1,8003f4c <rtems_semaphore_create+0x158>
the_mutex_attr.priority_ceiling = priority_ceiling;
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
the_mutex_attr.only_owner_release = false;
if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) {
8003f0c: 2b 82 00 2c lw r2,(sp+44)
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY;
else
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
the_mutex_attr.priority_ceiling = priority_ceiling;
8003f10: 5b 91 00 30 sw (sp+48),r17
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
8003f14: 5b 80 00 24 sw (sp+36),r0
the_mutex_attr.only_owner_release = false;
8003f18: 33 80 00 28 sb (sp+40),r0
if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) {
8003f1c: 34 01 00 01 mvi r1,1
8003f20: 5c 41 00 0e bne r2,r1,8003f58 <rtems_semaphore_create+0x164>
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_inherit_priority(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_INHERIT_PRIORITY ) ? true : false;
8003f24: 21 81 00 40 andi r1,r12,0x40
if ( _Attributes_Is_inherit_priority( attribute_set ) ) {
8003f28: 44 20 00 03 be r1,r0,8003f34 <rtems_semaphore_create+0x140>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
8003f2c: 34 01 00 02 mvi r1,2
8003f30: e0 00 00 04 bi 8003f40 <rtems_semaphore_create+0x14c>
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_PRIORITY_CEILING ) ? true : false;
8003f34: 21 8c 00 80 andi r12,r12,0x80
the_mutex_attr.only_owner_release = true;
} else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) {
8003f38: 45 81 00 08 be r12,r1,8003f58 <rtems_semaphore_create+0x164>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
8003f3c: 34 01 00 03 mvi r1,3
8003f40: 5b 81 00 2c sw (sp+44),r1
the_mutex_attr.only_owner_release = true;
8003f44: 33 82 00 28 sb (sp+40),r2
8003f48: e0 00 00 04 bi 8003f58 <rtems_semaphore_create+0x164>
}
}
} else /* must be simple binary semaphore */ {
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS;
8003f4c: 34 01 00 02 mvi r1,2
8003f50: 5b 81 00 24 sw (sp+36),r1
the_mutex_attr.only_owner_release = false;
8003f54: 33 80 00 28 sb (sp+40),r0
}
mutex_status = _CORE_mutex_Initialize(
8003f58: 65 c3 00 01 cmpei r3,r14,1
8003f5c: 37 82 00 24 addi r2,sp,36
8003f60: 35 61 00 14 addi r1,r11,20
8003f64: f8 00 03 39 calli 8004c48 <_CORE_mutex_Initialize>
&the_semaphore->Core_control.mutex,
&the_mutex_attr,
(count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED
);
if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) {
8003f68: 34 02 00 06 mvi r2,6
8003f6c: 5c 22 00 08 bne r1,r2,8003f8c <rtems_semaphore_create+0x198>
*/
RTEMS_INLINE_ROUTINE void _Semaphore_Free (
Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
8003f70: 78 01 08 01 mvhi r1,0x801
8003f74: 38 21 98 78 ori r1,r1,0x9878
8003f78: b9 60 10 00 mv r2,r11
8003f7c: f8 00 06 e9 calli 8005b20 <_Objects_Free>
_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
8003f80: f8 00 09 89 calli 80065a4 <_Thread_Enable_dispatch>
return RTEMS_INVALID_PRIORITY;
8003f84: 34 01 00 13 mvi r1,19
8003f88: e0 00 00 0e bi 8003fc0 <rtems_semaphore_create+0x1cc>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8003f8c: 29 6c 00 08 lw r12,(r11+8)
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
8003f90: 78 02 08 01 mvhi r2,0x801
8003f94: 38 42 98 78 ori r2,r2,0x9878
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8003f98: 28 4d 00 1c lw r13,(r2+28)
8003f9c: 21 81 ff ff andi r1,r12,0xffff
8003fa0: 34 02 00 02 mvi r2,2
8003fa4: f8 00 4b cb calli 8016ed0 <__ashlsi3>
8003fa8: b5 a1 08 00 add r1,r13,r1
8003fac: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8003fb0: 59 70 00 0c sw (r11+12),r16
&_Semaphore_Information,
&the_semaphore->Object,
(Objects_Name) name
);
*id = the_semaphore->Object.id;
8003fb4: 59 ec 00 00 sw (r15+0),r12
the_semaphore->Object.id,
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
8003fb8: f8 00 09 7b calli 80065a4 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8003fbc: 34 01 00 00 mvi r1,0
}
8003fc0: 2b 9d 00 04 lw ra,(sp+4)
8003fc4: 2b 8b 00 20 lw r11,(sp+32)
8003fc8: 2b 8c 00 1c lw r12,(sp+28)
8003fcc: 2b 8d 00 18 lw r13,(sp+24)
8003fd0: 2b 8e 00 14 lw r14,(sp+20)
8003fd4: 2b 8f 00 10 lw r15,(sp+16)
8003fd8: 2b 90 00 0c lw r16,(sp+12)
8003fdc: 2b 91 00 08 lw r17,(sp+8)
8003fe0: 37 9c 00 38 addi sp,sp,56
8003fe4: c3 a0 00 00 ret
0801349c <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
801349c: 37 9c ff f4 addi sp,sp,-12
80134a0: 5b 8b 00 08 sw (sp+8),r11
80134a4: 5b 9d 00 04 sw (sp+4),ra
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
80134a8: 34 03 00 0a mvi r3,10
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
80134ac: b8 40 58 00 mv r11,r2
register Thread_Control *the_thread;
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
80134b0: 44 40 00 29 be r2,r0,8013554 <rtems_signal_send+0xb8>
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
80134b4: 37 82 00 0c addi r2,sp,12
80134b8: f8 00 14 3c calli 80185a8 <_Thread_Get>
switch ( location ) {
80134bc: 2b 82 00 0c lw r2,(sp+12)
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
80134c0: 34 03 00 04 mvi r3,4
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
switch ( location ) {
80134c4: 5c 40 00 24 bne r2,r0,8013554 <rtems_signal_send+0xb8>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
80134c8: 28 23 01 28 lw r3,(r1+296)
asr = &api->Signal;
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
80134cc: 28 64 00 0c lw r4,(r3+12)
80134d0: 44 82 00 1f be r4,r2,801354c <rtems_signal_send+0xb0>
if ( asr->is_enabled ) {
80134d4: 40 62 00 08 lbu r2,(r3+8)
80134d8: 44 40 00 12 be r2,r0,8013520 <rtems_signal_send+0x84>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
80134dc: 90 00 10 00 rcsr r2,IE
80134e0: 34 04 ff fe mvi r4,-2
80134e4: a0 44 20 00 and r4,r2,r4
80134e8: d0 04 00 00 wcsr IE,r4
*signal_set |= signals;
80134ec: 28 64 00 14 lw r4,(r3+20)
80134f0: b8 8b 58 00 or r11,r4,r11
80134f4: 58 6b 00 14 sw (r3+20),r11
_ISR_Enable( _level );
80134f8: d0 02 00 00 wcsr IE,r2
_ASR_Post_signals( signal_set, &asr->signals_posted );
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
80134fc: 78 02 08 04 mvhi r2,0x804
8013500: 38 42 11 84 ori r2,r2,0x1184
8013504: 28 43 00 08 lw r3,(r2+8)
8013508: 44 60 00 0e be r3,r0,8013540 <rtems_signal_send+0xa4>
801350c: 28 43 00 0c lw r3,(r2+12)
8013510: 5c 23 00 0c bne r1,r3,8013540 <rtems_signal_send+0xa4> <== NEVER TAKEN
_Context_Switch_necessary = true;
8013514: 34 01 00 01 mvi r1,1
8013518: 30 41 00 18 sb (r2+24),r1
801351c: e0 00 00 09 bi 8013540 <rtems_signal_send+0xa4>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
8013520: 90 00 08 00 rcsr r1,IE
8013524: 34 02 ff fe mvi r2,-2
8013528: a0 22 10 00 and r2,r1,r2
801352c: d0 02 00 00 wcsr IE,r2
*signal_set |= signals;
8013530: 28 62 00 18 lw r2,(r3+24)
8013534: b8 4b 58 00 or r11,r2,r11
8013538: 58 6b 00 18 sw (r3+24),r11
_ISR_Enable( _level );
801353c: d0 01 00 00 wcsr IE,r1
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
8013540: f8 00 14 0d calli 8018574 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8013544: 34 03 00 00 mvi r3,0
8013548: e0 00 00 03 bi 8013554 <rtems_signal_send+0xb8>
}
_Thread_Enable_dispatch();
801354c: f8 00 14 0a calli 8018574 <_Thread_Enable_dispatch>
return RTEMS_NOT_DEFINED;
8013550: 34 03 00 0b mvi r3,11
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
8013554: b8 60 08 00 mv r1,r3
8013558: 2b 9d 00 04 lw ra,(sp+4)
801355c: 2b 8b 00 08 lw r11,(sp+8)
8013560: 37 9c 00 0c addi sp,sp,12
8013564: c3 a0 00 00 ret
0800de08 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
800de08: 37 9c ff e0 addi sp,sp,-32
800de0c: 5b 8b 00 20 sw (sp+32),r11
800de10: 5b 8c 00 1c sw (sp+28),r12
800de14: 5b 8d 00 18 sw (sp+24),r13
800de18: 5b 8e 00 14 sw (sp+20),r14
800de1c: 5b 8f 00 10 sw (sp+16),r15
800de20: 5b 90 00 0c sw (sp+12),r16
800de24: 5b 91 00 08 sw (sp+8),r17
800de28: 5b 9d 00 04 sw (sp+4),ra
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
800de2c: 34 04 00 09 mvi r4,9
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
800de30: b8 20 68 00 mv r13,r1
800de34: b8 40 70 00 mv r14,r2
800de38: b8 60 80 00 mv r16,r3
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
800de3c: 44 60 00 55 be r3,r0,800df90 <rtems_task_mode+0x188>
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
800de40: 78 01 08 01 mvhi r1,0x801
800de44: 38 21 9d fc ori r1,r1,0x9dfc
800de48: 28 2c 00 0c lw r12,(r1+12)
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
800de4c: 41 8f 00 74 lbu r15,(r12+116)
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800de50: 29 81 00 7c lw r1,(r12+124)
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
800de54: 29 8b 01 28 lw r11,(r12+296)
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
800de58: 65 ef 00 00 cmpei r15,r15,0
800de5c: c8 0f 78 00 sub r15,r0,r15
800de60: 21 ef 01 00 andi r15,r15,0x100
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800de64: 44 20 00 02 be r1,r0,800de6c <rtems_task_mode+0x64>
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
800de68: 39 ef 02 00 ori r15,r15,0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
800de6c: 41 71 00 08 lbu r17,(r11+8)
old_mode |= _ISR_Get_level();
800de70: fb ff e7 ef calli 8007e2c <_CPU_ISR_Get_level>
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;
800de74: 66 31 00 00 cmpei r17,r17,0
800de78: c8 11 88 00 sub r17,r0,r17
800de7c: 22 31 04 00 andi r17,r17,0x400
800de80: ba 21 08 00 or r1,r17,r1
old_mode |= _ISR_Get_level();
800de84: b8 2f 78 00 or r15,r1,r15
*previous_mode_set = old_mode;
800de88: 5a 0f 00 00 sw (r16+0),r15
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
800de8c: 21 c1 01 00 andi r1,r14,0x100
800de90: 44 20 00 04 be r1,r0,800dea0 <rtems_task_mode+0x98>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
800de94: 21 a1 01 00 andi r1,r13,0x100
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
800de98: 64 21 00 00 cmpei r1,r1,0
800de9c: 31 81 00 74 sb (r12+116),r1
if ( mask & RTEMS_TIMESLICE_MASK ) {
800dea0: 21 c1 02 00 andi r1,r14,0x200
800dea4: 44 20 00 0b be r1,r0,800ded0 <rtems_task_mode+0xc8>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
800dea8: 21 a1 02 00 andi r1,r13,0x200
if ( _Modes_Is_timeslice(mode_set) ) {
800deac: 44 20 00 08 be r1,r0,800decc <rtems_task_mode+0xc4>
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
800deb0: 34 01 00 01 mvi r1,1
800deb4: 59 81 00 7c sw (r12+124),r1
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
800deb8: 78 01 08 01 mvhi r1,0x801
800debc: 38 21 98 bc ori r1,r1,0x98bc
800dec0: 28 21 00 00 lw r1,(r1+0)
800dec4: 59 81 00 78 sw (r12+120),r1
800dec8: e0 00 00 02 bi 800ded0 <rtems_task_mode+0xc8>
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
800decc: 59 80 00 7c sw (r12+124),r0
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
800ded0: 21 c1 00 01 andi r1,r14,0x1
800ded4: 44 20 00 04 be r1,r0,800dee4 <rtems_task_mode+0xdc>
*/
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
Modes_Control mode_set
)
{
return ( mode_set & RTEMS_INTERRUPT_MASK );
800ded8: 21 a1 00 01 andi r1,r13,0x1
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
800dedc: 64 21 00 00 cmpei r1,r1,0
800dee0: d0 01 00 00 wcsr IE,r1
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
800dee4: 21 ce 04 00 andi r14,r14,0x400
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800dee8: 34 03 00 00 mvi r3,0
if ( mask & RTEMS_ASR_MASK ) {
800deec: 45 c0 00 11 be r14,r0,800df30 <rtems_task_mode+0x128>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR;
800def0: 21 ad 04 00 andi r13,r13,0x400
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
800def4: 41 61 00 08 lbu r1,(r11+8)
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
800def8: 65 ad 00 00 cmpei r13,r13,0
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
800defc: 44 2d 00 0d be r1,r13,800df30 <rtems_task_mode+0x128>
asr->is_enabled = is_asr_enabled;
800df00: 31 6d 00 08 sb (r11+8),r13
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
800df04: 90 00 08 00 rcsr r1,IE
800df08: 34 02 ff fe mvi r2,-2
800df0c: a0 22 10 00 and r2,r1,r2
800df10: d0 02 00 00 wcsr IE,r2
_signals = information->signals_pending;
800df14: 29 62 00 18 lw r2,(r11+24)
information->signals_pending = information->signals_posted;
800df18: 29 63 00 14 lw r3,(r11+20)
information->signals_posted = _signals;
800df1c: 59 62 00 14 sw (r11+20),r2
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
information->signals_pending = information->signals_posted;
800df20: 59 63 00 18 sw (r11+24),r3
information->signals_posted = _signals;
_ISR_Enable( _level );
800df24: d0 01 00 00 wcsr IE,r1
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
800df28: 29 63 00 14 lw r3,(r11+20)
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800df2c: 7c 63 00 00 cmpnei r3,r3,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) )
800df30: 78 01 08 01 mvhi r1,0x801
800df34: 38 21 9a a4 ori r1,r1,0x9aa4
800df38: 28 22 00 00 lw r2,(r1+0)
800df3c: 34 01 00 03 mvi r1,3
if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
_Thread_Dispatch();
return RTEMS_SUCCESSFUL;
800df40: 34 04 00 00 mvi r4,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) )
800df44: 5c 41 00 13 bne r2,r1,800df90 <rtems_task_mode+0x188> <== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void )
{
Thread_Control *executing;
executing = _Thread_Executing;
800df48: 78 02 08 01 mvhi r2,0x801
800df4c: 38 42 9d fc ori r2,r2,0x9dfc
800df50: 28 41 00 0c lw r1,(r2+12)
if ( !_States_Is_ready( executing->current_state ) ||
800df54: 28 24 00 10 lw r4,(r1+16)
800df58: 5c 80 00 05 bne r4,r0,800df6c <rtems_task_mode+0x164> <== NEVER TAKEN
800df5c: 28 42 00 10 lw r2,(r2+16)
800df60: 44 22 00 08 be r1,r2,800df80 <rtems_task_mode+0x178>
( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) {
800df64: 40 21 00 74 lbu r1,(r1+116)
800df68: 44 20 00 06 be r1,r0,800df80 <rtems_task_mode+0x178> <== NEVER TAKEN
_Context_Switch_necessary = true;
800df6c: 78 01 08 01 mvhi r1,0x801
800df70: 38 21 9d fc ori r1,r1,0x9dfc
800df74: 34 02 00 01 mvi r2,1
800df78: 30 22 00 18 sb (r1+24),r2
800df7c: e0 00 00 03 bi 800df88 <rtems_task_mode+0x180>
if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
_Thread_Dispatch();
return RTEMS_SUCCESSFUL;
800df80: 34 04 00 00 mvi r4,0
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) )
if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
800df84: 44 60 00 03 be r3,r0,800df90 <rtems_task_mode+0x188>
_Thread_Dispatch();
800df88: fb ff e1 27 calli 8006424 <_Thread_Dispatch>
return RTEMS_SUCCESSFUL;
800df8c: 34 04 00 00 mvi r4,0
}
800df90: b8 80 08 00 mv r1,r4
800df94: 2b 9d 00 04 lw ra,(sp+4)
800df98: 2b 8b 00 20 lw r11,(sp+32)
800df9c: 2b 8c 00 1c lw r12,(sp+28)
800dfa0: 2b 8d 00 18 lw r13,(sp+24)
800dfa4: 2b 8e 00 14 lw r14,(sp+20)
800dfa8: 2b 8f 00 10 lw r15,(sp+16)
800dfac: 2b 90 00 0c lw r16,(sp+12)
800dfb0: 2b 91 00 08 lw r17,(sp+8)
800dfb4: 37 9c 00 20 addi sp,sp,32
800dfb8: c3 a0 00 00 ret
08008538 <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
8008538: 37 9c ff f0 addi sp,sp,-16
800853c: 5b 8b 00 0c sw (sp+12),r11
8008540: 5b 8c 00 08 sw (sp+8),r12
8008544: 5b 9d 00 04 sw (sp+4),ra
8008548: b8 40 58 00 mv r11,r2
800854c: b8 60 60 00 mv r12,r3
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
8008550: 44 40 00 06 be r2,r0,8008568 <rtems_task_set_priority+0x30>
RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid (
rtems_task_priority the_priority
)
{
return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) &&
( the_priority <= RTEMS_MAXIMUM_PRIORITY ) );
8008554: 78 02 08 01 mvhi r2,0x801
8008558: 38 42 a0 c0 ori r2,r2,0xa0c0
800855c: 40 43 00 00 lbu r3,(r2+0)
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
8008560: 34 02 00 13 mvi r2,19
)
{
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
8008564: 55 63 00 16 bgu r11,r3,80085bc <rtems_task_set_priority+0x84>
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
return RTEMS_INVALID_ADDRESS;
8008568: 34 02 00 09 mvi r2,9
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
800856c: 45 80 00 14 be r12,r0,80085bc <rtems_task_set_priority+0x84>
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
8008570: 37 82 00 10 addi r2,sp,16
8008574: f8 00 09 9b calli 800abe0 <_Thread_Get>
switch ( location ) {
8008578: 2b 82 00 10 lw r2,(sp+16)
800857c: 5c 40 00 0f bne r2,r0,80085b8 <rtems_task_set_priority+0x80>
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
8008580: 28 23 00 14 lw r3,(r1+20)
8008584: 59 83 00 00 sw (r12+0),r3
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
8008588: 45 62 00 09 be r11,r2,80085ac <rtems_task_set_priority+0x74>
the_thread->real_priority = new_priority;
if ( the_thread->resource_count == 0 ||
800858c: 28 22 00 1c lw r2,(r1+28)
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
the_thread->real_priority = new_priority;
8008590: 58 2b 00 18 sw (r1+24),r11
if ( the_thread->resource_count == 0 ||
8008594: 44 40 00 03 be r2,r0,80085a0 <rtems_task_set_priority+0x68>
8008598: 28 22 00 14 lw r2,(r1+20)
800859c: 51 62 00 04 bgeu r11,r2,80085ac <rtems_task_set_priority+0x74><== ALWAYS TAKEN
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
80085a0: b9 60 10 00 mv r2,r11
80085a4: 34 03 00 00 mvi r3,0
80085a8: f8 00 07 fc calli 800a598 <_Thread_Change_priority>
}
_Thread_Enable_dispatch();
80085ac: f8 00 09 80 calli 800abac <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
80085b0: 34 02 00 00 mvi r2,0
80085b4: e0 00 00 02 bi 80085bc <rtems_task_set_priority+0x84>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
80085b8: 34 02 00 04 mvi r2,4
}
80085bc: b8 40 08 00 mv r1,r2
80085c0: 2b 9d 00 04 lw ra,(sp+4)
80085c4: 2b 8b 00 0c lw r11,(sp+12)
80085c8: 2b 8c 00 08 lw r12,(sp+8)
80085cc: 37 9c 00 10 addi sp,sp,16
80085d0: c3 a0 00 00 ret
08013fd0 <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
8013fd0: 37 9c ff f8 addi sp,sp,-8
8013fd4: 5b 9d 00 04 sw (sp+4),ra
8013fd8: b8 20 10 00 mv r2,r1
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
_Objects_Get( &_Timer_Information, id, location );
8013fdc: 78 01 08 04 mvhi r1,0x804
8013fe0: 38 21 15 8c ori r1,r1,0x158c
8013fe4: 37 83 00 08 addi r3,sp,8
8013fe8: f8 00 0e 99 calli 8017a4c <_Objects_Get>
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
8013fec: 2b 82 00 08 lw r2,(sp+8)
8013ff0: 5c 40 00 09 bne r2,r0,8014014 <rtems_timer_cancel+0x44> <== NEVER TAKEN
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
8013ff4: 28 23 00 38 lw r3,(r1+56)
8013ff8: 34 02 00 04 mvi r2,4
8013ffc: 44 62 00 03 be r3,r2,8014008 <rtems_timer_cancel+0x38> <== NEVER TAKEN
(void) _Watchdog_Remove( &the_timer->Ticker );
8014000: 34 21 00 10 addi r1,r1,16
8014004: f8 00 18 86 calli 801a21c <_Watchdog_Remove>
_Thread_Enable_dispatch();
8014008: f8 00 11 5b calli 8018574 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
801400c: 34 01 00 00 mvi r1,0
8014010: e0 00 00 02 bi 8014018 <rtems_timer_cancel+0x48>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8014014: 34 01 00 04 mvi r1,4
}
8014018: 2b 9d 00 04 lw ra,(sp+4)
801401c: 37 9c 00 08 addi sp,sp,8
8014020: c3 a0 00 00 ret
080145ec <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
80145ec: 37 9c ff dc addi sp,sp,-36
80145f0: 5b 8b 00 20 sw (sp+32),r11
80145f4: 5b 8c 00 1c sw (sp+28),r12
80145f8: 5b 8d 00 18 sw (sp+24),r13
80145fc: 5b 8e 00 14 sw (sp+20),r14
8014600: 5b 8f 00 10 sw (sp+16),r15
8014604: 5b 90 00 0c sw (sp+12),r16
8014608: 5b 91 00 08 sw (sp+8),r17
801460c: 5b 9d 00 04 sw (sp+4),ra
Timer_Control *the_timer;
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
8014610: 78 05 08 04 mvhi r5,0x804
8014614: 38 a5 15 cc ori r5,r5,0x15cc
8014618: 28 ad 00 00 lw r13,(r5+0)
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
801461c: b8 20 78 00 mv r15,r1
8014620: b8 40 60 00 mv r12,r2
8014624: b8 60 80 00 mv r16,r3
8014628: b8 80 88 00 mv r17,r4
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
return RTEMS_INCORRECT_STATE;
801462c: 34 0b 00 0e mvi r11,14
Timer_Control *the_timer;
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
8014630: 45 a0 00 2e be r13,r0,80146e8 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
8014634: 78 05 08 04 mvhi r5,0x804
8014638: 38 a5 0c b4 ori r5,r5,0xcb4
801463c: 40 a1 00 00 lbu r1,(r5+0)
return RTEMS_NOT_DEFINED;
8014640: 34 0b 00 0b mvi r11,11
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
8014644: 44 20 00 29 be r1,r0,80146e8 <rtems_timer_server_fire_when+0xfc><== NEVER TAKEN
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
8014648: 34 0b 00 09 mvi r11,9
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
if ( !routine )
801464c: 44 60 00 27 be r3,r0,80146e8 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
8014650: b8 40 08 00 mv r1,r2
8014654: fb ff f1 bc calli 8010d44 <_TOD_Validate>
return RTEMS_INVALID_CLOCK;
8014658: 34 0b 00 14 mvi r11,20
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
801465c: 44 20 00 23 be r1,r0,80146e8 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
8014660: b9 80 08 00 mv r1,r12
if ( seconds <= _TOD_Seconds_since_epoch() )
8014664: 78 0c 08 04 mvhi r12,0x804
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
8014668: fb ff f1 77 calli 8010c44 <_TOD_To_seconds>
if ( seconds <= _TOD_Seconds_since_epoch() )
801466c: 39 8c 0d 2c ori r12,r12,0xd2c
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
8014670: b8 20 70 00 mv r14,r1
if ( seconds <= _TOD_Seconds_since_epoch() )
8014674: 29 81 00 00 lw r1,(r12+0)
8014678: 50 2e 00 1c bgeu r1,r14,80146e8 <rtems_timer_server_fire_when+0xfc>
801467c: 78 01 08 04 mvhi r1,0x804
8014680: 38 21 15 8c ori r1,r1,0x158c
8014684: b9 e0 10 00 mv r2,r15
8014688: 37 83 00 24 addi r3,sp,36
801468c: f8 00 0c f0 calli 8017a4c <_Objects_Get>
8014690: b8 20 58 00 mv r11,r1
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
8014694: 2b 81 00 24 lw r1,(sp+36)
8014698: 5c 20 00 13 bne r1,r0,80146e4 <rtems_timer_server_fire_when+0xf8>
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
801469c: 35 61 00 10 addi r1,r11,16
80146a0: f8 00 16 df calli 801a21c <_Watchdog_Remove>
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
80146a4: 34 01 00 03 mvi r1,3
80146a8: 59 61 00 38 sw (r11+56),r1
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
80146ac: 29 81 00 00 lw r1,(r12+0)
(*timer_server->schedule_operation)( timer_server, the_timer );
80146b0: 29 a3 00 04 lw r3,(r13+4)
80146b4: b9 60 10 00 mv r2,r11
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();
80146b8: c9 c1 70 00 sub r14,r14,r1
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
80146bc: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
80146c0: 59 70 00 2c sw (r11+44),r16
the_watchdog->id = id;
80146c4: 59 6f 00 30 sw (r11+48),r15
the_watchdog->user_data = user_data;
80146c8: 59 71 00 34 sw (r11+52),r17
80146cc: 59 6e 00 1c sw (r11+28),r14
(*timer_server->schedule_operation)( timer_server, the_timer );
80146d0: b9 a0 08 00 mv r1,r13
80146d4: d8 60 00 00 call r3
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
80146d8: 34 0b 00 00 mvi r11,0
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
(*timer_server->schedule_operation)( timer_server, the_timer );
_Thread_Enable_dispatch();
80146dc: f8 00 0f a6 calli 8018574 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
80146e0: e0 00 00 02 bi 80146e8 <rtems_timer_server_fire_when+0xfc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
80146e4: 34 0b 00 04 mvi r11,4
}
80146e8: b9 60 08 00 mv r1,r11
80146ec: 2b 9d 00 04 lw ra,(sp+4)
80146f0: 2b 8b 00 20 lw r11,(sp+32)
80146f4: 2b 8c 00 1c lw r12,(sp+28)
80146f8: 2b 8d 00 18 lw r13,(sp+24)
80146fc: 2b 8e 00 14 lw r14,(sp+20)
8014700: 2b 8f 00 10 lw r15,(sp+16)
8014704: 2b 90 00 0c lw r16,(sp+12)
8014708: 2b 91 00 08 lw r17,(sp+8)
801470c: 37 9c 00 24 addi sp,sp,36
8014710: c3 a0 00 00 ret
080039ac <sched_get_priority_max>:
#include <rtems/posix/priority.h>
int sched_get_priority_max(
int policy
)
{
80039ac: 37 9c ff fc addi sp,sp,-4
80039b0: 5b 9d 00 04 sw (sp+4),ra
switch ( policy ) {
80039b4: 48 01 00 05 bg r0,r1,80039c8 <sched_get_priority_max+0x1c>
80039b8: 34 02 00 02 mvi r2,2
80039bc: 4c 41 00 08 bge r2,r1,80039dc <sched_get_priority_max+0x30>
80039c0: 34 02 00 04 mvi r2,4
80039c4: 44 22 00 06 be r1,r2,80039dc <sched_get_priority_max+0x30> <== ALWAYS TAKEN
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
80039c8: f8 00 26 8e calli 800d400 <__errno>
80039cc: 34 02 00 16 mvi r2,22
80039d0: 58 22 00 00 sw (r1+0),r2
80039d4: 34 01 ff ff mvi r1,-1
80039d8: e0 00 00 05 bi 80039ec <sched_get_priority_max+0x40>
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
80039dc: 78 01 08 01 mvhi r1,0x801
80039e0: 38 21 f0 e4 ori r1,r1,0xf0e4
80039e4: 40 21 00 00 lbu r1,(r1+0)
80039e8: 34 21 ff ff addi r1,r1,-1
}
80039ec: 2b 9d 00 04 lw ra,(sp+4)
80039f0: 37 9c 00 04 addi sp,sp,4
80039f4: c3 a0 00 00 ret
080039f8 <sched_get_priority_min>:
#include <rtems/posix/priority.h>
int sched_get_priority_min(
int policy
)
{
80039f8: 37 9c ff fc addi sp,sp,-4
80039fc: 5b 9d 00 04 sw (sp+4),ra
switch ( policy ) {
8003a00: 48 01 00 05 bg r0,r1,8003a14 <sched_get_priority_min+0x1c>
8003a04: 34 02 00 02 mvi r2,2
8003a08: 4c 41 00 08 bge r2,r1,8003a28 <sched_get_priority_min+0x30><== ALWAYS TAKEN
8003a0c: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
8003a10: 44 22 00 06 be r1,r2,8003a28 <sched_get_priority_min+0x30> <== NOT EXECUTED
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
8003a14: f8 00 26 7b calli 800d400 <__errno>
8003a18: 34 02 00 16 mvi r2,22
8003a1c: 58 22 00 00 sw (r1+0),r2
8003a20: 34 01 ff ff mvi r1,-1
8003a24: e0 00 00 02 bi 8003a2c <sched_get_priority_min+0x34>
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
8003a28: 34 01 00 01 mvi r1,1
}
8003a2c: 2b 9d 00 04 lw ra,(sp+4)
8003a30: 37 9c 00 04 addi sp,sp,4
8003a34: c3 a0 00 00 ret
08003a38 <sched_rr_get_interval>:
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
)
{
8003a38: 37 9c ff f4 addi sp,sp,-12
8003a3c: 5b 8b 00 08 sw (sp+8),r11
8003a40: 5b 9d 00 04 sw (sp+4),ra
8003a44: b8 20 58 00 mv r11,r1
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid && pid != getpid() )
8003a48: 44 20 00 08 be r1,r0,8003a68 <sched_rr_get_interval+0x30> <== NEVER TAKEN
8003a4c: 5b 82 00 0c sw (sp+12),r2
8003a50: fb ff f8 ba calli 8001d38 <getpid>
8003a54: 2b 82 00 0c lw r2,(sp+12)
8003a58: 45 61 00 04 be r11,r1,8003a68 <sched_rr_get_interval+0x30>
rtems_set_errno_and_return_minus_one( ESRCH );
8003a5c: f8 00 26 69 calli 800d400 <__errno>
8003a60: 34 02 00 03 mvi r2,3
8003a64: e0 00 00 04 bi 8003a74 <sched_rr_get_interval+0x3c>
if ( !interval )
8003a68: 5c 40 00 06 bne r2,r0,8003a80 <sched_rr_get_interval+0x48>
rtems_set_errno_and_return_minus_one( EINVAL );
8003a6c: f8 00 26 65 calli 800d400 <__errno>
8003a70: 34 02 00 16 mvi r2,22
8003a74: 58 22 00 00 sw (r1+0),r2
8003a78: 34 01 ff ff mvi r1,-1
8003a7c: e0 00 00 06 bi 8003a94 <sched_rr_get_interval+0x5c>
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
8003a80: 78 01 08 01 mvhi r1,0x801
8003a84: 38 21 f7 f4 ori r1,r1,0xf7f4
8003a88: 28 21 00 00 lw r1,(r1+0)
8003a8c: f8 00 0d db calli 80071f8 <_Timespec_From_ticks>
return 0;
8003a90: 34 01 00 00 mvi r1,0
}
8003a94: 2b 9d 00 04 lw ra,(sp+4)
8003a98: 2b 8b 00 08 lw r11,(sp+8)
8003a9c: 37 9c 00 0c addi sp,sp,12
8003aa0: c3 a0 00 00 ret
080061a8 <sem_open>:
int oflag,
...
/* mode_t mode, */
/* unsigned int value */
)
{
80061a8: 37 9c ff c0 addi sp,sp,-64
80061ac: 5b 8b 00 18 sw (sp+24),r11
80061b0: 5b 8c 00 14 sw (sp+20),r12
80061b4: 5b 8d 00 10 sw (sp+16),r13
80061b8: 5b 8e 00 0c sw (sp+12),r14
80061bc: 5b 8f 00 08 sw (sp+8),r15
80061c0: 5b 9d 00 04 sw (sp+4),ra
80061c4: 5b 83 00 2c sw (sp+44),r3
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
80061c8: 78 03 08 02 mvhi r3,0x802
80061cc: 5b 82 00 28 sw (sp+40),r2
80061d0: 5b 84 00 30 sw (sp+48),r4
80061d4: 5b 85 00 34 sw (sp+52),r5
80061d8: 5b 86 00 38 sw (sp+56),r6
80061dc: 5b 87 00 3c sw (sp+60),r7
80061e0: 5b 88 00 40 sw (sp+64),r8
80061e4: 38 63 4a 54 ori r3,r3,0x4a54
80061e8: b8 20 60 00 mv r12,r1
80061ec: 28 61 00 00 lw r1,(r3+0)
80061f0: b8 40 70 00 mv r14,r2
80061f4: 34 21 00 01 addi r1,r1,1
80061f8: 58 61 00 00 sw (r3+0),r1
POSIX_Semaphore_Control *the_semaphore;
Objects_Locations location;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
80061fc: 20 4f 02 00 andi r15,r2,0x200
/* unsigned int value */
)
{
va_list arg;
mode_t mode;
unsigned int value = 0;
8006200: 34 0d 00 00 mvi r13,0
POSIX_Semaphore_Control *the_semaphore;
Objects_Locations location;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
8006204: 45 e0 00 02 be r15,r0,800620c <sem_open+0x64>
va_start(arg, oflag);
mode = (mode_t) va_arg( arg, unsigned int );
value = va_arg( arg, unsigned int );
8006208: 2b 8d 00 30 lw r13,(sp+48)
va_end(arg);
}
status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
800620c: b9 80 08 00 mv r1,r12
8006210: 37 82 00 24 addi r2,sp,36
8006214: f8 00 1a c6 calli 800cd2c <_POSIX_Semaphore_Name_to_id>
8006218: b8 20 58 00 mv r11,r1
* 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 ) {
800621c: 44 20 00 08 be r1,r0,800623c <sem_open+0x94>
/*
* 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) ) ) {
8006220: 34 01 00 02 mvi r1,2
8006224: 5d 61 00 02 bne r11,r1,800622c <sem_open+0x84> <== NEVER TAKEN
8006228: 5d e0 00 1a bne r15,r0,8006290 <sem_open+0xe8>
_Thread_Enable_dispatch();
800622c: f8 00 09 b8 calli 800890c <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
8006230: f8 00 2a 66 calli 8010bc8 <__errno>
8006234: 58 2b 00 00 sw (r1+0),r11
8006238: e0 00 00 08 bi 8006258 <sem_open+0xb0>
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
800623c: 21 ce 0a 00 andi r14,r14,0xa00
8006240: 34 01 0a 00 mvi r1,2560
8006244: 5d c1 00 07 bne r14,r1,8006260 <sem_open+0xb8>
_Thread_Enable_dispatch();
8006248: f8 00 09 b1 calli 800890c <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
800624c: f8 00 2a 5f calli 8010bc8 <__errno>
8006250: 34 02 00 11 mvi r2,17
8006254: 58 22 00 00 sw (r1+0),r2
8006258: 34 01 ff ff mvi r1,-1
800625c: e0 00 00 18 bi 80062bc <sem_open+0x114>
8006260: 2b 82 00 24 lw r2,(sp+36)
8006264: 78 01 08 02 mvhi r1,0x802
8006268: 37 83 00 1c addi r3,sp,28
800626c: 38 21 4c b4 ori r1,r1,0x4cb4
8006270: f8 00 07 5d calli 8007fe4 <_Objects_Get>
}
the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location );
the_semaphore->open_count += 1;
8006274: 28 22 00 18 lw r2,(r1+24)
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 );
8006278: 5b 81 00 20 sw (sp+32),r1
the_semaphore->open_count += 1;
800627c: 34 42 00 01 addi r2,r2,1
8006280: 58 22 00 18 sw (r1+24),r2
_Thread_Enable_dispatch();
8006284: f8 00 09 a2 calli 800890c <_Thread_Enable_dispatch>
_Thread_Enable_dispatch();
8006288: f8 00 09 a1 calli 800890c <_Thread_Enable_dispatch>
goto return_id;
800628c: e0 00 00 0a bi 80062b4 <sem_open+0x10c>
/*
* 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(
8006290: 34 02 00 00 mvi r2,0
8006294: b9 a0 18 00 mv r3,r13
8006298: 37 84 00 20 addi r4,sp,32
800629c: b9 80 08 00 mv r1,r12
80062a0: f8 00 1a 3f calli 800cb9c <_POSIX_Semaphore_Create_support>
80062a4: b8 20 58 00 mv r11,r1
/*
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
80062a8: f8 00 09 99 calli 800890c <_Thread_Enable_dispatch>
if ( status == -1 )
return SEM_FAILED;
80062ac: 34 01 ff ff mvi r1,-1
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
if ( status == -1 )
80062b0: 45 61 00 03 be r11,r1,80062bc <sem_open+0x114>
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;
80062b4: 2b 81 00 20 lw r1,(sp+32)
80062b8: 34 21 00 08 addi r1,r1,8
#endif
return id;
}
80062bc: 2b 9d 00 04 lw ra,(sp+4)
80062c0: 2b 8b 00 18 lw r11,(sp+24)
80062c4: 2b 8c 00 14 lw r12,(sp+20)
80062c8: 2b 8d 00 10 lw r13,(sp+16)
80062cc: 2b 8e 00 0c lw r14,(sp+12)
80062d0: 2b 8f 00 08 lw r15,(sp+8)
80062d4: 37 9c 00 40 addi sp,sp,64
80062d8: c3 a0 00 00 ret
080038b4 <sigaction>:
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
80038b4: 37 9c ff e4 addi sp,sp,-28
80038b8: 5b 8b 00 1c sw (sp+28),r11
80038bc: 5b 8c 00 18 sw (sp+24),r12
80038c0: 5b 8d 00 14 sw (sp+20),r13
80038c4: 5b 8e 00 10 sw (sp+16),r14
80038c8: 5b 8f 00 0c sw (sp+12),r15
80038cc: 5b 90 00 08 sw (sp+8),r16
80038d0: 5b 9d 00 04 sw (sp+4),ra
80038d4: b8 20 58 00 mv r11,r1
80038d8: b8 40 60 00 mv r12,r2
80038dc: b8 60 68 00 mv r13,r3
ISR_Level level;
if ( oact )
80038e0: 44 60 00 0f be r3,r0,800391c <sigaction+0x68>
*oact = _POSIX_signals_Vectors[ sig ];
80038e4: 34 02 00 01 mvi r2,1
80038e8: f8 00 65 7d calli 801cedc <__ashlsi3>
80038ec: 34 02 00 02 mvi r2,2
80038f0: 78 0e 08 02 mvhi r14,0x802
80038f4: b4 2b 08 00 add r1,r1,r11
80038f8: f8 00 65 79 calli 801cedc <__ashlsi3>
80038fc: 39 ce 0d a8 ori r14,r14,0xda8
8003900: b5 c1 08 00 add r1,r14,r1
8003904: 28 23 00 00 lw r3,(r1+0)
8003908: 28 22 00 04 lw r2,(r1+4)
800390c: 28 21 00 08 lw r1,(r1+8)
8003910: 59 a3 00 00 sw (r13+0),r3
8003914: 59 a2 00 04 sw (r13+4),r2
8003918: 59 a1 00 08 sw (r13+8),r1
if ( !sig )
800391c: 45 60 00 07 be r11,r0,8003938 <sigaction+0x84>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
8003920: 35 61 ff ff addi r1,r11,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
8003924: 34 02 00 1f mvi r2,31
8003928: 50 41 00 02 bgeu r2,r1,8003930 <sigaction+0x7c>
800392c: e0 00 00 03 bi 8003938 <sigaction+0x84>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
8003930: 34 01 00 09 mvi r1,9
8003934: 5d 61 00 06 bne r11,r1,800394c <sigaction+0x98>
rtems_set_errno_and_return_minus_one( EINVAL );
8003938: f8 00 28 11 calli 800d97c <__errno>
800393c: 34 02 00 16 mvi r2,22
8003940: 58 22 00 00 sw (r1+0),r2
8003944: 34 01 ff ff mvi r1,-1
8003948: e0 00 00 35 bi 8003a1c <sigaction+0x168>
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
800394c: 34 01 00 00 mvi r1,0
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
8003950: 45 80 00 33 be r12,r0,8003a1c <sigaction+0x168> <== NEVER TAKEN
/*
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
8003954: 90 00 70 00 rcsr r14,IE
8003958: 34 01 ff fe mvi r1,-2
800395c: a1 c1 08 00 and r1,r14,r1
8003960: d0 01 00 00 wcsr IE,r1
if ( act->sa_handler == SIG_DFL ) {
8003964: 29 81 00 08 lw r1,(r12+8)
8003968: 78 0d 08 02 mvhi r13,0x802
800396c: 39 ad 0d a8 ori r13,r13,0xda8
8003970: 5c 20 00 1a bne r1,r0,80039d8 <sigaction+0x124>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
8003974: 34 02 00 01 mvi r2,1
8003978: b9 60 08 00 mv r1,r11
800397c: f8 00 65 58 calli 801cedc <__ashlsi3>
8003980: b4 2b 80 00 add r16,r1,r11
8003984: 34 02 00 02 mvi r2,2
8003988: ba 00 08 00 mv r1,r16
800398c: f8 00 65 54 calli 801cedc <__ashlsi3>
8003990: b5 a1 68 00 add r13,r13,r1
8003994: b8 20 78 00 mv r15,r1
8003998: 34 02 00 01 mvi r2,1
800399c: b9 60 08 00 mv r1,r11
80039a0: f8 00 65 4f calli 801cedc <__ashlsi3>
80039a4: 34 02 00 02 mvi r2,2
80039a8: 78 0c 08 01 mvhi r12,0x801
80039ac: ba 00 08 00 mv r1,r16
80039b0: f8 00 65 4b calli 801cedc <__ashlsi3>
80039b4: 39 8c e8 f4 ori r12,r12,0xe8f4
80039b8: b5 8f 08 00 add r1,r12,r15
80039bc: 28 23 00 00 lw r3,(r1+0)
80039c0: 28 22 00 04 lw r2,(r1+4)
80039c4: 28 21 00 08 lw r1,(r1+8)
80039c8: 59 a3 00 00 sw (r13+0),r3
80039cc: 59 a2 00 04 sw (r13+4),r2
80039d0: 59 a1 00 08 sw (r13+8),r1
80039d4: e0 00 00 10 bi 8003a14 <sigaction+0x160>
} else {
_POSIX_signals_Clear_process_signals( sig );
80039d8: b9 60 08 00 mv r1,r11
80039dc: f8 00 18 5f calli 8009b58 <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
80039e0: 34 02 00 01 mvi r2,1
80039e4: b9 60 08 00 mv r1,r11
80039e8: f8 00 65 3d calli 801cedc <__ashlsi3>
80039ec: 34 02 00 02 mvi r2,2
80039f0: b4 2b 08 00 add r1,r1,r11
80039f4: f8 00 65 3a calli 801cedc <__ashlsi3>
80039f8: 29 83 00 00 lw r3,(r12+0)
80039fc: 29 82 00 04 lw r2,(r12+4)
8003a00: 29 84 00 08 lw r4,(r12+8)
8003a04: b5 a1 08 00 add r1,r13,r1
8003a08: 58 23 00 00 sw (r1+0),r3
8003a0c: 58 22 00 04 sw (r1+4),r2
8003a10: 58 24 00 08 sw (r1+8),r4
}
_ISR_Enable( level );
8003a14: d0 0e 00 00 wcsr IE,r14
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
8003a18: 34 01 00 00 mvi r1,0
}
8003a1c: 2b 9d 00 04 lw ra,(sp+4)
8003a20: 2b 8b 00 1c lw r11,(sp+28)
8003a24: 2b 8c 00 18 lw r12,(sp+24)
8003a28: 2b 8d 00 14 lw r13,(sp+20)
8003a2c: 2b 8e 00 10 lw r14,(sp+16)
8003a30: 2b 8f 00 0c lw r15,(sp+12)
8003a34: 2b 90 00 08 lw r16,(sp+8)
8003a38: 37 9c 00 1c addi sp,sp,28
8003a3c: c3 a0 00 00 ret
0800605c <sigsuspend>:
#include <rtems/seterr.h>
int sigsuspend(
const sigset_t *sigmask
)
{
800605c: 37 9c ff f0 addi sp,sp,-16
8006060: 5b 8b 00 08 sw (sp+8),r11
8006064: 5b 9d 00 04 sw (sp+4),ra
8006068: b8 20 10 00 mv r2,r1
int status;
POSIX_API_Control *api;
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
800606c: 37 83 00 10 addi r3,sp,16
8006070: 34 01 00 01 mvi r1,1
8006074: fb ff ff ec calli 8006024 <sigprocmask>
(void) sigfillset( &all_signals );
8006078: 37 8b 00 0c addi r11,sp,12
800607c: b9 60 08 00 mv r1,r11
8006080: fb ff ff ad calli 8005f34 <sigfillset>
status = sigtimedwait( &all_signals, NULL, NULL );
8006084: b9 60 08 00 mv r1,r11
8006088: 34 02 00 00 mvi r2,0
800608c: 34 03 00 00 mvi r3,0
8006090: f8 00 00 2f calli 800614c <sigtimedwait>
(void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
8006094: 37 82 00 10 addi r2,sp,16
status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
(void) sigfillset( &all_signals );
status = sigtimedwait( &all_signals, NULL, NULL );
8006098: b8 20 58 00 mv r11,r1
(void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
800609c: 34 03 00 00 mvi r3,0
80060a0: 34 01 00 00 mvi r1,0
80060a4: fb ff ff e0 calli 8006024 <sigprocmask>
/*
* sigtimedwait() returns the signal number while sigsuspend()
* is supposed to return -1 and EINTR when a signal is caught.
*/
if ( status != -1 )
80060a8: 34 02 ff ff mvi r2,-1
80060ac: 45 62 00 04 be r11,r2,80060bc <sigsuspend+0x60> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINTR );
80060b0: f8 00 27 76 calli 800fe88 <__errno>
80060b4: 34 02 00 04 mvi r2,4
80060b8: 58 22 00 00 sw (r1+0),r2
return status;
}
80060bc: 34 01 ff ff mvi r1,-1
80060c0: 2b 9d 00 04 lw ra,(sp+4)
80060c4: 2b 8b 00 08 lw r11,(sp+8)
80060c8: 37 9c 00 10 addi sp,sp,16
80060cc: c3 a0 00 00 ret
08003edc <sigtimedwait>:
int sigtimedwait(
const sigset_t *set,
siginfo_t *info,
const struct timespec *timeout
)
{
8003edc: 37 9c ff e0 addi sp,sp,-32
8003ee0: 5b 8b 00 14 sw (sp+20),r11
8003ee4: 5b 8c 00 10 sw (sp+16),r12
8003ee8: 5b 8d 00 0c sw (sp+12),r13
8003eec: 5b 8e 00 08 sw (sp+8),r14
8003ef0: 5b 9d 00 04 sw (sp+4),ra
8003ef4: b8 20 60 00 mv r12,r1
8003ef8: b8 40 58 00 mv r11,r2
8003efc: b8 60 68 00 mv r13,r3
ISR_Level level;
/*
* Error check parameters before disabling interrupts.
*/
if ( !set )
8003f00: 44 20 00 09 be r1,r0,8003f24 <sigtimedwait+0x48>
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
if ( timeout ) {
8003f04: 44 60 00 0d be r3,r0,8003f38 <sigtimedwait+0x5c>
if ( !_Timespec_Is_valid( timeout ) )
8003f08: b8 60 08 00 mv r1,r3
8003f0c: f8 00 0d f5 calli 80076e0 <_Timespec_Is_valid>
8003f10: 44 20 00 05 be r1,r0,8003f24 <sigtimedwait+0x48>
rtems_set_errno_and_return_minus_one( EINVAL );
interval = _Timespec_To_ticks( timeout );
8003f14: b9 a0 08 00 mv r1,r13
8003f18: f8 00 0e 10 calli 8007758 <_Timespec_To_ticks>
8003f1c: b8 20 10 00 mv r2,r1
if ( !interval )
8003f20: 5c 20 00 07 bne r1,r0,8003f3c <sigtimedwait+0x60> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
8003f24: f8 00 28 59 calli 800e088 <__errno>
8003f28: 34 02 00 16 mvi r2,22
8003f2c: 58 22 00 00 sw (r1+0),r2
8003f30: 34 0c ff ff mvi r12,-1
8003f34: e0 00 00 55 bi 8004088 <sigtimedwait+0x1ac>
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
8003f38: 34 02 00 00 mvi r2,0
/*
* Initialize local variables.
*/
the_info = ( info ) ? info : &signal_information;
8003f3c: 5d 60 00 02 bne r11,r0,8003f44 <sigtimedwait+0x68>
8003f40: 37 8b 00 18 addi r11,sp,24
the_thread = _Thread_Executing;
8003f44: 78 01 08 02 mvhi r1,0x802
8003f48: 38 21 0d 84 ori r1,r1,0xd84
8003f4c: 28 23 00 0c lw r3,(r1+12)
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8003f50: 28 6d 01 2c lw r13,(r3+300)
* What if they are already pending?
*/
/* API signals pending? */
_ISR_Disable( level );
8003f54: 90 00 70 00 rcsr r14,IE
8003f58: 34 01 ff fe mvi r1,-2
8003f5c: a1 c1 08 00 and r1,r14,r1
8003f60: d0 01 00 00 wcsr IE,r1
if ( *set & api->signals_pending ) {
8003f64: 29 85 00 00 lw r5,(r12+0)
8003f68: 29 a1 00 d0 lw r1,(r13+208)
8003f6c: a0 a1 20 00 and r4,r5,r1
8003f70: 44 80 00 0e be r4,r0,8003fa8 <sigtimedwait+0xcc>
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending );
8003f74: fb ff ff bb calli 8003e60 <_POSIX_signals_Get_highest>
8003f78: b8 20 10 00 mv r2,r1
8003f7c: 59 61 00 00 sw (r11+0),r1
_POSIX_signals_Clear_signals(
8003f80: b9 60 18 00 mv r3,r11
8003f84: b9 a0 08 00 mv r1,r13
8003f88: 34 04 00 00 mvi r4,0
8003f8c: 34 05 00 00 mvi r5,0
8003f90: f8 00 19 6f calli 800a54c <_POSIX_signals_Clear_signals>
the_info->si_signo,
the_info,
false,
false
);
_ISR_Enable( level );
8003f94: d0 0e 00 00 wcsr IE,r14
the_info->si_code = SI_USER;
8003f98: 34 01 00 01 mvi r1,1
8003f9c: 59 61 00 04 sw (r11+4),r1
the_info->si_value.sival_int = 0;
8003fa0: 59 60 00 08 sw (r11+8),r0
8003fa4: e0 00 00 38 bi 8004084 <sigtimedwait+0x1a8>
return the_info->si_signo;
}
/* Process pending signals? */
if ( *set & _POSIX_signals_Pending ) {
8003fa8: 78 01 08 02 mvhi r1,0x802
8003fac: 38 21 0f 9c ori r1,r1,0xf9c
8003fb0: 28 21 00 00 lw r1,(r1+0)
8003fb4: a0 a1 28 00 and r5,r5,r1
8003fb8: 44 a4 00 0f be r5,r4,8003ff4 <sigtimedwait+0x118>
signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending );
8003fbc: fb ff ff a9 calli 8003e60 <_POSIX_signals_Get_highest>
8003fc0: b8 20 60 00 mv r12,r1
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
8003fc4: b9 80 10 00 mv r2,r12
8003fc8: b9 a0 08 00 mv r1,r13
8003fcc: b9 60 18 00 mv r3,r11
8003fd0: 34 04 00 01 mvi r4,1
8003fd4: 34 05 00 00 mvi r5,0
8003fd8: f8 00 19 5d calli 800a54c <_POSIX_signals_Clear_signals>
_ISR_Enable( level );
8003fdc: d0 0e 00 00 wcsr IE,r14
the_info->si_signo = signo;
the_info->si_code = SI_USER;
8003fe0: 34 01 00 01 mvi r1,1
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;
8003fe4: 59 6c 00 00 sw (r11+0),r12
the_info->si_code = SI_USER;
8003fe8: 59 61 00 04 sw (r11+4),r1
the_info->si_value.sival_int = 0;
8003fec: 59 60 00 08 sw (r11+8),r0
return signo;
8003ff0: e0 00 00 26 bi 8004088 <sigtimedwait+0x1ac>
}
the_info->si_signo = -1;
8003ff4: 34 01 ff ff mvi r1,-1
8003ff8: 59 61 00 00 sw (r11+0),r1
8003ffc: 78 01 08 02 mvhi r1,0x802
8004000: 38 21 08 ac ori r1,r1,0x8ac
8004004: 28 24 00 00 lw r4,(r1+0)
8004008: 34 84 00 01 addi r4,r4,1
800400c: 58 24 00 00 sw (r1+0),r4
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
the_thread->Wait.return_code = EINTR;
8004010: 34 01 00 04 mvi r1,4
8004014: 58 61 00 34 sw (r3+52),r1
the_thread->Wait.option = *set;
8004018: 29 81 00 00 lw r1,(r12+0)
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
800401c: 78 04 08 02 mvhi r4,0x802
8004020: 38 84 0f 34 ori r4,r4,0xf34
the_thread->Wait.return_code = EINTR;
the_thread->Wait.option = *set;
8004024: 58 61 00 30 sw (r3+48),r1
the_thread->Wait.return_argument = the_info;
8004028: 58 6b 00 28 sw (r3+40),r11
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;
800402c: 34 01 00 01 mvi r1,1
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
8004030: 58 64 00 44 sw (r3+68),r4
8004034: 58 81 00 30 sw (r4+48),r1
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 );
8004038: d0 0e 00 00 wcsr IE,r14
_Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval );
800403c: 78 01 08 02 mvhi r1,0x802
8004040: 78 03 08 00 mvhi r3,0x800
8004044: 38 21 0f 34 ori r1,r1,0xf34
8004048: 38 63 70 80 ori r3,r3,0x7080
800404c: f8 00 0a d7 calli 8006ba8 <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
8004050: f8 00 09 99 calli 80066b4 <_Thread_Enable_dispatch>
/*
* 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 );
8004054: 29 62 00 00 lw r2,(r11+0)
8004058: b9 60 18 00 mv r3,r11
800405c: 34 04 00 00 mvi r4,0
8004060: 34 05 00 00 mvi r5,0
8004064: b9 a0 08 00 mv r1,r13
8004068: f8 00 19 39 calli 800a54c <_POSIX_signals_Clear_signals>
errno = _Thread_Executing->Wait.return_code;
800406c: f8 00 28 07 calli 800e088 <__errno>
8004070: 78 02 08 02 mvhi r2,0x802
8004074: 38 42 0d 84 ori r2,r2,0xd84
8004078: 28 42 00 0c lw r2,(r2+12)
800407c: 28 42 00 34 lw r2,(r2+52)
8004080: 58 22 00 00 sw (r1+0),r2
return the_info->si_signo;
8004084: 29 6c 00 00 lw r12,(r11+0)
}
8004088: b9 80 08 00 mv r1,r12
800408c: 2b 9d 00 04 lw ra,(sp+4)
8004090: 2b 8b 00 14 lw r11,(sp+20)
8004094: 2b 8c 00 10 lw r12,(sp+16)
8004098: 2b 8d 00 0c lw r13,(sp+12)
800409c: 2b 8e 00 08 lw r14,(sp+8)
80040a0: 37 9c 00 20 addi sp,sp,32
80040a4: c3 a0 00 00 ret
08006334 <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
8006334: 37 9c ff f8 addi sp,sp,-8
8006338: 5b 8b 00 08 sw (sp+8),r11
800633c: 5b 9d 00 04 sw (sp+4),ra
int status;
status = sigtimedwait( set, NULL, NULL );
8006340: 34 03 00 00 mvi r3,0
int sigwait(
const sigset_t *set,
int *sig
)
{
8006344: b8 40 58 00 mv r11,r2
int status;
status = sigtimedwait( set, NULL, NULL );
8006348: 34 02 00 00 mvi r2,0
800634c: fb ff ff 80 calli 800614c <sigtimedwait>
8006350: b8 20 18 00 mv r3,r1
if ( status != -1 ) {
8006354: 34 01 ff ff mvi r1,-1
8006358: 44 61 00 05 be r3,r1,800636c <sigwait+0x38>
if ( sig )
*sig = status;
return 0;
800635c: 34 01 00 00 mvi r1,0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
8006360: 45 60 00 05 be r11,r0,8006374 <sigwait+0x40> <== NEVER TAKEN
*sig = status;
8006364: 59 63 00 00 sw (r11+0),r3
8006368: e0 00 00 03 bi 8006374 <sigwait+0x40>
return 0;
}
return errno;
800636c: f8 00 26 c7 calli 800fe88 <__errno>
8006370: 28 21 00 00 lw r1,(r1+0)
}
8006374: 2b 9d 00 04 lw ra,(sp+4)
8006378: 2b 8b 00 08 lw r11,(sp+8)
800637c: 37 9c 00 08 addi sp,sp,8
8006380: c3 a0 00 00 ret
08002eac <timer_create>:
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
)
{
8002eac: 37 9c ff ec addi sp,sp,-20
8002eb0: 5b 8b 00 14 sw (sp+20),r11
8002eb4: 5b 8c 00 10 sw (sp+16),r12
8002eb8: 5b 8d 00 0c sw (sp+12),r13
8002ebc: 5b 8e 00 08 sw (sp+8),r14
8002ec0: 5b 9d 00 04 sw (sp+4),ra
8002ec4: b8 40 60 00 mv r12,r2
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
8002ec8: 34 02 00 01 mvi r2,1
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
)
{
8002ecc: b8 60 68 00 mv r13,r3
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
8002ed0: 5c 22 00 0c bne r1,r2,8002f00 <timer_create+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !timerid )
8002ed4: 44 60 00 0b be r3,r0,8002f00 <timer_create+0x54>
/*
* The data of the structure evp are checked in order to verify if they
* are coherent.
*/
if (evp != NULL) {
8002ed8: 45 80 00 0d be r12,r0,8002f0c <timer_create+0x60>
/* The structure has data */
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
8002edc: 29 82 00 00 lw r2,(r12+0)
8002ee0: 34 42 ff ff addi r2,r2,-1
8002ee4: 50 22 00 02 bgeu r1,r2,8002eec <timer_create+0x40> <== ALWAYS TAKEN
8002ee8: e0 00 00 06 bi 8002f00 <timer_create+0x54> <== NOT EXECUTED
( evp->sigev_notify != SIGEV_SIGNAL ) ) {
/* The value of the field sigev_notify is not valid */
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !evp->sigev_signo )
8002eec: 29 81 00 04 lw r1,(r12+4)
8002ef0: 44 20 00 04 be r1,r0,8002f00 <timer_create+0x54> <== NEVER TAKEN
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
8002ef4: 34 21 ff ff addi r1,r1,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(evp->sigev_signo) )
8002ef8: 34 02 00 1f mvi r2,31
8002efc: 50 41 00 04 bgeu r2,r1,8002f0c <timer_create+0x60> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
8002f00: f8 00 29 dc calli 800d670 <__errno>
8002f04: 34 02 00 16 mvi r2,22
8002f08: e0 00 00 0e bi 8002f40 <timer_create+0x94>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8002f0c: 78 01 08 01 mvhi r1,0x801
8002f10: 38 21 f8 bc ori r1,r1,0xf8bc
8002f14: 28 22 00 00 lw r2,(r1+0)
8002f18: 34 42 00 01 addi r2,r2,1
8002f1c: 58 22 00 00 sw (r1+0),r2
* 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 );
8002f20: 78 01 08 01 mvhi r1,0x801
8002f24: 38 21 fb 5c ori r1,r1,0xfb5c
8002f28: f8 00 07 10 calli 8004b68 <_Objects_Allocate>
8002f2c: b8 20 58 00 mv r11,r1
/*
* Allocate a timer
*/
ptimer = _POSIX_Timer_Allocate();
if ( !ptimer ) {
8002f30: 5c 20 00 07 bne r1,r0,8002f4c <timer_create+0xa0>
_Thread_Enable_dispatch();
8002f34: f8 00 0a 6a calli 80058dc <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
8002f38: f8 00 29 ce calli 800d670 <__errno>
8002f3c: 34 02 00 0b mvi r2,11
8002f40: 58 22 00 00 sw (r1+0),r2
8002f44: 34 01 ff ff mvi r1,-1
8002f48: e0 00 00 25 bi 8002fdc <timer_create+0x130>
}
/* The data of the created timer are stored to use them later */
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
8002f4c: 34 01 00 02 mvi r1,2
8002f50: 31 61 00 3c sb (r11+60),r1
ptimer->thread_id = _Thread_Executing->Object.id;
8002f54: 78 01 08 01 mvhi r1,0x801
8002f58: 38 21 fd 94 ori r1,r1,0xfd94
8002f5c: 28 21 00 0c lw r1,(r1+12)
8002f60: 28 21 00 08 lw r1,(r1+8)
8002f64: 59 61 00 38 sw (r11+56),r1
if ( evp != NULL ) {
8002f68: 45 80 00 07 be r12,r0,8002f84 <timer_create+0xd8>
ptimer->inf.sigev_notify = evp->sigev_notify;
8002f6c: 29 81 00 00 lw r1,(r12+0)
8002f70: 59 61 00 40 sw (r11+64),r1
ptimer->inf.sigev_signo = evp->sigev_signo;
8002f74: 29 81 00 04 lw r1,(r12+4)
8002f78: 59 61 00 44 sw (r11+68),r1
ptimer->inf.sigev_value = evp->sigev_value;
8002f7c: 29 81 00 08 lw r1,(r12+8)
8002f80: 59 61 00 48 sw (r11+72),r1
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8002f84: 29 6c 00 08 lw r12,(r11+8)
_Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0);
*timerid = ptimer->Object.id;
_Thread_Enable_dispatch();
return 0;
}
8002f88: 78 01 08 01 mvhi r1,0x801
8002f8c: 38 21 fb 5c ori r1,r1,0xfb5c
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8002f90: 28 2e 00 1c lw r14,(r1+28)
8002f94: 34 02 00 02 mvi r2,2
ptimer->inf.sigev_notify = evp->sigev_notify;
ptimer->inf.sigev_signo = evp->sigev_signo;
ptimer->inf.sigev_value = evp->sigev_value;
}
ptimer->overrun = 0;
8002f98: 59 60 00 68 sw (r11+104),r0
ptimer->timer_data.it_value.tv_sec = 0;
8002f9c: 59 60 00 5c sw (r11+92),r0
ptimer->timer_data.it_value.tv_nsec = 0;
8002fa0: 59 60 00 60 sw (r11+96),r0
ptimer->timer_data.it_interval.tv_sec = 0;
8002fa4: 59 60 00 54 sw (r11+84),r0
ptimer->timer_data.it_interval.tv_nsec = 0;
8002fa8: 59 60 00 58 sw (r11+88),r0
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8002fac: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8002fb0: 59 60 00 2c sw (r11+44),r0
the_watchdog->id = id;
8002fb4: 59 60 00 30 sw (r11+48),r0
the_watchdog->user_data = user_data;
8002fb8: 59 60 00 34 sw (r11+52),r0
8002fbc: 21 81 ff ff andi r1,r12,0xffff
8002fc0: f8 00 61 59 calli 801b524 <__ashlsi3>
8002fc4: b5 c1 08 00 add r1,r14,r1
8002fc8: 58 2b 00 00 sw (r1+0),r11
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
8002fcc: 59 60 00 0c sw (r11+12),r0
_Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL );
_Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0);
*timerid = ptimer->Object.id;
8002fd0: 59 ac 00 00 sw (r13+0),r12
_Thread_Enable_dispatch();
8002fd4: f8 00 0a 42 calli 80058dc <_Thread_Enable_dispatch>
return 0;
8002fd8: 34 01 00 00 mvi r1,0
}
8002fdc: 2b 9d 00 04 lw ra,(sp+4)
8002fe0: 2b 8b 00 14 lw r11,(sp+20)
8002fe4: 2b 8c 00 10 lw r12,(sp+16)
8002fe8: 2b 8d 00 0c lw r13,(sp+12)
8002fec: 2b 8e 00 08 lw r14,(sp+8)
8002ff0: 37 9c 00 14 addi sp,sp,20
8002ff4: c3 a0 00 00 ret
08002ff8 <timer_settime>:
timer_t timerid,
int flags,
const struct itimerspec *value,
struct itimerspec *ovalue
)
{
8002ff8: 37 9c ff cc addi sp,sp,-52
8002ffc: 5b 8b 00 18 sw (sp+24),r11
8003000: 5b 8c 00 14 sw (sp+20),r12
8003004: 5b 8d 00 10 sw (sp+16),r13
8003008: 5b 8e 00 0c sw (sp+12),r14
800300c: 5b 8f 00 08 sw (sp+8),r15
8003010: 5b 9d 00 04 sw (sp+4),ra
8003014: b8 20 78 00 mv r15,r1
8003018: b8 40 58 00 mv r11,r2
800301c: b8 60 60 00 mv r12,r3
8003020: b8 80 68 00 mv r13,r4
Objects_Locations location;
bool activated;
uint32_t initial_period;
struct itimerspec normalize;
if ( !value )
8003024: 44 60 00 69 be r3,r0,80031c8 <timer_settime+0x1d0> <== NEVER TAKEN
/*
* First, it verifies if the structure "value" is correct
* if the number of nanoseconds is not correct return EINVAL
*/
if ( !_Timespec_Is_valid( &(value->it_value) ) ) {
8003028: 34 61 00 08 addi r1,r3,8
800302c: f8 00 0e 70 calli 80069ec <_Timespec_Is_valid>
8003030: 44 20 00 66 be r1,r0,80031c8 <timer_settime+0x1d0>
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !_Timespec_Is_valid( &(value->it_interval) ) ) {
8003034: b9 80 08 00 mv r1,r12
8003038: f8 00 0e 6d calli 80069ec <_Timespec_Is_valid>
800303c: 44 20 00 63 be r1,r0,80031c8 <timer_settime+0x1d0> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) {
8003040: 7d 62 00 00 cmpnei r2,r11,0
8003044: 7d 61 00 04 cmpnei r1,r11,4
8003048: a0 41 08 00 and r1,r2,r1
800304c: 5c 20 00 5f bne r1,r0,80031c8 <timer_settime+0x1d0>
rtems_set_errno_and_return_minus_one( EINVAL );
}
normalize = *value;
8003050: 29 81 00 0c lw r1,(r12+12)
8003054: 29 84 00 00 lw r4,(r12+0)
8003058: 29 83 00 04 lw r3,(r12+4)
800305c: 29 82 00 08 lw r2,(r12+8)
8003060: 5b 81 00 28 sw (sp+40),r1
8003064: 5b 84 00 1c sw (sp+28),r4
8003068: 5b 83 00 20 sw (sp+32),r3
800306c: 5b 82 00 24 sw (sp+36),r2
/* Convert absolute to relative time */
if (flags == TIMER_ABSTIME) {
8003070: 34 01 00 04 mvi r1,4
8003074: 5d 61 00 0d bne r11,r1,80030a8 <timer_settime+0xb0>
struct timespec now;
_TOD_Get( &now );
8003078: 37 8b 00 2c addi r11,sp,44
800307c: b9 60 08 00 mv r1,r11
8003080: f8 00 04 f1 calli 8004444 <_TOD_Get>
/* Check for seconds in the past */
if ( _Timespec_Greater_than( &now, &normalize.it_value ) )
8003084: 37 8e 00 24 addi r14,sp,36
8003088: b9 60 08 00 mv r1,r11
800308c: b9 c0 10 00 mv r2,r14
8003090: f8 00 0e 4c calli 80069c0 <_Timespec_Greater_than>
8003094: 5c 20 00 4d bne r1,r0,80031c8 <timer_settime+0x1d0>
rtems_set_errno_and_return_minus_one( EINVAL );
_Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value );
8003098: b9 60 08 00 mv r1,r11
800309c: b9 c0 10 00 mv r2,r14
80030a0: b9 c0 18 00 mv r3,r14
80030a4: f8 00 0e 5e calli 8006a1c <_Timespec_Subtract>
timer_t id,
Objects_Locations *location
)
{
return (POSIX_Timer_Control *)
_Objects_Get( &_POSIX_Timer_Information, (Objects_Id) id, location );
80030a8: 78 03 08 01 mvhi r3,0x801
80030ac: b8 60 08 00 mv r1,r3
80030b0: b9 e0 10 00 mv r2,r15
80030b4: 38 21 fb 5c ori r1,r1,0xfb5c
80030b8: 37 83 00 34 addi r3,sp,52
80030bc: f8 00 07 fa calli 80050a4 <_Objects_Get>
* something with the structure of times of the timer: to stop, start
* or start it again
*/
ptimer = _POSIX_Timer_Get( timerid, &location );
switch ( location ) {
80030c0: 2b 82 00 34 lw r2,(sp+52)
80030c4: b8 20 58 00 mv r11,r1
80030c8: 5c 40 00 40 bne r2,r0,80031c8 <timer_settime+0x1d0>
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 ) {
80030cc: 2b 81 00 24 lw r1,(sp+36)
80030d0: 5c 22 00 19 bne r1,r2,8003134 <timer_settime+0x13c>
80030d4: 2b 8e 00 28 lw r14,(sp+40)
80030d8: 5d c1 00 17 bne r14,r1,8003134 <timer_settime+0x13c>
/* Stop the timer */
(void) _Watchdog_Remove( &ptimer->Timer );
80030dc: 35 61 00 10 addi r1,r11,16
80030e0: f8 00 0f c4 calli 8006ff0 <_Watchdog_Remove>
/* The old data of the timer are returned */
if ( ovalue )
80030e4: 45 ae 00 09 be r13,r14,8003108 <timer_settime+0x110>
*ovalue = ptimer->timer_data;
80030e8: 29 64 00 54 lw r4,(r11+84)
80030ec: 29 63 00 58 lw r3,(r11+88)
80030f0: 29 62 00 5c lw r2,(r11+92)
80030f4: 29 61 00 60 lw r1,(r11+96)
80030f8: 59 a4 00 00 sw (r13+0),r4
80030fc: 59 a3 00 04 sw (r13+4),r3
8003100: 59 a2 00 08 sw (r13+8),r2
8003104: 59 a1 00 0c sw (r13+12),r1
/* The new data are set */
ptimer->timer_data = normalize;
8003108: 2b 81 00 1c lw r1,(sp+28)
800310c: 59 61 00 54 sw (r11+84),r1
8003110: 2b 81 00 20 lw r1,(sp+32)
8003114: 59 61 00 58 sw (r11+88),r1
8003118: 2b 81 00 24 lw r1,(sp+36)
800311c: 59 61 00 5c sw (r11+92),r1
8003120: 2b 81 00 28 lw r1,(sp+40)
8003124: 59 61 00 60 sw (r11+96),r1
/* Indicates that the timer is created and stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
8003128: 34 01 00 04 mvi r1,4
800312c: 31 61 00 3c sb (r11+60),r1
8003130: e0 00 00 23 bi 80031bc <timer_settime+0x1c4>
_Thread_Enable_dispatch();
return 0;
}
/* Convert from seconds and nanoseconds to ticks */
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
8003134: b9 80 08 00 mv r1,r12
8003138: f8 00 0e 4b calli 8006a64 <_Timespec_To_ticks>
800313c: 59 61 00 64 sw (r11+100),r1
initial_period = _Timespec_To_ticks( &normalize.it_value );
8003140: 37 81 00 24 addi r1,sp,36
8003144: f8 00 0e 48 calli 8006a64 <_Timespec_To_ticks>
activated = _POSIX_Timer_Insert_helper(
8003148: 29 63 00 08 lw r3,(r11+8)
800314c: 78 04 08 00 mvhi r4,0x800
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 );
8003150: b8 20 10 00 mv r2,r1
activated = _POSIX_Timer_Insert_helper(
8003154: 38 84 31 f8 ori r4,r4,0x31f8
8003158: 35 61 00 10 addi r1,r11,16
800315c: b9 60 28 00 mv r5,r11
8003160: f8 00 1a 64 calli 8009af0 <_POSIX_Timer_Insert_helper>
initial_period,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated ) {
8003164: 44 20 00 16 be r1,r0,80031bc <timer_settime+0x1c4>
/*
* The timer has been started and is running. So we return the
* old ones in "ovalue"
*/
if ( ovalue )
8003168: 45 a0 00 09 be r13,r0,800318c <timer_settime+0x194>
*ovalue = ptimer->timer_data;
800316c: 29 64 00 54 lw r4,(r11+84)
8003170: 29 63 00 58 lw r3,(r11+88)
8003174: 29 62 00 5c lw r2,(r11+92)
8003178: 29 61 00 60 lw r1,(r11+96)
800317c: 59 a4 00 00 sw (r13+0),r4
8003180: 59 a3 00 04 sw (r13+4),r3
8003184: 59 a2 00 08 sw (r13+8),r2
8003188: 59 a1 00 0c sw (r13+12),r1
ptimer->timer_data = normalize;
800318c: 2b 81 00 1c lw r1,(sp+28)
8003190: 59 61 00 54 sw (r11+84),r1
8003194: 2b 81 00 20 lw r1,(sp+32)
8003198: 59 61 00 58 sw (r11+88),r1
800319c: 2b 81 00 24 lw r1,(sp+36)
80031a0: 59 61 00 5c sw (r11+92),r1
80031a4: 2b 81 00 28 lw r1,(sp+40)
80031a8: 59 61 00 60 sw (r11+96),r1
/* Indicate that the time is running */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
80031ac: 34 01 00 03 mvi r1,3
80031b0: 31 61 00 3c sb (r11+60),r1
_TOD_Get( &ptimer->time );
80031b4: 35 61 00 6c addi r1,r11,108
80031b8: f8 00 04 a3 calli 8004444 <_TOD_Get>
_Thread_Enable_dispatch();
80031bc: f8 00 09 c8 calli 80058dc <_Thread_Enable_dispatch>
return 0;
80031c0: 34 01 00 00 mvi r1,0
80031c4: e0 00 00 05 bi 80031d8 <timer_settime+0x1e0>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EINVAL );
80031c8: f8 00 29 2a calli 800d670 <__errno>
80031cc: 34 02 00 16 mvi r2,22
80031d0: 58 22 00 00 sw (r1+0),r2
80031d4: 34 01 ff ff mvi r1,-1
}
80031d8: 2b 9d 00 04 lw ra,(sp+4)
80031dc: 2b 8b 00 18 lw r11,(sp+24)
80031e0: 2b 8c 00 14 lw r12,(sp+20)
80031e4: 2b 8d 00 10 lw r13,(sp+16)
80031e8: 2b 8e 00 0c lw r14,(sp+12)
80031ec: 2b 8f 00 08 lw r15,(sp+8)
80031f0: 37 9c 00 34 addi sp,sp,52
80031f4: c3 a0 00 00 ret
08002ddc <ualarm>:
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
8002ddc: 37 9c ff e8 addi sp,sp,-24
8002de0: 5b 8b 00 10 sw (sp+16),r11
8002de4: 5b 8c 00 0c sw (sp+12),r12
8002de8: 5b 8d 00 08 sw (sp+8),r13
8002dec: 5b 9d 00 04 sw (sp+4),ra
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
8002df0: 78 0b 08 01 mvhi r11,0x801
8002df4: 39 6b 71 30 ori r11,r11,0x7130
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
8002df8: b8 20 68 00 mv r13,r1
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
8002dfc: 29 61 00 1c lw r1,(r11+28)
8002e00: 5c 20 00 09 bne r1,r0,8002e24 <ualarm+0x48>
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
8002e04: 78 01 08 00 mvhi r1,0x800
8002e08: 38 21 2d 94 ori r1,r1,0x2d94
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8002e0c: 59 60 00 08 sw (r11+8),r0
the_watchdog->routine = routine;
8002e10: 59 61 00 1c sw (r11+28),r1
the_watchdog->id = id;
8002e14: 59 60 00 20 sw (r11+32),r0
the_watchdog->user_data = user_data;
8002e18: 59 60 00 24 sw (r11+36),r0
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
8002e1c: 34 0c 00 00 mvi r12,0
8002e20: e0 00 00 18 bi 8002e80 <ualarm+0xa4>
if ( !the_timer->routine ) {
_Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL );
} else {
Watchdog_States state;
state = _Watchdog_Remove( the_timer );
8002e24: b9 60 08 00 mv r1,r11
8002e28: f8 00 0e e4 calli 80069b8 <_Watchdog_Remove>
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
8002e2c: 34 21 ff fe addi r1,r1,-2
8002e30: 34 02 00 01 mvi r2,1
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
8002e34: 34 0c 00 00 mvi r12,0
_Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL );
} else {
Watchdog_States state;
state = _Watchdog_Remove( the_timer );
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
8002e38: 54 22 00 12 bgu r1,r2,8002e80 <ualarm+0xa4> <== NEVER TAKEN
* 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);
8002e3c: 29 61 00 0c lw r1,(r11+12)
8002e40: 29 62 00 14 lw r2,(r11+20)
8002e44: b4 41 10 00 add r2,r2,r1
8002e48: 29 61 00 18 lw r1,(r11+24)
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
8002e4c: c8 41 08 00 sub r1,r2,r1
8002e50: 37 82 00 14 addi r2,sp,20
8002e54: f8 00 0d 11 calli 8006298 <_Timespec_From_ticks>
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
8002e58: 78 03 08 01 mvhi r3,0x801
8002e5c: 38 63 4e b0 ori r3,r3,0x4eb0
8002e60: 28 62 00 00 lw r2,(r3+0)
8002e64: 2b 81 00 14 lw r1,(sp+20)
8002e68: f8 00 43 5f calli 8013be4 <__mulsi3>
8002e6c: b8 20 60 00 mv r12,r1
remaining += tp.tv_nsec / 1000;
8002e70: 2b 81 00 18 lw r1,(sp+24)
8002e74: 34 02 03 e8 mvi r2,1000
8002e78: f8 00 43 67 calli 8013c14 <__divsi3>
8002e7c: b4 2c 60 00 add r12,r1,r12
/*
* 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 ) {
8002e80: 45 a0 00 1a be r13,r0,8002ee8 <ualarm+0x10c>
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
8002e84: 78 03 08 01 mvhi r3,0x801
8002e88: 38 63 4e b0 ori r3,r3,0x4eb0
8002e8c: 28 62 00 00 lw r2,(r3+0)
8002e90: b9 a0 08 00 mv r1,r13
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
ticks = _Timespec_To_ticks( &tp );
8002e94: 37 8b 00 14 addi r11,sp,20
* 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;
8002e98: f8 00 43 b8 calli 8013d78 <__udivsi3>
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
8002e9c: 78 03 08 01 mvhi r3,0x801
8002ea0: 38 63 4e b0 ori r3,r3,0x4eb0
8002ea4: 28 62 00 00 lw r2,(r3+0)
* 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;
8002ea8: 5b 81 00 14 sw (sp+20),r1
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
8002eac: b9 a0 08 00 mv r1,r13
8002eb0: f8 00 43 c2 calli 8013db8 <__umodsi3>
8002eb4: 34 02 03 e8 mvi r2,1000
8002eb8: f8 00 43 4b calli 8013be4 <__mulsi3>
8002ebc: 5b 81 00 18 sw (sp+24),r1
ticks = _Timespec_To_ticks( &tp );
8002ec0: b9 60 08 00 mv r1,r11
8002ec4: f8 00 0d 23 calli 8006350 <_Timespec_To_ticks>
if ( ticks == 0 )
ticks = 1;
_Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) );
8002ec8: b9 60 08 00 mv r1,r11
8002ecc: f8 00 0d 21 calli 8006350 <_Timespec_To_ticks>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8002ed0: 78 02 08 01 mvhi r2,0x801
8002ed4: 38 42 71 30 ori r2,r2,0x7130
8002ed8: 58 41 00 0c sw (r2+12),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8002edc: 78 01 08 01 mvhi r1,0x801
8002ee0: 38 21 69 80 ori r1,r1,0x6980
8002ee4: f8 00 0e 58 calli 8006844 <_Watchdog_Insert>
}
return remaining;
}
8002ee8: b9 80 08 00 mv r1,r12
8002eec: 2b 9d 00 04 lw ra,(sp+4)
8002ef0: 2b 8b 00 10 lw r11,(sp+16)
8002ef4: 2b 8c 00 0c lw r12,(sp+12)
8002ef8: 2b 8d 00 08 lw r13,(sp+8)
8002efc: 37 9c 00 18 addi sp,sp,24
8002f00: c3 a0 00 00 ret