RTEMS 4.11Annotated Report
Mon Mar 21 01:34:59 2011
08005fbc <_CORE_RWLock_Obtain_for_writing>:
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_RWLock_API_mp_support_callout api_rwlock_mp_support
)
{
8005fbc: 37 9c ff fc addi sp,sp,-4
8005fc0: 5b 9d 00 04 sw (sp+4),ra
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
8005fc4: 78 05 08 01 mvhi r5,0x801
8005fc8: 38 a5 8d 84 ori r5,r5,0x8d84
8005fcc: 28 a5 00 0c lw r5,(r5+12)
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_RWLock_API_mp_support_callout api_rwlock_mp_support
)
{
8005fd0: 20 63 00 ff andi r3,r3,0xff
* 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 );
8005fd4: 90 00 30 00 rcsr r6,IE
8005fd8: 34 07 ff fe mvi r7,-2
8005fdc: a0 c7 38 00 and r7,r6,r7
8005fe0: d0 07 00 00 wcsr IE,r7
switch ( the_rwlock->current_state ) {
8005fe4: 28 27 00 44 lw r7,(r1+68)
8005fe8: 5c e0 00 06 bne r7,r0,8006000 <_CORE_RWLock_Obtain_for_writing+0x44><== NEVER TAKEN
case CORE_RWLOCK_UNLOCKED:
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
8005fec: 34 02 00 02 mvi r2,2
8005ff0: 58 22 00 44 sw (r1+68),r2
_ISR_Enable( level );
8005ff4: d0 06 00 00 wcsr IE,r6
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
8005ff8: 58 a0 00 34 sw (r5+52),r0
return;
8005ffc: e0 00 00 11 bi 8006040 <_CORE_RWLock_Obtain_for_writing+0x84>
/*
* If the thread is not willing to wait, then return immediately.
*/
if ( !wait ) {
8006000: 5c 60 00 05 bne r3,r0,8006014 <_CORE_RWLock_Obtain_for_writing+0x58>
_ISR_Enable( level );
8006004: d0 06 00 00 wcsr IE,r6
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
8006008: 34 01 00 02 mvi r1,2
800600c: 58 a1 00 34 sw (r5+52),r1
return;
8006010: e0 00 00 0c bi 8006040 <_CORE_RWLock_Obtain_for_writing+0x84>
8006014: 34 03 00 01 mvi r3,1
8006018: 58 23 00 30 sw (r1+48),r3
/*
* 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;
800601c: 58 a1 00 44 sw (r5+68),r1
executing->Wait.id = id;
8006020: 58 a2 00 20 sw (r5+32),r2
executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE;
8006024: 58 a3 00 30 sw (r5+48),r3
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
8006028: 58 a0 00 34 sw (r5+52),r0
_ISR_Enable( level );
800602c: d0 06 00 00 wcsr IE,r6
_Thread_queue_Enqueue_with_handler(
8006030: 78 03 08 00 mvhi r3,0x800
8006034: b8 80 10 00 mv r2,r4
8006038: 38 63 61 40 ori r3,r3,0x6140
800603c: f8 00 08 ad calli 80082f0 <_Thread_queue_Enqueue_with_handler>
_CORE_RWLock_Timeout
);
/* return to API level so it can dispatch and we block */
}
8006040: 2b 9d 00 04 lw ra,(sp+4)
8006044: 37 9c 00 04 addi sp,sp,4
8006048: c3 a0 00 00 ret
0800604c <_CORE_RWLock_Release>:
*/
CORE_RWLock_Status _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock
)
{
800604c: 37 9c ff f4 addi sp,sp,-12
8006050: 5b 8b 00 0c sw (sp+12),r11
8006054: 5b 8c 00 08 sw (sp+8),r12
8006058: 5b 9d 00 04 sw (sp+4),ra
800605c: b8 20 58 00 mv r11,r1
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
8006060: 78 01 08 01 mvhi r1,0x801
8006064: 38 21 8d 84 ori r1,r1,0x8d84
8006068: 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 );
800606c: 90 00 08 00 rcsr r1,IE
8006070: 34 03 ff fe mvi r3,-2
8006074: a0 23 18 00 and r3,r1,r3
8006078: d0 03 00 00 wcsr IE,r3
if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){
800607c: 29 63 00 44 lw r3,(r11+68)
8006080: 5c 60 00 05 bne r3,r0,8006094 <_CORE_RWLock_Release+0x48>
_ISR_Enable( level );
8006084: d0 01 00 00 wcsr IE,r1
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
8006088: 34 01 00 02 mvi r1,2
800608c: 58 41 00 34 sw (r2+52),r1
return CORE_RWLOCK_SUCCESSFUL;
8006090: e0 00 00 26 bi 8006128 <_CORE_RWLock_Release+0xdc>
}
if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) {
8006094: 34 04 00 01 mvi r4,1
8006098: 5c 64 00 07 bne r3,r4,80060b4 <_CORE_RWLock_Release+0x68>
the_rwlock->number_of_readers -= 1;
800609c: 29 63 00 48 lw r3,(r11+72)
80060a0: 34 63 ff ff addi r3,r3,-1
80060a4: 59 63 00 48 sw (r11+72),r3
if ( the_rwlock->number_of_readers != 0 ) {
80060a8: 44 60 00 03 be r3,r0,80060b4 <_CORE_RWLock_Release+0x68>
/* must be unlocked again */
_ISR_Enable( level );
80060ac: d0 01 00 00 wcsr IE,r1
return CORE_RWLOCK_SUCCESSFUL;
80060b0: e0 00 00 1e bi 8006128 <_CORE_RWLock_Release+0xdc>
}
}
/* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
80060b4: 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;
80060b8: 59 60 00 44 sw (r11+68),r0
_ISR_Enable( level );
80060bc: d0 01 00 00 wcsr IE,r1
next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue );
80060c0: b9 60 08 00 mv r1,r11
80060c4: f8 00 08 18 calli 8008124 <_Thread_queue_Dequeue>
if ( next ) {
80060c8: 44 20 00 18 be r1,r0,8006128 <_CORE_RWLock_Release+0xdc>
if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
80060cc: 28 22 00 30 lw r2,(r1+48)
80060d0: 34 01 00 01 mvi r1,1
80060d4: 5c 41 00 04 bne r2,r1,80060e4 <_CORE_RWLock_Release+0x98>
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
80060d8: 34 01 00 02 mvi r1,2
80060dc: 59 61 00 44 sw (r11+68),r1
return CORE_RWLOCK_SUCCESSFUL;
80060e0: e0 00 00 12 bi 8006128 <_CORE_RWLock_Release+0xdc>
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
80060e4: 29 62 00 48 lw r2,(r11+72)
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
80060e8: 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 ||
80060ec: 34 0c 00 01 mvi r12,1
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
80060f0: 34 42 00 01 addi r2,r2,1
80060f4: 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 );
80060f8: b9 60 08 00 mv r1,r11
80060fc: f8 00 09 91 calli 8008740 <_Thread_queue_First>
8006100: b8 20 10 00 mv r2,r1
if ( !next ||
8006104: 44 20 00 09 be r1,r0,8006128 <_CORE_RWLock_Release+0xdc>
8006108: 28 21 00 30 lw r1,(r1+48)
800610c: 44 2c 00 07 be r1,r12,8006128 <_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;
8006110: 29 61 00 48 lw r1,(r11+72)
8006114: 34 21 00 01 addi r1,r1,1
8006118: 59 61 00 48 sw (r11+72),r1
_Thread_queue_Extract( &the_rwlock->Wait_queue, next );
800611c: b9 60 08 00 mv r1,r11
8006120: f8 00 09 3e calli 8008618 <_Thread_queue_Extract>
}
8006124: e3 ff ff f5 bi 80060f8 <_CORE_RWLock_Release+0xac>
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
8006128: 34 01 00 00 mvi r1,0
800612c: 2b 9d 00 04 lw ra,(sp+4)
8006130: 2b 8b 00 0c lw r11,(sp+12)
8006134: 2b 8c 00 08 lw r12,(sp+8)
8006138: 37 9c 00 0c addi sp,sp,12
800613c: c3 a0 00 00 ret
08006140 <_CORE_RWLock_Timeout>:
void _CORE_RWLock_Timeout(
Objects_Id id,
void *ignored
)
{
8006140: 37 9c ff f8 addi sp,sp,-8
8006144: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
8006148: 37 82 00 08 addi r2,sp,8
800614c: f8 00 07 0e calli 8007d84 <_Thread_Get>
switch ( location ) {
8006150: 2b 82 00 08 lw r2,(sp+8)
8006154: 5c 40 00 07 bne r2,r0,8006170 <_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 );
8006158: f8 00 09 d4 calli 80088a8 <_Thread_queue_Process_timeout>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
800615c: 78 01 08 01 mvhi r1,0x801
8006160: 38 21 88 d8 ori r1,r1,0x88d8
8006164: 28 22 00 00 lw r2,(r1+0)
8006168: 34 42 ff ff addi r2,r2,-1
800616c: 58 22 00 00 sw (r1+0),r2
_Thread_Unnest_dispatch();
break;
}
}
8006170: 2b 9d 00 04 lw ra,(sp+4)
8006174: 37 9c 00 08 addi sp,sp,8
8006178: c3 a0 00 00 ret
0800dad4 <_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
)
{
800dad4: 37 9c ff e4 addi sp,sp,-28
800dad8: 5b 8b 00 1c sw (sp+28),r11
800dadc: 5b 8c 00 18 sw (sp+24),r12
800dae0: 5b 8d 00 14 sw (sp+20),r13
800dae4: 5b 8e 00 10 sw (sp+16),r14
800dae8: 5b 8f 00 0c sw (sp+12),r15
800daec: 5b 90 00 08 sw (sp+8),r16
800daf0: 5b 9d 00 04 sw (sp+4),ra
800daf4: 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;
800daf8: 58 20 00 48 sw (r1+72),r0
the_message_queue->maximum_message_size = maximum_message_size;
800dafc: 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;
800db00: 58 20 00 60 sw (r1+96),r0
the_message_queue->notify_argument = the_argument;
800db04: 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;
800db08: 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)) {
800db0c: 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
)
{
800db10: b8 40 80 00 mv r16,r2
800db14: 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)) {
800db18: b8 80 60 00 mv r12,r4
800db1c: 44 20 00 06 be r1,r0,800db34 <_CORE_message_queue_Initialize+0x60>
allocated_message_size += sizeof(uint32_t);
800db20: 34 8c 00 04 addi r12,r4,4
allocated_message_size &= ~(sizeof(uint32_t) - 1);
800db24: 34 01 ff fc mvi r1,-4
800db28: a1 81 60 00 and r12,r12,r1
}
if (allocated_message_size < maximum_message_size)
return false;
800db2c: 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)
800db30: 54 8c 00 1c bgu r4,r12,800dba0 <_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));
800db34: 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 *
800db38: b9 e0 08 00 mv r1,r15
800db3c: b9 c0 10 00 mv r2,r14
800db40: f8 00 5e 6c calli 80254f0 <__mulsi3>
(allocated_message_size + sizeof(CORE_message_queue_Buffer_control));
if (message_buffering_required < allocated_message_size)
return false;
800db44: 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)
800db48: 55 81 00 16 bgu r12,r1,800dba0 <_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 );
800db4c: f8 00 0e f5 calli 8011720 <_Workspace_Allocate>
return false;
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
800db50: 59 61 00 5c sw (r11+92),r1
_Workspace_Allocate( message_buffering_required );
800db54: b8 20 28 00 mv r5,r1
if (the_message_queue->message_buffers == 0)
800db58: 44 20 00 12 be r1,r0,800dba0 <_CORE_message_queue_Initialize+0xcc>
/*
* Initialize the pool of inactive messages, pending messages,
* and set of waiting threads.
*/
_Chain_Initialize (
800db5c: b8 a0 10 00 mv r2,r5
800db60: 35 61 00 68 addi r1,r11,104
800db64: b9 c0 18 00 mv r3,r14
800db68: b9 e0 20 00 mv r4,r15
800db6c: f8 00 1a 3e calli 8014464 <_Chain_Initialize>
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
800db70: 35 61 00 54 addi r1,r11,84
head->next = tail;
800db74: 59 61 00 50 sw (r11+80),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
800db78: 35 61 00 50 addi r1,r11,80
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
800db7c: 59 61 00 58 sw (r11+88),r1
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
800db80: 59 60 00 54 sw (r11+84),r0
allocated_message_size + sizeof( CORE_message_queue_Buffer_control )
);
_Chain_Initialize_empty( &the_message_queue->Pending_messages );
_Thread_queue_Initialize(
800db84: 2a 02 00 00 lw r2,(r16+0)
800db88: b9 60 08 00 mv r1,r11
800db8c: 34 03 00 80 mvi r3,128
800db90: 64 42 00 01 cmpei r2,r2,1
800db94: 34 04 00 06 mvi r4,6
800db98: f8 00 0b c7 calli 8010ab4 <_Thread_queue_Initialize>
THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
STATES_WAITING_FOR_MESSAGE,
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
);
return true;
800db9c: 34 0d 00 01 mvi r13,1
}
800dba0: b9 a0 08 00 mv r1,r13
800dba4: 2b 9d 00 04 lw ra,(sp+4)
800dba8: 2b 8b 00 1c lw r11,(sp+28)
800dbac: 2b 8c 00 18 lw r12,(sp+24)
800dbb0: 2b 8d 00 14 lw r13,(sp+20)
800dbb4: 2b 8e 00 10 lw r14,(sp+16)
800dbb8: 2b 8f 00 0c lw r15,(sp+12)
800dbbc: 2b 90 00 08 lw r16,(sp+8)
800dbc0: 37 9c 00 1c addi sp,sp,28
800dbc4: c3 a0 00 00 ret
0800dbc8 <_CORE_message_queue_Seize>:
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800dbc8: 37 9c ff f0 addi sp,sp,-16
800dbcc: 5b 8b 00 10 sw (sp+16),r11
800dbd0: 5b 8c 00 0c sw (sp+12),r12
800dbd4: 5b 8d 00 08 sw (sp+8),r13
800dbd8: 5b 9d 00 04 sw (sp+4),ra
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
800dbdc: 78 07 08 02 mvhi r7,0x802
800dbe0: 38 e7 8f 4c ori r7,r7,0x8f4c
800dbe4: 28 e7 00 0c lw r7,(r7+12)
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800dbe8: b8 20 58 00 mv r11,r1
800dbec: 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;
800dbf0: 58 e0 00 34 sw (r7+52),r0
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800dbf4: 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 );
800dbf8: 90 00 40 00 rcsr r8,IE
800dbfc: 34 03 ff fe mvi r3,-2
800dc00: a1 03 18 00 and r3,r8,r3
800dc04: d0 03 00 00 wcsr IE,r3
executing->Wait.return_argument = size_p;
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
}
800dc08: 29 6c 00 50 lw r12,(r11+80)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
800dc0c: 35 63 00 54 addi r3,r11,84
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800dc10: 45 83 00 07 be r12,r3,800dc2c <_CORE_message_queue_Seize+0x64>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
800dc14: 29 83 00 00 lw r3,(r12+0)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
800dc18: 35 69 00 50 addi r9,r11,80
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
800dc1c: 59 63 00 50 sw (r11+80),r3
new_first->previous = head;
800dc20: 58 69 00 04 sw (r3+4),r9
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
_ISR_Disable( level );
the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
if ( the_message != NULL ) {
800dc24: 5d 80 00 04 bne r12,r0,800dc34 <_CORE_message_queue_Seize+0x6c><== ALWAYS TAKEN
800dc28: e0 00 00 25 bi 800dcbc <_CORE_message_queue_Seize+0xf4> <== NOT EXECUTED
)
{
if ( !_Chain_Is_empty(the_chain))
return _Chain_Get_first_unprotected(the_chain);
else
return NULL;
800dc2c: 34 0c 00 00 mvi r12,0
800dc30: e0 00 00 23 bi 800dcbc <_CORE_message_queue_Seize+0xf4>
the_message_queue->number_of_pending_messages -= 1;
800dc34: 29 62 00 48 lw r2,(r11+72)
800dc38: 34 42 ff ff addi r2,r2,-1
800dc3c: 59 62 00 48 sw (r11+72),r2
_ISR_Enable( level );
800dc40: d0 08 00 00 wcsr IE,r8
*size_p = the_message->Contents.size;
800dc44: 29 83 00 0c lw r3,(r12+12)
_Thread_Executing->Wait.count =
800dc48: 78 02 08 02 mvhi r2,0x802
800dc4c: 38 42 8f 4c ori r2,r2,0x8f4c
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;
800dc50: 58 83 00 00 sw (r4+0),r3
_Thread_Executing->Wait.count =
800dc54: 29 84 00 08 lw r4,(r12+8)
800dc58: 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,
800dc5c: 35 8d 00 10 addi r13,r12,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 =
800dc60: 58 44 00 24 sw (r2+36),r4
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800dc64: b9 a0 10 00 mv r2,r13
800dc68: f8 00 27 8a calli 8017a90 <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 );
800dc6c: b9 60 08 00 mv r1,r11
800dc70: f8 00 0a 33 calli 801053c <_Thread_queue_Dequeue>
800dc74: b8 20 20 00 mv r4,r1
if ( !the_thread ) {
800dc78: 5c 20 00 05 bne r1,r0,800dc8c <_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 );
800dc7c: 35 61 00 68 addi r1,r11,104
800dc80: b9 80 10 00 mv r2,r12
800dc84: fb ff ff 64 calli 800da14 <_Chain_Append>
_CORE_message_queue_Free_message_buffer(
the_message_queue,
the_message
);
return;
800dc88: e0 00 00 1e bi 800dd00 <_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;
800dc8c: 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;
800dc90: 28 83 00 30 lw r3,(r4+48)
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800dc94: 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;
800dc98: 59 81 00 08 sw (r12+8),r1
800dc9c: 59 83 00 0c sw (r12+12),r3
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800dca0: b9 a0 08 00 mv r1,r13
800dca4: f8 00 27 7b calli 8017a90 <memcpy>
the_thread->Wait.return_argument_second.immutable_object,
the_message->Contents.buffer,
the_message->Contents.size
);
_CORE_message_queue_Insert_message(
800dca8: 29 83 00 08 lw r3,(r12+8)
800dcac: b9 60 08 00 mv r1,r11
800dcb0: b9 80 10 00 mv r2,r12
800dcb4: f8 00 19 f9 calli 8014498 <_CORE_message_queue_Insert_message>
the_message_queue,
the_message,
_CORE_message_queue_Get_message_priority( the_message )
);
return;
800dcb8: e0 00 00 12 bi 800dd00 <_CORE_message_queue_Seize+0x138>
}
#endif
}
if ( !wait ) {
800dcbc: 5c ac 00 05 bne r5,r12,800dcd0 <_CORE_message_queue_Seize+0x108>
_ISR_Enable( level );
800dcc0: d0 08 00 00 wcsr IE,r8
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
800dcc4: 34 01 00 04 mvi r1,4
800dcc8: 58 e1 00 34 sw (r7+52),r1
return;
800dccc: e0 00 00 0d bi 800dd00 <_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;
800dcd0: 34 03 00 01 mvi r3,1
800dcd4: 59 63 00 30 sw (r11+48),r3
}
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
executing->Wait.queue = &the_message_queue->Wait_queue;
800dcd8: 58 eb 00 44 sw (r7+68),r11
executing->Wait.id = id;
800dcdc: 58 e2 00 20 sw (r7+32),r2
executing->Wait.return_argument_second.mutable_object = buffer;
800dce0: 58 e1 00 2c sw (r7+44),r1
executing->Wait.return_argument = size_p;
800dce4: 58 e4 00 28 sw (r7+40),r4
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
800dce8: d0 08 00 00 wcsr IE,r8
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
800dcec: 78 03 08 01 mvhi r3,0x801
800dcf0: b9 60 08 00 mv r1,r11
800dcf4: b8 c0 10 00 mv r2,r6
800dcf8: 38 63 0b f4 ori r3,r3,0xbf4
800dcfc: f8 00 0a 83 calli 8010708 <_Thread_queue_Enqueue_with_handler>
}
800dd00: 2b 9d 00 04 lw ra,(sp+4)
800dd04: 2b 8b 00 10 lw r11,(sp+16)
800dd08: 2b 8c 00 0c lw r12,(sp+12)
800dd0c: 2b 8d 00 08 lw r13,(sp+8)
800dd10: 37 9c 00 10 addi sp,sp,16
800dd14: c3 a0 00 00 ret
08004d30 <_CORE_mutex_Seize>:
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
8004d30: 37 9c ff e8 addi sp,sp,-24
8004d34: 5b 8b 00 14 sw (sp+20),r11
8004d38: 5b 8c 00 10 sw (sp+16),r12
8004d3c: 5b 8d 00 0c sw (sp+12),r13
8004d40: 5b 8e 00 08 sw (sp+8),r14
8004d44: 5b 9d 00 04 sw (sp+4),ra
8004d48: b8 20 58 00 mv r11,r1
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
8004d4c: 78 01 08 01 mvhi r1,0x801
8004d50: 38 21 99 90 ori r1,r1,0x9990
8004d54: 28 21 00 00 lw r1,(r1+0)
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
8004d58: 5b 85 00 18 sw (sp+24),r5
8004d5c: b8 40 70 00 mv r14,r2
8004d60: b8 80 68 00 mv r13,r4
8004d64: 20 6c 00 ff andi r12,r3,0xff
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
8004d68: 44 20 00 0b be r1,r0,8004d94 <_CORE_mutex_Seize+0x64>
8004d6c: 45 80 00 0a be r12,r0,8004d94 <_CORE_mutex_Seize+0x64> <== NEVER TAKEN
8004d70: 78 01 08 01 mvhi r1,0x801
8004d74: 38 21 9a e8 ori r1,r1,0x9ae8
8004d78: 28 21 00 00 lw r1,(r1+0)
8004d7c: 34 02 00 01 mvi r2,1
8004d80: 50 41 00 05 bgeu r2,r1,8004d94 <_CORE_mutex_Seize+0x64>
8004d84: 34 01 00 00 mvi r1,0
8004d88: 34 02 00 00 mvi r2,0
8004d8c: 34 03 00 12 mvi r3,18
8004d90: f8 00 02 0a calli 80055b8 <_Internal_error_Occurred>
8004d94: b9 60 08 00 mv r1,r11
8004d98: 37 82 00 18 addi r2,sp,24
8004d9c: f8 00 26 51 calli 800e6e0 <_CORE_mutex_Seize_interrupt_trylock>
8004da0: 44 20 00 19 be r1,r0,8004e04 <_CORE_mutex_Seize+0xd4>
8004da4: 78 01 08 01 mvhi r1,0x801
8004da8: 38 21 9e 3c ori r1,r1,0x9e3c
8004dac: 5d 80 00 07 bne r12,r0,8004dc8 <_CORE_mutex_Seize+0x98>
8004db0: 2b 82 00 18 lw r2,(sp+24)
8004db4: d0 02 00 00 wcsr IE,r2
8004db8: 28 21 00 0c lw r1,(r1+12)
8004dbc: 34 02 00 01 mvi r2,1
8004dc0: 58 22 00 34 sw (r1+52),r2
8004dc4: e0 00 00 10 bi 8004e04 <_CORE_mutex_Seize+0xd4>
8004dc8: 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;
8004dcc: 34 02 00 01 mvi r2,1
8004dd0: 59 62 00 30 sw (r11+48),r2
8004dd4: 58 2b 00 44 sw (r1+68),r11
8004dd8: 58 2e 00 20 sw (r1+32),r14
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8004ddc: 78 01 08 01 mvhi r1,0x801
8004de0: 38 21 99 90 ori r1,r1,0x9990
8004de4: 28 22 00 00 lw r2,(r1+0)
8004de8: 34 42 00 01 addi r2,r2,1
8004dec: 58 22 00 00 sw (r1+0),r2
8004df0: 2b 81 00 18 lw r1,(sp+24)
8004df4: d0 01 00 00 wcsr IE,r1
8004df8: b9 60 08 00 mv r1,r11
8004dfc: b9 a0 10 00 mv r2,r13
8004e00: fb ff ff ab calli 8004cac <_CORE_mutex_Seize_interrupt_blocking>
}
8004e04: 2b 9d 00 04 lw ra,(sp+4)
8004e08: 2b 8b 00 14 lw r11,(sp+20)
8004e0c: 2b 8c 00 10 lw r12,(sp+16)
8004e10: 2b 8d 00 0c lw r13,(sp+12)
8004e14: 2b 8e 00 08 lw r14,(sp+8)
8004e18: 37 9c 00 18 addi sp,sp,24
8004e1c: c3 a0 00 00 ret
08004f98 <_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
)
{
8004f98: 37 9c ff f8 addi sp,sp,-8
8004f9c: 5b 8b 00 08 sw (sp+8),r11
8004fa0: 5b 9d 00 04 sw (sp+4),ra
8004fa4: 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)) ) {
8004fa8: f8 00 07 d5 calli 8006efc <_Thread_queue_Dequeue>
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
8004fac: 34 02 00 00 mvi r2,0
if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
8004fb0: 5c 20 00 0d bne r1,r0,8004fe4 <_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 );
8004fb4: 90 00 08 00 rcsr r1,IE
8004fb8: 34 02 ff fe mvi r2,-2
8004fbc: a0 22 10 00 and r2,r1,r2
8004fc0: d0 02 00 00 wcsr IE,r2
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
8004fc4: 29 63 00 48 lw r3,(r11+72)
8004fc8: 29 64 00 40 lw r4,(r11+64)
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
8004fcc: 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 )
8004fd0: 50 64 00 04 bgeu r3,r4,8004fe0 <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN
the_semaphore->count += 1;
8004fd4: 34 63 00 01 addi r3,r3,1
8004fd8: 59 63 00 48 sw (r11+72),r3
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
8004fdc: 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 );
8004fe0: d0 01 00 00 wcsr IE,r1
}
return status;
}
8004fe4: b8 40 08 00 mv r1,r2
8004fe8: 2b 9d 00 04 lw ra,(sp+4)
8004fec: 2b 8b 00 08 lw r11,(sp+8)
8004ff0: 37 9c 00 08 addi sp,sp,8
8004ff4: c3 a0 00 00 ret
0800dadc <_Event_Surrender>:
*/
void _Event_Surrender(
Thread_Control *the_thread
)
{
800dadc: 37 9c ff f8 addi sp,sp,-8
800dae0: 5b 8b 00 08 sw (sp+8),r11
800dae4: 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 ];
800dae8: 28 24 01 1c lw r4,(r1+284)
option_set = (rtems_option) the_thread->Wait.option;
800daec: 28 28 00 30 lw r8,(r1+48)
*/
void _Event_Surrender(
Thread_Control *the_thread
)
{
800daf0: 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 );
800daf4: 90 00 08 00 rcsr r1,IE
800daf8: 34 07 ff fe mvi r7,-2
800dafc: a0 27 38 00 and r7,r1,r7
800db00: d0 07 00 00 wcsr IE,r7
pending_events = api->pending_events;
800db04: 28 85 00 00 lw r5,(r4+0)
event_condition = (rtems_event_set) the_thread->Wait.count;
800db08: 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 );
800db0c: 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 ) ) {
800db10: 5c 40 00 03 bne r2,r0,800db1c <_Event_Surrender+0x40>
_ISR_Enable( level );
800db14: d0 01 00 00 wcsr IE,r1
return;
800db18: e0 00 00 3d bi 800dc0c <_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() &&
800db1c: 78 03 08 01 mvhi r3,0x801
800db20: 38 63 9e 3c ori r3,r3,0x9e3c
800db24: 28 69 00 08 lw r9,(r3+8)
800db28: 45 20 00 1a be r9,r0,800db90 <_Event_Surrender+0xb4>
800db2c: 28 63 00 0c lw r3,(r3+12)
800db30: 5d 63 00 18 bne r11,r3,800db90 <_Event_Surrender+0xb4>
_Thread_Is_executing( the_thread ) &&
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
800db34: 78 03 08 01 mvhi r3,0x801
800db38: 38 63 a3 30 ori r3,r3,0xa330
800db3c: 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 ) &&
800db40: 34 09 00 02 mvi r9,2
800db44: 45 49 00 04 be r10,r9,800db54 <_Event_Surrender+0x78> <== NEVER TAKEN
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
800db48: 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) ||
800db4c: 34 03 00 01 mvi r3,1
800db50: 5d 23 00 10 bne r9,r3,800db90 <_Event_Surrender+0xb4>
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
800db54: 44 46 00 03 be r2,r6,800db60 <_Event_Surrender+0x84>
*/
RTEMS_INLINE_ROUTINE bool _Options_Is_any (
rtems_option option_set
)
{
return (option_set & RTEMS_EVENT_ANY) ? true : false;
800db58: 21 08 00 02 andi r8,r8,0x2
800db5c: 45 00 00 0b be r8,r0,800db88 <_Event_Surrender+0xac> <== 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) );
800db60: a4 40 18 00 not r3,r2
800db64: 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;
800db68: 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 );
800db6c: 58 85 00 00 sw (r4+0),r5
the_thread->Wait.count = 0;
800db70: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800db74: 58 62 00 00 sw (r3+0),r2
_Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
800db78: 78 02 08 01 mvhi r2,0x801
800db7c: 38 42 a3 30 ori r2,r2,0xa330
800db80: 34 03 00 03 mvi r3,3
800db84: 58 43 00 00 sw (r2+0),r3
}
_ISR_Enable( level );
800db88: d0 01 00 00 wcsr IE,r1
return;
800db8c: e0 00 00 20 bi 800dc0c <_Event_Surrender+0x130>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event (
States_Control the_states
)
{
return (the_states & STATES_WAITING_FOR_EVENT);
800db90: 29 63 00 10 lw r3,(r11+16)
800db94: 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 ) ) {
800db98: 44 60 00 1c be r3,r0,800dc08 <_Event_Surrender+0x12c>
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
800db9c: 44 46 00 03 be r2,r6,800dba8 <_Event_Surrender+0xcc>
800dba0: 21 08 00 02 andi r8,r8,0x2
800dba4: 45 00 00 19 be r8,r0,800dc08 <_Event_Surrender+0x12c> <== NEVER TAKEN
800dba8: a4 40 18 00 not r3,r2
800dbac: 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;
800dbb0: 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 );
800dbb4: 58 85 00 00 sw (r4+0),r5
the_thread->Wait.count = 0;
800dbb8: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800dbbc: 58 62 00 00 sw (r3+0),r2
_ISR_Flash( level );
800dbc0: d0 01 00 00 wcsr IE,r1
800dbc4: d0 07 00 00 wcsr IE,r7
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
800dbc8: 29 63 00 50 lw r3,(r11+80)
800dbcc: 34 02 00 02 mvi r2,2
800dbd0: 44 62 00 03 be r3,r2,800dbdc <_Event_Surrender+0x100>
_ISR_Enable( level );
800dbd4: d0 01 00 00 wcsr IE,r1
800dbd8: e0 00 00 06 bi 800dbf0 <_Event_Surrender+0x114>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
800dbdc: 34 02 00 03 mvi r2,3
800dbe0: 59 62 00 50 sw (r11+80),r2
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
800dbe4: d0 01 00 00 wcsr IE,r1
(void) _Watchdog_Remove( &the_thread->Timer );
800dbe8: 35 61 00 48 addi r1,r11,72
800dbec: fb ff e8 6e calli 8007da4 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800dbf0: 78 03 08 01 mvhi r3,0x801
800dbf4: 38 63 81 74 ori r3,r3,0x8174
800dbf8: 28 62 00 00 lw r2,(r3+0)
800dbfc: b9 60 08 00 mv r1,r11
800dc00: f8 00 05 04 calli 800f010 <_Thread_Clear_state>
800dc04: e0 00 00 02 bi 800dc0c <_Event_Surrender+0x130>
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
800dc08: d0 01 00 00 wcsr IE,r1
}
800dc0c: 2b 9d 00 04 lw ra,(sp+4)
800dc10: 2b 8b 00 08 lw r11,(sp+8)
800dc14: 37 9c 00 08 addi sp,sp,8
800dc18: c3 a0 00 00 ret
0800dc1c <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *ignored
)
{
800dc1c: 37 9c ff f8 addi sp,sp,-8
800dc20: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
ISR_Level level;
the_thread = _Thread_Get( id, &location );
800dc24: 37 82 00 08 addi r2,sp,8
800dc28: fb ff e3 cd calli 8006b5c <_Thread_Get>
switch ( location ) {
800dc2c: 2b 82 00 08 lw r2,(sp+8)
800dc30: 5c 40 00 1d bne r2,r0,800dca4 <_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 );
800dc34: 90 00 18 00 rcsr r3,IE
800dc38: 34 02 ff fe mvi r2,-2
800dc3c: a0 62 10 00 and r2,r3,r2
800dc40: d0 02 00 00 wcsr IE,r2
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
800dc44: 78 02 08 01 mvhi r2,0x801
800dc48: 38 42 9e 3c ori r2,r2,0x9e3c
return;
}
#endif
the_thread->Wait.count = 0;
if ( _Thread_Is_executing( the_thread ) ) {
800dc4c: 28 42 00 0c lw r2,(r2+12)
_ISR_Enable( level );
return;
}
#endif
the_thread->Wait.count = 0;
800dc50: 58 20 00 24 sw (r1+36),r0
if ( _Thread_Is_executing( the_thread ) ) {
800dc54: 5c 22 00 08 bne r1,r2,800dc74 <_Event_Timeout+0x58>
if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
800dc58: 78 02 08 01 mvhi r2,0x801
800dc5c: 38 42 a3 30 ori r2,r2,0xa330
800dc60: 28 45 00 00 lw r5,(r2+0)
800dc64: 34 04 00 01 mvi r4,1
800dc68: 5c a4 00 03 bne r5,r4,800dc74 <_Event_Timeout+0x58> <== ALWAYS TAKEN
_Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
800dc6c: 34 04 00 02 mvi r4,2 <== NOT EXECUTED
800dc70: 58 44 00 00 sw (r2+0),r4 <== NOT EXECUTED
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
800dc74: 34 02 00 06 mvi r2,6
800dc78: 58 22 00 34 sw (r1+52),r2
_ISR_Enable( level );
800dc7c: d0 03 00 00 wcsr IE,r3
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800dc80: 78 03 08 01 mvhi r3,0x801
800dc84: 38 63 81 74 ori r3,r3,0x8174
800dc88: 28 62 00 00 lw r2,(r3+0)
800dc8c: f8 00 04 e1 calli 800f010 <_Thread_Clear_state>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
800dc90: 78 01 08 01 mvhi r1,0x801
800dc94: 38 21 99 90 ori r1,r1,0x9990
800dc98: 28 22 00 00 lw r2,(r1+0)
800dc9c: 34 42 ff ff addi r2,r2,-1
800dca0: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
800dca4: 2b 9d 00 04 lw ra,(sp+4)
800dca8: 37 9c 00 08 addi sp,sp,8
800dcac: c3 a0 00 00 ret
08009fb4 <_Heap_Extend>:
Heap_Control *heap,
void *extend_area_begin_ptr,
uintptr_t extend_area_size,
uintptr_t *extended_size_ptr
)
{
8009fb4: 37 9c ff b8 addi sp,sp,-72
8009fb8: 5b 8b 00 40 sw (sp+64),r11
8009fbc: 5b 8c 00 3c sw (sp+60),r12
8009fc0: 5b 8d 00 38 sw (sp+56),r13
8009fc4: 5b 8e 00 34 sw (sp+52),r14
8009fc8: 5b 8f 00 30 sw (sp+48),r15
8009fcc: 5b 90 00 2c sw (sp+44),r16
8009fd0: 5b 91 00 28 sw (sp+40),r17
8009fd4: 5b 92 00 24 sw (sp+36),r18
8009fd8: 5b 93 00 20 sw (sp+32),r19
8009fdc: 5b 94 00 1c sw (sp+28),r20
8009fe0: 5b 95 00 18 sw (sp+24),r21
8009fe4: 5b 96 00 14 sw (sp+20),r22
8009fe8: 5b 97 00 10 sw (sp+16),r23
8009fec: 5b 98 00 0c sw (sp+12),r24
8009ff0: 5b 99 00 08 sw (sp+8),r25
8009ff4: 5b 9d 00 04 sw (sp+4),ra
8009ff8: 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;
8009ffc: 5b 80 00 48 sw (sp+72),r0
Heap_Block *extend_last_block = NULL;
800a000: 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;
800a004: 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
)
{
800a008: b8 80 a0 00 mv r20,r4
800a00c: b8 20 58 00 mv r11,r1
800a010: b8 60 10 00 mv r2,r3
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const first_block = heap->first_block;
800a014: 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;
800a018: 28 36 00 10 lw r22,(r1+16)
uintptr_t const min_block_size = heap->min_block_size;
800a01c: 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;
800a020: 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;
800a024: 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 ) {
800a028: 55 cd 00 8e bgu r14,r13,800a260 <_Heap_Extend+0x2ac>
return false;
}
extend_area_ok = _Heap_Get_first_and_last_block(
800a02c: b9 c0 08 00 mv r1,r14
800a030: ba c0 18 00 mv r3,r22
800a034: 37 85 00 48 addi r5,sp,72
800a038: 37 86 00 44 addi r6,sp,68
800a03c: fb ff e7 d7 calli 8003f98 <_Heap_Get_first_and_last_block>
page_size,
min_block_size,
&extend_first_block,
&extend_last_block
);
if (!extend_area_ok ) {
800a040: 44 20 00 88 be r1,r0,800a260 <_Heap_Extend+0x2ac>
800a044: ba a0 78 00 mv r15,r21
800a048: 34 11 00 00 mvi r17,0
800a04c: 34 13 00 00 mvi r19,0
800a050: 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;
800a054: 29 61 00 18 lw r1,(r11+24)
- 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;
800a058: 34 18 ff fe mvi r24,-2
800a05c: e0 00 00 02 bi 800a064 <_Heap_Extend+0xb0>
800a060: b9 e0 08 00 mv r1,r15
uintptr_t const sub_area_end = start_block->prev_size;
800a064: 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
800a068: f5 a1 18 00 cmpgu r3,r13,r1
800a06c: 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 (
800a070: a0 62 10 00 and r2,r3,r2
800a074: 5c 40 00 7a bne r2,r0,800a25c <_Heap_Extend+0x2a8>
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
}
if ( extend_area_end == sub_area_begin ) {
800a078: 45 a1 00 03 be r13,r1,800a084 <_Heap_Extend+0xd0>
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
800a07c: 56 4d 00 04 bgu r18,r13,800a08c <_Heap_Extend+0xd8>
800a080: e0 00 00 04 bi 800a090 <_Heap_Extend+0xdc>
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
}
if ( extend_area_end == sub_area_begin ) {
800a084: b9 e0 80 00 mv r16,r15
800a088: e0 00 00 02 bi 800a090 <_Heap_Extend+0xdc>
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
800a08c: 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);
800a090: ba 40 08 00 mv r1,r18
800a094: ba c0 10 00 mv r2,r22
800a098: 36 59 ff f8 addi r25,r18,-8
800a09c: f8 00 20 c1 calli 80123a0 <__umodsi3>
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
800a0a0: cb 21 08 00 sub r1,r25,r1
link_below_block = start_block;
}
if ( sub_area_end == extend_area_begin ) {
800a0a4: 5d d2 00 04 bne r14,r18,800a0b4 <_Heap_Extend+0x100>
start_block->prev_size = extend_area_end;
800a0a8: 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 )
800a0ac: b8 20 60 00 mv r12,r1
800a0b0: e0 00 00 04 bi 800a0c0 <_Heap_Extend+0x10c>
merge_above_block = end_block;
} else if ( sub_area_end < extend_area_begin ) {
800a0b4: 55 d2 00 02 bgu r14,r18,800a0bc <_Heap_Extend+0x108>
800a0b8: e0 00 00 02 bi 800a0c0 <_Heap_Extend+0x10c>
800a0bc: 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;
800a0c0: 28 2f 00 04 lw r15,(r1+4)
800a0c4: 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);
800a0c8: 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 );
800a0cc: 5d f5 ff e5 bne r15,r21,800a060 <_Heap_Extend+0xac>
if ( extend_area_begin < heap->area_begin ) {
800a0d0: 29 61 00 18 lw r1,(r11+24)
800a0d4: 51 c1 00 03 bgeu r14,r1,800a0e0 <_Heap_Extend+0x12c>
heap->area_begin = extend_area_begin;
800a0d8: 59 6e 00 18 sw (r11+24),r14
800a0dc: e0 00 00 04 bi 800a0ec <_Heap_Extend+0x138>
} else if ( heap->area_end < extend_area_end ) {
800a0e0: 29 61 00 1c lw r1,(r11+28)
800a0e4: 50 2d 00 02 bgeu r1,r13,800a0ec <_Heap_Extend+0x138>
heap->area_end = extend_area_end;
800a0e8: 59 6d 00 1c sw (r11+28),r13
}
extend_first_block_size =
(uintptr_t) extend_last_block - (uintptr_t) extend_first_block;
800a0ec: 2b 81 00 44 lw r1,(sp+68)
800a0f0: 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 =
800a0f4: 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;
800a0f8: 58 4d 00 00 sw (r2+0),r13
extend_first_block->size_and_flag =
extend_first_block_size | HEAP_PREV_BLOCK_USED;
800a0fc: 38 64 00 01 ori r4,r3,0x1
_Heap_Protection_block_initialize( heap, extend_first_block );
extend_last_block->prev_size = extend_first_block_size;
800a100: 58 23 00 00 sw (r1+0),r3
extend_last_block->size_and_flag = 0;
_Heap_Protection_block_initialize( heap, extend_last_block );
if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) {
800a104: 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 =
800a108: 58 44 00 04 sw (r2+4),r4
extend_first_block_size | HEAP_PREV_BLOCK_USED;
_Heap_Protection_block_initialize( heap, extend_first_block );
extend_last_block->prev_size = extend_first_block_size;
extend_last_block->size_and_flag = 0;
800a10c: 58 20 00 04 sw (r1+4),r0
_Heap_Protection_block_initialize( heap, extend_last_block );
if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) {
800a110: 50 43 00 03 bgeu r2,r3,800a11c <_Heap_Extend+0x168>
heap->first_block = extend_first_block;
800a114: 59 62 00 20 sw (r11+32),r2
800a118: e0 00 00 04 bi 800a128 <_Heap_Extend+0x174>
} else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) {
800a11c: 29 62 00 24 lw r2,(r11+36)
800a120: 50 41 00 02 bgeu r2,r1,800a128 <_Heap_Extend+0x174>
heap->last_block = extend_last_block;
800a124: 59 61 00 24 sw (r11+36),r1
}
if ( merge_below_block != NULL ) {
800a128: 46 00 00 12 be r16,r0,800a170 <_Heap_Extend+0x1bc>
Heap_Control *heap,
uintptr_t extend_area_begin,
Heap_Block *first_block
)
{
uintptr_t const page_size = heap->page_size;
800a12c: 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 );
800a130: 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;
800a134: b9 c0 08 00 mv r1,r14
800a138: b9 e0 10 00 mv r2,r15
800a13c: f8 00 20 99 calli 80123a0 <__umodsi3>
if ( remainder != 0 ) {
800a140: 44 20 00 03 be r1,r0,800a14c <_Heap_Extend+0x198>
return value - remainder + alignment;
800a144: b5 cf 70 00 add r14,r14,r15
800a148: c9 c1 70 00 sub r14,r14,r1
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;
800a14c: 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 =
800a150: 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;
800a154: 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 =
800a158: 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;
800a15c: 38 21 00 01 ori r1,r1,0x1
800a160: 58 41 00 04 sw (r2+4),r1
_Heap_Free_block( heap, new_first_block );
800a164: b9 60 08 00 mv r1,r11
800a168: fb ff ff 86 calli 8009f80 <_Heap_Free_block>
800a16c: e0 00 00 06 bi 800a184 <_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 ) {
800a170: 46 70 00 05 be r19,r16,800a184 <_Heap_Extend+0x1d0>
_Heap_Link_below(
800a174: 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;
800a178: ca 61 98 00 sub r19,r19,r1
800a17c: 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 =
800a180: 58 33 00 04 sw (r1+4),r19
link_below_block,
extend_last_block
);
}
if ( merge_above_block != NULL ) {
800a184: 45 80 00 14 be r12,r0,800a1d4 <_Heap_Extend+0x220>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
800a188: 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,
800a18c: 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(
800a190: c9 ac 68 00 sub r13,r13,r12
800a194: b9 a0 08 00 mv r1,r13
800a198: f8 00 20 82 calli 80123a0 <__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)
800a19c: 29 83 00 04 lw r3,(r12+4)
800a1a0: 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 =
800a1a4: b4 2c 10 00 add r2,r1,r12
(last_block->size_and_flag - last_block_new_size)
800a1a8: c8 61 18 00 sub r3,r3,r1
| HEAP_PREV_BLOCK_USED;
800a1ac: 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 =
800a1b0: 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;
800a1b4: 29 82 00 04 lw r2,(r12+4)
800a1b8: 20 42 00 01 andi r2,r2,0x1
block->size_and_flag = size | flag;
800a1bc: b8 22 08 00 or r1,r1,r2
800a1c0: 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 );
800a1c4: b9 80 10 00 mv r2,r12
800a1c8: b9 60 08 00 mv r1,r11
800a1cc: fb ff ff 6d calli 8009f80 <_Heap_Free_block>
800a1d0: e0 00 00 0c bi 800a200 <_Heap_Extend+0x24c>
);
}
if ( merge_above_block != NULL ) {
_Heap_Merge_above( heap, merge_above_block, extend_area_end );
} else if ( link_above_block != NULL ) {
800a1d4: 46 2c 00 0b be r17,r12,800a200 <_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;
800a1d8: 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 );
800a1dc: 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(
800a1e0: 2b 82 00 44 lw r2,(sp+68)
800a1e4: 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 );
800a1e8: c8 71 18 00 sub r3,r3,r17
block->size_and_flag = size | flag;
800a1ec: b8 61 08 00 or r1,r3,r1
800a1f0: 5a 21 00 04 sw (r17+4),r1
last_block->size_and_flag |= HEAP_PREV_BLOCK_USED;
800a1f4: 28 41 00 04 lw r1,(r2+4)
800a1f8: 38 21 00 01 ori r1,r1,0x1
800a1fc: 58 41 00 04 sw (r2+4),r1
extend_first_block,
extend_last_block
);
}
if ( merge_below_block == NULL && merge_above_block == NULL ) {
800a200: 65 8c 00 00 cmpei r12,r12,0
800a204: 66 10 00 00 cmpei r16,r16,0
800a208: a1 90 60 00 and r12,r12,r16
800a20c: 45 80 00 04 be r12,r0,800a21c <_Heap_Extend+0x268>
_Heap_Free_block( heap, extend_first_block );
800a210: 2b 82 00 48 lw r2,(sp+72)
800a214: b9 60 08 00 mv r1,r11
800a218: fb ff ff 5a calli 8009f80 <_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
800a21c: 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(
800a220: 29 63 00 20 lw r3,(r11+32)
stats->size += extended_size;
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
800a224: 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;
800a228: 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(
800a22c: 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;
800a230: 20 42 00 01 andi r2,r2,0x1
block->size_and_flag = size | flag;
800a234: b8 62 10 00 or r2,r3,r2
800a238: 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;
800a23c: 29 61 00 30 lw r1,(r11+48)
/* Statistics */
stats->size += extended_size;
800a240: 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;
800a244: c8 37 08 00 sub r1,r1,r23
/* Statistics */
stats->size += extended_size;
800a248: b4 41 10 00 add r2,r2,r1
800a24c: 59 62 00 2c sw (r11+44),r2
if ( extended_size_ptr != NULL )
800a250: 46 80 00 04 be r20,r0,800a260 <_Heap_Extend+0x2ac> <== NEVER TAKEN
*extended_size_ptr = extended_size;
800a254: 5a 81 00 00 sw (r20+0),r1
800a258: e0 00 00 02 bi 800a260 <_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;
800a25c: 34 0c 00 00 mvi r12,0
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
}
800a260: b9 80 08 00 mv r1,r12
800a264: 2b 9d 00 04 lw ra,(sp+4)
800a268: 2b 8b 00 40 lw r11,(sp+64)
800a26c: 2b 8c 00 3c lw r12,(sp+60)
800a270: 2b 8d 00 38 lw r13,(sp+56)
800a274: 2b 8e 00 34 lw r14,(sp+52)
800a278: 2b 8f 00 30 lw r15,(sp+48)
800a27c: 2b 90 00 2c lw r16,(sp+44)
800a280: 2b 91 00 28 lw r17,(sp+40)
800a284: 2b 92 00 24 lw r18,(sp+36)
800a288: 2b 93 00 20 lw r19,(sp+32)
800a28c: 2b 94 00 1c lw r20,(sp+28)
800a290: 2b 95 00 18 lw r21,(sp+24)
800a294: 2b 96 00 14 lw r22,(sp+20)
800a298: 2b 97 00 10 lw r23,(sp+16)
800a29c: 2b 98 00 0c lw r24,(sp+12)
800a2a0: 2b 99 00 08 lw r25,(sp+8)
800a2a4: 37 9c 00 48 addi sp,sp,72
800a2a8: c3 a0 00 00 ret
0800eab8 <_Heap_Free>:
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
800eab8: 37 9c ff f4 addi sp,sp,-12
800eabc: 5b 8b 00 0c sw (sp+12),r11
800eac0: 5b 8c 00 08 sw (sp+8),r12
800eac4: 5b 9d 00 04 sw (sp+4),ra
800eac8: b8 20 58 00 mv r11,r1
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
return true;
800eacc: 34 01 00 01 mvi r1,1
/*
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
800ead0: 44 40 00 73 be r2,r0,800ec9c <_Heap_Free+0x1e4>
800ead4: 34 4c ff f8 addi r12,r2,-8
800ead8: b8 40 08 00 mv r1,r2
800eadc: 29 62 00 10 lw r2,(r11+16)
800eae0: f8 00 21 f6 calli 80172b8 <__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
800eae4: 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);
800eae8: 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;
800eaec: 34 01 00 00 mvi r1,0
800eaf0: 54 e3 00 03 bgu r7,r3,800eafc <_Heap_Free+0x44>
800eaf4: 29 61 00 24 lw r1,(r11+36)
800eaf8: f0 23 08 00 cmpgeu r1,r1,r3
}
alloc_begin = (uintptr_t) alloc_begin_ptr;
block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
800eafc: b8 20 10 00 mv r2,r1
return false;
800eb00: 34 01 00 00 mvi r1,0
}
alloc_begin = (uintptr_t) alloc_begin_ptr;
block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
800eb04: 44 40 00 66 be r2,r0,800ec9c <_Heap_Free+0x1e4>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800eb08: 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;
800eb0c: 34 04 ff fe mvi r4,-2
800eb10: 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);
800eb14: 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;
800eb18: 54 e2 00 03 bgu r7,r2,800eb24 <_Heap_Free+0x6c> <== NEVER TAKEN
800eb1c: 29 61 00 24 lw r1,(r11+36)
800eb20: f0 22 08 00 cmpgeu r1,r1,r2
_Heap_Protection_block_check( heap, block );
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
800eb24: b8 20 28 00 mv r5,r1
return false;
800eb28: 34 01 00 00 mvi r1,0
_Heap_Protection_block_check( heap, block );
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
800eb2c: 44 a0 00 5c be r5,r0,800ec9c <_Heap_Free+0x1e4> <== NEVER TAKEN
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800eb30: 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;
800eb34: 20 a8 00 01 andi r8,r5,0x1
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
800eb38: 45 00 00 59 be r8,r0,800ec9c <_Heap_Free+0x1e4> <== NEVER TAKEN
if ( !_Heap_Protection_determine_block_free( heap, block ) ) {
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
800eb3c: 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;
800eb40: 34 01 ff fe mvi r1,-2
800eb44: a0 a1 28 00 and r5,r5,r1
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
800eb48: 34 08 00 00 mvi r8,0
800eb4c: 45 22 00 05 be r9,r2,800eb60 <_Heap_Free+0xa8>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800eb50: 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;
800eb54: 28 28 00 04 lw r8,(r1+4)
800eb58: 21 08 00 01 andi r8,r8,0x1
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
800eb5c: 65 08 00 00 cmpei r8,r8,0
800eb60: 20 c6 00 01 andi r6,r6,0x1
if ( !_Heap_Protection_determine_block_free( heap, block ) ) {
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
800eb64: 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 ) ) {
800eb68: 5c c0 00 24 bne r6,r0,800ebf8 <_Heap_Free+0x140>
uintptr_t const prev_size = block->prev_size;
800eb6c: 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;
800eb70: 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);
800eb74: 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;
800eb78: 54 e3 00 02 bgu r7,r3,800eb80 <_Heap_Free+0xc8> <== NEVER TAKEN
800eb7c: 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 ) ) {
800eb80: b8 20 38 00 mv r7,r1
_HAssert( false );
return( false );
800eb84: 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 ) ) {
800eb88: 44 e0 00 45 be r7,r0,800ec9c <_Heap_Free+0x1e4> <== 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;
800eb8c: 28 67 00 04 lw r7,(r3+4)
800eb90: 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) ) {
800eb94: 44 e0 00 42 be r7,r0,800ec9c <_Heap_Free+0x1e4> <== NEVER TAKEN
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
800eb98: 45 00 00 0f be r8,r0,800ebd4 <_Heap_Free+0x11c>
return _Heap_Free_list_tail(heap)->prev;
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
800eb9c: 28 41 00 08 lw r1,(r2+8)
Heap_Block *prev = block->prev;
800eba0: 28 42 00 0c lw r2,(r2+12)
uintptr_t const size = block_size + prev_size + next_block_size;
800eba4: b4 85 28 00 add r5,r4,r5
800eba8: b4 a6 30 00 add r6,r5,r6
prev->next = next;
800ebac: 58 41 00 08 sw (r2+8),r1
next->prev = prev;
800ebb0: 58 22 00 0c sw (r1+12),r2
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
800ebb4: 29 61 00 38 lw r1,(r11+56)
800ebb8: 34 21 ff ff addi r1,r1,-1
800ebbc: 59 61 00 38 sw (r11+56),r1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800ebc0: 38 c1 00 01 ori r1,r6,0x1
800ebc4: 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;
800ebc8: b4 66 18 00 add r3,r3,r6
800ebcc: 58 66 00 00 sw (r3+0),r6
800ebd0: e0 00 00 29 bi 800ec74 <_Heap_Free+0x1bc>
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
800ebd4: b4 86 30 00 add r6,r4,r6
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800ebd8: 38 c1 00 01 ori r1,r6,0x1
800ebdc: 58 61 00 04 sw (r3+4),r1
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
800ebe0: 28 43 00 04 lw r3,(r2+4)
800ebe4: 34 01 ff fe mvi r1,-2
next_block->prev_size = size;
800ebe8: 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;
800ebec: a0 61 08 00 and r1,r3,r1
800ebf0: 58 41 00 04 sw (r2+4),r1
800ebf4: e0 00 00 20 bi 800ec74 <_Heap_Free+0x1bc>
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
800ebf8: 45 00 00 0d be r8,r0,800ec2c <_Heap_Free+0x174>
uintptr_t const size = block_size + next_block_size;
800ebfc: 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;
800ec00: 28 45 00 08 lw r5,(r2+8)
Heap_Block *prev = old_block->prev;
800ec04: 28 42 00 0c lw r2,(r2+12)
new_block->next = next;
800ec08: 58 65 00 08 sw (r3+8),r5
new_block->prev = prev;
800ec0c: 58 62 00 0c sw (r3+12),r2
next->prev = new_block;
prev->next = new_block;
800ec10: 58 43 00 08 sw (r2+8),r3
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800ec14: 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;
800ec18: 58 a3 00 0c sw (r5+12),r3
800ec1c: 58 62 00 04 sw (r3+4),r2
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
800ec20: b4 61 18 00 add r3,r3,r1
800ec24: 58 61 00 00 sw (r3+0),r1
800ec28: e0 00 00 13 bi 800ec74 <_Heap_Free+0x1bc>
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
800ec2c: 29 61 00 08 lw r1,(r11+8)
new_block->next = next;
new_block->prev = block_before;
800ec30: 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;
800ec34: 58 44 00 00 sw (r2+0),r4
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
800ec38: 58 61 00 08 sw (r3+8),r1
new_block->prev = block_before;
block_before->next = new_block;
next->prev = new_block;
800ec3c: 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;
800ec40: 38 81 00 01 ori r1,r4,0x1
800ec44: 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;
800ec48: 59 63 00 08 sw (r11+8),r3
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
800ec4c: 28 43 00 04 lw r3,(r2+4)
800ec50: 34 01 ff fe mvi r1,-2
800ec54: a0 61 08 00 and r1,r3,r1
800ec58: 58 41 00 04 sw (r2+4),r1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
800ec5c: 29 61 00 38 lw r1,(r11+56)
if ( stats->max_free_blocks < stats->free_blocks ) {
800ec60: 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;
800ec64: 34 21 00 01 addi r1,r1,1
800ec68: 59 61 00 38 sw (r11+56),r1
if ( stats->max_free_blocks < stats->free_blocks ) {
800ec6c: 50 41 00 02 bgeu r2,r1,800ec74 <_Heap_Free+0x1bc>
stats->max_free_blocks = stats->free_blocks;
800ec70: 59 61 00 3c sw (r11+60),r1
}
}
/* Statistics */
--stats->used_blocks;
800ec74: 29 61 00 40 lw r1,(r11+64)
800ec78: 34 21 ff ff addi r1,r1,-1
800ec7c: 59 61 00 40 sw (r11+64),r1
++stats->frees;
800ec80: 29 61 00 50 lw r1,(r11+80)
800ec84: 34 21 00 01 addi r1,r1,1
800ec88: 59 61 00 50 sw (r11+80),r1
stats->free_size += block_size;
800ec8c: 29 61 00 30 lw r1,(r11+48)
800ec90: b4 24 20 00 add r4,r1,r4
800ec94: 59 64 00 30 sw (r11+48),r4
return( true );
800ec98: 34 01 00 01 mvi r1,1
}
800ec9c: 2b 9d 00 04 lw ra,(sp+4)
800eca0: 2b 8b 00 0c lw r11,(sp+12)
800eca4: 2b 8c 00 08 lw r12,(sp+8)
800eca8: 37 9c 00 0c addi sp,sp,12
800ecac: c3 a0 00 00 ret
0800ee0c <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
800ee0c: 37 9c ff ec addi sp,sp,-20
800ee10: 5b 8b 00 14 sw (sp+20),r11
800ee14: 5b 8c 00 10 sw (sp+16),r12
800ee18: 5b 8d 00 0c sw (sp+12),r13
800ee1c: 5b 8e 00 08 sw (sp+8),r14
800ee20: 5b 9d 00 04 sw (sp+4),ra
800ee24: 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);
800ee28: 34 4e ff f8 addi r14,r2,-8
800ee2c: b8 40 08 00 mv r1,r2
800ee30: b8 40 60 00 mv r12,r2
800ee34: 29 62 00 10 lw r2,(r11+16)
800ee38: b8 60 68 00 mv r13,r3
800ee3c: f8 00 21 1f calli 80172b8 <__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
800ee40: 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);
800ee44: 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;
800ee48: 34 01 00 00 mvi r1,0
800ee4c: 54 44 00 03 bgu r2,r4,800ee58 <_Heap_Size_of_alloc_area+0x4c>
800ee50: 29 61 00 24 lw r1,(r11+36)
800ee54: 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 ) ) {
800ee58: b8 20 18 00 mv r3,r1
return false;
800ee5c: 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 ) ) {
800ee60: 44 60 00 13 be r3,r0,800eeac <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN
- 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;
800ee64: 28 83 00 04 lw r3,(r4+4)
800ee68: 34 01 ff fe mvi r1,-2
800ee6c: 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);
800ee70: 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;
800ee74: 34 01 00 00 mvi r1,0
800ee78: 54 44 00 03 bgu r2,r4,800ee84 <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN
800ee7c: 29 61 00 24 lw r1,(r11+36)
800ee80: f0 24 08 00 cmpgeu r1,r1,r4
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
800ee84: b8 20 10 00 mv r2,r1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
800ee88: 34 01 00 00 mvi r1,0
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
800ee8c: 44 40 00 08 be r2,r0,800eeac <_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;
800ee90: 28 82 00 04 lw r2,(r4+4)
800ee94: 20 42 00 01 andi r2,r2,0x1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
800ee98: 44 40 00 05 be r2,r0,800eeac <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
800ee9c: c8 8c 20 00 sub r4,r4,r12
800eea0: 34 84 00 04 addi r4,r4,4
800eea4: 59 a4 00 00 sw (r13+0),r4
return true;
800eea8: 34 01 00 01 mvi r1,1
}
800eeac: 2b 9d 00 04 lw ra,(sp+4)
800eeb0: 2b 8b 00 14 lw r11,(sp+20)
800eeb4: 2b 8c 00 10 lw r12,(sp+16)
800eeb8: 2b 8d 00 0c lw r13,(sp+12)
800eebc: 2b 8e 00 08 lw r14,(sp+8)
800eec0: 37 9c 00 14 addi sp,sp,20
800eec4: c3 a0 00 00 ret
08004c4c <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
8004c4c: 37 9c ff a0 addi sp,sp,-96
8004c50: 5b 8b 00 50 sw (sp+80),r11
8004c54: 5b 8c 00 4c sw (sp+76),r12
8004c58: 5b 8d 00 48 sw (sp+72),r13
8004c5c: 5b 8e 00 44 sw (sp+68),r14
8004c60: 5b 8f 00 40 sw (sp+64),r15
8004c64: 5b 90 00 3c sw (sp+60),r16
8004c68: 5b 91 00 38 sw (sp+56),r17
8004c6c: 5b 92 00 34 sw (sp+52),r18
8004c70: 5b 93 00 30 sw (sp+48),r19
8004c74: 5b 94 00 2c sw (sp+44),r20
8004c78: 5b 95 00 28 sw (sp+40),r21
8004c7c: 5b 96 00 24 sw (sp+36),r22
8004c80: 5b 97 00 20 sw (sp+32),r23
8004c84: 5b 98 00 1c sw (sp+28),r24
8004c88: 5b 99 00 18 sw (sp+24),r25
8004c8c: 5b 9b 00 14 sw (sp+20),fp
8004c90: 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;
8004c94: 78 0d 08 00 mvhi r13,0x800
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
8004c98: 20 63 00 ff andi r3,r3,0xff
8004c9c: b8 20 60 00 mv r12,r1
8004ca0: b8 40 70 00 mv r14,r2
uintptr_t const page_size = heap->page_size;
8004ca4: 28 33 00 10 lw r19,(r1+16)
uintptr_t const min_block_size = heap->min_block_size;
8004ca8: 28 35 00 14 lw r21,(r1+20)
Heap_Block *const first_block = heap->first_block;
8004cac: 28 34 00 20 lw r20,(r1+32)
Heap_Block *const last_block = heap->last_block;
8004cb0: 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;
8004cb4: 39 ad 4b b4 ori r13,r13,0x4bb4
8004cb8: 44 60 00 03 be r3,r0,8004cc4 <_Heap_Walk+0x78>
8004cbc: 78 0d 08 00 mvhi r13,0x800
8004cc0: 39 ad 4b d8 ori r13,r13,0x4bd8
if ( !_System_state_Is_up( _System_state_Get() ) ) {
8004cc4: 78 03 08 01 mvhi r3,0x801
8004cc8: 38 63 6a a8 ori r3,r3,0x6aa8
8004ccc: 28 67 00 00 lw r7,(r3+0)
8004cd0: 34 02 00 03 mvi r2,3
return true;
8004cd4: 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() ) ) {
8004cd8: 5c e2 01 08 bne r7,r2,80050f8 <_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)(
8004cdc: 29 81 00 08 lw r1,(r12+8)
8004ce0: 29 86 00 18 lw r6,(r12+24)
8004ce4: 29 87 00 1c lw r7,(r12+28)
8004ce8: 5b 81 00 08 sw (sp+8),r1
8004cec: 29 81 00 0c lw r1,(r12+12)
8004cf0: 78 03 08 01 mvhi r3,0x801
8004cf4: 5b 96 00 04 sw (sp+4),r22
8004cf8: 5b 81 00 0c sw (sp+12),r1
8004cfc: 34 02 00 00 mvi r2,0
8004d00: b9 c0 08 00 mv r1,r14
8004d04: 38 63 41 e4 ori r3,r3,0x41e4
8004d08: ba 60 20 00 mv r4,r19
8004d0c: ba a0 28 00 mv r5,r21
8004d10: ba 80 40 00 mv r8,r20
8004d14: 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 ) {
8004d18: 5e 60 00 06 bne r19,r0,8004d30 <_Heap_Walk+0xe4>
(*printer)( source, true, "page size is zero\n" );
8004d1c: 78 03 08 01 mvhi r3,0x801
8004d20: b9 c0 08 00 mv r1,r14
8004d24: 34 02 00 01 mvi r2,1
8004d28: 38 63 42 78 ori r3,r3,0x4278
8004d2c: e0 00 00 25 bi 8004dc0 <_Heap_Walk+0x174>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
8004d30: 22 6f 00 07 andi r15,r19,0x7
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
8004d34: 45 e0 00 07 be r15,r0,8004d50 <_Heap_Walk+0x104>
(*printer)(
8004d38: 78 03 08 01 mvhi r3,0x801
8004d3c: b9 c0 08 00 mv r1,r14
8004d40: 34 02 00 01 mvi r2,1
8004d44: 38 63 42 8c ori r3,r3,0x428c
8004d48: ba 60 20 00 mv r4,r19
8004d4c: e0 00 01 04 bi 800515c <_Heap_Walk+0x510>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004d50: ba a0 08 00 mv r1,r21
8004d54: ba 60 10 00 mv r2,r19
8004d58: fb ff ef 94 calli 8000ba8 <__umodsi3>
8004d5c: b8 20 58 00 mv r11,r1
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
8004d60: 44 2f 00 07 be r1,r15,8004d7c <_Heap_Walk+0x130>
(*printer)(
8004d64: 78 03 08 01 mvhi r3,0x801
8004d68: b9 c0 08 00 mv r1,r14
8004d6c: 34 02 00 01 mvi r2,1
8004d70: 38 63 42 ac ori r3,r3,0x42ac
8004d74: ba a0 20 00 mv r4,r21
8004d78: e0 00 00 f9 bi 800515c <_Heap_Walk+0x510>
8004d7c: 36 81 00 08 addi r1,r20,8
8004d80: ba 60 10 00 mv r2,r19
8004d84: fb ff ef 89 calli 8000ba8 <__umodsi3>
);
return false;
}
if (
8004d88: 44 2b 00 07 be r1,r11,8004da4 <_Heap_Walk+0x158>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
8004d8c: 78 03 08 01 mvhi r3,0x801
8004d90: b9 c0 08 00 mv r1,r14
8004d94: 34 02 00 01 mvi r2,1
8004d98: 38 63 42 d0 ori r3,r3,0x42d0
8004d9c: ba 80 20 00 mv r4,r20
8004da0: e0 00 00 ef bi 800515c <_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;
8004da4: 2a 82 00 04 lw r2,(r20+4)
8004da8: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
8004dac: 5c 41 00 07 bne r2,r1,8004dc8 <_Heap_Walk+0x17c>
(*printer)(
8004db0: 78 03 08 01 mvhi r3,0x801
8004db4: b9 c0 08 00 mv r1,r14
8004db8: 34 02 00 01 mvi r2,1
8004dbc: 38 63 43 04 ori r3,r3,0x4304
8004dc0: d9 a0 00 00 call r13
8004dc4: e0 00 00 40 bi 8004ec4 <_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;
8004dc8: 2a cf 00 04 lw r15,(r22+4)
8004dcc: 34 02 ff fe mvi r2,-2
8004dd0: 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);
8004dd4: 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;
8004dd8: 29 e2 00 04 lw r2,(r15+4)
8004ddc: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
8004de0: 5c 41 00 06 bne r2,r1,8004df8 <_Heap_Walk+0x1ac>
(*printer)(
8004de4: 78 03 08 01 mvhi r3,0x801
8004de8: b9 c0 08 00 mv r1,r14
8004dec: 34 02 00 01 mvi r2,1
8004df0: 38 63 43 34 ori r3,r3,0x4334
8004df4: e3 ff ff f3 bi 8004dc0 <_Heap_Walk+0x174>
);
return false;
}
if (
8004df8: 45 f4 00 06 be r15,r20,8004e10 <_Heap_Walk+0x1c4>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*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 4c ori r3,r3,0x434c
8004e0c: e3 ff ff ed bi 8004dc0 <_Heap_Walk+0x174>
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
8004e10: 29 92 00 10 lw r18,(r12+16)
block = next_block;
} while ( block != first_block );
return true;
}
8004e14: 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 );
8004e18: 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;
8004e1c: 34 11 ff fe mvi r17,-2
8004e20: e0 00 00 2d bi 8004ed4 <_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;
8004e24: 29 83 00 20 lw r3,(r12+32)
8004e28: 34 01 00 00 mvi r1,0
8004e2c: 54 6b 00 03 bgu r3,r11,8004e38 <_Heap_Walk+0x1ec>
8004e30: 29 81 00 24 lw r1,(r12+36)
8004e34: 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 ) ) {
8004e38: 5c 20 00 06 bne r1,r0,8004e50 <_Heap_Walk+0x204>
(*printer)(
8004e3c: 78 03 08 01 mvhi r3,0x801
8004e40: b9 c0 08 00 mv r1,r14
8004e44: 34 02 00 01 mvi r2,1
8004e48: 38 63 43 7c ori r3,r3,0x437c
8004e4c: e0 00 00 14 bi 8004e9c <_Heap_Walk+0x250>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004e50: 35 61 00 08 addi r1,r11,8
8004e54: ba 40 10 00 mv r2,r18
8004e58: fb ff ef 54 calli 8000ba8 <__umodsi3>
);
return false;
}
if (
8004e5c: 44 20 00 06 be r1,r0,8004e74 <_Heap_Walk+0x228>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
8004e60: 78 03 08 01 mvhi r3,0x801
8004e64: b9 c0 08 00 mv r1,r14
8004e68: 34 02 00 01 mvi r2,1
8004e6c: 38 63 43 9c ori r3,r3,0x439c
8004e70: e0 00 00 0b bi 8004e9c <_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;
8004e74: 29 63 00 04 lw r3,(r11+4)
8004e78: a2 23 18 00 and r3,r17,r3
block = next_block;
} while ( block != first_block );
return true;
}
8004e7c: 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;
8004e80: 28 63 00 04 lw r3,(r3+4)
8004e84: 20 63 00 01 andi r3,r3,0x1
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
8004e88: 44 61 00 07 be r3,r1,8004ea4 <_Heap_Walk+0x258>
(*printer)(
8004e8c: 78 03 08 01 mvhi r3,0x801
8004e90: b9 c0 08 00 mv r1,r14
8004e94: 34 02 00 01 mvi r2,1
8004e98: 38 63 43 cc ori r3,r3,0x43cc
8004e9c: b9 60 20 00 mv r4,r11
8004ea0: e0 00 00 af bi 800515c <_Heap_Walk+0x510>
);
return false;
}
if ( free_block->prev != prev_block ) {
8004ea4: 29 65 00 0c lw r5,(r11+12)
8004ea8: 44 b0 00 09 be r5,r16,8004ecc <_Heap_Walk+0x280>
(*printer)(
8004eac: 78 03 08 01 mvhi r3,0x801
8004eb0: b9 c0 08 00 mv r1,r14
8004eb4: 34 02 00 01 mvi r2,1
8004eb8: 38 63 43 e8 ori r3,r3,0x43e8
8004ebc: b9 60 20 00 mv r4,r11
8004ec0: 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;
8004ec4: 34 03 00 00 mvi r3,0
8004ec8: e0 00 00 8c bi 80050f8 <_Heap_Walk+0x4ac>
return false;
}
prev_block = free_block;
free_block = free_block->next;
8004ecc: b9 60 80 00 mv r16,r11
8004ed0: 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 ) {
8004ed4: 5d 6c ff d4 bne r11,r12,8004e24 <_Heap_Walk+0x1d8>
8004ed8: e0 00 00 03 bi 8004ee4 <_Heap_Walk+0x298>
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
8004edc: ba 20 78 00 mv r15,r17
8004ee0: e0 00 00 15 bi 8004f34 <_Heap_Walk+0x2e8>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
8004ee4: 78 01 08 01 mvhi r1,0x801
8004ee8: 38 21 45 98 ori r1,r1,0x4598
8004eec: 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)(
8004ef0: 78 01 08 01 mvhi r1,0x801
8004ef4: 38 21 45 80 ori r1,r1,0x4580
8004ef8: 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)(
8004efc: 78 01 08 01 mvhi r1,0x801
8004f00: 38 21 41 ac ori r1,r1,0x41ac
8004f04: 5b 81 00 5c sw (sp+92),r1
8004f08: 78 01 08 01 mvhi r1,0x801
8004f0c: 38 21 41 c8 ori r1,r1,0x41c8
8004f10: 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)" : "")
8004f14: 78 17 08 01 mvhi r23,0x801
8004f18: 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)" : ""),
8004f1c: 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)(
8004f20: 5b 81 00 60 sw (sp+96),r1
8004f24: 3b 7b 44 dc ori fp,fp,0x44dc
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
8004f28: 3a f7 45 4c ori r23,r23,0x454c
8004f2c: 3b 39 41 d8 ori r25,r25,0x41d8
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
8004f30: 3b 18 41 bc ori r24,r24,0x41bc
block = next_block;
} while ( block != first_block );
return true;
}
8004f34: 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;
8004f38: 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;
8004f3c: 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;
8004f40: 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);
8004f44: 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;
8004f48: 34 06 00 00 mvi r6,0
8004f4c: 54 91 00 03 bgu r4,r17,8004f58 <_Heap_Walk+0x30c> <== NEVER TAKEN
8004f50: 29 86 00 24 lw r6,(r12+36)
8004f54: 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 ) ) {
8004f58: 5c c0 00 06 bne r6,r0,8004f70 <_Heap_Walk+0x324>
(*printer)(
8004f5c: 78 03 08 01 mvhi r3,0x801
8004f60: b9 c0 08 00 mv r1,r14
8004f64: 34 02 00 01 mvi r2,1
8004f68: 38 63 44 1c ori r3,r3,0x441c
8004f6c: e0 00 00 1f bi 8004fe8 <_Heap_Walk+0x39c>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004f70: ba 00 08 00 mv r1,r16
8004f74: 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;
8004f78: fd f6 58 00 cmpne r11,r15,r22
8004f7c: fb ff ef 0b calli 8000ba8 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
8004f80: 44 20 00 09 be r1,r0,8004fa4 <_Heap_Walk+0x358>
8004f84: 45 60 00 08 be r11,r0,8004fa4 <_Heap_Walk+0x358>
(*printer)(
8004f88: 78 03 08 01 mvhi r3,0x801
8004f8c: b9 c0 08 00 mv r1,r14
8004f90: 34 02 00 01 mvi r2,1
8004f94: 38 63 44 4c ori r3,r3,0x444c
8004f98: b9 e0 20 00 mv r4,r15
8004f9c: ba 00 28 00 mv r5,r16
8004fa0: e3 ff ff c8 bi 8004ec0 <_Heap_Walk+0x274>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
8004fa4: 52 15 00 0b bgeu r16,r21,8004fd0 <_Heap_Walk+0x384>
8004fa8: 45 60 00 0a be r11,r0,8004fd0 <_Heap_Walk+0x384> <== NEVER TAKEN
(*printer)(
8004fac: 78 03 08 01 mvhi r3,0x801
8004fb0: b9 c0 08 00 mv r1,r14
8004fb4: 34 02 00 01 mvi r2,1
8004fb8: 38 63 44 7c ori r3,r3,0x447c
8004fbc: b9 e0 20 00 mv r4,r15
8004fc0: ba 00 28 00 mv r5,r16
8004fc4: ba a0 30 00 mv r6,r21
8004fc8: d9 a0 00 00 call r13
8004fcc: e3 ff ff be bi 8004ec4 <_Heap_Walk+0x278>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
8004fd0: 56 2f 00 09 bgu r17,r15,8004ff4 <_Heap_Walk+0x3a8>
8004fd4: 45 60 00 08 be r11,r0,8004ff4 <_Heap_Walk+0x3a8>
(*printer)(
8004fd8: 78 03 08 01 mvhi r3,0x801
8004fdc: b9 c0 08 00 mv r1,r14
8004fe0: 34 02 00 01 mvi r2,1
8004fe4: 38 63 44 a8 ori r3,r3,0x44a8
8004fe8: b9 e0 20 00 mv r4,r15
8004fec: ba 20 28 00 mv r5,r17
8004ff0: e3 ff ff b4 bi 8004ec0 <_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;
8004ff4: 2a 24 00 04 lw r4,(r17+4)
8004ff8: 22 52 00 01 andi r18,r18,0x1
8004ffc: 20 84 00 01 andi r4,r4,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
8005000: 5c 80 00 2d bne r4,r0,80050b4 <_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 ?
8005004: 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)(
8005008: 29 85 00 08 lw r5,(r12+8)
block = next_block;
} while ( block != first_block );
return true;
}
800500c: 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)(
8005010: 2b 87 00 5c lw r7,(sp+92)
8005014: 44 c5 00 04 be r6,r5,8005024 <_Heap_Walk+0x3d8>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
8005018: ba e0 38 00 mv r7,r23
800501c: 5c cc 00 02 bne r6,r12,8005024 <_Heap_Walk+0x3d8>
8005020: bb 00 38 00 mv r7,r24
block->next,
block->next == last_free_block ?
8005024: 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)(
8005028: 2b 89 00 60 lw r9,(sp+96)
800502c: 45 04 00 04 be r8,r4,800503c <_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)" : "")
8005030: ba e0 48 00 mv r9,r23
8005034: 5d 0c 00 02 bne r8,r12,800503c <_Heap_Walk+0x3f0>
8005038: 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)(
800503c: 5b 89 00 04 sw (sp+4),r9
8005040: b9 c0 08 00 mv r1,r14
8005044: 34 02 00 00 mvi r2,0
8005048: bb 60 18 00 mv r3,fp
800504c: b9 e0 20 00 mv r4,r15
8005050: ba 00 28 00 mv r5,r16
8005054: 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 ) {
8005058: 2a 26 00 00 lw r6,(r17+0)
800505c: 46 06 00 0a be r16,r6,8005084 <_Heap_Walk+0x438>
(*printer)(
8005060: 78 03 08 01 mvhi r3,0x801
8005064: b9 c0 08 00 mv r1,r14
8005068: 34 02 00 01 mvi r2,1
800506c: 38 63 45 14 ori r3,r3,0x4514
8005070: b9 e0 20 00 mv r4,r15
8005074: ba 00 28 00 mv r5,r16
8005078: ba 20 38 00 mv r7,r17
800507c: d9 a0 00 00 call r13
8005080: e3 ff ff 91 bi 8004ec4 <_Heap_Walk+0x278>
);
return false;
}
if ( !prev_used ) {
8005084: 5e 40 00 06 bne r18,r0,800509c <_Heap_Walk+0x450>
(*printer)(
8005088: 78 03 08 01 mvhi r3,0x801
800508c: b9 c0 08 00 mv r1,r14
8005090: 34 02 00 01 mvi r2,1
8005094: 38 63 45 50 ori r3,r3,0x4550
8005098: e0 00 00 30 bi 8005158 <_Heap_Walk+0x50c>
block = next_block;
} while ( block != first_block );
return true;
}
800509c: 29 85 00 08 lw r5,(r12+8)
80050a0: e0 00 00 03 bi 80050ac <_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 ) {
80050a4: 44 af 00 13 be r5,r15,80050f0 <_Heap_Walk+0x4a4>
return true;
}
free_block = free_block->next;
80050a8: 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 ) {
80050ac: 5c ac ff fe bne r5,r12,80050a4 <_Heap_Walk+0x458>
80050b0: e0 00 00 26 bi 8005148 <_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) {
80050b4: 46 40 00 08 be r18,r0,80050d4 <_Heap_Walk+0x488>
(*printer)(
80050b8: 2b 83 00 58 lw r3,(sp+88)
80050bc: b9 c0 08 00 mv r1,r14
80050c0: 34 02 00 00 mvi r2,0
80050c4: b9 e0 20 00 mv r4,r15
80050c8: ba 00 28 00 mv r5,r16
80050cc: d9 a0 00 00 call r13
80050d0: e0 00 00 08 bi 80050f0 <_Heap_Walk+0x4a4>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
80050d4: 2b 83 00 54 lw r3,(sp+84)
80050d8: 29 e6 00 00 lw r6,(r15+0)
80050dc: b9 c0 08 00 mv r1,r14
80050e0: 34 02 00 00 mvi r2,0
80050e4: b9 e0 20 00 mv r4,r15
80050e8: ba 00 28 00 mv r5,r16
80050ec: d9 a0 00 00 call r13
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
80050f0: 5e 91 ff 7b bne r20,r17,8004edc <_Heap_Walk+0x290>
return true;
80050f4: 34 03 00 01 mvi r3,1
}
80050f8: b8 60 08 00 mv r1,r3
80050fc: 2b 9d 00 10 lw ra,(sp+16)
8005100: 2b 8b 00 50 lw r11,(sp+80)
8005104: 2b 8c 00 4c lw r12,(sp+76)
8005108: 2b 8d 00 48 lw r13,(sp+72)
800510c: 2b 8e 00 44 lw r14,(sp+68)
8005110: 2b 8f 00 40 lw r15,(sp+64)
8005114: 2b 90 00 3c lw r16,(sp+60)
8005118: 2b 91 00 38 lw r17,(sp+56)
800511c: 2b 92 00 34 lw r18,(sp+52)
8005120: 2b 93 00 30 lw r19,(sp+48)
8005124: 2b 94 00 2c lw r20,(sp+44)
8005128: 2b 95 00 28 lw r21,(sp+40)
800512c: 2b 96 00 24 lw r22,(sp+36)
8005130: 2b 97 00 20 lw r23,(sp+32)
8005134: 2b 98 00 1c lw r24,(sp+28)
8005138: 2b 99 00 18 lw r25,(sp+24)
800513c: 2b 9b 00 14 lw fp,(sp+20)
8005140: 37 9c 00 60 addi sp,sp,96
8005144: c3 a0 00 00 ret
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
8005148: 78 03 08 01 mvhi r3,0x801
800514c: b9 c0 08 00 mv r1,r14
8005150: 34 02 00 01 mvi r2,1
8005154: 38 63 45 c0 ori r3,r3,0x45c0
8005158: b9 e0 20 00 mv r4,r15
800515c: d9 a0 00 00 call r13
8005160: e3 ff ff 59 bi 8004ec4 <_Heap_Walk+0x278>
08004534 <_IO_Manager_initialization>:
* workspace.
*
*/
void _IO_Manager_initialization(void)
{
8004534: 37 9c ff e8 addi sp,sp,-24
8004538: 5b 8b 00 18 sw (sp+24),r11
800453c: 5b 8c 00 14 sw (sp+20),r12
8004540: 5b 8d 00 10 sw (sp+16),r13
8004544: 5b 8e 00 0c sw (sp+12),r14
8004548: 5b 8f 00 08 sw (sp+8),r15
800454c: 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;
8004550: 78 01 08 01 mvhi r1,0x801
8004554: 38 21 90 dc ori r1,r1,0x90dc
drivers_in_table = Configuration.number_of_device_drivers;
8004558: 28 2d 00 30 lw r13,(r1+48)
number_of_drivers = Configuration.maximum_drivers;
800455c: 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;
8004560: 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 )
8004564: 51 ab 00 03 bgeu r13,r11,8004570 <_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 ) {
8004568: 5d 6d 00 0a bne r11,r13,8004590 <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN
800456c: e0 00 00 02 bi 8004574 <_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 )
8004570: 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;
8004574: 78 01 08 01 mvhi r1,0x801
8004578: 38 21 a2 ac ori r1,r1,0xa2ac
800457c: 58 2e 00 00 sw (r1+0),r14
_IO_Number_of_drivers = number_of_drivers;
8004580: 78 01 08 01 mvhi r1,0x801
8004584: 38 21 a2 a8 ori r1,r1,0xa2a8
8004588: 58 2b 00 00 sw (r1+0),r11
return;
800458c: e0 00 00 27 bi 8004628 <_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 )
8004590: 34 02 00 01 mvi r2,1
8004594: b9 60 08 00 mv r1,r11
8004598: f8 00 4a 5e calli 8016f10 <__ashlsi3>
800459c: 34 02 00 03 mvi r2,3
80045a0: b4 2b 08 00 add r1,r1,r11
80045a4: f8 00 4a 5b calli 8016f10 <__ashlsi3>
80045a8: 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(
80045ac: f8 00 0e 58 calli 8007f0c <_Workspace_Allocate_or_fatal_error>
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
80045b0: 78 02 08 01 mvhi r2,0x801
80045b4: 38 42 a2 a8 ori r2,r2,0xa2a8
/*
* 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 *)
80045b8: 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;
80045bc: 58 4b 00 00 sw (r2+0),r11
memset(
80045c0: 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 *)
80045c4: 39 8c a2 ac ori r12,r12,0xa2ac
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
memset(
80045c8: 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 *)
80045cc: 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(
80045d0: f8 00 36 9f calli 801204c <memset>
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
80045d4: 34 03 00 00 mvi r3,0
80045d8: 34 04 00 00 mvi r4,0
80045dc: e0 00 00 12 bi 8004624 <_IO_Manager_initialization+0xf0>
_IO_Driver_address_table[index] = driver_table[index];
80045e0: 29 82 00 00 lw r2,(r12+0)
* registration. The driver table is now allocated in the
* workspace.
*
*/
void _IO_Manager_initialization(void)
80045e4: 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];
80045e8: 28 29 00 00 lw r9,(r1+0)
80045ec: 28 28 00 04 lw r8,(r1+4)
80045f0: 28 27 00 08 lw r7,(r1+8)
80045f4: 28 26 00 0c lw r6,(r1+12)
80045f8: 28 25 00 10 lw r5,(r1+16)
80045fc: 28 21 00 14 lw r1,(r1+20)
8004600: b4 43 10 00 add r2,r2,r3
8004604: 58 49 00 00 sw (r2+0),r9
8004608: 58 48 00 04 sw (r2+4),r8
800460c: 58 47 00 08 sw (r2+8),r7
8004610: 58 46 00 0c sw (r2+12),r6
8004614: 58 45 00 10 sw (r2+16),r5
8004618: 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++ )
800461c: 34 84 00 01 addi r4,r4,1
8004620: 34 63 00 18 addi r3,r3,24
8004624: 55 a4 ff ef bgu r13,r4,80045e0 <_IO_Manager_initialization+0xac>
_IO_Driver_address_table[index] = driver_table[index];
}
8004628: 2b 9d 00 04 lw ra,(sp+4)
800462c: 2b 8b 00 18 lw r11,(sp+24)
8004630: 2b 8c 00 14 lw r12,(sp+20)
8004634: 2b 8d 00 10 lw r13,(sp+16)
8004638: 2b 8e 00 0c lw r14,(sp+12)
800463c: 2b 8f 00 08 lw r15,(sp+8)
8004640: 37 9c 00 18 addi sp,sp,24
8004644: c3 a0 00 00 ret
0800567c <_Objects_Allocate>:
*/
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
800567c: 37 9c ff ec addi sp,sp,-20
8005680: 5b 8b 00 14 sw (sp+20),r11
8005684: 5b 8c 00 10 sw (sp+16),r12
8005688: 5b 8d 00 0c sw (sp+12),r13
800568c: 5b 8e 00 08 sw (sp+8),r14
8005690: 5b 9d 00 04 sw (sp+4),ra
8005694: 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 )
8005698: 28 21 00 18 lw r1,(r1+24)
return NULL;
800569c: 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 )
80056a0: 44 20 00 1e be r1,r0,8005718 <_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 );
80056a4: 35 6d 00 20 addi r13,r11,32
80056a8: b9 a0 08 00 mv r1,r13
80056ac: fb ff fd 3d calli 8004ba0 <_Chain_Get>
80056b0: b8 20 60 00 mv r12,r1
80056b4: b8 20 70 00 mv r14,r1
if ( information->auto_extend ) {
80056b8: 41 61 00 12 lbu r1,(r11+18)
80056bc: 44 20 00 17 be r1,r0,8005718 <_Objects_Allocate+0x9c>
/*
* If the list is empty then we are out of objects and need to
* extend information base.
*/
if ( !the_object ) {
80056c0: 5d 80 00 07 bne r12,r0,80056dc <_Objects_Allocate+0x60>
_Objects_Extend_information( information );
80056c4: b9 60 08 00 mv r1,r11
80056c8: f8 00 00 32 calli 8005790 <_Objects_Extend_information>
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
80056cc: b9 a0 08 00 mv r1,r13
80056d0: fb ff fd 34 calli 8004ba0 <_Chain_Get>
80056d4: b8 20 60 00 mv r12,r1
}
if ( the_object ) {
80056d8: 44 2e 00 10 be r1,r14,8005718 <_Objects_Allocate+0x9c>
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
80056dc: 2d 82 00 0a lhu r2,(r12+10)
80056e0: 2d 61 00 0a lhu r1,(r11+10)
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
80056e4: c8 41 08 00 sub r1,r2,r1
80056e8: 2d 62 00 14 lhu r2,(r11+20)
80056ec: f8 00 46 e3 calli 8017278 <__udivsi3>
information->inactive_per_block[ block ]--;
80056f0: 34 02 00 02 mvi r2,2
80056f4: f8 00 46 07 calli 8016f10 <__ashlsi3>
80056f8: 29 62 00 30 lw r2,(r11+48)
80056fc: b4 41 08 00 add r1,r2,r1
8005700: 28 22 00 00 lw r2,(r1+0)
8005704: 34 42 ff ff addi r2,r2,-1
8005708: 58 22 00 00 sw (r1+0),r2
information->inactive--;
800570c: 2d 61 00 2c lhu r1,(r11+44)
8005710: 34 21 ff ff addi r1,r1,-1
8005714: 0d 61 00 2c sh (r11+44),r1
);
}
#endif
return the_object;
}
8005718: b9 80 08 00 mv r1,r12
800571c: 2b 9d 00 04 lw ra,(sp+4)
8005720: 2b 8b 00 14 lw r11,(sp+20)
8005724: 2b 8c 00 10 lw r12,(sp+16)
8005728: 2b 8d 00 0c lw r13,(sp+12)
800572c: 2b 8e 00 08 lw r14,(sp+8)
8005730: 37 9c 00 14 addi sp,sp,20
8005734: c3 a0 00 00 ret
0800ef14 <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint16_t the_class
)
{
800ef14: 37 9c ff ec addi sp,sp,-20
800ef18: 5b 8b 00 14 sw (sp+20),r11
800ef1c: 5b 8c 00 10 sw (sp+16),r12
800ef20: 5b 8d 00 0c sw (sp+12),r13
800ef24: 5b 8e 00 08 sw (sp+8),r14
800ef28: 5b 9d 00 04 sw (sp+4),ra
800ef2c: 20 4c ff ff andi r12,r2,0xffff
800ef30: b8 20 70 00 mv r14,r1
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
return NULL;
800ef34: 34 0b 00 00 mvi r11,0
)
{
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
800ef38: 45 80 00 16 be r12,r0,800ef90 <_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 );
800ef3c: f8 00 08 9a calli 80111a4 <_Objects_API_maximum_class>
if ( the_class_api_maximum == 0 )
800ef40: 44 20 00 14 be r1,r0,800ef90 <_Objects_Get_information+0x7c>
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
800ef44: 55 81 00 13 bgu r12,r1,800ef90 <_Objects_Get_information+0x7c>
return NULL;
if ( !_Objects_Information_table[ the_api ] )
800ef48: 78 0d 08 01 mvhi r13,0x801
800ef4c: b9 c0 08 00 mv r1,r14
800ef50: 34 02 00 02 mvi r2,2
800ef54: 39 ad 99 2c ori r13,r13,0x992c
800ef58: f8 00 1f ee calli 8016f10 <__ashlsi3>
800ef5c: b5 a1 08 00 add r1,r13,r1
800ef60: 28 2d 00 00 lw r13,(r1+0)
800ef64: 45 a0 00 0b be r13,r0,800ef90 <_Objects_Get_information+0x7c><== NEVER TAKEN
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
800ef68: b9 80 08 00 mv r1,r12
800ef6c: 34 02 00 02 mvi r2,2
800ef70: f8 00 1f e8 calli 8016f10 <__ashlsi3>
800ef74: b5 a1 08 00 add r1,r13,r1
800ef78: 28 2b 00 00 lw r11,(r1+0)
if ( !info )
800ef7c: 45 60 00 05 be r11,r0,800ef90 <_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 )
800ef80: 2d 61 00 10 lhu r1,(r11+16)
return NULL;
800ef84: 7c 21 00 00 cmpnei r1,r1,0
800ef88: c8 01 08 00 sub r1,r0,r1
800ef8c: a1 61 58 00 and r11,r11,r1
#endif
return info;
}
800ef90: b9 60 08 00 mv r1,r11
800ef94: 2b 9d 00 04 lw ra,(sp+4)
800ef98: 2b 8b 00 14 lw r11,(sp+20)
800ef9c: 2b 8c 00 10 lw r12,(sp+16)
800efa0: 2b 8d 00 0c lw r13,(sp+12)
800efa4: 2b 8e 00 08 lw r14,(sp+8)
800efa8: 37 9c 00 14 addi sp,sp,20
800efac: c3 a0 00 00 ret
08017954 <_Objects_Get_no_protection>:
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
8017954: 37 9c ff f4 addi sp,sp,-12
8017958: 5b 8b 00 0c sw (sp+12),r11
801795c: 5b 8c 00 08 sw (sp+8),r12
8017960: 5b 9d 00 04 sw (sp+4),ra
8017964: 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;
8017968: 28 21 00 08 lw r1,(r1+8)
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
801796c: 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;
8017970: c8 41 08 00 sub r1,r2,r1
if ( information->maximum >= index ) {
8017974: 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;
8017978: 34 21 00 01 addi r1,r1,1
if ( information->maximum >= index ) {
801797c: 54 22 00 09 bgu r1,r2,80179a0 <_Objects_Get_no_protection+0x4c>
if ( (the_object = information->local_table[ index ]) != NULL ) {
8017980: 28 8c 00 1c lw r12,(r4+28)
8017984: 34 02 00 02 mvi r2,2
8017988: fb ff d9 5b calli 800def4 <__ashlsi3>
801798c: b5 81 08 00 add r1,r12,r1
8017990: 28 21 00 00 lw r1,(r1+0)
8017994: 44 20 00 03 be r1,r0,80179a0 <_Objects_Get_no_protection+0x4c><== NEVER TAKEN
*location = OBJECTS_LOCAL;
8017998: 59 60 00 00 sw (r11+0),r0
return the_object;
801799c: e0 00 00 04 bi 80179ac <_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;
80179a0: 34 01 00 01 mvi r1,1
80179a4: 59 61 00 00 sw (r11+0),r1
return NULL;
80179a8: 34 01 00 00 mvi r1,0
}
80179ac: 2b 9d 00 04 lw ra,(sp+4)
80179b0: 2b 8b 00 0c lw r11,(sp+12)
80179b4: 2b 8c 00 08 lw r12,(sp+8)
80179b8: 37 9c 00 0c addi sp,sp,12
80179bc: c3 a0 00 00 ret
08006278 <_Objects_Id_to_name>:
*/
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
8006278: 37 9c ff e8 addi sp,sp,-24
800627c: 5b 8b 00 14 sw (sp+20),r11
8006280: 5b 8c 00 10 sw (sp+16),r12
8006284: 5b 8d 00 0c sw (sp+12),r13
8006288: 5b 8e 00 08 sw (sp+8),r14
800628c: 5b 9d 00 04 sw (sp+4),ra
8006290: b8 40 70 00 mv r14,r2
/*
* Caller is trusted for name != NULL.
*/
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
8006294: b8 20 58 00 mv r11,r1
8006298: 5c 20 00 05 bne r1,r0,80062ac <_Objects_Id_to_name+0x34>
800629c: 78 01 08 02 mvhi r1,0x802
80062a0: 38 21 0e 0c ori r1,r1,0xe0c
80062a4: 28 21 00 0c lw r1,(r1+12)
80062a8: 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);
80062ac: 34 02 00 18 mvi r2,24
80062b0: b9 60 08 00 mv r1,r11
80062b4: f8 00 58 76 calli 801c48c <__lshrsi3>
80062b8: 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 )
80062bc: 34 23 ff ff addi r3,r1,-1
80062c0: 34 02 00 02 mvi r2,2
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
80062c4: 34 0d 00 03 mvi r13,3
80062c8: 54 62 00 14 bgu r3,r2,8006318 <_Objects_Id_to_name+0xa0>
80062cc: e0 00 00 1b bi 8006338 <_Objects_Id_to_name+0xc0>
*/
RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
Objects_Id id
)
{
return (uint32_t)
80062d0: 34 02 00 1b mvi r2,27
80062d4: b9 60 08 00 mv r1,r11
80062d8: f8 00 58 6d calli 801c48c <__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 ];
80062dc: 34 02 00 02 mvi r2,2
80062e0: fb ff ec d7 calli 800163c <__ashlsi3>
80062e4: b5 81 08 00 add r1,r12,r1
80062e8: 28 21 00 00 lw r1,(r1+0)
if ( !information )
80062ec: 44 20 00 0b be r1,r0,8006318 <_Objects_Id_to_name+0xa0> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
80062f0: 40 2c 00 38 lbu r12,(r1+56)
80062f4: 5d 80 00 09 bne r12,r0,8006318 <_Objects_Id_to_name+0xa0> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#endif
the_object = _Objects_Get( information, tmpId, &ignored_location );
80062f8: b9 60 10 00 mv r2,r11
80062fc: 37 83 00 18 addi r3,sp,24
8006300: fb ff ff b8 calli 80061e0 <_Objects_Get>
if ( !the_object )
8006304: 44 2c 00 05 be r1,r12,8006318 <_Objects_Id_to_name+0xa0>
return OBJECTS_INVALID_ID;
*name = the_object->name;
8006308: 28 21 00 0c lw r1,(r1+12)
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
800630c: 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;
8006310: 59 c1 00 00 sw (r14+0),r1
_Thread_Enable_dispatch();
8006314: f8 00 03 dc calli 8007284 <_Thread_Enable_dispatch>
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
}
8006318: b9 a0 08 00 mv r1,r13
800631c: 2b 9d 00 04 lw ra,(sp+4)
8006320: 2b 8b 00 14 lw r11,(sp+20)
8006324: 2b 8c 00 10 lw r12,(sp+16)
8006328: 2b 8d 00 0c lw r13,(sp+12)
800632c: 2b 8e 00 08 lw r14,(sp+8)
8006330: 37 9c 00 18 addi sp,sp,24
8006334: 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 ] )
8006338: 78 0c 08 02 mvhi r12,0x802
800633c: 34 02 00 02 mvi r2,2
8006340: 39 8c 08 fc ori r12,r12,0x8fc
8006344: fb ff ec be calli 800163c <__ashlsi3>
8006348: b5 81 08 00 add r1,r12,r1
800634c: 28 2c 00 00 lw r12,(r1+0)
8006350: 5d 80 ff e0 bne r12,r0,80062d0 <_Objects_Id_to_name+0x58>
8006354: e3 ff ff f1 bi 8006318 <_Objects_Id_to_name+0xa0>
08005ca4 <_Objects_Initialize_information>:
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8005ca4: 37 9c ff e4 addi sp,sp,-28
8005ca8: 5b 8b 00 1c sw (sp+28),r11
8005cac: 5b 8c 00 18 sw (sp+24),r12
8005cb0: 5b 8d 00 14 sw (sp+20),r13
8005cb4: 5b 8e 00 10 sw (sp+16),r14
8005cb8: 5b 8f 00 0c sw (sp+12),r15
8005cbc: 5b 90 00 08 sw (sp+8),r16
8005cc0: 5b 9d 00 04 sw (sp+4),ra
8005cc4: 20 6d ff ff andi r13,r3,0xffff
8005cc8: b8 20 58 00 mv r11,r1
8005ccc: 20 a5 ff ff andi r5,r5,0xffff
uint32_t index;
#endif
information->the_api = the_api;
information->the_class = the_class;
information->size = size;
8005cd0: 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;
8005cd4: 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;
8005cd8: 59 62 00 00 sw (r11+0),r2
information->the_class = the_class;
8005cdc: 0c 2d 00 04 sh (r1+4),r13
information->size = size;
information->local_table = 0;
8005ce0: 58 20 00 1c sw (r1+28),r0
information->inactive_per_block = 0;
8005ce4: 58 20 00 30 sw (r1+48),r0
information->object_blocks = 0;
8005ce8: 58 20 00 34 sw (r1+52),r0
information->inactive = 0;
8005cec: 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;
8005cf0: 0c 20 00 10 sh (r1+16),r0
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8005cf4: 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;
8005cf8: b8 40 08 00 mv r1,r2
8005cfc: 78 0f 08 01 mvhi r15,0x801
8005d00: 34 02 00 02 mvi r2,2
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8005d04: b8 80 60 00 mv r12,r4
8005d08: 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;
8005d0c: 39 ef 99 2c ori r15,r15,0x992c
8005d10: f8 00 44 80 calli 8016f10 <__ashlsi3>
8005d14: b5 e1 08 00 add r1,r15,r1
8005d18: 28 2f 00 00 lw r15,(r1+0)
8005d1c: 34 02 00 02 mvi r2,2
8005d20: b9 a0 08 00 mv r1,r13
8005d24: f8 00 44 7b calli 8016f10 <__ashlsi3>
8005d28: b5 e1 08 00 add r1,r15,r1
8005d2c: 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;
8005d30: 34 02 00 1f mvi r2,31
8005d34: b9 80 08 00 mv r1,r12
8005d38: f8 00 44 c4 calli 8017048 <__lshrsi3>
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
8005d3c: 78 03 08 01 mvhi r3,0x801
8005d40: 38 63 81 68 ori r3,r3,0x8168
/*
* Are we operating in limited or unlimited (e.g. auto-extend) mode.
*/
information->auto_extend =
(maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false;
8005d44: 20 22 00 ff andi r2,r1,0xff
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
8005d48: 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 =
8005d4c: 31 62 00 12 sb (r11+18),r2
(maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false;
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
8005d50: a1 81 60 00 and r12,r12,r1
/*
* Unlimited and maximum of zero is illogical.
*/
if ( information->auto_extend && maximum_per_allocation == 0) {
8005d54: 44 40 00 06 be r2,r0,8005d6c <_Objects_Initialize_information+0xc8>
8005d58: 5d 80 00 05 bne r12,r0,8005d6c <_Objects_Initialize_information+0xc8><== ALWAYS TAKEN
_Internal_error_Occurred(
8005d5c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
8005d60: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8005d64: 34 03 00 13 mvi r3,19 <== NOT EXECUTED
8005d68: fb ff fe 14 calli 80055b8 <_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;
8005d6c: 78 01 08 01 mvhi r1,0x801
8005d70: 38 21 97 54 ori r1,r1,0x9754
8005d74: 59 61 00 1c sw (r11+28),r1
8005d78: 34 02 00 18 mvi r2,24
8005d7c: b9 c0 08 00 mv r1,r14
}
/*
* The allocation unit is the maximum value
*/
information->allocation_size = maximum_per_allocation;
8005d80: 0d 6c 00 14 sh (r11+20),r12
8005d84: f8 00 44 63 calli 8016f10 <__ashlsi3>
8005d88: 78 0e 00 01 mvhi r14,0x1
8005d8c: b8 2e 70 00 or r14,r1,r14
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
8005d90: 34 02 00 1b mvi r2,27
8005d94: b9 a0 08 00 mv r1,r13
8005d98: f8 00 44 5e calli 8016f10 <__ashlsi3>
information->local_table = &null_local_table;
/*
* Calculate minimum and maximum Id's
*/
minimum_index = (maximum_per_allocation == 0) ? 0 : 1;
8005d9c: 7d 82 00 00 cmpnei r2,r12,0
8005da0: 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) |
8005da4: b8 22 08 00 or r1,r1,r2
information->minimum_id =
8005da8: 59 61 00 08 sw (r11+8),r1
* lengths that may be an odd number of bytes.
*/
name_length = maximum_name_length;
#if defined(RTEMS_POSIX_API)
if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) )
8005dac: 22 01 00 03 andi r1,r16,0x3
8005db0: ba 00 38 00 mv r7,r16
8005db4: 44 20 00 04 be r1,r0,8005dc4 <_Objects_Initialize_information+0x120>
name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
8005db8: 36 07 00 04 addi r7,r16,4
8005dbc: 34 01 ff fc mvi r1,-4
8005dc0: a0 e1 38 00 and r7,r7,r1
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
8005dc4: 35 61 00 24 addi r1,r11,36
head->next = tail;
8005dc8: 59 61 00 20 sw (r11+32),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
8005dcc: 35 61 00 20 addi r1,r11,32
~(OBJECTS_NAME_ALIGNMENT-1);
#endif
information->name_length = name_length;
8005dd0: 0d 67 00 3a sh (r11+58),r7
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
8005dd4: 59 60 00 24 sw (r11+36),r0
tail->previous = head;
8005dd8: 59 61 00 28 sw (r11+40),r1
_Chain_Initialize_empty( &information->Inactive );
/*
* Initialize objects .. if there are any
*/
if ( maximum_per_allocation ) {
8005ddc: 45 80 00 03 be r12,r0,8005de8 <_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 );
8005de0: b9 60 08 00 mv r1,r11
8005de4: fb ff fe 6b calli 8005790 <_Objects_Extend_information>
_Chain_Initialize_empty( &information->global_table[ index ] );
}
else
information->global_table = NULL;
#endif
}
8005de8: 2b 9d 00 04 lw ra,(sp+4)
8005dec: 2b 8b 00 1c lw r11,(sp+28)
8005df0: 2b 8c 00 18 lw r12,(sp+24)
8005df4: 2b 8d 00 14 lw r13,(sp+20)
8005df8: 2b 8e 00 10 lw r14,(sp+16)
8005dfc: 2b 8f 00 0c lw r15,(sp+12)
8005e00: 2b 90 00 08 lw r16,(sp+8)
8005e04: 37 9c 00 1c addi sp,sp,28
8005e08: c3 a0 00 00 ret
08003f80 <_POSIX_Condition_variables_Wait_support>:
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
8003f80: 37 9c ff e0 addi sp,sp,-32
8003f84: 5b 8b 00 1c sw (sp+28),r11
8003f88: 5b 8c 00 18 sw (sp+24),r12
8003f8c: 5b 8d 00 14 sw (sp+20),r13
8003f90: 5b 8e 00 10 sw (sp+16),r14
8003f94: 5b 8f 00 0c sw (sp+12),r15
8003f98: 5b 90 00 08 sw (sp+8),r16
8003f9c: 5b 9d 00 04 sw (sp+4),ra
8003fa0: b8 20 70 00 mv r14,r1
8003fa4: b8 40 60 00 mv r12,r2
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
8003fa8: b8 40 08 00 mv r1,r2
8003fac: 37 82 00 20 addi r2,sp,32
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
8003fb0: b8 60 78 00 mv r15,r3
8003fb4: 20 90 00 ff andi r16,r4,0xff
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
8003fb8: f8 00 00 62 calli 8004140 <_POSIX_Mutex_Get>
return EINVAL;
8003fbc: 34 0b 00 16 mvi r11,22
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
8003fc0: 44 20 00 33 be r1,r0,800408c <_POSIX_Condition_variables_Wait_support+0x10c><== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
8003fc4: 78 05 08 01 mvhi r5,0x801
8003fc8: 38 a5 78 d8 ori r5,r5,0x78d8
8003fcc: 28 a1 00 00 lw r1,(r5+0)
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
8003fd0: 37 82 00 20 addi r2,sp,32
8003fd4: 34 21 ff ff addi r1,r1,-1
8003fd8: 58 a1 00 00 sw (r5+0),r1
8003fdc: b9 c0 08 00 mv r1,r14
8003fe0: fb ff ff 4d calli 8003d14 <_POSIX_Condition_variables_Get>
switch ( location ) {
8003fe4: 2b 85 00 20 lw r5,(sp+32)
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
8003fe8: b8 20 68 00 mv r13,r1
switch ( location ) {
8003fec: 5c a0 00 28 bne r5,r0,800408c <_POSIX_Condition_variables_Wait_support+0x10c><== NEVER TAKEN
case OBJECTS_LOCAL:
if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
8003ff0: 28 21 00 14 lw r1,(r1+20)
8003ff4: 44 25 00 05 be r1,r5,8004008 <_POSIX_Condition_variables_Wait_support+0x88>
8003ff8: 29 82 00 00 lw r2,(r12+0)
8003ffc: 44 22 00 03 be r1,r2,8004008 <_POSIX_Condition_variables_Wait_support+0x88>
_Thread_Enable_dispatch();
8004000: f8 00 0e 61 calli 8007984 <_Thread_Enable_dispatch>
return EINVAL;
8004004: e0 00 00 22 bi 800408c <_POSIX_Condition_variables_Wait_support+0x10c>
}
(void) pthread_mutex_unlock( mutex );
8004008: b9 80 08 00 mv r1,r12
800400c: f8 00 01 17 calli 8004468 <pthread_mutex_unlock>
_Thread_Enable_dispatch();
return EINVAL;
}
*/
if ( !already_timedout ) {
8004010: 5e 00 00 19 bne r16,r0,8004074 <_POSIX_Condition_variables_Wait_support+0xf4>
the_cond->Mutex = *mutex;
8004014: 29 81 00 00 lw r1,(r12+0)
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
8004018: 78 0b 08 01 mvhi r11,0x801
800401c: 39 6b 7d 84 ori r11,r11,0x7d84
8004020: 29 64 00 0c lw r4,(r11+12)
return EINVAL;
}
*/
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
8004024: 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;
8004028: 34 01 00 01 mvi r1,1
800402c: 59 a1 00 48 sw (r13+72),r1
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
8004030: 58 80 00 34 sw (r4+52),r0
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
_Thread_Executing->Wait.id = *cond;
8004034: 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;
8004038: 35 ad 00 18 addi r13,r13,24
_Thread_Executing->Wait.id = *cond;
_Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
800403c: 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;
8004040: 58 81 00 20 sw (r4+32),r1
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;
8004044: 58 8d 00 44 sw (r4+68),r13
_Thread_Executing->Wait.id = *cond;
_Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
8004048: b9 a0 08 00 mv r1,r13
800404c: b9 e0 10 00 mv r2,r15
8004050: 38 63 83 d8 ori r3,r3,0x83d8
8004054: f8 00 0f 76 calli 8007e2c <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
8004058: f8 00 0e 4b calli 8007984 <_Thread_Enable_dispatch>
* a POSIX signal, then pthread_cond_wait returns spuriously,
* according to the POSIX standard. It means that pthread_cond_wait
* returns a success status, except for the fact that it was not
* woken up a pthread_cond_signal or a pthread_cond_broadcast.
*/
status = _Thread_Executing->Wait.return_code;
800405c: 29 61 00 0c lw r1,(r11+12)
8004060: 28 2b 00 34 lw r11,(r1+52)
if ( status == EINTR )
status = 0;
8004064: 7d 61 00 04 cmpnei r1,r11,4
8004068: c8 01 08 00 sub r1,r0,r1
800406c: a1 61 58 00 and r11,r11,r1
8004070: e0 00 00 03 bi 800407c <_POSIX_Condition_variables_Wait_support+0xfc>
} else {
_Thread_Enable_dispatch();
8004074: f8 00 0e 44 calli 8007984 <_Thread_Enable_dispatch>
status = ETIMEDOUT;
8004078: 34 0b 00 74 mvi r11,116
/*
* When we get here the dispatch disable level is 0.
*/
mutex_status = pthread_mutex_lock( mutex );
800407c: b9 80 08 00 mv r1,r12
8004080: f8 00 00 c7 calli 800439c <pthread_mutex_lock>
if ( mutex_status )
8004084: 44 20 00 02 be r1,r0,800408c <_POSIX_Condition_variables_Wait_support+0x10c>
return EINVAL;
8004088: 34 0b 00 16 mvi r11,22
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
800408c: b9 60 08 00 mv r1,r11
8004090: 2b 9d 00 04 lw ra,(sp+4)
8004094: 2b 8b 00 1c lw r11,(sp+28)
8004098: 2b 8c 00 18 lw r12,(sp+24)
800409c: 2b 8d 00 14 lw r13,(sp+20)
80040a0: 2b 8e 00 10 lw r14,(sp+16)
80040a4: 2b 8f 00 0c lw r15,(sp+12)
80040a8: 2b 90 00 08 lw r16,(sp+8)
80040ac: 37 9c 00 20 addi sp,sp,32
80040b0: c3 a0 00 00 ret
08008da8 <_POSIX_Message_queue_Receive_support>:
size_t msg_len,
unsigned int *msg_prio,
bool wait,
Watchdog_Interval timeout
)
{
8008da8: 37 9c ff dc addi sp,sp,-36
8008dac: 5b 8b 00 18 sw (sp+24),r11
8008db0: 5b 8c 00 14 sw (sp+20),r12
8008db4: 5b 8d 00 10 sw (sp+16),r13
8008db8: 5b 8e 00 0c sw (sp+12),r14
8008dbc: 5b 8f 00 08 sw (sp+8),r15
8008dc0: 5b 9d 00 04 sw (sp+4),ra
8008dc4: 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(
8008dc8: 78 01 08 02 mvhi r1,0x802
8008dcc: b8 40 60 00 mv r12,r2
8008dd0: b8 60 78 00 mv r15,r3
8008dd4: b9 60 10 00 mv r2,r11
8008dd8: 38 21 a2 58 ori r1,r1,0xa258
8008ddc: 37 83 00 24 addi r3,sp,36
8008de0: 5b 86 00 1c sw (sp+28),r6
8008de4: b8 80 68 00 mv r13,r4
8008de8: 20 ae 00 ff andi r14,r5,0xff
8008dec: f8 00 0c c0 calli 800c0ec <_Objects_Get>
Objects_Locations location;
size_t length_out;
bool do_wait;
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
8008df0: 2b 82 00 24 lw r2,(sp+36)
8008df4: 2b 86 00 1c lw r6,(sp+28)
8008df8: 5c 40 00 2f bne r2,r0,8008eb4 <_POSIX_Message_queue_Receive_support+0x10c>
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
8008dfc: 28 28 00 14 lw r8,(r1+20)
8008e00: 34 02 00 01 mvi r2,1
8008e04: 21 03 00 03 andi r3,r8,0x3
8008e08: 5c 62 00 03 bne r3,r2,8008e14 <_POSIX_Message_queue_Receive_support+0x6c>
_Thread_Enable_dispatch();
8008e0c: f8 00 10 b1 calli 800d0d0 <_Thread_Enable_dispatch>
8008e10: e0 00 00 29 bi 8008eb4 <_POSIX_Message_queue_Receive_support+0x10c>
rtems_set_errno_and_return_minus_one( EBADF );
}
the_mq = the_mq_fd->Queue;
8008e14: 28 27 00 10 lw r7,(r1+16)
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
8008e18: 28 e1 00 68 lw r1,(r7+104)
8008e1c: 51 e1 00 05 bgeu r15,r1,8008e30 <_POSIX_Message_queue_Receive_support+0x88>
_Thread_Enable_dispatch();
8008e20: f8 00 10 ac calli 800d0d0 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EMSGSIZE );
8008e24: f8 00 2e cb calli 8014950 <__errno>
8008e28: 34 02 00 7a mvi r2,122
8008e2c: e0 00 00 24 bi 8008ebc <_POSIX_Message_queue_Receive_support+0x114>
/*
* Now if something goes wrong, we return a "length" of -1
* to indicate an error.
*/
length_out = -1;
8008e30: 34 01 ff ff mvi r1,-1
8008e34: 5b 81 00 20 sw (sp+32),r1
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
8008e38: 34 05 00 00 mvi r5,0
8008e3c: 45 c0 00 03 be r14,r0,8008e48 <_POSIX_Message_queue_Receive_support+0xa0><== NEVER TAKEN
do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true;
8008e40: 21 05 40 00 andi r5,r8,0x4000
8008e44: 64 a5 00 00 cmpei r5,r5,0
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
8008e48: b9 60 10 00 mv r2,r11
timeout
);
_Thread_Enable_dispatch();
*msg_prio =
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
8008e4c: 78 0b 08 02 mvhi r11,0x802
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
8008e50: 34 e1 00 1c addi r1,r7,28
8008e54: b9 80 18 00 mv r3,r12
8008e58: 37 84 00 20 addi r4,sp,32
timeout
);
_Thread_Enable_dispatch();
*msg_prio =
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
8008e5c: 39 6b a2 c4 ori r11,r11,0xa2c4
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
8008e60: f8 00 07 86 calli 800ac78 <_CORE_message_queue_Seize>
&length_out,
do_wait,
timeout
);
_Thread_Enable_dispatch();
8008e64: f8 00 10 9b calli 800d0d0 <_Thread_Enable_dispatch>
*msg_prio =
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
8008e68: 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);
8008e6c: 34 02 00 1f mvi r2,31
8008e70: 29 81 00 24 lw r1,(r12+36)
8008e74: f8 00 6e 14 calli 80246c4 <__ashrsi3>
8008e78: 29 82 00 24 lw r2,(r12+36)
8008e7c: 98 22 10 00 xor r2,r1,r2
8008e80: c8 41 08 00 sub r1,r2,r1
do_wait,
timeout
);
_Thread_Enable_dispatch();
*msg_prio =
8008e84: 59 a1 00 00 sw (r13+0),r1
_POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count);
if ( !_Thread_Executing->Wait.return_code )
8008e88: 29 81 00 34 lw r1,(r12+52)
8008e8c: 5c 20 00 03 bne r1,r0,8008e98 <_POSIX_Message_queue_Receive_support+0xf0>
return length_out;
8008e90: 2b 81 00 20 lw r1,(sp+32)
8008e94: e0 00 00 0c bi 8008ec4 <_POSIX_Message_queue_Receive_support+0x11c>
rtems_set_errno_and_return_minus_one(
8008e98: f8 00 2e ae calli 8014950 <__errno>
8008e9c: b8 20 60 00 mv r12,r1
8008ea0: 29 61 00 0c lw r1,(r11+12)
8008ea4: 28 21 00 34 lw r1,(r1+52)
8008ea8: f8 00 00 b9 calli 800918c <_POSIX_Message_queue_Translate_core_message_queue_return_code>
8008eac: 59 81 00 00 sw (r12+0),r1
8008eb0: e0 00 00 04 bi 8008ec0 <_POSIX_Message_queue_Receive_support+0x118>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
8008eb4: f8 00 2e a7 calli 8014950 <__errno>
8008eb8: 34 02 00 09 mvi r2,9
8008ebc: 58 22 00 00 sw (r1+0),r2
8008ec0: 34 01 ff ff mvi r1,-1
}
8008ec4: 2b 9d 00 04 lw ra,(sp+4)
8008ec8: 2b 8b 00 18 lw r11,(sp+24)
8008ecc: 2b 8c 00 14 lw r12,(sp+20)
8008ed0: 2b 8d 00 10 lw r13,(sp+16)
8008ed4: 2b 8e 00 0c lw r14,(sp+12)
8008ed8: 2b 8f 00 08 lw r15,(sp+8)
8008edc: 37 9c 00 24 addi sp,sp,36
8008ee0: c3 a0 00 00 ret
08008870 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>:
#include <rtems/posix/pthread.h>
void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(
Thread_Control *the_thread
)
{
8008870: 37 9c ff fc addi sp,sp,-4
8008874: 5b 9d 00 04 sw (sp+4),ra
POSIX_API_Control *thread_support;
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
8008878: 28 22 01 20 lw r2,(r1+288)
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
800887c: 28 43 00 d8 lw r3,(r2+216)
8008880: 5c 60 00 0e bne r3,r0,80088b8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48><== NEVER TAKEN
8008884: 28 44 00 dc lw r4,(r2+220)
8008888: 34 03 00 01 mvi r3,1
800888c: 5c 83 00 0b bne r4,r3,80088b8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48>
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
8008890: 28 42 00 e0 lw r2,(r2+224)
8008894: 44 40 00 09 be r2,r0,80088b8 <_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;
8008898: 78 02 08 01 mvhi r2,0x801
800889c: 38 42 58 c8 ori r2,r2,0x58c8
80088a0: 28 43 00 00 lw r3,(r2+0)
80088a4: 34 63 ff ff addi r3,r3,-1
80088a8: 58 43 00 00 sw (r2+0),r3
thread_support->cancelation_requested ) {
_Thread_Unnest_dispatch();
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
80088ac: 34 02 ff ff mvi r2,-1
80088b0: f8 00 02 62 calli 8009238 <_POSIX_Thread_Exit>
80088b4: e0 00 00 02 bi 80088bc <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x4c>
} else
_Thread_Enable_dispatch();
80088b8: fb ff f3 5a calli 8005620 <_Thread_Enable_dispatch>
}
80088bc: 2b 9d 00 04 lw ra,(sp+4)
80088c0: 37 9c 00 04 addi sp,sp,4
80088c4: c3 a0 00 00 ret
0800a1e4 <_POSIX_Thread_Translate_sched_param>:
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
800a1e4: 37 9c ff e8 addi sp,sp,-24
800a1e8: 5b 8b 00 18 sw (sp+24),r11
800a1ec: 5b 8c 00 14 sw (sp+20),r12
800a1f0: 5b 8d 00 10 sw (sp+16),r13
800a1f4: 5b 8e 00 0c sw (sp+12),r14
800a1f8: 5b 8f 00 08 sw (sp+8),r15
800a1fc: 5b 9d 00 04 sw (sp+4),ra
800a200: b8 20 68 00 mv r13,r1
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a204: 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
)
{
800a208: b8 40 58 00 mv r11,r2
800a20c: b8 60 70 00 mv r14,r3
800a210: b8 80 78 00 mv r15,r4
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a214: fb ff ff ec calli 800a1c4 <_POSIX_Priority_Is_valid>
return EINVAL;
800a218: 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 ) )
800a21c: 44 20 00 2a be r1,r0,800a2c4 <_POSIX_Thread_Translate_sched_param+0xe0><== NEVER TAKEN
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
800a220: 59 c0 00 00 sw (r14+0),r0
*budget_callout = NULL;
800a224: 59 e0 00 00 sw (r15+0),r0
if ( policy == SCHED_OTHER ) {
800a228: 5d a0 00 04 bne r13,r0,800a238 <_POSIX_Thread_Translate_sched_param+0x54>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
800a22c: 34 01 00 01 mvi r1,1
800a230: 59 c1 00 00 sw (r14+0),r1
800a234: e0 00 00 23 bi 800a2c0 <_POSIX_Thread_Translate_sched_param+0xdc>
return 0;
}
if ( policy == SCHED_FIFO ) {
800a238: 34 01 00 01 mvi r1,1
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
800a23c: 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 ) {
800a240: 45 a1 00 21 be r13,r1,800a2c4 <_POSIX_Thread_Translate_sched_param+0xe0>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
}
if ( policy == SCHED_RR ) {
800a244: 34 01 00 02 mvi r1,2
800a248: 5d a1 00 03 bne r13,r1,800a254 <_POSIX_Thread_Translate_sched_param+0x70>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
800a24c: 59 cd 00 00 sw (r14+0),r13
return 0;
800a250: e0 00 00 1d bi 800a2c4 <_POSIX_Thread_Translate_sched_param+0xe0>
}
if ( policy == SCHED_SPORADIC ) {
800a254: 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;
800a258: 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 ) {
800a25c: 5d a1 00 1a bne r13,r1,800a2c4 <_POSIX_Thread_Translate_sched_param+0xe0>
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
800a260: 29 61 00 08 lw r1,(r11+8)
800a264: 5c 20 00 03 bne r1,r0,800a270 <_POSIX_Thread_Translate_sched_param+0x8c>
800a268: 29 62 00 0c lw r2,(r11+12)
800a26c: 44 41 00 16 be r2,r1,800a2c4 <_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) &&
800a270: 29 61 00 10 lw r1,(r11+16)
800a274: 5c 20 00 04 bne r1,r0,800a284 <_POSIX_Thread_Translate_sched_param+0xa0>
800a278: 29 62 00 14 lw r2,(r11+20)
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
800a27c: 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) &&
800a280: 44 41 00 11 be r2,r1,800a2c4 <_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 ) <
800a284: 35 61 00 08 addi r1,r11,8
800a288: fb ff f4 98 calli 80074e8 <_Timespec_To_ticks>
800a28c: b8 20 68 00 mv r13,r1
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
800a290: 35 61 00 10 addi r1,r11,16
800a294: fb ff f4 95 calli 80074e8 <_Timespec_To_ticks>
return EINVAL;
800a298: 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 ) <
800a29c: 54 2d 00 0a bgu r1,r13,800a2c4 <_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 ) )
800a2a0: 29 61 00 04 lw r1,(r11+4)
800a2a4: fb ff ff c8 calli 800a1c4 <_POSIX_Priority_Is_valid>
800a2a8: 44 20 00 07 be r1,r0,800a2c4 <_POSIX_Thread_Translate_sched_param+0xe0>
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
800a2ac: 34 01 00 03 mvi r1,3
800a2b0: 59 c1 00 00 sw (r14+0),r1
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
800a2b4: 78 01 08 00 mvhi r1,0x800
800a2b8: 38 21 38 2c ori r1,r1,0x382c
800a2bc: 59 e1 00 00 sw (r15+0),r1
return 0;
800a2c0: 34 0c 00 00 mvi r12,0
}
return EINVAL;
}
800a2c4: b9 80 08 00 mv r1,r12
800a2c8: 2b 9d 00 04 lw ra,(sp+4)
800a2cc: 2b 8b 00 18 lw r11,(sp+24)
800a2d0: 2b 8c 00 14 lw r12,(sp+20)
800a2d4: 2b 8d 00 10 lw r13,(sp+16)
800a2d8: 2b 8e 00 0c lw r14,(sp+12)
800a2dc: 2b 8f 00 08 lw r15,(sp+8)
800a2e0: 37 9c 00 18 addi sp,sp,24
800a2e4: c3 a0 00 00 ret
080034ac <_POSIX_Threads_Initialize_user_threads_body>:
*
* Output parameters: NONE
*/
void _POSIX_Threads_Initialize_user_threads_body(void)
{
80034ac: 37 9c ff a8 addi sp,sp,-88
80034b0: 5b 8b 00 14 sw (sp+20),r11
80034b4: 5b 8c 00 10 sw (sp+16),r12
80034b8: 5b 8d 00 0c sw (sp+12),r13
80034bc: 5b 8e 00 08 sw (sp+8),r14
80034c0: 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;
80034c4: 78 01 08 01 mvhi r1,0x801
80034c8: 38 21 f0 d8 ori r1,r1,0xf0d8
maximum = Configuration_POSIX_API.number_of_initialization_threads;
80034cc: 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;
80034d0: 28 2c 00 34 lw r12,(r1+52)
maximum = Configuration_POSIX_API.number_of_initialization_threads;
if ( !user_threads || maximum == 0 )
80034d4: 65 c2 00 00 cmpei r2,r14,0
80034d8: 65 81 00 00 cmpei r1,r12,0
80034dc: b8 41 08 00 or r1,r2,r1
80034e0: 5c 20 00 18 bne r1,r0,8003540 <_POSIX_Threads_Initialize_user_threads_body+0x94><== NEVER TAKEN
80034e4: 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 );
80034e8: 37 8b 00 18 addi r11,sp,24
80034ec: b9 60 08 00 mv r1,r11
80034f0: f8 00 1b 7e calli 800a2e8 <pthread_attr_init>
(void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
80034f4: 34 02 00 02 mvi r2,2
80034f8: b9 60 08 00 mv r1,r11
80034fc: f8 00 1b 88 calli 800a31c <pthread_attr_setinheritsched>
(void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
8003500: 29 82 00 04 lw r2,(r12+4)
8003504: b9 60 08 00 mv r1,r11
8003508: f8 00 1b 91 calli 800a34c <pthread_attr_setstacksize>
status = pthread_create(
800350c: 29 83 00 00 lw r3,(r12+0)
8003510: 37 81 00 58 addi r1,sp,88
8003514: b9 60 10 00 mv r2,r11
8003518: 34 04 00 00 mvi r4,0
800351c: fb ff fe ed calli 80030d0 <pthread_create>
8003520: b8 20 18 00 mv r3,r1
&thread_id,
&attr,
user_threads[ index ].thread_entry,
NULL
);
if ( status )
8003524: 44 20 00 04 be r1,r0,8003534 <_POSIX_Threads_Initialize_user_threads_body+0x88><== ALWAYS TAKEN
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
8003528: 34 01 00 02 mvi r1,2 <== NOT EXECUTED
800352c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8003530: f8 00 07 19 calli 8005194 <_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++ ) {
8003534: 35 ad 00 01 addi r13,r13,1
8003538: 35 8c 00 08 addi r12,r12,8
800353c: 55 cd ff ec bgu r14,r13,80034ec <_POSIX_Threads_Initialize_user_threads_body+0x40><== NEVER TAKEN
NULL
);
if ( status )
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
}
}
8003540: 2b 9d 00 04 lw ra,(sp+4)
8003544: 2b 8b 00 14 lw r11,(sp+20)
8003548: 2b 8c 00 10 lw r12,(sp+16)
800354c: 2b 8d 00 0c lw r13,(sp+12)
8003550: 2b 8e 00 08 lw r14,(sp+8)
8003554: 37 9c 00 58 addi sp,sp,88
8003558: c3 a0 00 00 ret
0800d670 <_POSIX_Threads_Sporadic_budget_TSR>:
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
800d670: 37 9c ff f4 addi sp,sp,-12
800d674: 5b 8b 00 0c sw (sp+12),r11
800d678: 5b 8c 00 08 sw (sp+8),r12
800d67c: 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 ];
800d680: 28 4c 01 20 lw r12,(r2+288)
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
800d684: 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 );
800d688: 35 81 00 98 addi r1,r12,152
800d68c: f8 00 07 73 calli 800f458 <_Timespec_To_ticks>
the_thread->cpu_time_budget = ticks;
800d690: 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);
800d694: 78 01 08 01 mvhi r1,0x801
800d698: 38 21 90 d8 ori r1,r1,0x90d8
800d69c: 40 21 00 00 lbu r1,(r1+0)
800d6a0: 29 82 00 88 lw r2,(r12+136)
800d6a4: 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 ) {
800d6a8: 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;
800d6ac: 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 ) {
800d6b0: 5c 20 00 06 bne r1,r0,800d6c8 <_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 ) {
800d6b4: 29 61 00 14 lw r1,(r11+20)
800d6b8: 50 41 00 04 bgeu r2,r1,800d6c8 <_POSIX_Threads_Sporadic_budget_TSR+0x58>
_Thread_Change_priority( the_thread, new_priority, true );
800d6bc: b9 60 08 00 mv r1,r11
800d6c0: 34 03 00 01 mvi r3,1
800d6c4: fb ff e4 35 calli 8006798 <_Thread_Change_priority>
#endif
}
}
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period );
800d6c8: 35 81 00 90 addi r1,r12,144
800d6cc: f8 00 07 63 calli 800f458 <_Timespec_To_ticks>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
800d6d0: 59 81 00 b4 sw (r12+180),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800d6d4: 78 01 08 01 mvhi r1,0x801
800d6d8: 38 21 9a 50 ori r1,r1,0x9a50
800d6dc: 35 82 00 a8 addi r2,r12,168
800d6e0: fb ff e9 52 calli 8007c28 <_Watchdog_Insert>
_Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
}
800d6e4: 2b 9d 00 04 lw ra,(sp+4)
800d6e8: 2b 8b 00 0c lw r11,(sp+12)
800d6ec: 2b 8c 00 08 lw r12,(sp+8)
800d6f0: 37 9c 00 0c addi sp,sp,12
800d6f4: c3 a0 00 00 ret
0800d6f8 <_POSIX_Threads_Sporadic_budget_callout>:
* _POSIX_Threads_Sporadic_budget_callout
*/
void _POSIX_Threads_Sporadic_budget_callout(
Thread_Control *the_thread
)
{
800d6f8: 37 9c ff fc addi sp,sp,-4
800d6fc: 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 */
800d700: 34 02 ff ff mvi r2,-1
)
{
POSIX_API_Control *api;
uint32_t new_priority;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
800d704: 28 25 01 20 lw r5,(r1+288)
/*
* 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 */
800d708: 58 22 00 78 sw (r1+120),r2
800d70c: 78 02 08 01 mvhi r2,0x801
800d710: 38 42 90 d8 ori r2,r2,0x90d8
800d714: 40 44 00 00 lbu r4,(r2+0)
800d718: 28 a2 00 8c lw r2,(r5+140)
800d71c: 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 ) {
800d720: 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;
800d724: 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 ) {
800d728: 5c 80 00 05 bne r4,r0,800d73c <_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 ) {
800d72c: 28 23 00 14 lw r3,(r1+20)
800d730: 50 62 00 03 bgeu r3,r2,800d73c <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN
_Thread_Change_priority( the_thread, new_priority, true );
800d734: 34 03 00 01 mvi r3,1
800d738: fb ff e4 18 calli 8006798 <_Thread_Change_priority>
#if 0
printk( "lower priority\n" );
#endif
}
}
}
800d73c: 2b 9d 00 04 lw ra,(sp+4)
800d740: 37 9c 00 04 addi sp,sp,4
800d744: c3 a0 00 00 ret
080031ac <_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)
{
80031ac: 37 9c ff f8 addi sp,sp,-8
80031b0: 5b 8b 00 08 sw (sp+8),r11
80031b4: 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;
80031b8: 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)
{
80031bc: b8 40 58 00 mv r11,r2
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
80031c0: 34 21 00 01 addi r1,r1,1
80031c4: 58 41 00 68 sw (r2+104),r1
/* The timer must be reprogrammed */
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
80031c8: 28 41 00 54 lw r1,(r2+84)
80031cc: 5c 20 00 03 bne r1,r0,80031d8 <_POSIX_Timer_TSR+0x2c>
80031d0: 28 42 00 58 lw r2,(r2+88)
80031d4: 44 41 00 0d be r2,r1,8003208 <_POSIX_Timer_TSR+0x5c> <== NEVER TAKEN
( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) {
activated = _POSIX_Timer_Insert_helper(
80031d8: 29 62 00 64 lw r2,(r11+100)
80031dc: 29 63 00 08 lw r3,(r11+8)
80031e0: 78 04 08 00 mvhi r4,0x800
80031e4: 35 61 00 10 addi r1,r11,16
80031e8: 38 84 31 ac ori r4,r4,0x31ac
80031ec: b9 60 28 00 mv r5,r11
80031f0: f8 00 1a c3 calli 8009cfc <_POSIX_Timer_Insert_helper>
ptimer->ticks,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated )
80031f4: 44 20 00 0b be r1,r0,8003220 <_POSIX_Timer_TSR+0x74> <== NEVER TAKEN
return;
/* Store the time when the timer was started again */
_TOD_Get( &ptimer->time );
80031f8: 35 61 00 6c addi r1,r11,108
80031fc: f8 00 04 7d calli 80043f0 <_TOD_Get>
/* The state really did not change but just to be safe */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
8003200: 34 01 00 03 mvi r1,3
8003204: e0 00 00 02 bi 800320c <_POSIX_Timer_TSR+0x60>
} else {
/* Indicates that the timer is stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
8003208: 34 01 00 04 mvi r1,4 <== NOT EXECUTED
800320c: 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 ) ) {
8003210: 29 62 00 44 lw r2,(r11+68)
8003214: 29 61 00 38 lw r1,(r11+56)
8003218: f8 00 19 6d calli 80097cc <pthread_kill>
}
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
800321c: 59 60 00 68 sw (r11+104),r0
}
8003220: 2b 9d 00 04 lw ra,(sp+4)
8003224: 2b 8b 00 08 lw r11,(sp+8)
8003228: 37 9c 00 08 addi sp,sp,8
800322c: c3 a0 00 00 ret
08010b34 <_POSIX_signals_Check_signal>:
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8010b34: 37 9c ff b0 addi sp,sp,-80
8010b38: 5b 8b 00 1c sw (sp+28),r11
8010b3c: 5b 8c 00 18 sw (sp+24),r12
8010b40: 5b 8d 00 14 sw (sp+20),r13
8010b44: 5b 8e 00 10 sw (sp+16),r14
8010b48: 5b 8f 00 0c sw (sp+12),r15
8010b4c: 5b 90 00 08 sw (sp+8),r16
8010b50: 5b 9d 00 04 sw (sp+4),ra
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8010b54: 37 90 00 48 addi r16,sp,72
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8010b58: 20 64 00 ff andi r4,r3,0xff
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8010b5c: 34 05 00 01 mvi r5,1
8010b60: ba 00 18 00 mv r3,r16
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8010b64: b8 20 68 00 mv r13,r1
8010b68: b8 40 58 00 mv r11,r2
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8010b6c: f8 00 00 37 calli 8010c48 <_POSIX_signals_Clear_signals>
is_global, true ) )
return false;
8010b70: 34 0f 00 00 mvi r15,0
{
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8010b74: 44 20 00 2b be r1,r0,8010c20 <_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 )
8010b78: 34 02 00 01 mvi r2,1
8010b7c: b9 60 08 00 mv r1,r11
8010b80: f8 00 18 e4 calli 8016f10 <__ashlsi3>
8010b84: 78 0c 08 01 mvhi r12,0x801
8010b88: b4 2b 08 00 add r1,r1,r11
8010b8c: 34 02 00 02 mvi r2,2
8010b90: f8 00 18 e0 calli 8016f10 <__ashlsi3>
8010b94: 39 8c 9e 88 ori r12,r12,0x9e88
8010b98: b5 81 60 00 add r12,r12,r1
8010b9c: 29 8e 00 08 lw r14,(r12+8)
8010ba0: 34 01 00 01 mvi r1,1
8010ba4: 45 c1 00 1f be r14,r1,8010c20 <_POSIX_signals_Check_signal+0xec><== NEVER TAKEN
return false;
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
8010ba8: 29 af 00 d0 lw r15,(r13+208)
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
8010bac: 29 81 00 04 lw r1,(r12+4)
/*
* We have to save the blocking information of the current wait queue
* because the signal handler may subsequently go on and put the thread
* on a wait queue, for its own purposes.
*/
memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait,
8010bb0: 34 03 00 28 mvi r3,40
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
8010bb4: b8 2f 08 00 or r1,r1,r15
8010bb8: 59 a1 00 d0 sw (r13+208),r1
/*
* We have to save the blocking information of the current wait queue
* because the signal handler may subsequently go on and put the thread
* on a wait queue, for its own purposes.
*/
memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait,
8010bbc: 78 01 08 01 mvhi r1,0x801
8010bc0: 38 21 9e 3c ori r1,r1,0x9e3c
8010bc4: 28 22 00 0c lw r2,(r1+12)
8010bc8: 37 81 00 20 addi r1,sp,32
8010bcc: 34 42 00 20 addi r2,r2,32
8010bd0: f8 00 04 de calli 8011f48 <memcpy>
sizeof( Thread_Wait_information ));
/*
* Here, the signal handler function executes
*/
switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
8010bd4: 29 82 00 00 lw r2,(r12+0)
8010bd8: 34 01 00 02 mvi r1,2
8010bdc: 5c 41 00 06 bne r2,r1,8010bf4 <_POSIX_signals_Check_signal+0xc0>
case SA_SIGINFO:
(*_POSIX_signals_Vectors[ signo ].sa_sigaction)(
8010be0: b9 60 08 00 mv r1,r11
8010be4: ba 00 10 00 mv r2,r16
8010be8: 34 03 00 00 mvi r3,0
8010bec: d9 c0 00 00 call r14
signo,
&siginfo_struct,
NULL /* context is undefined per 1003.1b-1993, p. 66 */
);
break;
8010bf0: e0 00 00 03 bi 8010bfc <_POSIX_signals_Check_signal+0xc8>
default:
(*_POSIX_signals_Vectors[ signo ].sa_handler)( signo );
8010bf4: b9 60 08 00 mv r1,r11
8010bf8: d9 c0 00 00 call r14
}
/*
* Restore the blocking information
*/
memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information,
8010bfc: 78 01 08 01 mvhi r1,0x801
8010c00: 38 21 9e 3c ori r1,r1,0x9e3c
8010c04: 28 21 00 0c lw r1,(r1+12)
8010c08: 37 82 00 20 addi r2,sp,32
8010c0c: 34 03 00 28 mvi r3,40
8010c10: 34 21 00 20 addi r1,r1,32
8010c14: f8 00 04 cd calli 8011f48 <memcpy>
sizeof( Thread_Wait_information ));
/*
* Restore the previous set of blocked signals
*/
api->signals_blocked = saved_signals_blocked;
8010c18: 59 af 00 d0 sw (r13+208),r15
return true;
8010c1c: 34 0f 00 01 mvi r15,1
}
8010c20: b9 e0 08 00 mv r1,r15
8010c24: 2b 9d 00 04 lw ra,(sp+4)
8010c28: 2b 8b 00 1c lw r11,(sp+28)
8010c2c: 2b 8c 00 18 lw r12,(sp+24)
8010c30: 2b 8d 00 14 lw r13,(sp+20)
8010c34: 2b 8e 00 10 lw r14,(sp+16)
8010c38: 2b 8f 00 0c lw r15,(sp+12)
8010c3c: 2b 90 00 08 lw r16,(sp+8)
8010c40: 37 9c 00 50 addi sp,sp,80
8010c44: c3 a0 00 00 ret
08011308 <_POSIX_signals_Clear_process_signals>:
*/
void _POSIX_signals_Clear_process_signals(
int signo
)
{
8011308: 37 9c ff ec addi sp,sp,-20
801130c: 5b 8b 00 14 sw (sp+20),r11
8011310: 5b 8c 00 10 sw (sp+16),r12
8011314: 5b 8d 00 0c sw (sp+12),r13
8011318: 5b 8e 00 08 sw (sp+8),r14
801131c: 5b 9d 00 04 sw (sp+4),ra
8011320: b8 20 60 00 mv r12,r1
clear_signal = true;
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
8011324: 90 00 68 00 rcsr r13,IE
8011328: 34 01 ff fe mvi r1,-2
801132c: a1 a1 08 00 and r1,r13,r1
8011330: d0 01 00 00 wcsr IE,r1
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
8011334: 34 02 00 01 mvi r2,1
8011338: b9 80 08 00 mv r1,r12
801133c: f8 00 16 f5 calli 8016f10 <__ashlsi3>
8011340: b4 2c 70 00 add r14,r1,r12
8011344: 34 02 00 02 mvi r2,2
8011348: 78 0b 08 01 mvhi r11,0x801
801134c: b9 c0 08 00 mv r1,r14
8011350: f8 00 16 f0 calli 8016f10 <__ashlsi3>
8011354: 39 6b 9e 88 ori r11,r11,0x9e88
8011358: b5 61 08 00 add r1,r11,r1
801135c: 28 22 00 00 lw r2,(r1+0)
8011360: 34 01 00 02 mvi r1,2
8011364: 5c 41 00 0a bne r2,r1,801138c <_POSIX_signals_Clear_process_signals+0x84>
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
}
_ISR_Enable( level );
}
8011368: 34 02 00 02 mvi r2,2
801136c: 78 0b 08 01 mvhi r11,0x801
8011370: b9 c0 08 00 mv r1,r14
8011374: f8 00 16 e7 calli 8016f10 <__ashlsi3>
8011378: 39 6b a0 80 ori r11,r11,0xa080
801137c: b5 61 08 00 add r1,r11,r1
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8011380: 34 22 00 04 addi r2,r1,4
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
8011384: 28 21 00 00 lw r1,(r1+0)
8011388: 5c 22 00 0a bne r1,r2,80113b0 <_POSIX_signals_Clear_process_signals+0xa8><== NEVER TAKEN
801138c: 35 82 ff ff addi r2,r12,-1
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
8011390: 78 0b 08 01 mvhi r11,0x801
8011394: 34 01 00 01 mvi r1,1
8011398: f8 00 16 de calli 8016f10 <__ashlsi3>
801139c: 39 6b a0 7c ori r11,r11,0xa07c
80113a0: 29 62 00 00 lw r2,(r11+0)
80113a4: a4 20 08 00 not r1,r1
80113a8: a0 22 08 00 and r1,r1,r2
80113ac: 59 61 00 00 sw (r11+0),r1
}
_ISR_Enable( level );
80113b0: d0 0d 00 00 wcsr IE,r13
}
80113b4: 2b 9d 00 04 lw ra,(sp+4)
80113b8: 2b 8b 00 14 lw r11,(sp+20)
80113bc: 2b 8c 00 10 lw r12,(sp+16)
80113c0: 2b 8d 00 0c lw r13,(sp+12)
80113c4: 2b 8e 00 08 lw r14,(sp+8)
80113c8: 37 9c 00 14 addi sp,sp,20
80113cc: c3 a0 00 00 ret
08003de8 <_POSIX_signals_Get_lowest>:
#include <rtems/score/isr.h>
int _POSIX_signals_Get_lowest(
sigset_t set
)
{
8003de8: 37 9c ff f0 addi sp,sp,-16
8003dec: 5b 8b 00 10 sw (sp+16),r11
8003df0: 5b 8c 00 0c sw (sp+12),r12
8003df4: 5b 8d 00 08 sw (sp+8),r13
8003df8: 5b 9d 00 04 sw (sp+4),ra
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8003dfc: 34 0b 00 1b mvi r11,27
#include <rtems/score/isr.h>
int _POSIX_signals_Get_lowest(
sigset_t set
)
{
8003e00: b8 20 60 00 mv r12,r1
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8003e04: 34 0d 00 20 mvi r13,32
8003e08: 34 01 00 01 mvi r1,1
8003e0c: 35 62 ff ff addi r2,r11,-1
8003e10: f8 00 67 69 calli 801dbb4 <__ashlsi3>
if ( set & signo_to_mask( signo ) ) {
8003e14: a0 2c 08 00 and r1,r1,r12
8003e18: 5c 20 00 0c bne r1,r0,8003e48 <_POSIX_signals_Get_lowest+0x60><== NEVER TAKEN
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8003e1c: 35 6b 00 01 addi r11,r11,1
8003e20: 5d 6d ff fa bne r11,r13,8003e08 <_POSIX_signals_Get_lowest+0x20>
8003e24: 34 0b 00 01 mvi r11,1
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
8003e28: 34 0d 00 1b mvi r13,27
8003e2c: 34 01 00 01 mvi r1,1
8003e30: 35 62 ff ff addi r2,r11,-1
8003e34: f8 00 67 60 calli 801dbb4 <__ashlsi3>
if ( set & signo_to_mask( signo ) ) {
8003e38: a0 2c 08 00 and r1,r1,r12
8003e3c: 5c 20 00 03 bne r1,r0,8003e48 <_POSIX_signals_Get_lowest+0x60>
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
8003e40: 35 6b 00 01 addi r11,r11,1
8003e44: 5d 6d ff fa bne r11,r13,8003e2c <_POSIX_signals_Get_lowest+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;
}
8003e48: b9 60 08 00 mv r1,r11
8003e4c: 2b 9d 00 04 lw ra,(sp+4)
8003e50: 2b 8b 00 10 lw r11,(sp+16)
8003e54: 2b 8c 00 0c lw r12,(sp+12)
8003e58: 2b 8d 00 08 lw r13,(sp+8)
8003e5c: 37 9c 00 10 addi sp,sp,16
8003e60: c3 a0 00 00 ret
08025f4c <_POSIX_signals_Unblock_thread>:
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
8025f4c: 37 9c ff ec addi sp,sp,-20
8025f50: 5b 8b 00 14 sw (sp+20),r11
8025f54: 5b 8c 00 10 sw (sp+16),r12
8025f58: 5b 8d 00 0c sw (sp+12),r13
8025f5c: 5b 8e 00 08 sw (sp+8),r14
8025f60: 5b 9d 00 04 sw (sp+4),ra
8025f64: b8 20 58 00 mv r11,r1
8025f68: 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 ];
8025f6c: 28 2c 01 20 lw r12,(r1+288)
8025f70: 34 42 ff ff addi r2,r2,-1
8025f74: 34 01 00 01 mvi r1,1
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
8025f78: b8 60 68 00 mv r13,r3
8025f7c: fb ff 6f ca calli 8001ea4 <__ashlsi3>
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
8025f80: 78 03 08 02 mvhi r3,0x802
8025f84: 38 63 77 78 ori r3,r3,0x7778
8025f88: 29 64 00 10 lw r4,(r11+16)
8025f8c: 28 62 00 00 lw r2,(r3+0)
8025f90: a0 82 18 00 and r3,r4,r2
8025f94: 5c 62 00 1c bne r3,r2,8026004 <_POSIX_signals_Unblock_thread+0xb8>
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
8025f98: 29 62 00 30 lw r2,(r11+48)
8025f9c: a0 22 10 00 and r2,r1,r2
8025fa0: 5c 40 00 06 bne r2,r0,8025fb8 <_POSIX_signals_Unblock_thread+0x6c>
8025fa4: 29 82 00 d0 lw r2,(r12+208)
/*
* This should only be reached via pthread_kill().
*/
return false;
8025fa8: 34 0c 00 00 mvi r12,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) ) {
8025fac: a4 40 10 00 not r2,r2
8025fb0: a0 22 08 00 and r1,r1,r2
8025fb4: 44 2c 00 39 be r1,r12,8026098 <_POSIX_signals_Unblock_thread+0x14c>
the_thread->Wait.return_code = EINTR;
8025fb8: 34 01 00 04 mvi r1,4
8025fbc: 59 61 00 34 sw (r11+52),r1
the_info = (siginfo_t *) the_thread->Wait.return_argument;
8025fc0: 29 61 00 28 lw r1,(r11+40)
if ( !info ) {
8025fc4: 5d a0 00 06 bne r13,r0,8025fdc <_POSIX_signals_Unblock_thread+0x90>
the_info->si_signo = signo;
the_info->si_code = SI_USER;
8025fc8: 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;
8025fcc: 58 2e 00 00 sw (r1+0),r14
the_info->si_code = SI_USER;
8025fd0: 58 22 00 04 sw (r1+4),r2
the_info->si_value.sival_int = 0;
8025fd4: 58 20 00 08 sw (r1+8),r0
8025fd8: e0 00 00 07 bi 8025ff4 <_POSIX_signals_Unblock_thread+0xa8>
} else {
*the_info = *info;
8025fdc: 29 a3 00 00 lw r3,(r13+0)
8025fe0: 29 a2 00 04 lw r2,(r13+4)
8025fe4: 29 a4 00 08 lw r4,(r13+8)
8025fe8: 58 23 00 00 sw (r1+0),r3
8025fec: 58 22 00 04 sw (r1+4),r2
8025ff0: 58 24 00 08 sw (r1+8),r4
}
_Thread_queue_Extract_with_proxy( the_thread );
8025ff4: b9 60 08 00 mv r1,r11
8025ff8: fb ff 9a 9b calli 800ca64 <_Thread_queue_Extract_with_proxy>
return true;
8025ffc: 34 0c 00 01 mvi r12,1
8026000: e0 00 00 26 bi 8026098 <_POSIX_signals_Unblock_thread+0x14c>
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
8026004: 29 82 00 d0 lw r2,(r12+208)
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
8026008: 34 0c 00 00 mvi r12,0
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
802600c: a4 40 10 00 not r2,r2
8026010: a0 22 08 00 and r1,r1,r2
8026014: 44 20 00 21 be r1,r0,8026098 <_POSIX_signals_Unblock_thread+0x14c>
8026018: 78 01 10 00 mvhi r1,0x1000
802601c: a0 81 08 00 and r1,r4,r1
* it is not blocked, THEN
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
8026020: 44 20 00 15 be r1,r0,8026074 <_POSIX_signals_Unblock_thread+0x128>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
8026024: 78 02 08 02 mvhi r2,0x802
the_thread->Wait.return_code = EINTR;
8026028: 34 01 00 04 mvi r1,4
802602c: 38 42 75 2c ori r2,r2,0x752c
8026030: 59 61 00 34 sw (r11+52),r1
8026034: 28 41 00 00 lw r1,(r2+0)
8026038: a0 81 08 00 and r1,r4,r1
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
802603c: 44 20 00 04 be r1,r0,802604c <_POSIX_signals_Unblock_thread+0x100>
_Thread_queue_Extract_with_proxy( the_thread );
8026040: b9 60 08 00 mv r1,r11
8026044: fb ff 9a 88 calli 800ca64 <_Thread_queue_Extract_with_proxy>
8026048: e0 00 00 14 bi 8026098 <_POSIX_signals_Unblock_thread+0x14c>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_delaying (
States_Control the_states
)
{
return (the_states & STATES_DELAYING);
802604c: 20 84 00 08 andi r4,r4,0x8
else if ( _States_Is_delaying(the_thread->current_state) ) {
8026050: 44 8c 00 12 be r4,r12,8026098 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN
(void) _Watchdog_Remove( &the_thread->Timer );
8026054: 35 61 00 48 addi r1,r11,72
8026058: fb ff 9d 45 calli 800d56c <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
802605c: 78 03 08 02 mvhi r3,0x802
8026060: 38 63 73 90 ori r3,r3,0x7390
8026064: 28 62 00 00 lw r2,(r3+0)
8026068: b9 60 08 00 mv r1,r11
802606c: fb ff 97 52 calli 800bdb4 <_Thread_Clear_state>
8026070: e0 00 00 0a bi 8026098 <_POSIX_signals_Unblock_thread+0x14c>
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
8026074: 5c 8c 00 09 bne r4,r12,8026098 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
8026078: 78 01 08 02 mvhi r1,0x802
802607c: 38 21 9f 2c ori r1,r1,0x9f2c
8026080: 28 22 00 08 lw r2,(r1+8)
8026084: 44 4c 00 05 be r2,r12,8026098 <_POSIX_signals_Unblock_thread+0x14c>
8026088: 28 22 00 0c lw r2,(r1+12)
802608c: 5d 62 00 03 bne r11,r2,8026098 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN
_Thread_Dispatch_necessary = true;
8026090: 34 02 00 01 mvi r2,1
8026094: 30 22 00 18 sb (r1+24),r2
}
}
return false;
}
8026098: b9 80 08 00 mv r1,r12
802609c: 2b 9d 00 04 lw ra,(sp+4)
80260a0: 2b 8b 00 14 lw r11,(sp+20)
80260a4: 2b 8c 00 10 lw r12,(sp+16)
80260a8: 2b 8d 00 0c lw r13,(sp+12)
80260ac: 2b 8e 00 08 lw r14,(sp+8)
80260b0: 37 9c 00 14 addi sp,sp,20
80260b4: c3 a0 00 00 ret
08004298 <_RTEMS_tasks_Initialize_user_tasks_body>:
*
* Output parameters: NONE
*/
void _RTEMS_tasks_Initialize_user_tasks_body( void )
{
8004298: 37 9c ff e8 addi sp,sp,-24
800429c: 5b 8b 00 14 sw (sp+20),r11
80042a0: 5b 8c 00 10 sw (sp+16),r12
80042a4: 5b 8d 00 0c sw (sp+12),r13
80042a8: 5b 8e 00 08 sw (sp+8),r14
80042ac: 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;
80042b0: 78 01 08 01 mvhi r1,0x801
80042b4: 38 21 90 a4 ori r1,r1,0x90a4
80042b8: 28 2b 00 2c lw r11,(r1+44)
maximum = Configuration_RTEMS_API.number_of_initialization_tasks;
80042bc: 28 2e 00 28 lw r14,(r1+40)
/*
* Verify that we have a set of user tasks to iterate
*/
if ( !user_tasks )
80042c0: 34 0d 00 00 mvi r13,0
80042c4: 5d 60 00 1a bne r11,r0,800432c <_RTEMS_tasks_Initialize_user_tasks_body+0x94>
80042c8: e0 00 00 1a bi 8004330 <_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(
80042cc: 29 61 00 00 lw r1,(r11+0)
80042d0: 29 62 00 08 lw r2,(r11+8)
80042d4: 29 63 00 04 lw r3,(r11+4)
80042d8: 29 64 00 14 lw r4,(r11+20)
80042dc: 29 65 00 0c lw r5,(r11+12)
80042e0: 37 86 00 18 addi r6,sp,24
80042e4: f8 00 26 f1 calli 800dea8 <rtems_task_create>
80042e8: 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 ) )
80042ec: 44 20 00 05 be r1,r0,8004300 <_RTEMS_tasks_Initialize_user_tasks_body+0x68><== ALWAYS TAKEN
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
80042f0: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
80042f4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
80042f8: b9 80 18 00 mv r3,r12 <== NOT EXECUTED
80042fc: e0 00 00 0a bi 8004324 <_RTEMS_tasks_Initialize_user_tasks_body+0x8c><== NOT EXECUTED
return_value = rtems_task_start(
8004300: 29 63 00 18 lw r3,(r11+24)
8004304: 29 62 00 10 lw r2,(r11+16)
8004308: 2b 81 00 18 lw r1,(sp+24)
800430c: 35 6b 00 1c addi r11,r11,28
8004310: f8 00 00 0f calli 800434c <rtems_task_start>
8004314: b8 20 18 00 mv r3,r1
id,
user_tasks[ index ].entry_point,
user_tasks[ index ].argument
);
if ( !rtems_is_status_successful( return_value ) )
8004318: 44 2c 00 04 be r1,r12,8004328 <_RTEMS_tasks_Initialize_user_tasks_body+0x90>
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
800431c: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8004320: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8004324: f8 00 04 a5 calli 80055b8 <_Internal_error_Occurred> <== NOT EXECUTED
return;
/*
* Now iterate over the initialization tasks and create/start them.
*/
for ( index=0 ; index < maximum ; index++ ) {
8004328: 35 ad 00 01 addi r13,r13,1
800432c: 55 cd ff e8 bgu r14,r13,80042cc <_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 );
}
}
8004330: 2b 9d 00 04 lw ra,(sp+4)
8004334: 2b 8b 00 14 lw r11,(sp+20)
8004338: 2b 8c 00 10 lw r12,(sp+16)
800433c: 2b 8d 00 0c lw r13,(sp+12)
8004340: 2b 8e 00 08 lw r14,(sp+8)
8004344: 37 9c 00 18 addi sp,sp,24
8004348: c3 a0 00 00 ret
08004634 <_Rate_monotonic_Timeout>:
void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
)
{
8004634: 37 9c ff f4 addi sp,sp,-12
8004638: 5b 8b 00 08 sw (sp+8),r11
800463c: 5b 9d 00 04 sw (sp+4),ra
8004640: b8 20 10 00 mv r2,r1
8004644: 78 01 08 02 mvhi r1,0x802
8004648: 38 21 19 00 ori r1,r1,0x1900
800464c: 37 83 00 0c addi r3,sp,12
8004650: f8 00 08 dd calli 80069c4 <_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 ) {
8004654: 2b 82 00 0c lw r2,(sp+12)
8004658: b8 20 58 00 mv r11,r1
800465c: 5c 40 00 22 bne r2,r0,80046e4 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN
case OBJECTS_LOCAL:
the_thread = the_period->owner;
8004660: 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);
8004664: 28 23 00 10 lw r3,(r1+16)
8004668: 20 63 40 00 andi r3,r3,0x4000
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
800466c: 44 62 00 09 be r3,r2,8004690 <_Rate_monotonic_Timeout+0x5c>
8004670: 28 23 00 20 lw r3,(r1+32)
8004674: 29 62 00 08 lw r2,(r11+8)
8004678: 5c 62 00 06 bne r3,r2,8004690 <_Rate_monotonic_Timeout+0x5c>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800467c: 78 03 08 01 mvhi r3,0x801
8004680: 38 63 eb b4 ori r3,r3,0xebb4
8004684: 28 62 00 00 lw r2,(r3+0)
8004688: f8 00 0b dd calli 80075fc <_Thread_Clear_state>
800468c: e0 00 00 06 bi 80046a4 <_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 ) {
8004690: 29 62 00 38 lw r2,(r11+56)
8004694: 34 01 00 01 mvi r1,1
8004698: 5c 41 00 0c bne r2,r1,80046c8 <_Rate_monotonic_Timeout+0x94><== ALWAYS TAKEN
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
800469c: 34 01 00 03 mvi r1,3 <== NOT EXECUTED
80046a0: 59 61 00 38 sw (r11+56),r1 <== NOT EXECUTED
_Rate_monotonic_Initiate_statistics( the_period );
80046a4: b9 60 08 00 mv r1,r11
80046a8: fb ff fe 2e calli 8003f60 <_Rate_monotonic_Initiate_statistics>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80046ac: 29 61 00 3c lw r1,(r11+60)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80046b0: 35 62 00 10 addi r2,r11,16
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80046b4: 59 61 00 1c sw (r11+28),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80046b8: 78 01 08 02 mvhi r1,0x802
80046bc: 38 21 1a e8 ori r1,r1,0x1ae8
80046c0: f8 00 11 3b calli 8008bac <_Watchdog_Insert>
80046c4: e0 00 00 03 bi 80046d0 <_Rate_monotonic_Timeout+0x9c>
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
80046c8: 34 01 00 04 mvi r1,4
80046cc: 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;
80046d0: 78 01 08 02 mvhi r1,0x802
80046d4: 38 21 1a 28 ori r1,r1,0x1a28
80046d8: 28 22 00 00 lw r2,(r1+0)
80046dc: 34 42 ff ff addi r2,r2,-1
80046e0: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
80046e4: 2b 9d 00 04 lw ra,(sp+4)
80046e8: 2b 8b 00 08 lw r11,(sp+8)
80046ec: 37 9c 00 0c addi sp,sp,12
80046f0: c3 a0 00 00 ret
08003ff4 <_Rate_monotonic_Update_statistics>:
void _Rate_monotonic_Update_statistics(
Rate_monotonic_Control *the_period
)
{
8003ff4: 37 9c ff e4 addi sp,sp,-28
8003ff8: 5b 8b 00 0c sw (sp+12),r11
8003ffc: 5b 8c 00 08 sw (sp+8),r12
8004000: 5b 9d 00 04 sw (sp+4),ra
8004004: b8 20 58 00 mv r11,r1
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8004008: 28 21 00 54 lw r1,(r1+84)
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
800400c: 29 62 00 38 lw r2,(r11+56)
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8004010: 34 21 00 01 addi r1,r1,1
8004014: 59 61 00 54 sw (r11+84),r1
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
8004018: 34 01 00 04 mvi r1,4
800401c: 5c 41 00 04 bne r2,r1,800402c <_Rate_monotonic_Update_statistics+0x38>
stats->missed_count++;
8004020: 29 61 00 58 lw r1,(r11+88)
8004024: 34 21 00 01 addi r1,r1,1
8004028: 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 );
800402c: 37 8c 00 18 addi r12,sp,24
stats->missed_count++;
/*
* Grab status for time statistics.
*/
valid_status =
8004030: b9 60 08 00 mv r1,r11
8004034: 37 82 00 10 addi r2,sp,16
8004038: b9 80 18 00 mv r3,r12
800403c: fb ff ff 90 calli 8003e7c <_Rate_monotonic_Get_status>
_Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
if (!valid_status)
8004040: 44 20 00 28 be r1,r0,80040e0 <_Rate_monotonic_Update_statistics+0xec><== NEVER TAKEN
/*
* Update CPU time
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Add_to( &stats->total_cpu_time, &executed );
8004044: b9 80 10 00 mv r2,r12
8004048: 35 61 00 6c addi r1,r11,108
800404c: f8 00 11 75 calli 8008620 <_Timespec_Add_to>
if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) )
8004050: b9 80 08 00 mv r1,r12
8004054: 35 62 00 5c addi r2,r11,92
8004058: f8 00 11 d0 calli 8008798 <_Timespec_Less_than>
800405c: 44 20 00 05 be r1,r0,8004070 <_Rate_monotonic_Update_statistics+0x7c>
stats->min_cpu_time = executed;
8004060: 2b 81 00 18 lw r1,(sp+24)
8004064: 59 61 00 5c sw (r11+92),r1
8004068: 2b 81 00 1c lw r1,(sp+28)
800406c: 59 61 00 60 sw (r11+96),r1
if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
8004070: 37 81 00 18 addi r1,sp,24
8004074: 35 62 00 64 addi r2,r11,100
8004078: f8 00 11 bd calli 800876c <_Timespec_Greater_than>
800407c: 44 20 00 05 be r1,r0,8004090 <_Rate_monotonic_Update_statistics+0x9c>
stats->max_cpu_time = executed;
8004080: 2b 81 00 18 lw r1,(sp+24)
8004084: 59 61 00 64 sw (r11+100),r1
8004088: 2b 81 00 1c lw r1,(sp+28)
800408c: 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 );
8004090: 37 8c 00 10 addi r12,sp,16
8004094: b9 80 10 00 mv r2,r12
8004098: 35 61 00 84 addi r1,r11,132
800409c: f8 00 11 61 calli 8008620 <_Timespec_Add_to>
if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
80040a0: b9 80 08 00 mv r1,r12
80040a4: 35 62 00 74 addi r2,r11,116
80040a8: f8 00 11 bc calli 8008798 <_Timespec_Less_than>
80040ac: 44 20 00 05 be r1,r0,80040c0 <_Rate_monotonic_Update_statistics+0xcc>
stats->min_wall_time = since_last_period;
80040b0: 2b 81 00 10 lw r1,(sp+16)
80040b4: 59 61 00 74 sw (r11+116),r1
80040b8: 2b 81 00 14 lw r1,(sp+20)
80040bc: 59 61 00 78 sw (r11+120),r1
if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
80040c0: 37 81 00 10 addi r1,sp,16
80040c4: 35 62 00 7c addi r2,r11,124
80040c8: f8 00 11 a9 calli 800876c <_Timespec_Greater_than>
80040cc: 44 20 00 05 be r1,r0,80040e0 <_Rate_monotonic_Update_statistics+0xec>
stats->max_wall_time = since_last_period;
80040d0: 2b 81 00 10 lw r1,(sp+16)
80040d4: 59 61 00 7c sw (r11+124),r1
80040d8: 2b 81 00 14 lw r1,(sp+20)
80040dc: 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
}
80040e0: 2b 9d 00 04 lw ra,(sp+4)
80040e4: 2b 8b 00 0c lw r11,(sp+12)
80040e8: 2b 8c 00 08 lw r12,(sp+8)
80040ec: 37 9c 00 1c addi sp,sp,28
80040f0: c3 a0 00 00 ret
08006108 <_Scheduler_priority_Block>:
#include <rtems/score/thread.h>
void _Scheduler_priority_Block(
Thread_Control *the_thread
)
{
8006108: 37 9c ff ec addi sp,sp,-20
800610c: 5b 8b 00 14 sw (sp+20),r11
8006110: 5b 8c 00 10 sw (sp+16),r12
8006114: 5b 8d 00 0c sw (sp+12),r13
8006118: 5b 8e 00 08 sw (sp+8),r14
800611c: 5b 9d 00 04 sw (sp+4),ra
8006120: b8 20 60 00 mv r12,r1
)
{
Scheduler_priority_Per_thread *sched_info;
Chain_Control *ready;
sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info;
8006124: 28 21 00 8c lw r1,(r1+140)
ready = sched_info->ready_chain;
8006128: 28 22 00 00 lw r2,(r1+0)
if ( _Chain_Has_only_one_node( ready ) ) {
800612c: 28 44 00 00 lw r4,(r2+0)
8006130: 28 43 00 08 lw r3,(r2+8)
8006134: 5c 83 00 12 bne r4,r3,800617c <_Scheduler_priority_Block+0x74>
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
8006138: 34 43 00 04 addi r3,r2,4
head->next = tail;
800613c: 58 43 00 00 sw (r2+0),r3
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove (
Priority_bit_map_Information *the_priority_map
)
{
*the_priority_map->minor &= the_priority_map->block_minor;
8006140: 28 23 00 04 lw r3,(r1+4)
head->previous = NULL;
8006144: 58 40 00 04 sw (r2+4),r0
tail->previous = head;
8006148: 58 42 00 08 sw (r2+8),r2
800614c: 2c 24 00 0e lhu r4,(r1+14)
8006150: 2c 62 00 00 lhu r2,(r3+0)
8006154: a0 44 10 00 and r2,r2,r4
8006158: 0c 62 00 00 sh (r3+0),r2
if ( *the_priority_map->minor == 0 )
800615c: 5c 40 00 0c bne r2,r0,800618c <_Scheduler_priority_Block+0x84>
_Priority_Major_bit_map &= the_priority_map->block_major;
8006160: 78 02 08 01 mvhi r2,0x801
8006164: 38 42 9e 58 ori r2,r2,0x9e58
8006168: 2c 43 00 00 lhu r3,(r2+0)
800616c: 2c 21 00 0c lhu r1,(r1+12)
8006170: a0 23 08 00 and r1,r1,r3
8006174: 0c 41 00 00 sh (r2+0),r1
8006178: e0 00 00 05 bi 800618c <_Scheduler_priority_Block+0x84>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
800617c: 29 82 00 00 lw r2,(r12+0)
previous = the_node->previous;
8006180: 29 81 00 04 lw r1,(r12+4)
next->previous = previous;
8006184: 58 41 00 04 sw (r2+4),r1
previous->next = next;
8006188: 58 22 00 00 sw (r1+0),r2
RTEMS_INLINE_ROUTINE bool _Thread_Is_heir (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Heir );
800618c: 78 01 08 01 mvhi r1,0x801
8006190: 38 21 9e 3c ori r1,r1,0x9e3c
_Scheduler_priority_Ready_queue_extract( the_thread );
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
8006194: 28 21 00 10 lw r1,(r1+16)
8006198: 5d 81 00 3b bne r12,r1,8006284 <_Scheduler_priority_Block+0x17c>
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
(Chain_Control *) _Scheduler.information
800619c: 78 01 08 01 mvhi r1,0x801
RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void )
{
Priority_bit_map_Control minor;
Priority_bit_map_Control major;
_Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
80061a0: 78 02 08 01 mvhi r2,0x801
80061a4: 38 21 90 1c ori r1,r1,0x901c
80061a8: 38 42 9e 58 ori r2,r2,0x9e58
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
80061ac: 28 2e 00 00 lw r14,(r1+0)
80061b0: 2c 41 00 00 lhu r1,(r2+0)
80061b4: 78 0b 08 01 mvhi r11,0x801
80061b8: 34 02 00 ff mvi r2,255
80061bc: 20 21 ff ff andi r1,r1,0xffff
80061c0: 39 6b 80 04 ori r11,r11,0x8004
80061c4: 54 22 00 05 bgu r1,r2,80061d8 <_Scheduler_priority_Block+0xd0>
80061c8: b5 61 58 00 add r11,r11,r1
80061cc: 41 6d 00 00 lbu r13,(r11+0)
80061d0: 35 ad 00 08 addi r13,r13,8
80061d4: e0 00 00 05 bi 80061e8 <_Scheduler_priority_Block+0xe0>
80061d8: 34 02 00 08 mvi r2,8
80061dc: f8 00 43 9b calli 8017048 <__lshrsi3>
80061e0: b5 61 58 00 add r11,r11,r1
80061e4: 41 6d 00 00 lbu r13,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
80061e8: 34 02 00 01 mvi r2,1
80061ec: 78 0b 08 01 mvhi r11,0x801
80061f0: b9 a0 08 00 mv r1,r13
80061f4: f8 00 43 47 calli 8016f10 <__ashlsi3>
80061f8: 39 6b 9e 60 ori r11,r11,0x9e60
80061fc: b5 61 58 00 add r11,r11,r1
8006200: 2d 62 00 00 lhu r2,(r11+0)
8006204: 34 01 00 ff mvi r1,255
8006208: 78 0b 08 01 mvhi r11,0x801
800620c: 39 6b 80 04 ori r11,r11,0x8004
8006210: 54 41 00 05 bgu r2,r1,8006224 <_Scheduler_priority_Block+0x11c>
8006214: b5 62 58 00 add r11,r11,r2
8006218: 41 6b 00 00 lbu r11,(r11+0)
800621c: 35 6b 00 08 addi r11,r11,8
8006220: e0 00 00 06 bi 8006238 <_Scheduler_priority_Block+0x130>
8006224: b8 40 08 00 mv r1,r2
8006228: 34 02 00 08 mvi r2,8
800622c: f8 00 43 87 calli 8017048 <__lshrsi3>
8006230: b5 61 58 00 add r11,r11,r1
8006234: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
8006238: 34 02 00 04 mvi r2,4
800623c: b9 a0 08 00 mv r1,r13
8006240: f8 00 43 34 calli 8016f10 <__ashlsi3>
8006244: b5 61 58 00 add r11,r11,r1
Chain_Control *the_ready_queue
)
{
Priority_Control index = _Priority_bit_map_Get_highest();
if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) )
8006248: 34 02 00 01 mvi r2,1
800624c: b9 60 08 00 mv r1,r11
8006250: f8 00 43 30 calli 8016f10 <__ashlsi3>
8006254: 34 02 00 02 mvi r2,2
8006258: b4 2b 08 00 add r1,r1,r11
800625c: f8 00 43 2d calli 8016f10 <__ashlsi3>
8006260: b5 c1 08 00 add r1,r14,r1
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
8006264: 28 23 00 00 lw r3,(r1+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8006268: 34 21 00 04 addi r1,r1,4
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
800626c: 34 02 00 00 mvi r2,0
Chain_Control *the_ready_queue
)
{
Priority_Control index = _Priority_bit_map_Get_highest();
if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) )
8006270: 44 61 00 02 be r3,r1,8006278 <_Scheduler_priority_Block+0x170><== NEVER TAKEN
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
8006274: b8 60 10 00 mv r2,r3
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8006278: 78 01 08 01 mvhi r1,0x801
800627c: 38 21 9e 3c ori r1,r1,0x9e3c
8006280: 58 22 00 10 sw (r1+16),r2
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
8006284: 78 01 08 01 mvhi r1,0x801
8006288: 38 21 9e 3c ori r1,r1,0x9e3c
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
800628c: 28 22 00 0c lw r2,(r1+12)
8006290: 5d 82 00 03 bne r12,r2,800629c <_Scheduler_priority_Block+0x194>
_Thread_Dispatch_necessary = true;
8006294: 34 02 00 01 mvi r2,1
8006298: 30 22 00 18 sb (r1+24),r2
}
800629c: 2b 9d 00 04 lw ra,(sp+4)
80062a0: 2b 8b 00 14 lw r11,(sp+20)
80062a4: 2b 8c 00 10 lw r12,(sp+16)
80062a8: 2b 8d 00 0c lw r13,(sp+12)
80062ac: 2b 8e 00 08 lw r14,(sp+8)
80062b0: 37 9c 00 14 addi sp,sp,20
80062b4: c3 a0 00 00 ret
0800648c <_Scheduler_priority_Schedule>:
#include <rtems/system.h>
#include <rtems/score/scheduler.h>
#include <rtems/score/schedulerpriority.h>
void _Scheduler_priority_Schedule(void)
{
800648c: 37 9c ff f0 addi sp,sp,-16
8006490: 5b 8b 00 10 sw (sp+16),r11
8006494: 5b 8c 00 0c sw (sp+12),r12
8006498: 5b 8d 00 08 sw (sp+8),r13
800649c: 5b 9d 00 04 sw (sp+4),ra
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
(Chain_Control *) _Scheduler.information
80064a0: 78 01 08 01 mvhi r1,0x801
RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void )
{
Priority_bit_map_Control minor;
Priority_bit_map_Control major;
_Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
80064a4: 78 02 08 01 mvhi r2,0x801
80064a8: 38 21 90 1c ori r1,r1,0x901c
80064ac: 38 42 9e 58 ori r2,r2,0x9e58
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
80064b0: 28 2d 00 00 lw r13,(r1+0)
80064b4: 2c 41 00 00 lhu r1,(r2+0)
80064b8: 78 0b 08 01 mvhi r11,0x801
80064bc: 34 02 00 ff mvi r2,255
80064c0: 20 21 ff ff andi r1,r1,0xffff
80064c4: 39 6b 80 04 ori r11,r11,0x8004
80064c8: 54 22 00 05 bgu r1,r2,80064dc <_Scheduler_priority_Schedule+0x50>
80064cc: b5 61 58 00 add r11,r11,r1
80064d0: 41 6c 00 00 lbu r12,(r11+0)
80064d4: 35 8c 00 08 addi r12,r12,8
80064d8: e0 00 00 05 bi 80064ec <_Scheduler_priority_Schedule+0x60>
80064dc: 34 02 00 08 mvi r2,8
80064e0: f8 00 42 da calli 8017048 <__lshrsi3>
80064e4: b5 61 58 00 add r11,r11,r1
80064e8: 41 6c 00 00 lbu r12,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
80064ec: 34 02 00 01 mvi r2,1
80064f0: 78 0b 08 01 mvhi r11,0x801
80064f4: b9 80 08 00 mv r1,r12
80064f8: f8 00 42 86 calli 8016f10 <__ashlsi3>
80064fc: 39 6b 9e 60 ori r11,r11,0x9e60
8006500: b5 61 58 00 add r11,r11,r1
8006504: 2d 62 00 00 lhu r2,(r11+0)
8006508: 34 01 00 ff mvi r1,255
800650c: 78 0b 08 01 mvhi r11,0x801
8006510: 39 6b 80 04 ori r11,r11,0x8004
8006514: 54 41 00 05 bgu r2,r1,8006528 <_Scheduler_priority_Schedule+0x9c>
8006518: b5 62 58 00 add r11,r11,r2
800651c: 41 6b 00 00 lbu r11,(r11+0)
8006520: 35 6b 00 08 addi r11,r11,8
8006524: e0 00 00 06 bi 800653c <_Scheduler_priority_Schedule+0xb0>
8006528: b8 40 08 00 mv r1,r2
800652c: 34 02 00 08 mvi r2,8
8006530: f8 00 42 c6 calli 8017048 <__lshrsi3>
8006534: b5 61 58 00 add r11,r11,r1
8006538: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
800653c: 34 02 00 04 mvi r2,4
8006540: b9 80 08 00 mv r1,r12
8006544: f8 00 42 73 calli 8016f10 <__ashlsi3>
8006548: b5 61 58 00 add r11,r11,r1
Chain_Control *the_ready_queue
)
{
Priority_Control index = _Priority_bit_map_Get_highest();
if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) )
800654c: 34 02 00 01 mvi r2,1
8006550: b9 60 08 00 mv r1,r11
8006554: f8 00 42 6f calli 8016f10 <__ashlsi3>
8006558: 34 02 00 02 mvi r2,2
800655c: b4 2b 08 00 add r1,r1,r11
8006560: f8 00 42 6c calli 8016f10 <__ashlsi3>
8006564: b5 a1 08 00 add r1,r13,r1
_Scheduler_priority_Schedule_body();
}
8006568: 28 23 00 00 lw r3,(r1+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
800656c: 34 21 00 04 addi r1,r1,4
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
8006570: 34 02 00 00 mvi r2,0
Chain_Control *the_ready_queue
)
{
Priority_Control index = _Priority_bit_map_Get_highest();
if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) )
8006574: 44 61 00 02 be r3,r1,800657c <_Scheduler_priority_Schedule+0xf0><== NEVER TAKEN
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
8006578: b8 60 10 00 mv r2,r3
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
800657c: 78 01 08 01 mvhi r1,0x801
8006580: 38 21 9e 3c ori r1,r1,0x9e3c
8006584: 58 22 00 10 sw (r1+16),r2
8006588: 2b 9d 00 04 lw ra,(sp+4)
800658c: 2b 8b 00 10 lw r11,(sp+16)
8006590: 2b 8c 00 0c lw r12,(sp+12)
8006594: 2b 8d 00 08 lw r13,(sp+8)
8006598: 37 9c 00 10 addi sp,sp,16
800659c: c3 a0 00 00 ret
0800428c <_TOD_Validate>:
*/
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
800428c: 37 9c ff f0 addi sp,sp,-16
8004290: 5b 8b 00 10 sw (sp+16),r11
8004294: 5b 8c 00 0c sw (sp+12),r12
8004298: 5b 8d 00 08 sw (sp+8),r13
800429c: 5b 9d 00 04 sw (sp+4),ra
80042a0: 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();
80042a4: 78 01 08 02 mvhi r1,0x802
80042a8: 38 21 10 f4 ori r1,r1,0x10f4
80042ac: 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;
80042b0: 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) ||
80042b4: 45 60 00 22 be r11,r0,800433c <_TOD_Validate+0xb0> <== NEVER TAKEN
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
80042b8: 78 03 08 01 mvhi r3,0x801
80042bc: 38 63 e9 44 ori r3,r3,0xe944
80042c0: 28 61 00 00 lw r1,(r3+0)
80042c4: f8 00 63 fe calli 801d2bc <__udivsi3>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
80042c8: 29 62 00 18 lw r2,(r11+24)
80042cc: 50 41 00 1c bgeu r2,r1,800433c <_TOD_Validate+0xb0>
(the_tod->ticks >= ticks_per_second) ||
80042d0: 29 62 00 14 lw r2,(r11+20)
80042d4: 34 01 00 3b mvi r1,59
80042d8: 54 41 00 19 bgu r2,r1,800433c <_TOD_Validate+0xb0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
80042dc: 29 62 00 10 lw r2,(r11+16)
80042e0: 54 41 00 17 bgu r2,r1,800433c <_TOD_Validate+0xb0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
80042e4: 29 62 00 0c lw r2,(r11+12)
80042e8: 34 01 00 17 mvi r1,23
80042ec: 54 41 00 14 bgu r2,r1,800433c <_TOD_Validate+0xb0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
80042f0: 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) ||
80042f4: 44 20 00 12 be r1,r0,800433c <_TOD_Validate+0xb0> <== NEVER TAKEN
(the_tod->month == 0) ||
80042f8: 34 02 00 0c mvi r2,12
80042fc: 54 22 00 10 bgu r1,r2,800433c <_TOD_Validate+0xb0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
8004300: 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) ||
8004304: 34 03 07 c3 mvi r3,1987
8004308: 50 62 00 0d bgeu r3,r2,800433c <_TOD_Validate+0xb0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
800430c: 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) ||
8004310: 45 a0 00 0b be r13,r0,800433c <_TOD_Validate+0xb0> <== NEVER TAKEN
8004314: 78 0b 08 01 mvhi r11,0x801
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
8004318: 20 42 00 03 andi r2,r2,0x3
800431c: 39 6b f1 fc ori r11,r11,0xf1fc
8004320: 5c 40 00 02 bne r2,r0,8004328 <_TOD_Validate+0x9c>
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
8004324: 34 21 00 0d addi r1,r1,13
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
8004328: 34 02 00 02 mvi r2,2
800432c: fb ff f3 dd calli 80012a0 <__ashlsi3>
8004330: b5 61 08 00 add r1,r11,r1
8004334: 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(
8004338: f1 8d 60 00 cmpgeu r12,r12,r13
if ( the_tod->day > days_in_month )
return false;
return true;
}
800433c: b9 80 08 00 mv r1,r12
8004340: 2b 9d 00 04 lw ra,(sp+4)
8004344: 2b 8b 00 10 lw r11,(sp+16)
8004348: 2b 8c 00 0c lw r12,(sp+12)
800434c: 2b 8d 00 08 lw r13,(sp+8)
8004350: 37 9c 00 10 addi sp,sp,16
8004354: c3 a0 00 00 ret
08006798 <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
8006798: 37 9c ff e8 addi sp,sp,-24
800679c: 5b 8b 00 18 sw (sp+24),r11
80067a0: 5b 8c 00 14 sw (sp+20),r12
80067a4: 5b 8d 00 10 sw (sp+16),r13
80067a8: 5b 8e 00 0c sw (sp+12),r14
80067ac: 5b 8f 00 08 sw (sp+8),r15
80067b0: 5b 9d 00 04 sw (sp+4),ra
80067b4: b8 20 58 00 mv r11,r1
States_Control state, original_state;
/*
* Save original state
*/
original_state = the_thread->current_state;
80067b8: 28 2f 00 10 lw r15,(r1+16)
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
80067bc: b8 40 60 00 mv r12,r2
80067c0: 20 6e 00 ff andi r14,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 );
80067c4: f8 00 03 9c calli 8007634 <_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 )
80067c8: 29 61 00 14 lw r1,(r11+20)
80067cc: 44 2c 00 04 be r1,r12,80067dc <_Thread_Change_priority+0x44>
_Thread_Set_priority( the_thread, new_priority );
80067d0: b9 60 08 00 mv r1,r11
80067d4: b9 80 10 00 mv r2,r12
80067d8: f8 00 03 76 calli 80075b0 <_Thread_Set_priority>
_ISR_Disable( level );
80067dc: 90 00 60 00 rcsr r12,IE
80067e0: 34 0d ff fe mvi r13,-2
80067e4: a1 8d 68 00 and r13,r12,r13
80067e8: d0 0d 00 00 wcsr IE,r13
/*
* 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;
80067ec: 29 61 00 10 lw r1,(r11+16)
if ( state != STATES_TRANSIENT ) {
80067f0: 34 03 00 04 mvi r3,4
80067f4: 21 e2 00 04 andi r2,r15,0x4
80067f8: 44 23 00 0f be r1,r3,8006834 <_Thread_Change_priority+0x9c>
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
80067fc: 5c 40 00 04 bne r2,r0,800680c <_Thread_Change_priority+0x74><== NEVER TAKEN
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
8006800: 34 02 ff fb mvi r2,-5
8006804: a0 22 10 00 and r2,r1,r2
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
8006808: 59 62 00 10 sw (r11+16),r2
_ISR_Enable( level );
800680c: 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);
8006810: 78 03 08 01 mvhi r3,0x801
8006814: 38 63 81 6c ori r3,r3,0x816c
8006818: 28 62 00 00 lw r2,(r3+0)
800681c: a0 22 08 00 and r1,r1,r2
if ( _States_Is_waiting_on_thread_queue( state ) ) {
8006820: 44 20 00 1f be r1,r0,800689c <_Thread_Change_priority+0x104>
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
8006824: 29 61 00 44 lw r1,(r11+68)
8006828: b9 60 10 00 mv r2,r11
800682c: f8 00 03 2c calli 80074dc <_Thread_queue_Requeue>
8006830: e0 00 00 1b bi 800689c <_Thread_Change_priority+0x104>
}
return;
}
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) ) {
8006834: 5c 40 00 0a bne r2,r0,800685c <_Thread_Change_priority+0xc4><== NEVER TAKEN
8006838: 78 01 08 01 mvhi r1,0x801
* 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 );
800683c: 59 60 00 10 sw (r11+16),r0
8006840: 38 21 90 1c ori r1,r1,0x901c
if ( prepend_it )
8006844: 45 c2 00 03 be r14,r2,8006850 <_Thread_Change_priority+0xb8>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue_first( the_thread );
8006848: 28 22 00 28 lw r2,(r1+40)
800684c: e0 00 00 02 bi 8006854 <_Thread_Change_priority+0xbc>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue( the_thread );
8006850: 28 22 00 24 lw r2,(r1+36)
8006854: b9 60 08 00 mv r1,r11
8006858: d8 40 00 00 call r2
_Scheduler_Enqueue_first( the_thread );
else
_Scheduler_Enqueue( the_thread );
}
_ISR_Flash( level );
800685c: d0 0c 00 00 wcsr IE,r12
8006860: d0 0d 00 00 wcsr IE,r13
* This kernel routine implements the scheduling decision logic for
* the scheduler. It does NOT dispatch.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void )
{
_Scheduler.Operations.schedule();
8006864: 78 01 08 01 mvhi r1,0x801
8006868: 38 21 90 1c ori r1,r1,0x901c
800686c: 28 21 00 08 lw r1,(r1+8)
8006870: d8 20 00 00 call r1
* is also the heir thread, and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void )
{
return ( _Thread_Executing == _Thread_Heir );
8006874: 78 01 08 01 mvhi r1,0x801
8006878: 38 21 9e 3c ori r1,r1,0x9e3c
800687c: 28 22 00 0c lw r2,(r1+12)
* We altered the set of thread priorities. So let's figure out
* who is the heir and if we need to switch to them.
*/
_Scheduler_Schedule();
if ( !_Thread_Is_executing_also_the_heir() &&
8006880: 28 23 00 10 lw r3,(r1+16)
8006884: 44 43 00 05 be r2,r3,8006898 <_Thread_Change_priority+0x100>
8006888: 40 42 00 74 lbu r2,(r2+116)
800688c: 44 40 00 03 be r2,r0,8006898 <_Thread_Change_priority+0x100>
_Thread_Executing->is_preemptible )
_Thread_Dispatch_necessary = true;
8006890: 34 02 00 01 mvi r2,1
8006894: 30 22 00 18 sb (r1+24),r2
_ISR_Enable( level );
8006898: d0 0c 00 00 wcsr IE,r12
}
800689c: 2b 9d 00 04 lw ra,(sp+4)
80068a0: 2b 8b 00 18 lw r11,(sp+24)
80068a4: 2b 8c 00 14 lw r12,(sp+20)
80068a8: 2b 8d 00 10 lw r13,(sp+16)
80068ac: 2b 8e 00 0c lw r14,(sp+12)
80068b0: 2b 8f 00 08 lw r15,(sp+8)
80068b4: 37 9c 00 18 addi sp,sp,24
80068b8: c3 a0 00 00 ret
0800bfd4 <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
800bfd4: 37 9c ff f8 addi sp,sp,-8
800bfd8: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
800bfdc: 37 82 00 08 addi r2,sp,8
800bfe0: f8 00 00 7c calli 800c1d0 <_Thread_Get>
switch ( location ) {
800bfe4: 2b 82 00 08 lw r2,(sp+8)
800bfe8: 5c 40 00 0a bne r2,r0,800c010 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
800bfec: 78 03 08 02 mvhi r3,0x802
800bff0: 38 63 75 34 ori r3,r3,0x7534
800bff4: 28 62 00 00 lw r2,(r3+0)
800bff8: fb ff ff 6f calli 800bdb4 <_Thread_Clear_state>
800bffc: 78 01 08 02 mvhi r1,0x802
800c000: 38 21 9a 80 ori r1,r1,0x9a80
800c004: 28 22 00 00 lw r2,(r1+0)
800c008: 34 42 ff ff addi r2,r2,-1
800c00c: 58 22 00 00 sw (r1+0),r2
| STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Thread_Unnest_dispatch();
break;
}
}
800c010: 2b 9d 00 04 lw ra,(sp+4)
800c014: 37 9c 00 08 addi sp,sp,8
800c018: c3 a0 00 00 ret
080069a8 <_Thread_Dispatch>:
* dispatch thread
* no dispatch thread
*/
void _Thread_Dispatch( void )
{
80069a8: 37 9c ff c0 addi sp,sp,-64
80069ac: 5b 8b 00 30 sw (sp+48),r11
80069b0: 5b 8c 00 2c sw (sp+44),r12
80069b4: 5b 8d 00 28 sw (sp+40),r13
80069b8: 5b 8e 00 24 sw (sp+36),r14
80069bc: 5b 8f 00 20 sw (sp+32),r15
80069c0: 5b 90 00 1c sw (sp+28),r16
80069c4: 5b 91 00 18 sw (sp+24),r17
80069c8: 5b 92 00 14 sw (sp+20),r18
80069cc: 5b 93 00 10 sw (sp+16),r19
80069d0: 5b 94 00 0c sw (sp+12),r20
80069d4: 5b 95 00 08 sw (sp+8),r21
80069d8: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *executing;
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
80069dc: 78 01 08 01 mvhi r1,0x801
80069e0: 38 21 9e 3c ori r1,r1,0x9e3c
80069e4: 28 2d 00 0c lw r13,(r1+12)
_ISR_Disable( level );
80069e8: 90 00 20 00 rcsr r4,IE
80069ec: 34 01 ff fe mvi r1,-2
80069f0: a0 81 08 00 and r1,r4,r1
80069f4: d0 01 00 00 wcsr IE,r1
while ( _Thread_Dispatch_necessary == true ) {
80069f8: 78 0c 08 01 mvhi r12,0x801
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
80069fc: 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;
8006a00: 78 0f 08 01 mvhi r15,0x801
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
8006a04: 78 0e 08 01 mvhi r14,0x801
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8006a08: 78 10 08 01 mvhi r16,0x801
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
8006a0c: 39 8c 9e 3c ori r12,r12,0x9e3c
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
8006a10: 3a 31 99 90 ori r17,r17,0x9990
8006a14: 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;
8006a18: 39 ef 99 28 ori r15,r15,0x9928
_ISR_Enable( level );
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
8006a1c: 37 93 00 3c addi r19,sp,60
_Timestamp_Subtract(
8006a20: 39 ce 9a 3c ori r14,r14,0x9a3c
8006a24: 37 92 00 34 addi r18,sp,52
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8006a28: 3a 10 9a 14 ori r16,r16,0x9a14
#endif
#endif
executing = _Thread_Executing;
_ISR_Disable( level );
8006a2c: 34 15 ff fe mvi r21,-2
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
8006a30: e0 00 00 28 bi 8006ad0 <_Thread_Dispatch+0x128>
heir = _Thread_Heir;
8006a34: 29 8b 00 10 lw r11,(r12+16)
_Thread_Dispatch_disable_level = 1;
8006a38: 5a 34 00 00 sw (r17+0),r20
_Thread_Dispatch_necessary = false;
8006a3c: 31 80 00 18 sb (r12+24),r0
_Thread_Executing = heir;
8006a40: 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 )
8006a44: 45 6d 00 26 be r11,r13,8006adc <_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 )
8006a48: 29 61 00 7c lw r1,(r11+124)
8006a4c: 5c 34 00 03 bne r1,r20,8006a58 <_Thread_Dispatch+0xb0>
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
8006a50: 29 e1 00 00 lw r1,(r15+0)
8006a54: 59 61 00 78 sw (r11+120),r1
_ISR_Enable( level );
8006a58: d0 04 00 00 wcsr IE,r4
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
8006a5c: ba 60 08 00 mv r1,r19
8006a60: f8 00 1f 6e calli 800e818 <_TOD_Get_uptime>
_Timestamp_Subtract(
8006a64: b9 c0 08 00 mv r1,r14
8006a68: ba 60 10 00 mv r2,r19
8006a6c: ba 40 18 00 mv r3,r18
8006a70: f8 00 03 74 calli 8007840 <_Timespec_Subtract>
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
8006a74: 35 a1 00 84 addi r1,r13,132
8006a78: ba 40 10 00 mv r2,r18
8006a7c: f8 00 03 58 calli 80077dc <_Timespec_Add_to>
_Thread_Time_of_last_context_switch = uptime;
8006a80: 2b 81 00 3c lw r1,(sp+60)
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8006a84: 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;
8006a88: 59 c1 00 00 sw (r14+0),r1
8006a8c: 2b 81 00 40 lw r1,(sp+64)
8006a90: 59 c1 00 04 sw (r14+4),r1
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8006a94: 44 80 00 05 be r4,r0,8006aa8 <_Thread_Dispatch+0x100> <== NEVER TAKEN
executing->libc_reent = *_Thread_libc_reent;
8006a98: 28 81 00 00 lw r1,(r4+0)
8006a9c: 59 a1 01 18 sw (r13+280),r1
*_Thread_libc_reent = heir->libc_reent;
8006aa0: 29 61 01 18 lw r1,(r11+280)
8006aa4: 58 81 00 00 sw (r4+0),r1
}
_User_extensions_Thread_switch( executing, heir );
8006aa8: b9 a0 08 00 mv r1,r13
8006aac: b9 60 10 00 mv r2,r11
8006ab0: f8 00 04 43 calli 8007bbc <_User_extensions_Thread_switch>
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
8006ab4: 35 a1 00 c4 addi r1,r13,196
8006ab8: 35 62 00 c4 addi r2,r11,196
8006abc: f8 00 05 23 calli 8007f48 <_CPU_Context_switch>
if ( executing->fp_context != NULL )
_Context_Restore_fp( &executing->fp_context );
#endif
#endif
executing = _Thread_Executing;
8006ac0: 29 8d 00 0c lw r13,(r12+12)
_ISR_Disable( level );
8006ac4: 90 00 20 00 rcsr r4,IE
8006ac8: a0 95 08 00 and r1,r4,r21
8006acc: d0 01 00 00 wcsr IE,r1
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
8006ad0: 41 81 00 18 lbu r1,(r12+24)
8006ad4: 20 21 00 ff andi r1,r1,0xff
8006ad8: 5c 20 ff d7 bne r1,r0,8006a34 <_Thread_Dispatch+0x8c>
_ISR_Disable( level );
}
post_switch:
_Thread_Dispatch_disable_level = 0;
8006adc: 78 01 08 01 mvhi r1,0x801
8006ae0: 38 21 99 90 ori r1,r1,0x9990
8006ae4: 58 20 00 00 sw (r1+0),r0
_ISR_Enable( level );
8006ae8: d0 04 00 00 wcsr IE,r4
_API_extensions_Run_postswitch();
8006aec: fb ff f7 ce calli 8004a24 <_API_extensions_Run_postswitch>
}
8006af0: 2b 9d 00 04 lw ra,(sp+4)
8006af4: 2b 8b 00 30 lw r11,(sp+48)
8006af8: 2b 8c 00 2c lw r12,(sp+44)
8006afc: 2b 8d 00 28 lw r13,(sp+40)
8006b00: 2b 8e 00 24 lw r14,(sp+36)
8006b04: 2b 8f 00 20 lw r15,(sp+32)
8006b08: 2b 90 00 1c lw r16,(sp+28)
8006b0c: 2b 91 00 18 lw r17,(sp+24)
8006b10: 2b 92 00 14 lw r18,(sp+20)
8006b14: 2b 93 00 10 lw r19,(sp+16)
8006b18: 2b 94 00 0c lw r20,(sp+12)
8006b1c: 2b 95 00 08 lw r21,(sp+8)
8006b20: 37 9c 00 40 addi sp,sp,64
8006b24: c3 a0 00 00 ret
080111ec <_Thread_Handler>:
*
* Output parameters: NONE
*/
void _Thread_Handler( void )
{
80111ec: 37 9c ff f4 addi sp,sp,-12
80111f0: 5b 8b 00 0c sw (sp+12),r11
80111f4: 5b 8c 00 08 sw (sp+8),r12
80111f8: 5b 9d 00 04 sw (sp+4),ra
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static char doneConstructors;
char doneCons;
#endif
executing = _Thread_Executing;
80111fc: 78 01 08 01 mvhi r1,0x801
8011200: 38 21 9e 3c ori r1,r1,0x9e3c
8011204: 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;
8011208: 29 61 00 ac lw r1,(r11+172)
_ISR_Set_level(level);
801120c: 64 21 00 00 cmpei r1,r1,0
8011210: d0 01 00 00 wcsr IE,r1
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
doneCons = doneConstructors;
8011214: 78 01 08 01 mvhi r1,0x801
8011218: 38 21 97 ec ori r1,r1,0x97ec
801121c: 40 2c 00 00 lbu r12,(r1+0)
doneConstructors = 1;
8011220: 34 02 00 01 mvi r2,1
8011224: 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 );
8011228: b9 60 08 00 mv r1,r11
801122c: fb ff d9 d8 calli 800798c <_User_extensions_Thread_begin>
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
8011230: fb ff d6 3e calli 8006b28 <_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) */ {
8011234: 5d 80 00 02 bne r12,r0,801123c <_Thread_Handler+0x50>
INIT_NAME ();
8011238: fb ff bb 72 calli 8000000 <RamBase>
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
801123c: 29 61 00 94 lw r1,(r11+148)
8011240: 5c 20 00 04 bne r1,r0,8011250 <_Thread_Handler+0x64>
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
8011244: 29 62 00 90 lw r2,(r11+144)
8011248: 29 61 00 9c lw r1,(r11+156)
801124c: e0 00 00 05 bi 8011260 <_Thread_Handler+0x74>
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
8011250: 34 02 00 01 mvi r2,1
8011254: 5c 22 00 05 bne r1,r2,8011268 <_Thread_Handler+0x7c> <== NEVER TAKEN
executing->Wait.return_argument =
(*(Thread_Entry_pointer) executing->Start.entry_point)(
8011258: 29 62 00 90 lw r2,(r11+144)
801125c: 29 61 00 98 lw r1,(r11+152)
8011260: 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 =
8011264: 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 );
8011268: b9 60 08 00 mv r1,r11
801126c: fb ff d9 e0 calli 80079ec <_User_extensions_Thread_exitted>
_Internal_error_Occurred(
8011270: 34 01 00 00 mvi r1,0
8011274: 34 02 00 01 mvi r2,1
8011278: 34 03 00 05 mvi r3,5
801127c: fb ff d0 cf calli 80055b8 <_Internal_error_Occurred>
0800bda4 <_Thread_Tickle_timeslice>:
*
* Output parameters: NONE
*/
void _Thread_Tickle_timeslice( void )
{
800bda4: 37 9c ff f8 addi sp,sp,-8
800bda8: 5b 8b 00 08 sw (sp+8),r11
800bdac: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *executing;
executing = _Thread_Executing;
800bdb0: 78 01 08 01 mvhi r1,0x801
800bdb4: 38 21 ae ec ori r1,r1,0xaeec
800bdb8: 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 )
800bdbc: 41 61 00 74 lbu r1,(r11+116)
800bdc0: 44 20 00 1e be r1,r0,800be38 <_Thread_Tickle_timeslice+0x94>
return;
if ( !_States_Is_ready( executing->current_state ) )
800bdc4: 29 61 00 10 lw r1,(r11+16)
800bdc8: 5c 20 00 1c bne r1,r0,800be38 <_Thread_Tickle_timeslice+0x94>
/*
* The cpu budget algorithm determines what happens next.
*/
switch ( executing->budget_algorithm ) {
800bdcc: 29 61 00 7c lw r1,(r11+124)
800bdd0: 44 20 00 1a be r1,r0,800be38 <_Thread_Tickle_timeslice+0x94>
800bdd4: 34 02 00 02 mvi r2,2
800bdd8: 50 41 00 04 bgeu r2,r1,800bde8 <_Thread_Tickle_timeslice+0x44>
800bddc: 34 02 00 03 mvi r2,3
800bde0: 5c 22 00 16 bne r1,r2,800be38 <_Thread_Tickle_timeslice+0x94><== NEVER TAKEN
800bde4: e0 00 00 0e bi 800be1c <_Thread_Tickle_timeslice+0x78>
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 ) {
800bde8: 29 61 00 78 lw r1,(r11+120)
800bdec: 34 21 ff ff addi r1,r1,-1
800bdf0: 59 61 00 78 sw (r11+120),r1
800bdf4: 48 20 00 11 bg r1,r0,800be38 <_Thread_Tickle_timeslice+0x94>
* always operates on the scheduler that 'owns' the currently executing
* thread.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void )
{
_Scheduler.Operations.yield();
800bdf8: 78 01 08 01 mvhi r1,0x801
800bdfc: 38 21 a0 1c ori r1,r1,0xa01c
800be00: 28 21 00 0c lw r1,(r1+12)
800be04: d8 20 00 00 call r1
* executing thread's timeslice is reset. Otherwise, the
* currently executing thread is placed at the rear of the
* FIFO for this priority and a new heir is selected.
*/
_Scheduler_Yield( );
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
800be08: 78 01 08 01 mvhi r1,0x801
800be0c: 38 21 a9 d8 ori r1,r1,0xa9d8
800be10: 28 21 00 00 lw r1,(r1+0)
800be14: 59 61 00 78 sw (r11+120),r1
800be18: e0 00 00 08 bi 800be38 <_Thread_Tickle_timeslice+0x94>
}
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
if ( --executing->cpu_time_budget == 0 )
800be1c: 29 61 00 78 lw r1,(r11+120)
800be20: 34 21 ff ff addi r1,r1,-1
800be24: 59 61 00 78 sw (r11+120),r1
800be28: 5c 20 00 04 bne r1,r0,800be38 <_Thread_Tickle_timeslice+0x94>
(*executing->budget_callout)( executing );
800be2c: 29 62 00 80 lw r2,(r11+128)
800be30: b9 60 08 00 mv r1,r11
800be34: d8 40 00 00 call r2
break;
#endif
}
}
800be38: 2b 9d 00 04 lw ra,(sp+4)
800be3c: 2b 8b 00 08 lw r11,(sp+8)
800be40: 37 9c 00 08 addi sp,sp,8
800be44: c3 a0 00 00 ret
0800718c <_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
)
{
800718c: 37 9c ff cc addi sp,sp,-52
8007190: 5b 8b 00 34 sw (sp+52),r11
8007194: 5b 8c 00 30 sw (sp+48),r12
8007198: 5b 8d 00 2c sw (sp+44),r13
800719c: 5b 8e 00 28 sw (sp+40),r14
80071a0: 5b 8f 00 24 sw (sp+36),r15
80071a4: 5b 90 00 20 sw (sp+32),r16
80071a8: 5b 91 00 1c sw (sp+28),r17
80071ac: 5b 92 00 18 sw (sp+24),r18
80071b0: 5b 93 00 14 sw (sp+20),r19
80071b4: 5b 94 00 10 sw (sp+16),r20
80071b8: 5b 95 00 0c sw (sp+12),r21
80071bc: 5b 96 00 08 sw (sp+8),r22
80071c0: 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;
80071c4: 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
)
{
80071c8: b8 20 68 00 mv r13,r1
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
80071cc: 34 41 00 3c addi r1,r2,60
head->next = tail;
80071d0: 58 41 00 38 sw (r2+56),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
80071d4: 34 41 00 38 addi r1,r2,56
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
80071d8: 58 41 00 40 sw (r2+64),r1
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
80071dc: 58 40 00 3c sw (r2+60),r0
80071e0: b8 40 60 00 mv r12,r2
RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number (
Priority_Control the_priority
)
{
return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
80071e4: ba 00 08 00 mv r1,r16
80071e8: 34 02 00 06 mvi r2,6
80071ec: b8 60 a8 00 mv r21,r3
80071f0: f8 00 3f 96 calli 8017048 <__lshrsi3>
80071f4: b8 20 70 00 mv r14,r1
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
80071f8: 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 );
80071fc: 22 01 00 20 andi r1,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 ];
block_state = the_thread_queue->state;
8007200: 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;
8007204: 3a 52 90 d8 ori r18,r18,0x90d8
_ISR_Disable( level );
8007208: 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 ) )
800720c: 5c 20 00 30 bne r1,r0,80072cc <_Thread_queue_Enqueue_priority+0x140>
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
8007210: 34 14 ff fe mvi r20,-2
8007214: 90 00 78 00 rcsr r15,IE
8007218: a1 f4 90 00 and r18,r15,r20
800721c: d0 12 00 00 wcsr IE,r18
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
8007220: 34 02 00 01 mvi r2,1
8007224: b9 c0 08 00 mv r1,r14
8007228: f8 00 3f 3a calli 8016f10 <__ashlsi3>
800722c: b4 2e 08 00 add r1,r1,r14
8007230: 34 02 00 02 mvi r2,2
8007234: f8 00 3f 37 calli 8016f10 <__ashlsi3>
8007238: b5 a1 08 00 add r1,r13,r1
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
800723c: 28 2b 00 00 lw r11,(r1+0)
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
8007240: 34 11 ff ff mvi r17,-1
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
8007244: e0 00 00 0b bi 8007270 <_Thread_queue_Enqueue_priority+0xe4>
search_priority = search_thread->current_priority;
8007248: 29 71 00 14 lw r17,(r11+20)
if ( priority <= search_priority )
800724c: 52 30 00 12 bgeu r17,r16,8007294 <_Thread_queue_Enqueue_priority+0x108>
break;
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
8007250: d0 0f 00 00 wcsr IE,r15
8007254: 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);
8007258: 29 61 00 10 lw r1,(r11+16)
800725c: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
8007260: 5c 20 00 03 bne r1,r0,800726c <_Thread_queue_Enqueue_priority+0xe0><== ALWAYS TAKEN
_ISR_Enable( level );
8007264: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_forward_search;
8007268: e3 ff ff eb bi 8007214 <_Thread_queue_Enqueue_priority+0x88><== NOT EXECUTED
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
800726c: 29 6b 00 00 lw r11,(r11+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Tail(the_chain));
8007270: 34 02 00 01 mvi r2,1
8007274: b9 c0 08 00 mv r1,r14
8007278: f8 00 3f 26 calli 8016f10 <__ashlsi3>
800727c: b4 2e 08 00 add r1,r1,r14
8007280: 34 02 00 02 mvi r2,2
8007284: f8 00 3f 23 calli 8016f10 <__ashlsi3>
8007288: b5 a1 08 00 add r1,r13,r1
800728c: 34 21 00 04 addi r1,r1,4
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
8007290: 5d 61 ff ee bne r11,r1,8007248 <_Thread_queue_Enqueue_priority+0xbc>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
8007294: 29 a3 00 30 lw r3,(r13+48)
8007298: 34 02 00 01 mvi r2,1
800729c: b9 e0 08 00 mv r1,r15
80072a0: 5c 62 00 43 bne r3,r2,80073ac <_Thread_queue_Enqueue_priority+0x220>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
80072a4: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
80072a8: 46 11 00 38 be r16,r17,8007388 <_Thread_queue_Enqueue_priority+0x1fc>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
80072ac: 29 61 00 04 lw r1,(r11+4)
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
80072b0: 59 8b 00 00 sw (r12+0),r11
the_node->previous = previous_node;
80072b4: 59 81 00 04 sw (r12+4),r1
previous_node->next = the_node;
80072b8: 58 2c 00 00 sw (r1+0),r12
search_node->previous = the_node;
80072bc: 59 6c 00 04 sw (r11+4),r12
the_thread->Wait.queue = the_thread_queue;
80072c0: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
80072c4: d0 0f 00 00 wcsr IE,r15
80072c8: e0 00 00 2e bi 8007380 <_Thread_queue_Enqueue_priority+0x1f4>
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
80072cc: 42 51 00 00 lbu r17,(r18+0)
80072d0: 36 31 00 01 addi r17,r17,1
_ISR_Disable( level );
80072d4: 90 00 78 00 rcsr r15,IE
80072d8: a1 f6 a0 00 and r20,r15,r22
80072dc: d0 14 00 00 wcsr IE,r20
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
80072e0: 34 02 00 01 mvi r2,1
80072e4: b9 c0 08 00 mv r1,r14
80072e8: f8 00 3f 0a calli 8016f10 <__ashlsi3>
80072ec: b4 2e 08 00 add r1,r1,r14
80072f0: 34 02 00 02 mvi r2,2
80072f4: f8 00 3f 07 calli 8016f10 <__ashlsi3>
80072f8: b5 a1 08 00 add r1,r13,r1
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_Last( header );
80072fc: 28 2b 00 08 lw r11,(r1+8)
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
8007300: e0 00 00 0b bi 800732c <_Thread_queue_Enqueue_priority+0x1a0>
search_priority = search_thread->current_priority;
8007304: 29 71 00 14 lw r17,(r11+20)
if ( priority >= search_priority )
8007308: 52 11 00 11 bgeu r16,r17,800734c <_Thread_queue_Enqueue_priority+0x1c0>
break;
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
800730c: d0 0f 00 00 wcsr IE,r15
8007310: d0 14 00 00 wcsr IE,r20
8007314: 29 61 00 10 lw r1,(r11+16)
8007318: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
800731c: 5c 20 00 03 bne r1,r0,8007328 <_Thread_queue_Enqueue_priority+0x19c><== ALWAYS TAKEN
_ISR_Enable( level );
8007320: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_reverse_search;
8007324: e3 ff ff ea bi 80072cc <_Thread_queue_Enqueue_priority+0x140><== NOT EXECUTED
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
8007328: 29 6b 00 04 lw r11,(r11+4)
RTEMS_INLINE_ROUTINE bool _Chain_Is_head(
Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Head(the_chain));
800732c: 34 02 00 01 mvi r2,1
8007330: b9 c0 08 00 mv r1,r14
8007334: f8 00 3e f7 calli 8016f10 <__ashlsi3>
8007338: b4 2e 08 00 add r1,r1,r14
800733c: 34 02 00 02 mvi r2,2
8007340: f8 00 3e f4 calli 8016f10 <__ashlsi3>
8007344: b5 a1 08 00 add r1,r13,r1
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_Last( header );
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
8007348: 5d 61 ff ef bne r11,r1,8007304 <_Thread_queue_Enqueue_priority+0x178>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
800734c: 29 a3 00 30 lw r3,(r13+48)
8007350: 34 02 00 01 mvi r2,1
8007354: b9 e0 08 00 mv r1,r15
8007358: 5c 62 00 15 bne r3,r2,80073ac <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
800735c: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
8007360: 46 11 00 0a be r16,r17,8007388 <_Thread_queue_Enqueue_priority+0x1fc>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
8007364: 29 61 00 00 lw r1,(r11+0)
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
8007368: 59 8b 00 04 sw (r12+4),r11
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
800736c: 59 81 00 00 sw (r12+0),r1
the_node->previous = search_node;
search_node->next = the_node;
8007370: 59 6c 00 00 sw (r11+0),r12
next_node->previous = the_node;
8007374: 58 2c 00 04 sw (r1+4),r12
the_thread->Wait.queue = the_thread_queue;
8007378: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
800737c: d0 0f 00 00 wcsr IE,r15
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
8007380: 34 01 00 01 mvi r1,1
8007384: e0 00 00 0c bi 80073b4 <_Thread_queue_Enqueue_priority+0x228>
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
previous_node = search_node->previous;
8007388: 29 61 00 40 lw r1,(r11+64)
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
800738c: 35 62 00 3c addi r2,r11,60
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8007390: 59 82 00 00 sw (r12+0),r2
the_node->previous = previous_node;
8007394: 59 81 00 04 sw (r12+4),r1
previous_node->next = the_node;
8007398: 58 2c 00 00 sw (r1+0),r12
search_node->previous = the_node;
800739c: 59 6c 00 40 sw (r11+64),r12
the_thread->Wait.queue = the_thread_queue;
80073a0: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
80073a4: d0 0f 00 00 wcsr IE,r15
80073a8: e3 ff ff f6 bi 8007380 <_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;
80073ac: 5a a1 00 00 sw (r21+0),r1
return the_thread_queue->sync_state;
80073b0: 29 a1 00 30 lw r1,(r13+48)
}
80073b4: 2b 9d 00 04 lw ra,(sp+4)
80073b8: 2b 8b 00 34 lw r11,(sp+52)
80073bc: 2b 8c 00 30 lw r12,(sp+48)
80073c0: 2b 8d 00 2c lw r13,(sp+44)
80073c4: 2b 8e 00 28 lw r14,(sp+40)
80073c8: 2b 8f 00 24 lw r15,(sp+36)
80073cc: 2b 90 00 20 lw r16,(sp+32)
80073d0: 2b 91 00 1c lw r17,(sp+28)
80073d4: 2b 92 00 18 lw r18,(sp+24)
80073d8: 2b 93 00 14 lw r19,(sp+20)
80073dc: 2b 94 00 10 lw r20,(sp+16)
80073e0: 2b 95 00 0c lw r21,(sp+12)
80073e4: 2b 96 00 08 lw r22,(sp+8)
80073e8: 37 9c 00 34 addi sp,sp,52
80073ec: c3 a0 00 00 ret
0800f3b8 <_Thread_queue_Process_timeout>:
#include <rtems/score/tqdata.h>
void _Thread_queue_Process_timeout(
Thread_Control *the_thread
)
{
800f3b8: 37 9c ff fc addi sp,sp,-4
800f3bc: 5b 9d 00 04 sw (sp+4),ra
800f3c0: b8 20 10 00 mv r2,r1
Thread_queue_Control *the_thread_queue = the_thread->Wait.queue;
800f3c4: 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 &&
800f3c8: 28 24 00 30 lw r4,(r1+48)
800f3cc: 44 80 00 0c be r4,r0,800f3fc <_Thread_queue_Process_timeout+0x44>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
800f3d0: 78 03 08 01 mvhi r3,0x801
800f3d4: 38 63 9e 3c ori r3,r3,0x9e3c
800f3d8: 28 63 00 0c lw r3,(r3+12)
800f3dc: 5c 43 00 08 bne r2,r3,800f3fc <_Thread_queue_Process_timeout+0x44><== NEVER TAKEN
_Thread_Is_executing( the_thread ) ) {
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
800f3e0: 34 03 00 03 mvi r3,3
800f3e4: 44 83 00 09 be r4,r3,800f408 <_Thread_queue_Process_timeout+0x50><== ALWAYS TAKEN
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
800f3e8: 28 23 00 3c lw r3,(r1+60) <== NOT EXECUTED
800f3ec: 58 43 00 34 sw (r2+52),r3 <== NOT EXECUTED
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
800f3f0: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
800f3f4: 58 22 00 30 sw (r1+48),r2 <== NOT EXECUTED
800f3f8: e0 00 00 04 bi 800f408 <_Thread_queue_Process_timeout+0x50><== NOT EXECUTED
}
} else {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
800f3fc: 28 23 00 3c lw r3,(r1+60)
800f400: 58 43 00 34 sw (r2+52),r3
_Thread_queue_Extract( the_thread->Wait.queue, the_thread );
800f404: f8 00 07 9f calli 8011280 <_Thread_queue_Extract>
}
}
800f408: 2b 9d 00 04 lw ra,(sp+4)
800f40c: 37 9c 00 04 addi sp,sp,4
800f410: c3 a0 00 00 ret
080074dc <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
80074dc: 37 9c ff ec addi sp,sp,-20
80074e0: 5b 8b 00 10 sw (sp+16),r11
80074e4: 5b 8c 00 0c sw (sp+12),r12
80074e8: 5b 8d 00 08 sw (sp+8),r13
80074ec: 5b 9d 00 04 sw (sp+4),ra
80074f0: b8 20 58 00 mv r11,r1
80074f4: 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 )
80074f8: 44 20 00 19 be r1,r0,800755c <_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 ) {
80074fc: 28 22 00 34 lw r2,(r1+52)
8007500: 34 01 00 01 mvi r1,1
8007504: 5c 41 00 16 bne r2,r1,800755c <_Thread_queue_Requeue+0x80> <== NEVER TAKEN
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
8007508: 90 00 68 00 rcsr r13,IE
800750c: 34 01 ff fe mvi r1,-2
8007510: a1 a1 08 00 and r1,r13,r1
8007514: 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);
8007518: 78 03 08 01 mvhi r3,0x801
800751c: 38 63 81 6c ori r3,r3,0x816c
8007520: 29 82 00 10 lw r2,(r12+16)
8007524: 28 61 00 00 lw r1,(r3+0)
8007528: a0 41 08 00 and r1,r2,r1
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
800752c: 44 20 00 0b be r1,r0,8007558 <_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;
8007530: 34 01 00 01 mvi r1,1
8007534: 59 61 00 30 sw (r11+48),r1
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
8007538: b9 80 10 00 mv r2,r12
800753c: b9 60 08 00 mv r1,r11
8007540: 34 03 00 01 mvi r3,1
8007544: f8 00 1f 4f calli 800f280 <_Thread_queue_Extract_priority_helper>
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
8007548: b9 60 08 00 mv r1,r11
800754c: b9 80 10 00 mv r2,r12
8007550: 37 83 00 14 addi r3,sp,20
8007554: fb ff ff 0e calli 800718c <_Thread_queue_Enqueue_priority>
}
_ISR_Enable( level );
8007558: d0 0d 00 00 wcsr IE,r13
}
}
800755c: 2b 9d 00 04 lw ra,(sp+4)
8007560: 2b 8b 00 10 lw r11,(sp+16)
8007564: 2b 8c 00 0c lw r12,(sp+12)
8007568: 2b 8d 00 08 lw r13,(sp+8)
800756c: 37 9c 00 14 addi sp,sp,20
8007570: c3 a0 00 00 ret
08007574 <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
8007574: 37 9c ff f8 addi sp,sp,-8
8007578: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
800757c: 37 82 00 08 addi r2,sp,8
8007580: fb ff fd 77 calli 8006b5c <_Thread_Get>
switch ( location ) {
8007584: 2b 82 00 08 lw r2,(sp+8)
8007588: 5c 40 00 07 bne r2,r0,80075a4 <_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 );
800758c: f8 00 1f 8b calli 800f3b8 <_Thread_queue_Process_timeout>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
8007590: 78 01 08 01 mvhi r1,0x801
8007594: 38 21 99 90 ori r1,r1,0x9990
8007598: 28 22 00 00 lw r2,(r1+0)
800759c: 34 42 ff ff addi r2,r2,-1
80075a0: 58 22 00 00 sw (r1+0),r2
_Thread_Unnest_dispatch();
break;
}
}
80075a4: 2b 9d 00 04 lw ra,(sp+4)
80075a8: 37 9c 00 08 addi sp,sp,8
80075ac: c3 a0 00 00 ret
0801478c <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
801478c: 37 9c ff a8 addi sp,sp,-88
8014790: 5b 8b 00 40 sw (sp+64),r11
8014794: 5b 8c 00 3c sw (sp+60),r12
8014798: 5b 8d 00 38 sw (sp+56),r13
801479c: 5b 8e 00 34 sw (sp+52),r14
80147a0: 5b 8f 00 30 sw (sp+48),r15
80147a4: 5b 90 00 2c sw (sp+44),r16
80147a8: 5b 91 00 28 sw (sp+40),r17
80147ac: 5b 92 00 24 sw (sp+36),r18
80147b0: 5b 93 00 20 sw (sp+32),r19
80147b4: 5b 94 00 1c sw (sp+28),r20
80147b8: 5b 95 00 18 sw (sp+24),r21
80147bc: 5b 96 00 14 sw (sp+20),r22
80147c0: 5b 97 00 10 sw (sp+16),r23
80147c4: 5b 98 00 0c sw (sp+12),r24
80147c8: 5b 99 00 08 sw (sp+8),r25
80147cc: 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;
80147d0: 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
)
{
80147d4: b8 20 58 00 mv r11,r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80147d8: 37 82 00 54 addi r2,sp,84
80147dc: 37 81 00 50 addi r1,sp,80
80147e0: 37 8f 00 44 addi r15,sp,68
80147e4: 37 91 00 48 addi r17,sp,72
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
80147e8: 78 0e 08 04 mvhi r14,0x804
80147ec: 5b 82 00 50 sw (sp+80),r2
head->previous = NULL;
80147f0: 5b 80 00 54 sw (sp+84),r0
tail->previous = head;
80147f4: 5b 81 00 58 sw (sp+88),r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80147f8: 5b 91 00 44 sw (sp+68),r17
head->previous = NULL;
80147fc: 5b 80 00 48 sw (sp+72),r0
tail->previous = head;
8014800: 5b 8f 00 4c sw (sp+76),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;
8014804: b8 20 c8 00 mv r25,r1
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
8014808: 3a 10 0e 20 ori r16,r16,0xe20
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
801480c: 35 73 00 30 addi r19,r11,48
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
8014810: 39 ce 0d 98 ori r14,r14,0xd98
/*
* 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 );
8014814: 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 ) {
8014818: 34 18 00 03 mvi r24,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 );
801481c: 34 12 ff fe mvi r18,-2
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
8014820: b8 40 b8 00 mv r23,r2
_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;
8014824: 34 16 00 01 mvi r22,1
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
8014828: 35 75 00 08 addi r21,r11,8
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
801482c: 35 74 00 40 addi r20,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;
8014830: 59 79 00 78 sw (r11+120),r25
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
8014834: 2a 02 00 00 lw r2,(r16+0)
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
8014838: 29 63 00 3c lw r3,(r11+60)
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
801483c: ba 60 08 00 mv r1,r19
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
8014840: 59 62 00 3c sw (r11+60),r2
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
8014844: c8 43 10 00 sub r2,r2,r3
8014848: b9 e0 18 00 mv r3,r15
801484c: f8 00 15 aa calli 8019ef4 <_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;
8014850: 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();
8014854: 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 ) {
8014858: 50 8c 00 06 bgeu r4,r12,8014870 <_Timer_server_Body+0xe4>
/*
* 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 );
801485c: b9 a0 08 00 mv r1,r13
8014860: c9 84 10 00 sub r2,r12,r4
8014864: b9 e0 18 00 mv r3,r15
8014868: f8 00 15 a3 calli 8019ef4 <_Watchdog_Adjust_to_chain>
801486c: e0 00 00 06 bi 8014884 <_Timer_server_Body+0xf8>
} else if ( snapshot < last_snapshot ) {
8014870: 51 84 00 05 bgeu r12,r4,8014884 <_Timer_server_Body+0xf8>
/*
* 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 );
8014874: b9 a0 08 00 mv r1,r13
8014878: 34 02 00 01 mvi r2,1
801487c: c8 8c 18 00 sub r3,r4,r12
8014880: f8 00 15 66 calli 8019e18 <_Watchdog_Adjust>
}
watchdogs->last_snapshot = snapshot;
8014884: 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 ) {
8014888: 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 );
801488c: 29 63 00 78 lw r3,(r11+120)
8014890: b8 60 08 00 mv r1,r3
8014894: f8 00 03 7e calli 801568c <_Chain_Get>
8014898: b8 20 10 00 mv r2,r1
if ( timer == NULL ) {
801489c: 44 20 00 09 be r1,r0,80148c0 <_Timer_server_Body+0x134> <== ALWAYS TAKEN
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
80148a0: 28 23 00 38 lw r3,(r1+56) <== NOT EXECUTED
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
80148a4: ba 60 08 00 mv r1,r19 <== NOT EXECUTED
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
80148a8: 44 6c 00 03 be r3,r12,80148b4 <_Timer_server_Body+0x128> <== NOT EXECUTED
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
80148ac: 5c 78 ff f8 bne r3,r24,801488c <_Timer_server_Body+0x100> <== NOT EXECUTED
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
80148b0: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
80148b4: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED
80148b8: f8 00 15 b4 calli 8019f88 <_Watchdog_Insert> <== NOT EXECUTED
80148bc: e3 ff ff f4 bi 801488c <_Timer_server_Body+0x100> <== NOT EXECUTED
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
80148c0: 90 00 10 00 rcsr r2,IE
80148c4: a0 52 08 00 and r1,r2,r18
80148c8: d0 01 00 00 wcsr IE,r1
if ( _Chain_Is_empty( insert_chain ) ) {
80148cc: 2b 81 00 50 lw r1,(sp+80)
80148d0: 5c 37 00 06 bne r1,r23,80148e8 <_Timer_server_Body+0x15c> <== NEVER TAKEN
ts->insert_chain = NULL;
80148d4: 59 60 00 78 sw (r11+120),r0
_ISR_Enable( level );
80148d8: 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 ) ) {
80148dc: 2b 81 00 44 lw r1,(sp+68)
80148e0: 5c 31 00 04 bne r1,r17,80148f0 <_Timer_server_Body+0x164>
80148e4: e0 00 00 15 bi 8014938 <_Timer_server_Body+0x1ac>
ts->insert_chain = NULL;
_ISR_Enable( level );
break;
} else {
_ISR_Enable( level );
80148e8: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
80148ec: e3 ff ff d2 bi 8014834 <_Timer_server_Body+0xa8> <== 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 );
80148f0: 90 00 18 00 rcsr r3,IE
80148f4: a0 72 08 00 and r1,r3,r18
80148f8: d0 01 00 00 wcsr IE,r1
initialized = false;
}
#endif
return status;
}
80148fc: 2b 82 00 44 lw r2,(sp+68)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
8014900: 44 51 00 0c be r2,r17,8014930 <_Timer_server_Body+0x1a4>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
8014904: 28 44 00 00 lw r4,(r2+0)
head->next = new_first;
8014908: 5b 84 00 44 sw (sp+68),r4
new_first->previous = head;
801490c: 58 8f 00 04 sw (r4+4),r15
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
8014910: 44 40 00 08 be r2,r0,8014930 <_Timer_server_Body+0x1a4> <== NEVER TAKEN
watchdog->state = WATCHDOG_INACTIVE;
8014914: 58 40 00 08 sw (r2+8),r0
_ISR_Enable( level );
8014918: d0 03 00 00 wcsr IE,r3
/*
* 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 );
801491c: 28 43 00 1c lw r3,(r2+28)
8014920: 28 41 00 20 lw r1,(r2+32)
8014924: 28 42 00 24 lw r2,(r2+36)
8014928: d8 60 00 00 call r3
}
801492c: e3 ff ff f1 bi 80148f0 <_Timer_server_Body+0x164>
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
_ISR_Enable( level );
} else {
_ISR_Enable( level );
8014930: d0 03 00 00 wcsr IE,r3
8014934: e3 ff ff bf bi 8014830 <_Timer_server_Body+0xa4>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
8014938: 31 60 00 7c sb (r11+124),r0
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
801493c: fb ff ff 54 calli 801468c <_Thread_Disable_dispatch>
_Thread_Set_state( ts->thread, STATES_DELAYING );
8014940: 29 61 00 00 lw r1,(r11+0)
8014944: 34 02 00 08 mvi r2,8
8014948: f8 00 13 28 calli 80195e8 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
801494c: b9 60 08 00 mv r1,r11
8014950: fb ff ff 55 calli 80146a4 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
8014954: b9 60 08 00 mv r1,r11
8014958: fb ff ff 70 calli 8014718 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
801495c: f8 00 10 46 calli 8018a74 <_Thread_Enable_dispatch>
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
8014960: ba a0 08 00 mv r1,r21
_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;
8014964: 31 76 00 7c sb (r11+124),r22
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
8014968: f8 00 15 e7 calli 801a104 <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
801496c: ba 80 08 00 mv r1,r20
8014970: f8 00 15 e5 calli 801a104 <_Watchdog_Remove>
8014974: e3 ff ff af bi 8014830 <_Timer_server_Body+0xa4>
08014978 <_Timer_server_Schedule_operation_method>:
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
8014978: 37 9c ff f4 addi sp,sp,-12
801497c: 5b 8b 00 0c sw (sp+12),r11
8014980: 5b 8c 00 08 sw (sp+8),r12
8014984: 5b 9d 00 04 sw (sp+4),ra
8014988: b8 20 58 00 mv r11,r1
if ( ts->insert_chain == NULL ) {
801498c: 28 21 00 78 lw r1,(r1+120)
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
8014990: b8 40 60 00 mv r12,r2
if ( ts->insert_chain == NULL ) {
8014994: 5c 20 00 43 bne r1,r0,8014aa0 <_Timer_server_Schedule_operation_method+0x128><== NEVER TAKEN
* 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();
8014998: fb ff ff 3d calli 801468c <_Thread_Disable_dispatch>
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
801499c: 29 81 00 38 lw r1,(r12+56)
80149a0: 34 02 00 01 mvi r2,1
80149a4: 5c 22 00 1d bne r1,r2,8014a18 <_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 );
80149a8: 90 00 10 00 rcsr r2,IE
80149ac: 34 01 ff fe mvi r1,-2
80149b0: a0 41 08 00 and r1,r2,r1
80149b4: d0 01 00 00 wcsr IE,r1
snapshot = _Watchdog_Ticks_since_boot;
80149b8: 78 01 08 04 mvhi r1,0x804
80149bc: 38 21 0e 20 ori r1,r1,0xe20
80149c0: 28 23 00 00 lw r3,(r1+0)
initialized = false;
}
#endif
return status;
}
80149c4: 29 61 00 30 lw r1,(r11+48)
* We have to advance the last known ticks value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
snapshot = _Watchdog_Ticks_since_boot;
last_snapshot = ts->Interval_watchdogs.last_snapshot;
80149c8: 29 65 00 3c lw r5,(r11+60)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
80149cc: 35 64 00 34 addi r4,r11,52
if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) {
80149d0: 44 24 00 07 be r1,r4,80149ec <_Timer_server_Schedule_operation_method+0x74>
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
80149d4: 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;
80149d8: 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;
80149dc: 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) {
80149e0: 50 a6 00 02 bgeu r5,r6,80149e8 <_Timer_server_Schedule_operation_method+0x70>
delta_interval -= delta;
80149e4: c8 c5 20 00 sub r4,r6,r5
} else {
delta_interval = 0;
}
first_watchdog->delta_interval = delta_interval;
80149e8: 58 24 00 10 sw (r1+16),r4
}
ts->Interval_watchdogs.last_snapshot = snapshot;
80149ec: 59 63 00 3c sw (r11+60),r3
_ISR_Enable( level );
80149f0: d0 02 00 00 wcsr IE,r2
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
80149f4: 35 61 00 30 addi r1,r11,48
80149f8: 35 82 00 10 addi r2,r12,16
80149fc: f8 00 15 63 calli 8019f88 <_Watchdog_Insert>
if ( !ts->active ) {
8014a00: 41 61 00 7c lbu r1,(r11+124)
8014a04: 20 21 00 ff andi r1,r1,0xff
8014a08: 5c 20 00 24 bne r1,r0,8014a98 <_Timer_server_Schedule_operation_method+0x120>
_Timer_server_Reset_interval_system_watchdog( ts );
8014a0c: b9 60 08 00 mv r1,r11
8014a10: fb ff ff 25 calli 80146a4 <_Timer_server_Reset_interval_system_watchdog>
8014a14: e0 00 00 21 bi 8014a98 <_Timer_server_Schedule_operation_method+0x120>
}
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
8014a18: 34 02 00 03 mvi r2,3
8014a1c: 5c 22 00 1f bne r1,r2,8014a98 <_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 );
8014a20: 90 00 30 00 rcsr r6,IE
8014a24: 34 01 ff fe mvi r1,-2
8014a28: a0 c1 08 00 and r1,r6,r1
8014a2c: d0 01 00 00 wcsr IE,r1
initialized = false;
}
#endif
return status;
}
8014a30: 29 62 00 68 lw r2,(r11+104)
/*
* 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();
8014a34: 78 01 08 04 mvhi r1,0x804
last_snapshot = ts->TOD_watchdogs.last_snapshot;
8014a38: 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();
8014a3c: 38 21 0d 98 ori r1,r1,0xd98
8014a40: 35 63 00 6c addi r3,r11,108
8014a44: 28 21 00 00 lw r1,(r1+0)
last_snapshot = ts->TOD_watchdogs.last_snapshot;
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
8014a48: 44 43 00 0a be r2,r3,8014a70 <_Timer_server_Schedule_operation_method+0xf8>
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
8014a4c: 28 44 00 10 lw r4,(r2+16)
}
} else {
/*
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
8014a50: b4 85 18 00 add r3,r4,r5
delta_interval += delta;
8014a54: 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 ) {
8014a58: 50 a1 00 05 bgeu r5,r1,8014a6c <_Timer_server_Schedule_operation_method+0xf4>
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
8014a5c: c8 25 28 00 sub r5,r1,r5
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
8014a60: 34 03 00 00 mvi r3,0
if ( snapshot > last_snapshot ) {
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
if (delta_interval > delta) {
8014a64: 50 a4 00 02 bgeu r5,r4,8014a6c <_Timer_server_Schedule_operation_method+0xf4><== NEVER TAKEN
delta_interval -= delta;
8014a68: 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;
8014a6c: 58 43 00 10 sw (r2+16),r3
}
ts->TOD_watchdogs.last_snapshot = snapshot;
8014a70: 59 61 00 74 sw (r11+116),r1
_ISR_Enable( level );
8014a74: d0 06 00 00 wcsr IE,r6
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
8014a78: 35 61 00 68 addi r1,r11,104
8014a7c: 35 82 00 10 addi r2,r12,16
8014a80: f8 00 15 42 calli 8019f88 <_Watchdog_Insert>
if ( !ts->active ) {
8014a84: 41 61 00 7c lbu r1,(r11+124)
8014a88: 20 21 00 ff andi r1,r1,0xff
8014a8c: 5c 20 00 03 bne r1,r0,8014a98 <_Timer_server_Schedule_operation_method+0x120>
_Timer_server_Reset_tod_system_watchdog( ts );
8014a90: b9 60 08 00 mv r1,r11
8014a94: fb ff ff 21 calli 8014718 <_Timer_server_Reset_tod_system_watchdog>
}
}
_Thread_Enable_dispatch();
8014a98: f8 00 0f f7 calli 8018a74 <_Thread_Enable_dispatch>
8014a9c: e0 00 00 03 bi 8014aa8 <_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 );
8014aa0: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED
8014aa4: f8 00 02 e4 calli 8015634 <_Chain_Append> <== NOT EXECUTED
}
}
8014aa8: 2b 9d 00 04 lw ra,(sp+4)
8014aac: 2b 8b 00 0c lw r11,(sp+12)
8014ab0: 2b 8c 00 08 lw r12,(sp+8)
8014ab4: 37 9c 00 0c addi sp,sp,12
8014ab8: c3 a0 00 00 ret
08007888 <_User_extensions_Handler_initialization>:
#include <rtems/score/userext.h>
#include <rtems/score/wkspace.h>
#include <string.h>
void _User_extensions_Handler_initialization(void)
{
8007888: 37 9c ff ec addi sp,sp,-20
800788c: 5b 8b 00 14 sw (sp+20),r11
8007890: 5b 8c 00 10 sw (sp+16),r12
8007894: 5b 8d 00 0c sw (sp+12),r13
8007898: 5b 8e 00 08 sw (sp+8),r14
800789c: 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;
80078a0: 78 02 08 01 mvhi r2,0x801
80078a4: 38 42 90 dc ori r2,r2,0x90dc
80078a8: 28 4e 00 38 lw r14,(r2+56)
initial_extensions = Configuration.User_extension_table;
80078ac: 28 4b 00 3c lw r11,(r2+60)
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80078b0: 78 03 08 01 mvhi r3,0x801
80078b4: 78 02 08 01 mvhi r2,0x801
80078b8: 38 42 9a ec ori r2,r2,0x9aec
80078bc: 38 63 9a f0 ori r3,r3,0x9af0
80078c0: 58 43 00 00 sw (r2+0),r3
head->previous = NULL;
80078c4: 58 40 00 04 sw (r2+4),r0
tail->previous = head;
80078c8: 58 42 00 08 sw (r2+8),r2
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80078cc: 78 03 08 01 mvhi r3,0x801
80078d0: 78 02 08 01 mvhi r2,0x801
80078d4: 38 42 99 94 ori r2,r2,0x9994
80078d8: 38 63 99 98 ori r3,r3,0x9998
80078dc: 58 43 00 00 sw (r2+0),r3
head->previous = NULL;
80078e0: 58 40 00 04 sw (r2+4),r0
tail->previous = head;
80078e4: 58 42 00 08 sw (r2+8),r2
_Chain_Initialize_empty( &_User_extensions_List );
_Chain_Initialize_empty( &_User_extensions_Switches_list );
if ( initial_extensions ) {
80078e8: 45 60 00 22 be r11,r0,8007970 <_User_extensions_Handler_initialization+0xe8><== NEVER TAKEN
extension = (User_extensions_Control *)
_Workspace_Allocate_or_fatal_error(
number_of_extensions * sizeof( User_extensions_Control )
80078ec: 34 02 00 34 mvi r2,52
80078f0: b9 c0 08 00 mv r1,r14
80078f4: f8 00 3d fc calli 80170e4 <__mulsi3>
80078f8: 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(
80078fc: f8 00 01 84 calli 8007f0c <_Workspace_Allocate_or_fatal_error>
number_of_extensions * sizeof( User_extensions_Control )
);
memset (
8007900: b9 a0 18 00 mv r3,r13
8007904: 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(
8007908: b8 20 60 00 mv r12,r1
extension,
0,
number_of_extensions * sizeof( User_extensions_Control )
);
for ( i = 0 ; i < number_of_extensions ; i++ ) {
800790c: 34 0d 00 00 mvi r13,0
extension = (User_extensions_Control *)
_Workspace_Allocate_or_fatal_error(
number_of_extensions * sizeof( User_extensions_Control )
);
memset (
8007910: f8 00 29 cf calli 801204c <memset>
extension,
0,
number_of_extensions * sizeof( User_extensions_Control )
);
for ( i = 0 ; i < number_of_extensions ; i++ ) {
8007914: e0 00 00 16 bi 800796c <_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;
8007918: 29 61 00 1c lw r1,(r11+28)
800791c: 29 68 00 00 lw r8,(r11+0)
8007920: 29 67 00 04 lw r7,(r11+4)
8007924: 29 66 00 08 lw r6,(r11+8)
8007928: 29 65 00 0c lw r5,(r11+12)
800792c: 29 64 00 10 lw r4,(r11+16)
8007930: 29 63 00 14 lw r3,(r11+20)
8007934: 29 62 00 18 lw r2,(r11+24)
8007938: 59 81 00 30 sw (r12+48),r1
800793c: 59 88 00 14 sw (r12+20),r8
8007940: 59 87 00 18 sw (r12+24),r7
8007944: 59 86 00 1c sw (r12+28),r6
8007948: 59 85 00 20 sw (r12+32),r5
800794c: 59 84 00 24 sw (r12+36),r4
8007950: 59 83 00 28 sw (r12+40),r3
8007954: 59 82 00 2c sw (r12+44),r2
_User_extensions_Add_set( extension );
8007958: b9 80 08 00 mv r1,r12
800795c: f8 00 1e dd calli 800f4d0 <_User_extensions_Add_set>
_User_extensions_Add_set_with_table (extension, &initial_extensions[i]);
extension++;
8007960: 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++ ) {
8007964: 35 ad 00 01 addi r13,r13,1
8007968: 35 6b 00 20 addi r11,r11,32
800796c: 55 cd ff eb bgu r14,r13,8007918 <_User_extensions_Handler_initialization+0x90>
_User_extensions_Add_set_with_table (extension, &initial_extensions[i]);
extension++;
}
}
}
8007970: 2b 9d 00 04 lw ra,(sp+4)
8007974: 2b 8b 00 14 lw r11,(sp+20)
8007978: 2b 8c 00 10 lw r12,(sp+16)
800797c: 2b 8d 00 0c lw r13,(sp+12)
8007980: 2b 8e 00 08 lw r14,(sp+8)
8007984: 37 9c 00 14 addi sp,sp,20
8007988: c3 a0 00 00 ret
080089e0 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
80089e0: 37 9c ff e4 addi sp,sp,-28
80089e4: 5b 8b 00 1c sw (sp+28),r11
80089e8: 5b 8c 00 18 sw (sp+24),r12
80089ec: 5b 8d 00 14 sw (sp+20),r13
80089f0: 5b 8e 00 10 sw (sp+16),r14
80089f4: 5b 8f 00 0c sw (sp+12),r15
80089f8: 5b 90 00 08 sw (sp+8),r16
80089fc: 5b 9d 00 04 sw (sp+4),ra
8008a00: b8 20 60 00 mv r12,r1
8008a04: b8 60 58 00 mv r11,r3
ISR_Level level;
_ISR_Disable( level );
8008a08: 90 00 08 00 rcsr r1,IE
8008a0c: 34 03 ff fe mvi r3,-2
8008a10: a0 23 18 00 and r3,r1,r3
8008a14: d0 03 00 00 wcsr IE,r3
}
}
_ISR_Enable( level );
}
8008a18: 29 83 00 00 lw r3,(r12+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8008a1c: 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 ) ) {
8008a20: 44 6e 00 1d be r3,r14,8008a94 <_Watchdog_Adjust+0xb4>
switch ( direction ) {
8008a24: 44 40 00 04 be r2,r0,8008a34 <_Watchdog_Adjust+0x54>
8008a28: 34 04 00 01 mvi r4,1
8008a2c: 5c 44 00 1a bne r2,r4,8008a94 <_Watchdog_Adjust+0xb4> <== NEVER TAKEN
8008a30: e0 00 00 04 bi 8008a40 <_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;
8008a34: 34 10 00 01 mvi r16,1
_ISR_Enable( level );
_Watchdog_Tickle( header );
_ISR_Disable( level );
8008a38: 34 0f ff fe mvi r15,-2
8008a3c: e0 00 00 15 bi 8008a90 <_Watchdog_Adjust+0xb0>
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
8008a40: 28 62 00 10 lw r2,(r3+16)
8008a44: b4 4b 58 00 add r11,r2,r11
8008a48: 58 6b 00 10 sw (r3+16),r11
break;
8008a4c: e0 00 00 12 bi 8008a94 <_Watchdog_Adjust+0xb4>
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) _Chain_First( header ) );
8008a50: 29 82 00 00 lw r2,(r12+0)
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
8008a54: 28 4d 00 10 lw r13,(r2+16)
8008a58: 51 6d 00 04 bgeu r11,r13,8008a68 <_Watchdog_Adjust+0x88>
_Watchdog_First( header )->delta_interval -= units;
8008a5c: c9 ab 58 00 sub r11,r13,r11
8008a60: 58 4b 00 10 sw (r2+16),r11
break;
8008a64: e0 00 00 0c bi 8008a94 <_Watchdog_Adjust+0xb4>
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
8008a68: 58 50 00 10 sw (r2+16),r16
_ISR_Enable( level );
8008a6c: d0 01 00 00 wcsr IE,r1
_Watchdog_Tickle( header );
8008a70: b9 80 08 00 mv r1,r12
8008a74: f8 00 00 9a calli 8008cdc <_Watchdog_Tickle>
_ISR_Disable( level );
8008a78: 90 00 08 00 rcsr r1,IE
8008a7c: a0 2f 10 00 and r2,r1,r15
8008a80: d0 02 00 00 wcsr IE,r2
if ( _Chain_Is_empty( header ) )
8008a84: 29 82 00 00 lw r2,(r12+0)
8008a88: 44 4e 00 03 be r2,r14,8008a94 <_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;
8008a8c: 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 ) {
8008a90: 5d 60 ff f0 bne r11,r0,8008a50 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN
}
break;
}
}
_ISR_Enable( level );
8008a94: d0 01 00 00 wcsr IE,r1
}
8008a98: 2b 9d 00 04 lw ra,(sp+4)
8008a9c: 2b 8b 00 1c lw r11,(sp+28)
8008aa0: 2b 8c 00 18 lw r12,(sp+24)
8008aa4: 2b 8d 00 14 lw r13,(sp+20)
8008aa8: 2b 8e 00 10 lw r14,(sp+16)
8008aac: 2b 8f 00 0c lw r15,(sp+12)
8008ab0: 2b 90 00 08 lw r16,(sp+8)
8008ab4: 37 9c 00 1c addi sp,sp,28
8008ab8: c3 a0 00 00 ret
08007da4 <_Watchdog_Remove>:
{
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
8007da4: 90 00 28 00 rcsr r5,IE
8007da8: 34 02 ff fe mvi r2,-2
8007dac: a0 a2 10 00 and r2,r5,r2
8007db0: d0 02 00 00 wcsr IE,r2
previous_state = the_watchdog->state;
8007db4: 28 23 00 08 lw r3,(r1+8)
switch ( previous_state ) {
8007db8: 34 02 00 01 mvi r2,1
8007dbc: 44 62 00 05 be r3,r2,8007dd0 <_Watchdog_Remove+0x2c>
8007dc0: 44 60 00 1b be r3,r0,8007e2c <_Watchdog_Remove+0x88>
8007dc4: 34 02 00 03 mvi r2,3
8007dc8: 54 62 00 19 bgu r3,r2,8007e2c <_Watchdog_Remove+0x88> <== NEVER TAKEN
8007dcc: e0 00 00 03 bi 8007dd8 <_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;
8007dd0: 58 20 00 08 sw (r1+8),r0
break;
8007dd4: e0 00 00 16 bi 8007e2c <_Watchdog_Remove+0x88>
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
_ISR_Enable( level );
return( previous_state );
}
8007dd8: 28 22 00 00 lw r2,(r1+0)
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
8007ddc: 58 20 00 08 sw (r1+8),r0
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
8007de0: 28 44 00 00 lw r4,(r2+0)
8007de4: 44 80 00 05 be r4,r0,8007df8 <_Watchdog_Remove+0x54>
next_watchdog->delta_interval += the_watchdog->delta_interval;
8007de8: 28 46 00 10 lw r6,(r2+16)
8007dec: 28 24 00 10 lw r4,(r1+16)
8007df0: b4 c4 20 00 add r4,r6,r4
8007df4: 58 44 00 10 sw (r2+16),r4
if ( _Watchdog_Sync_count )
8007df8: 78 04 08 01 mvhi r4,0x801
8007dfc: 38 84 9a 9c ori r4,r4,0x9a9c
8007e00: 28 84 00 00 lw r4,(r4+0)
8007e04: 44 80 00 07 be r4,r0,8007e20 <_Watchdog_Remove+0x7c>
_Watchdog_Sync_level = _ISR_Nest_level;
8007e08: 78 04 08 01 mvhi r4,0x801
8007e0c: 38 84 9e 3c ori r4,r4,0x9e3c
8007e10: 28 86 00 08 lw r6,(r4+8)
8007e14: 78 04 08 01 mvhi r4,0x801
8007e18: 38 84 9a 34 ori r4,r4,0x9a34
8007e1c: 58 86 00 00 sw (r4+0),r6
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
8007e20: 28 24 00 04 lw r4,(r1+4)
next->previous = previous;
8007e24: 58 44 00 04 sw (r2+4),r4
previous->next = next;
8007e28: 58 82 00 00 sw (r4+0),r2
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
8007e2c: 78 02 08 01 mvhi r2,0x801
8007e30: 38 42 9a a0 ori r2,r2,0x9aa0
8007e34: 28 42 00 00 lw r2,(r2+0)
8007e38: 58 22 00 18 sw (r1+24),r2
_ISR_Enable( level );
8007e3c: d0 05 00 00 wcsr IE,r5
return( previous_state );
}
8007e40: b8 60 08 00 mv r1,r3
8007e44: c3 a0 00 00 ret
0800860c <_Watchdog_Report_chain>:
void _Watchdog_Report_chain(
const char *name,
Chain_Control *header
)
{
800860c: 37 9c ff ec addi sp,sp,-20
8008610: 5b 8b 00 14 sw (sp+20),r11
8008614: 5b 8c 00 10 sw (sp+16),r12
8008618: 5b 8d 00 0c sw (sp+12),r13
800861c: 5b 8e 00 08 sw (sp+8),r14
8008620: 5b 9d 00 04 sw (sp+4),ra
8008624: b8 20 70 00 mv r14,r1
8008628: b8 40 60 00 mv r12,r2
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
800862c: 90 00 68 00 rcsr r13,IE
8008630: 34 01 ff fe mvi r1,-2
8008634: a1 a1 08 00 and r1,r13,r1
8008638: d0 01 00 00 wcsr IE,r1
printk( "Watchdog Chain: %s %p\n", name, header );
800863c: 78 01 08 01 mvhi r1,0x801
8008640: b9 80 18 00 mv r3,r12
8008644: 38 21 ed 0c ori r1,r1,0xed0c
8008648: b9 c0 10 00 mv r2,r14
800864c: fb ff eb 6b calli 80033f8 <printk>
printk( "== end of %s \n", name );
} else {
printk( "Chain is empty\n" );
}
_ISR_Enable( level );
}
8008650: 29 8b 00 00 lw r11,(r12+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8008654: 35 8c 00 04 addi r12,r12,4
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
8008658: 45 6c 00 0b be r11,r12,8008684 <_Watchdog_Report_chain+0x78>
node != _Chain_Tail(header) ;
node = node->next )
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
800865c: b9 60 10 00 mv r2,r11
8008660: 34 01 00 00 mvi r1,0
8008664: f8 00 00 13 calli 80086b0 <_Watchdog_Report>
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = _Chain_First( header ) ;
node != _Chain_Tail(header) ;
node = node->next )
8008668: 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 = _Chain_First( header ) ;
800866c: 5d 6c ff fc bne r11,r12,800865c <_Watchdog_Report_chain+0x50><== NEVER TAKEN
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
8008670: 78 01 08 01 mvhi r1,0x801
8008674: 38 21 ed 24 ori r1,r1,0xed24
8008678: b9 c0 10 00 mv r2,r14
800867c: fb ff eb 5f calli 80033f8 <printk>
8008680: e0 00 00 04 bi 8008690 <_Watchdog_Report_chain+0x84>
} else {
printk( "Chain is empty\n" );
8008684: 78 01 08 01 mvhi r1,0x801
8008688: 38 21 ed 34 ori r1,r1,0xed34
800868c: fb ff eb 5b calli 80033f8 <printk>
}
_ISR_Enable( level );
8008690: d0 0d 00 00 wcsr IE,r13
}
8008694: 2b 9d 00 04 lw ra,(sp+4)
8008698: 2b 8b 00 14 lw r11,(sp+20)
800869c: 2b 8c 00 10 lw r12,(sp+16)
80086a0: 2b 8d 00 0c lw r13,(sp+12)
80086a4: 2b 8e 00 08 lw r14,(sp+8)
80086a8: 37 9c 00 14 addi sp,sp,20
80086ac: c3 a0 00 00 ret
0800c524 <_Watchdog_Tickle>:
*/
void _Watchdog_Tickle(
Chain_Control *header
)
{
800c524: 37 9c ff e4 addi sp,sp,-28
800c528: 5b 8b 00 1c sw (sp+28),r11
800c52c: 5b 8c 00 18 sw (sp+24),r12
800c530: 5b 8d 00 14 sw (sp+20),r13
800c534: 5b 8e 00 10 sw (sp+16),r14
800c538: 5b 8f 00 0c sw (sp+12),r15
800c53c: 5b 90 00 08 sw (sp+8),r16
800c540: 5b 9d 00 04 sw (sp+4),ra
800c544: 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 );
800c548: 90 00 18 00 rcsr r3,IE
800c54c: 34 01 ff fe mvi r1,-2
800c550: a0 61 08 00 and r1,r3,r1
800c554: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
800c558: 29 8b 00 00 lw r11,(r12+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
800c55c: 35 8e 00 04 addi r14,r12,4
* 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 );
800c560: b8 60 10 00 mv r2,r3
if ( _Chain_Is_empty( header ) )
800c564: 45 6e 00 1a be r11,r14,800c5cc <_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) {
800c568: 29 61 00 10 lw r1,(r11+16)
800c56c: 44 20 00 04 be r1,r0,800c57c <_Watchdog_Tickle+0x58>
the_watchdog->delta_interval--;
800c570: 34 21 ff ff addi r1,r1,-1
800c574: 59 61 00 10 sw (r11+16),r1
if ( the_watchdog->delta_interval != 0 )
800c578: 5c 20 00 15 bne r1,r0,800c5cc <_Watchdog_Tickle+0xa8>
*/
void _Watchdog_Tickle(
Chain_Control *header
)
{
800c57c: b8 60 68 00 mv r13,r3
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
_ISR_Enable( level );
switch( watchdog_state ) {
800c580: 34 10 00 02 mvi r16,2
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
800c584: 34 0f ff fe mvi r15,-2
800c588: e0 00 00 02 bi 800c590 <_Watchdog_Tickle+0x6c>
800c58c: b8 40 68 00 mv r13,r2
if ( the_watchdog->delta_interval != 0 )
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
800c590: b9 60 08 00 mv r1,r11
800c594: fb ff ff bb calli 800c480 <_Watchdog_Remove>
_ISR_Enable( level );
800c598: d0 0d 00 00 wcsr IE,r13
switch( watchdog_state ) {
800c59c: 5c 30 00 05 bne r1,r16,800c5b0 <_Watchdog_Tickle+0x8c> <== NEVER TAKEN
case WATCHDOG_ACTIVE:
(*the_watchdog->routine)(
800c5a0: 29 63 00 1c lw r3,(r11+28)
800c5a4: 29 61 00 20 lw r1,(r11+32)
800c5a8: 29 62 00 24 lw r2,(r11+36)
800c5ac: d8 60 00 00 call r3
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
800c5b0: 90 00 10 00 rcsr r2,IE
800c5b4: a0 4f 08 00 and r1,r2,r15
800c5b8: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
800c5bc: 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) );
800c5c0: 45 6e 00 03 be r11,r14,800c5cc <_Watchdog_Tickle+0xa8>
}
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
800c5c4: 29 61 00 10 lw r1,(r11+16)
800c5c8: 44 20 ff f1 be r1,r0,800c58c <_Watchdog_Tickle+0x68>
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
800c5cc: d0 02 00 00 wcsr IE,r2
}
800c5d0: 2b 9d 00 04 lw ra,(sp+4)
800c5d4: 2b 8b 00 1c lw r11,(sp+28)
800c5d8: 2b 8c 00 18 lw r12,(sp+24)
800c5dc: 2b 8d 00 14 lw r13,(sp+20)
800c5e0: 2b 8e 00 10 lw r14,(sp+16)
800c5e4: 2b 8f 00 0c lw r15,(sp+12)
800c5e8: 2b 90 00 08 lw r16,(sp+8)
800c5ec: 37 9c 00 1c addi sp,sp,28
800c5f0: c3 a0 00 00 ret
080039a4 <aio_cancel>:
* operation(s) cannot be canceled
*/
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
80039a4: 37 9c ff e8 addi sp,sp,-24
80039a8: 5b 8b 00 18 sw (sp+24),r11
80039ac: 5b 8c 00 14 sw (sp+20),r12
80039b0: 5b 8d 00 10 sw (sp+16),r13
80039b4: 5b 8e 00 0c sw (sp+12),r14
80039b8: 5b 8f 00 08 sw (sp+8),r15
80039bc: 5b 9d 00 04 sw (sp+4),ra
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
80039c0: 78 0b 08 01 mvhi r11,0x801
80039c4: 39 6b 78 68 ori r11,r11,0x7868
* operation(s) cannot be canceled
*/
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
80039c8: b8 20 70 00 mv r14,r1
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
80039cc: b9 60 08 00 mv r1,r11
* operation(s) cannot be canceled
*/
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
80039d0: b8 40 60 00 mv r12,r2
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
80039d4: f8 00 04 c9 calli 8004cf8 <pthread_mutex_lock>
if (fcntl (fildes, F_GETFD) < 0) {
80039d8: b9 c0 08 00 mv r1,r14
80039dc: 34 02 00 01 mvi r2,1
80039e0: f8 00 1e 6c calli 800b390 <fcntl>
80039e4: 4c 20 00 06 bge r1,r0,80039fc <aio_cancel+0x58>
pthread_mutex_unlock(&aio_request_queue.mutex);
80039e8: b9 60 08 00 mv r1,r11
80039ec: f8 00 04 f6 calli 8004dc4 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EBADF);
80039f0: f8 00 2e c7 calli 800f50c <__errno>
80039f4: 34 02 00 09 mvi r2,9
80039f8: e0 00 00 32 bi 8003ac0 <aio_cancel+0x11c>
}
/* if aiocbp is NULL remove all request for given file descriptor */
if (aiocbp == NULL) {
80039fc: 5d 80 00 2b bne r12,r0,8003aa8 <aio_cancel+0x104>
AIO_printf ("Cancel all requests\n");
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
8003a00: 78 01 08 01 mvhi r1,0x801
8003a04: 38 21 78 b0 ori r1,r1,0x78b0
8003a08: b9 c0 10 00 mv r2,r14
8003a0c: 34 03 00 00 mvi r3,0
8003a10: f8 00 00 c1 calli 8003d14 <rtems_aio_search_fd>
8003a14: b8 20 68 00 mv r13,r1
if (r_chain == NULL) {
8003a18: 5c 2c 00 17 bne r1,r12,8003a74 <aio_cancel+0xd0>
AIO_printf ("Request chain not on [WQ]\n");
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003a1c: 29 62 00 54 lw r2,(r11+84)
8003a20: 78 01 08 01 mvhi r1,0x801
8003a24: 38 21 78 c0 ori r1,r1,0x78c0
8003a28: 44 41 00 3f be r2,r1,8003b24 <aio_cancel+0x180> <== NEVER TAKEN
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
8003a2c: 78 01 08 01 mvhi r1,0x801
8003a30: 38 21 78 bc ori r1,r1,0x78bc
8003a34: b9 c0 10 00 mv r2,r14
8003a38: 34 03 00 00 mvi r3,0
8003a3c: f8 00 00 b6 calli 8003d14 <rtems_aio_search_fd>
8003a40: b8 20 60 00 mv r12,r1
if (r_chain == NULL) {
8003a44: 44 2d 00 38 be r1,r13,8003b24 <aio_cancel+0x180>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
8003a48: f8 00 0a 7a calli 8006430 <_Chain_Extract>
}
AIO_printf ("Request chain on [IQ]\n");
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
8003a4c: b9 80 08 00 mv r1,r12
8003a50: f8 00 01 b2 calli 8004118 <rtems_aio_remove_fd>
pthread_mutex_destroy (&r_chain->mutex);
8003a54: 35 8d 00 1c addi r13,r12,28
8003a58: b9 a0 08 00 mv r1,r13
8003a5c: f8 00 03 ed calli 8004a10 <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->mutex);
8003a60: b9 a0 08 00 mv r1,r13
8003a64: f8 00 02 ec calli 8004614 <pthread_cond_destroy>
free (r_chain);
8003a68: b9 80 08 00 mv r1,r12
8003a6c: fb ff f9 bd calli 8002160 <free>
8003a70: e0 00 00 0a bi 8003a98 <aio_cancel+0xf4>
return AIO_ALLDONE;
}
AIO_printf ("Request chain on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
8003a74: 34 2c 00 1c addi r12,r1,28
8003a78: b9 80 08 00 mv r1,r12
8003a7c: f8 00 04 9f calli 8004cf8 <pthread_mutex_lock>
8003a80: b9 a0 08 00 mv r1,r13
8003a84: f8 00 0a 6b calli 8006430 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
8003a88: b9 a0 08 00 mv r1,r13
8003a8c: f8 00 01 a3 calli 8004118 <rtems_aio_remove_fd>
pthread_mutex_unlock (&r_chain->mutex);
8003a90: b9 80 08 00 mv r1,r12
8003a94: f8 00 04 cc calli 8004dc4 <pthread_mutex_unlock>
pthread_mutex_unlock (&aio_request_queue.mutex);
8003a98: b9 60 08 00 mv r1,r11
8003a9c: f8 00 04 ca calli 8004dc4 <pthread_mutex_unlock>
return AIO_CANCELED;
8003aa0: 34 0c 00 00 mvi r12,0
8003aa4: e0 00 00 2f bi 8003b60 <aio_cancel+0x1bc>
} else {
AIO_printf ("Cancel request\n");
if (aiocbp->aio_fildes != fildes) {
8003aa8: 29 8f 00 00 lw r15,(r12+0)
8003aac: 45 ee 00 08 be r15,r14,8003acc <aio_cancel+0x128>
pthread_mutex_unlock (&aio_request_queue.mutex);
8003ab0: b9 60 08 00 mv r1,r11
8003ab4: f8 00 04 c4 calli 8004dc4 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EINVAL);
8003ab8: f8 00 2e 95 calli 800f50c <__errno>
8003abc: 34 02 00 16 mvi r2,22
8003ac0: 58 22 00 00 sw (r1+0),r2
8003ac4: 34 0c ff ff mvi r12,-1
8003ac8: e0 00 00 26 bi 8003b60 <aio_cancel+0x1bc>
}
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
8003acc: 78 01 08 01 mvhi r1,0x801
8003ad0: 38 21 78 b0 ori r1,r1,0x78b0
8003ad4: b9 e0 10 00 mv r2,r15
8003ad8: 34 03 00 00 mvi r3,0
8003adc: f8 00 00 8e calli 8003d14 <rtems_aio_search_fd>
8003ae0: b8 20 68 00 mv r13,r1
if (r_chain == NULL) {
8003ae4: 5c 20 00 14 bne r1,r0,8003b34 <aio_cancel+0x190>
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003ae8: 29 62 00 54 lw r2,(r11+84)
8003aec: 78 01 08 01 mvhi r1,0x801
8003af0: 38 21 78 c0 ori r1,r1,0x78c0
8003af4: 44 41 00 0c be r2,r1,8003b24 <aio_cancel+0x180> <== NEVER TAKEN
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
8003af8: 78 01 08 01 mvhi r1,0x801
8003afc: 38 21 78 bc ori r1,r1,0x78bc
8003b00: b9 e0 10 00 mv r2,r15
8003b04: 34 03 00 00 mvi r3,0
8003b08: f8 00 00 83 calli 8003d14 <rtems_aio_search_fd>
if (r_chain == NULL) {
8003b0c: 44 20 ff e9 be r1,r0,8003ab0 <aio_cancel+0x10c>
rtems_set_errno_and_return_minus_one (EINVAL);
}
AIO_printf ("Request on [IQ]\n");
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
8003b10: b9 80 10 00 mv r2,r12
8003b14: 34 21 00 08 addi r1,r1,8
8003b18: f8 00 01 9e calli 8004190 <rtems_aio_remove_req>
8003b1c: b8 20 60 00 mv r12,r1
8003b20: e0 00 00 0e bi 8003b58 <aio_cancel+0x1b4>
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
} else {
pthread_mutex_unlock (&aio_request_queue.mutex);
8003b24: b9 60 08 00 mv r1,r11
8003b28: f8 00 04 a7 calli 8004dc4 <pthread_mutex_unlock>
return AIO_ALLDONE;
8003b2c: 34 0c 00 02 mvi r12,2
8003b30: e0 00 00 0c bi 8003b60 <aio_cancel+0x1bc>
}
}
AIO_printf ("Request on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
8003b34: 34 2e 00 1c addi r14,r1,28
8003b38: b9 c0 08 00 mv r1,r14
8003b3c: f8 00 04 6f calli 8004cf8 <pthread_mutex_lock>
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
8003b40: b9 80 10 00 mv r2,r12
8003b44: 35 a1 00 08 addi r1,r13,8
8003b48: f8 00 01 92 calli 8004190 <rtems_aio_remove_req>
8003b4c: b8 20 60 00 mv r12,r1
pthread_mutex_unlock (&r_chain->mutex);
8003b50: b9 c0 08 00 mv r1,r14
8003b54: f8 00 04 9c calli 8004dc4 <pthread_mutex_unlock>
pthread_mutex_unlock (&aio_request_queue.mutex);
8003b58: b9 60 08 00 mv r1,r11
8003b5c: f8 00 04 9a calli 8004dc4 <pthread_mutex_unlock>
return result;
}
return AIO_ALLDONE;
}
8003b60: b9 80 08 00 mv r1,r12
8003b64: 2b 9d 00 04 lw ra,(sp+4)
8003b68: 2b 8b 00 18 lw r11,(sp+24)
8003b6c: 2b 8c 00 14 lw r12,(sp+20)
8003b70: 2b 8d 00 10 lw r13,(sp+16)
8003b74: 2b 8e 00 0c lw r14,(sp+12)
8003b78: 2b 8f 00 08 lw r15,(sp+8)
8003b7c: 37 9c 00 18 addi sp,sp,24
8003b80: c3 a0 00 00 ret
08003b8c <aio_fsync>:
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
8003b8c: 37 9c ff f4 addi sp,sp,-12
8003b90: 5b 8b 00 0c sw (sp+12),r11
8003b94: 5b 8c 00 08 sw (sp+8),r12
8003b98: 5b 9d 00 04 sw (sp+4),ra
8003b9c: b8 40 58 00 mv r11,r2
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
8003ba0: 34 02 20 00 mvi r2,8192
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
8003ba4: 34 0c 00 16 mvi r12,22
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
8003ba8: 5c 22 00 09 bne r1,r2,8003bcc <aio_fsync+0x40>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
8003bac: 29 61 00 00 lw r1,(r11+0)
8003bb0: 34 02 00 03 mvi r2,3
8003bb4: f8 00 1d f7 calli 800b390 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
8003bb8: 20 21 00 03 andi r1,r1,0x3
8003bbc: 34 21 ff ff addi r1,r1,-1
8003bc0: 34 02 00 01 mvi r2,1
8003bc4: 50 41 00 09 bgeu r2,r1,8003be8 <aio_fsync+0x5c>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
8003bc8: 34 0c 00 09 mvi r12,9
8003bcc: 34 01 ff ff mvi r1,-1
8003bd0: 59 6c 00 2c sw (r11+44),r12
8003bd4: 59 61 00 30 sw (r11+48),r1
8003bd8: f8 00 2e 4d calli 800f50c <__errno>
8003bdc: 58 2c 00 00 sw (r1+0),r12
8003be0: 34 01 ff ff mvi r1,-1
8003be4: e0 00 00 09 bi 8003c08 <aio_fsync+0x7c>
req = malloc (sizeof (rtems_aio_request));
8003be8: 34 01 00 18 mvi r1,24
8003bec: fb ff fb 15 calli 8002840 <malloc>
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
8003bf0: 34 0c 00 0b mvi r12,11
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
8003bf4: 44 20 ff f6 be r1,r0,8003bcc <aio_fsync+0x40> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
8003bf8: 58 2b 00 14 sw (r1+20),r11
req->aiocbp->aio_lio_opcode = LIO_SYNC;
8003bfc: 34 02 00 03 mvi r2,3
8003c00: 59 62 00 28 sw (r11+40),r2
return rtems_aio_enqueue (req);
8003c04: f8 00 01 7f calli 8004200 <rtems_aio_enqueue>
}
8003c08: 2b 9d 00 04 lw ra,(sp+4)
8003c0c: 2b 8b 00 0c lw r11,(sp+12)
8003c10: 2b 8c 00 08 lw r12,(sp+8)
8003c14: 37 9c 00 0c addi sp,sp,12
8003c18: c3 a0 00 00 ret
08004458 <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
8004458: 37 9c ff f4 addi sp,sp,-12
800445c: 5b 8b 00 0c sw (sp+12),r11
8004460: 5b 8c 00 08 sw (sp+8),r12
8004464: 5b 9d 00 04 sw (sp+4),ra
8004468: b8 20 58 00 mv r11,r1
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
800446c: 28 21 00 00 lw r1,(r1+0)
8004470: 34 02 00 03 mvi r2,3
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
8004474: 34 0c 00 09 mvi r12,9
aio_read (struct aiocb *aiocbp)
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
8004478: f8 00 1b c6 calli 800b390 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
800447c: 20 21 00 03 andi r1,r1,0x3
8004480: 7c 22 00 02 cmpnei r2,r1,2
8004484: 7c 21 00 00 cmpnei r1,r1,0
8004488: a0 41 08 00 and r1,r2,r1
800448c: 5c 20 00 04 bne r1,r0,800449c <aio_read+0x44>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
8004490: 29 6c 00 10 lw r12,(r11+16)
8004494: 45 81 00 09 be r12,r1,80044b8 <aio_read+0x60>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
8004498: 34 0c 00 16 mvi r12,22
800449c: 34 01 ff ff mvi r1,-1
80044a0: 59 6c 00 2c sw (r11+44),r12
80044a4: 59 61 00 30 sw (r11+48),r1
80044a8: f8 00 2c 19 calli 800f50c <__errno>
80044ac: 58 2c 00 00 sw (r1+0),r12
80044b0: 34 01 ff ff mvi r1,-1
80044b4: e0 00 00 0d bi 80044e8 <aio_read+0x90>
if (aiocbp->aio_offset < 0)
80044b8: 29 61 00 04 lw r1,(r11+4)
80044bc: 4c 2c 00 02 bge r1,r12,80044c4 <aio_read+0x6c>
80044c0: e3 ff ff f6 bi 8004498 <aio_read+0x40>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
80044c4: 34 01 00 18 mvi r1,24
80044c8: fb ff f8 de calli 8002840 <malloc>
if (req == NULL)
80044cc: 5c 2c 00 03 bne r1,r12,80044d8 <aio_read+0x80> <== ALWAYS TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
80044d0: 34 0c 00 0b mvi r12,11 <== NOT EXECUTED
80044d4: e3 ff ff f2 bi 800449c <aio_read+0x44> <== NOT EXECUTED
req->aiocbp = aiocbp;
80044d8: 58 2b 00 14 sw (r1+20),r11
req->aiocbp->aio_lio_opcode = LIO_READ;
80044dc: 34 02 00 01 mvi r2,1
80044e0: 59 62 00 28 sw (r11+40),r2
return rtems_aio_enqueue (req);
80044e4: fb ff ff 47 calli 8004200 <rtems_aio_enqueue>
}
80044e8: 2b 9d 00 04 lw ra,(sp+4)
80044ec: 2b 8b 00 0c lw r11,(sp+12)
80044f0: 2b 8c 00 08 lw r12,(sp+8)
80044f4: 37 9c 00 0c addi sp,sp,12
80044f8: c3 a0 00 00 ret
08004504 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
8004504: 37 9c ff f4 addi sp,sp,-12
8004508: 5b 8b 00 0c sw (sp+12),r11
800450c: 5b 8c 00 08 sw (sp+8),r12
8004510: 5b 9d 00 04 sw (sp+4),ra
8004514: b8 20 58 00 mv r11,r1
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
8004518: 28 21 00 00 lw r1,(r1+0)
800451c: 34 02 00 03 mvi r2,3
8004520: f8 00 1b 9c calli 800b390 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
8004524: 20 21 00 03 andi r1,r1,0x3
8004528: 34 21 ff ff addi r1,r1,-1
800452c: 34 02 00 01 mvi r2,1
8004530: 50 41 00 03 bgeu r2,r1,800453c <aio_write+0x38>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
8004534: 34 0c 00 09 mvi r12,9
8004538: e0 00 00 04 bi 8004548 <aio_write+0x44>
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
800453c: 29 61 00 10 lw r1,(r11+16)
8004540: 44 20 00 09 be r1,r0,8004564 <aio_write+0x60>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
8004544: 34 0c 00 16 mvi r12,22
8004548: 34 01 ff ff mvi r1,-1
800454c: 59 6c 00 2c sw (r11+44),r12
8004550: 59 61 00 30 sw (r11+48),r1
8004554: f8 00 2b ee calli 800f50c <__errno>
8004558: 58 2c 00 00 sw (r1+0),r12
800455c: 34 01 ff ff mvi r1,-1
8004560: e0 00 00 0c bi 8004590 <aio_write+0x8c>
if (aiocbp->aio_offset < 0)
8004564: 29 62 00 04 lw r2,(r11+4)
8004568: 4c 41 00 02 bge r2,r1,8004570 <aio_write+0x6c>
800456c: e3 ff ff f6 bi 8004544 <aio_write+0x40>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
8004570: 34 01 00 18 mvi r1,24
8004574: fb ff f8 b3 calli 8002840 <malloc>
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
8004578: 34 0c 00 0b mvi r12,11
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
800457c: 44 20 ff f3 be r1,r0,8004548 <aio_write+0x44> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
8004580: 58 2b 00 14 sw (r1+20),r11
req->aiocbp->aio_lio_opcode = LIO_WRITE;
8004584: 34 02 00 02 mvi r2,2
8004588: 59 62 00 28 sw (r11+40),r2
return rtems_aio_enqueue (req);
800458c: fb ff ff 1d calli 8004200 <rtems_aio_enqueue>
}
8004590: 2b 9d 00 04 lw ra,(sp+4)
8004594: 2b 8b 00 0c lw r11,(sp+12)
8004598: 2b 8c 00 08 lw r12,(sp+8)
800459c: 37 9c 00 0c addi sp,sp,12
80045a0: c3 a0 00 00 ret
08002ddc <clock_gettime>:
int clock_gettime(
clockid_t clock_id,
struct timespec *tp
)
{
8002ddc: 37 9c ff fc addi sp,sp,-4
8002de0: 5b 9d 00 04 sw (sp+4),ra
8002de4: b8 20 18 00 mv r3,r1
8002de8: b8 40 08 00 mv r1,r2
if ( !tp )
8002dec: 44 40 00 11 be r2,r0,8002e30 <clock_gettime+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
8002df0: 34 02 00 01 mvi r2,1
8002df4: 5c 62 00 03 bne r3,r2,8002e00 <clock_gettime+0x24>
_TOD_Get(tp);
8002df8: f8 00 06 f2 calli 80049c0 <_TOD_Get>
8002dfc: e0 00 00 06 bi 8002e14 <clock_gettime+0x38>
return 0;
}
#ifdef CLOCK_MONOTONIC
if ( clock_id == CLOCK_MONOTONIC ) {
8002e00: 34 02 00 04 mvi r2,4
8002e04: 44 62 00 03 be r3,r2,8002e10 <clock_gettime+0x34> <== NEVER TAKEN
return 0;
}
#endif
#ifdef _POSIX_CPUTIME
if ( clock_id == CLOCK_PROCESS_CPUTIME ) {
8002e08: 34 02 00 02 mvi r2,2
8002e0c: 5c 62 00 04 bne r3,r2,8002e1c <clock_gettime+0x40>
_TOD_Get_uptime_as_timespec( tp );
8002e10: f8 00 07 0e calli 8004a48 <_TOD_Get_uptime_as_timespec>
return 0;
8002e14: 34 01 00 00 mvi r1,0
8002e18: e0 00 00 0a bi 8002e40 <clock_gettime+0x64>
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
if ( clock_id == CLOCK_THREAD_CPUTIME )
8002e1c: 34 01 00 03 mvi r1,3
8002e20: 5c 61 00 04 bne r3,r1,8002e30 <clock_gettime+0x54>
rtems_set_errno_and_return_minus_one( ENOSYS );
8002e24: f8 00 2a 9d calli 800d898 <__errno>
8002e28: 34 02 00 58 mvi r2,88
8002e2c: e0 00 00 03 bi 8002e38 <clock_gettime+0x5c>
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
8002e30: f8 00 2a 9a calli 800d898 <__errno>
8002e34: 34 02 00 16 mvi r2,22
8002e38: 58 22 00 00 sw (r1+0),r2
8002e3c: 34 01 ff ff mvi r1,-1
return 0;
}
8002e40: 2b 9d 00 04 lw ra,(sp+4)
8002e44: 37 9c 00 04 addi sp,sp,4
8002e48: c3 a0 00 00 ret
08002e4c <clock_settime>:
int clock_settime(
clockid_t clock_id,
const struct timespec *tp
)
{
8002e4c: 37 9c ff fc addi sp,sp,-4
8002e50: 5b 9d 00 04 sw (sp+4),ra
if ( !tp )
8002e54: 44 40 00 1a be r2,r0,8002ebc <clock_settime+0x70> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
8002e58: 34 03 00 01 mvi r3,1
8002e5c: 5c 23 00 11 bne r1,r3,8002ea0 <clock_settime+0x54>
if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 )
8002e60: 78 04 08 01 mvhi r4,0x801
8002e64: 38 84 ea a4 ori r4,r4,0xeaa4
8002e68: 28 43 00 00 lw r3,(r2+0)
8002e6c: 28 81 00 00 lw r1,(r4+0)
8002e70: 54 61 00 02 bgu r3,r1,8002e78 <clock_settime+0x2c>
8002e74: e0 00 00 12 bi 8002ebc <clock_settime+0x70>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8002e78: 78 01 08 02 mvhi r1,0x802
8002e7c: 38 21 09 18 ori r1,r1,0x918
8002e80: 28 23 00 00 lw r3,(r1+0)
8002e84: 34 63 00 01 addi r3,r3,1
8002e88: 58 23 00 00 sw (r1+0),r3
rtems_set_errno_and_return_minus_one( EINVAL );
_Thread_Disable_dispatch();
_TOD_Set( tp );
8002e8c: b8 40 08 00 mv r1,r2
8002e90: f8 00 07 0b calli 8004abc <_TOD_Set>
_Thread_Enable_dispatch();
8002e94: f8 00 0d ad calli 8006548 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
8002e98: 34 01 00 00 mvi r1,0
8002e9c: e0 00 00 0c bi 8002ecc <clock_settime+0x80>
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
}
#ifdef _POSIX_CPUTIME
else if ( clock_id == CLOCK_PROCESS_CPUTIME )
8002ea0: 34 02 00 02 mvi r2,2
8002ea4: 44 22 00 03 be r1,r2,8002eb0 <clock_settime+0x64>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME )
8002ea8: 34 02 00 03 mvi r2,3
8002eac: 5c 22 00 04 bne r1,r2,8002ebc <clock_settime+0x70>
rtems_set_errno_and_return_minus_one( ENOSYS );
8002eb0: f8 00 2a 7a calli 800d898 <__errno>
8002eb4: 34 02 00 58 mvi r2,88
8002eb8: e0 00 00 03 bi 8002ec4 <clock_settime+0x78>
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
8002ebc: f8 00 2a 77 calli 800d898 <__errno>
8002ec0: 34 02 00 16 mvi r2,22
8002ec4: 58 22 00 00 sw (r1+0),r2
8002ec8: 34 01 ff ff mvi r1,-1
return 0;
}
8002ecc: 2b 9d 00 04 lw ra,(sp+4)
8002ed0: 37 9c 00 04 addi sp,sp,4
8002ed4: c3 a0 00 00 ret
08025c34 <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
8025c34: 37 9c ff dc addi sp,sp,-36
8025c38: 5b 8b 00 18 sw (sp+24),r11
8025c3c: 5b 8c 00 14 sw (sp+20),r12
8025c40: 5b 8d 00 10 sw (sp+16),r13
8025c44: 5b 8e 00 0c sw (sp+12),r14
8025c48: 5b 8f 00 08 sw (sp+8),r15
8025c4c: 5b 9d 00 04 sw (sp+4),ra
8025c50: b8 20 60 00 mv r12,r1
8025c54: b8 40 58 00 mv r11,r2
8025c58: 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() )
8025c5c: fb ff fe e8 calli 80257fc <getpid>
8025c60: 45 81 00 04 be r12,r1,8025c70 <killinfo+0x3c>
rtems_set_errno_and_return_minus_one( ESRCH );
8025c64: fb ff b4 ea calli 801300c <__errno>
8025c68: 34 02 00 03 mvi r2,3
8025c6c: e0 00 00 04 bi 8025c7c <killinfo+0x48>
/*
* Validate the signal passed.
*/
if ( !sig )
8025c70: 5d 60 00 06 bne r11,r0,8025c88 <killinfo+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
8025c74: fb ff b4 e6 calli 801300c <__errno>
8025c78: 34 02 00 16 mvi r2,22
8025c7c: 58 22 00 00 sw (r1+0),r2
8025c80: 34 01 ff ff mvi r1,-1
8025c84: e0 00 00 9f bi 8025f00 <killinfo+0x2cc>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
8025c88: 35 6f ff ff addi r15,r11,-1
if ( !is_valid_signo(sig) )
8025c8c: 34 01 00 1f mvi r1,31
8025c90: 50 2f 00 02 bgeu r1,r15,8025c98 <killinfo+0x64>
8025c94: e3 ff ff f8 bi 8025c74 <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 )
8025c98: 34 02 00 01 mvi r2,1
8025c9c: b9 60 08 00 mv r1,r11
8025ca0: fb ff 70 81 calli 8001ea4 <__ashlsi3>
8025ca4: 34 02 00 02 mvi r2,2
8025ca8: 78 0c 08 02 mvhi r12,0x802
8025cac: b4 2b 08 00 add r1,r1,r11
8025cb0: fb ff 70 7d calli 8001ea4 <__ashlsi3>
8025cb4: 39 8c 9f 78 ori r12,r12,0x9f78
8025cb8: b5 81 08 00 add r1,r12,r1
8025cbc: 28 22 00 08 lw r2,(r1+8)
8025cc0: 34 0e 00 01 mvi r14,1
return 0;
8025cc4: 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 )
8025cc8: 44 4e 00 8e be r2,r14,8025f00 <killinfo+0x2cc>
/*
* 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 ) )
8025ccc: 65 62 00 04 cmpei r2,r11,4
8025cd0: 65 61 00 08 cmpei r1,r11,8
8025cd4: b8 41 08 00 or r1,r2,r1
8025cd8: 5c 20 00 03 bne r1,r0,8025ce4 <killinfo+0xb0>
8025cdc: 34 01 00 0b mvi r1,11
8025ce0: 5d 61 00 05 bne r11,r1,8025cf4 <killinfo+0xc0>
return pthread_kill( pthread_self(), sig );
8025ce4: f8 00 01 36 calli 80261bc <pthread_self>
8025ce8: b9 60 10 00 mv r2,r11
8025cec: f8 00 00 f3 calli 80260b8 <pthread_kill>
8025cf0: e0 00 00 84 bi 8025f00 <killinfo+0x2cc>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
8025cf4: 34 01 00 01 mvi r1,1
8025cf8: b9 e0 10 00 mv r2,r15
8025cfc: fb ff 70 6a calli 8001ea4 <__ashlsi3>
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
8025d00: 5b 8b 00 1c sw (sp+28),r11
siginfo->si_code = SI_USER;
8025d04: 5b 8e 00 20 sw (sp+32),r14
8025d08: b8 20 60 00 mv r12,r1
if ( !value ) {
8025d0c: 5d a0 00 03 bne r13,r0,8025d18 <killinfo+0xe4>
siginfo->si_value.sival_int = 0;
8025d10: 5b 80 00 24 sw (sp+36),r0
8025d14: e0 00 00 03 bi 8025d20 <killinfo+0xec>
} else {
siginfo->si_value = *value;
8025d18: 29 a1 00 00 lw r1,(r13+0)
8025d1c: 5b 81 00 24 sw (sp+36),r1
8025d20: 78 01 08 02 mvhi r1,0x802
8025d24: 38 21 9a 80 ori r1,r1,0x9a80
8025d28: 28 22 00 00 lw r2,(r1+0)
8025d2c: 34 42 00 01 addi r2,r2,1
8025d30: 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;
8025d34: 78 01 08 02 mvhi r1,0x802
8025d38: 38 21 9f 2c ori r1,r1,0x9f2c
8025d3c: 28 23 00 0c lw r3,(r1+12)
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
8025d40: 28 61 01 20 lw r1,(r3+288)
8025d44: 28 21 00 d0 lw r1,(r1+208)
8025d48: a4 20 08 00 not r1,r1
8025d4c: a1 81 08 00 and r1,r12,r1
8025d50: 5c 20 00 3f bne r1,r0,8025e4c <killinfo+0x218>
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
8025d54: 78 01 08 02 mvhi r1,0x802
8025d58: 38 21 a1 04 ori r1,r1,0xa104
8025d5c: 28 22 00 00 lw r2,(r1+0)
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
8025d60: 78 01 08 02 mvhi r1,0x802
8025d64: 38 21 a1 08 ori r1,r1,0xa108
8025d68: e0 00 00 0b bi 8025d94 <killinfo+0x160>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
8025d6c: 28 44 00 30 lw r4,(r2+48)
for ( the_node = _Chain_First( the_chain );
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
8025d70: b8 40 18 00 mv r3,r2
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8025d74: 28 45 01 20 lw r5,(r2+288)
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
8025d78: a1 84 20 00 and r4,r12,r4
8025d7c: 5c 80 00 34 bne r4,r0,8025e4c <killinfo+0x218>
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
8025d80: 28 a5 00 d0 lw r5,(r5+208)
8025d84: a4 a0 28 00 not r5,r5
8025d88: a1 85 28 00 and r5,r12,r5
8025d8c: 5c a4 00 30 bne r5,r4,8025e4c <killinfo+0x218>
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
8025d90: 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 = _Chain_First( the_chain );
8025d94: 5c 41 ff f6 bne r2,r1,8025d6c <killinfo+0x138>
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
8025d98: 78 01 08 02 mvhi r1,0x802
8025d9c: 38 21 90 f0 ori r1,r1,0x90f0
8025da0: 40 21 00 00 lbu r1,(r1+0)
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
8025da4: 78 02 08 02 mvhi r2,0x802
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
8025da8: 78 04 08 02 mvhi r4,0x802
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
8025dac: 38 42 9a 1c ori r2,r2,0x9a1c
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
8025db0: 34 21 00 01 addi r1,r1,1
8025db4: 38 84 9a 24 ori r4,r4,0x9a24
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
8025db8: 34 4d 00 10 addi r13,r2,16
*
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
8025dbc: 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);
8025dc0: 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 ] )
8025dc4: 28 85 00 00 lw r5,(r4+0)
8025dc8: 44 a0 00 1e be r5,r0,8025e40 <killinfo+0x20c> <== NEVER TAKEN
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
8025dcc: 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++ ) {
8025dd0: 34 06 00 01 mvi r6,1
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
8025dd4: 2c ae 00 10 lhu r14,(r5+16)
8025dd8: 28 a7 00 1c lw r7,(r5+28)
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
8025ddc: e0 00 00 18 bi 8025e3c <killinfo+0x208>
the_thread = (Thread_Control *) object_table[ index ];
8025de0: 28 e2 00 04 lw r2,(r7+4)
if ( !the_thread )
8025de4: 44 40 00 14 be r2,r0,8025e34 <killinfo+0x200>
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
8025de8: 28 45 00 14 lw r5,(r2+20)
8025dec: 54 a1 00 12 bgu r5,r1,8025e34 <killinfo+0x200>
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
8025df0: 28 49 01 20 lw r9,(r2+288)
8025df4: 29 29 00 d0 lw r9,(r9+208)
8025df8: a5 20 48 00 not r9,r9
8025dfc: a1 89 48 00 and r9,r12,r9
8025e00: 45 20 00 0d be r9,r0,8025e34 <killinfo+0x200>
*
* 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 ) {
8025e04: 54 25 00 0a bgu r1,r5,8025e2c <killinfo+0x1f8>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
8025e08: 44 60 00 0b be r3,r0,8025e34 <killinfo+0x200> <== NEVER TAKEN
8025e0c: 28 69 00 10 lw r9,(r3+16)
8025e10: 45 20 00 09 be r9,r0,8025e34 <killinfo+0x200> <== NEVER TAKEN
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
8025e14: 28 4a 00 10 lw r10,(r2+16)
8025e18: 45 40 00 05 be r10,r0,8025e2c <killinfo+0x1f8>
8025e1c: 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) ) {
8025e20: 5d 20 00 05 bne r9,r0,8025e34 <killinfo+0x200>
8025e24: a1 48 50 00 and r10,r10,r8
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
8025e28: 45 49 00 03 be r10,r9,8025e34 <killinfo+0x200>
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
8025e2c: b8 a0 08 00 mv r1,r5
8025e30: b8 40 18 00 mv r3,r2
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
8025e34: 34 c6 00 01 addi r6,r6,1
8025e38: 34 e7 00 04 addi r7,r7,4
8025e3c: 51 c6 ff e9 bgeu r14,r6,8025de0 <killinfo+0x1ac>
8025e40: 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++) {
8025e44: 5c 8d ff e0 bne r4,r13,8025dc4 <killinfo+0x190>
}
}
}
}
if ( interested ) {
8025e48: 44 60 00 06 be r3,r0,8025e60 <killinfo+0x22c>
/*
* 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 ) ) {
8025e4c: b8 60 08 00 mv r1,r3
8025e50: b9 60 10 00 mv r2,r11
8025e54: 37 83 00 1c addi r3,sp,28
8025e58: f8 00 00 3d calli 8025f4c <_POSIX_signals_Unblock_thread>
8025e5c: 5c 20 00 27 bne r1,r0,8025ef8 <killinfo+0x2c4>
/*
* 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 );
8025e60: b9 80 08 00 mv r1,r12
8025e64: f8 00 00 2f calli 8025f20 <_POSIX_signals_Set_process_signals>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
8025e68: b9 60 08 00 mv r1,r11
8025e6c: 34 02 00 01 mvi r2,1
8025e70: fb ff 70 0d calli 8001ea4 <__ashlsi3>
8025e74: b4 2b 58 00 add r11,r1,r11
8025e78: 34 02 00 02 mvi r2,2
8025e7c: 78 0c 08 02 mvhi r12,0x802
8025e80: b9 60 08 00 mv r1,r11
8025e84: fb ff 70 08 calli 8001ea4 <__ashlsi3>
8025e88: 39 8c 9f 78 ori r12,r12,0x9f78
8025e8c: b5 81 08 00 add r1,r12,r1
8025e90: 28 22 00 00 lw r2,(r1+0)
8025e94: 34 01 00 02 mvi r1,2
8025e98: 5c 41 00 18 bne r2,r1,8025ef8 <killinfo+0x2c4>
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
8025e9c: 78 01 08 02 mvhi r1,0x802
8025ea0: 38 21 a0 f8 ori r1,r1,0xa0f8
8025ea4: fb ff 8f f1 calli 8009e68 <_Chain_Get>
8025ea8: b8 20 60 00 mv r12,r1
if ( !psiginfo ) {
8025eac: 5c 20 00 05 bne r1,r0,8025ec0 <killinfo+0x28c>
_Thread_Enable_dispatch();
8025eb0: fb ff 98 bb calli 800c19c <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
8025eb4: fb ff b4 56 calli 801300c <__errno>
8025eb8: 34 02 00 0b mvi r2,11
8025ebc: e3 ff ff 70 bi 8025c7c <killinfo+0x48>
}
psiginfo->Info = *siginfo;
8025ec0: 2b 81 00 1c lw r1,(sp+28)
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
8025ec4: 34 02 00 02 mvi r2,2
if ( !psiginfo ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
8025ec8: 59 81 00 08 sw (r12+8),r1
8025ecc: 2b 81 00 20 lw r1,(sp+32)
8025ed0: 59 81 00 0c sw (r12+12),r1
8025ed4: 2b 81 00 24 lw r1,(sp+36)
8025ed8: 59 81 00 10 sw (r12+16),r1
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
8025edc: b9 60 08 00 mv r1,r11
8025ee0: fb ff 6f f1 calli 8001ea4 <__ashlsi3>
8025ee4: 78 02 08 02 mvhi r2,0x802
8025ee8: 38 42 a1 70 ori r2,r2,0xa170
8025eec: b4 22 08 00 add r1,r1,r2
8025ef0: b9 80 10 00 mv r2,r12
8025ef4: fb ff 8f c7 calli 8009e10 <_Chain_Append>
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
8025ef8: fb ff 98 a9 calli 800c19c <_Thread_Enable_dispatch>
return 0;
8025efc: 34 01 00 00 mvi r1,0
}
8025f00: 2b 9d 00 04 lw ra,(sp+4)
8025f04: 2b 8b 00 18 lw r11,(sp+24)
8025f08: 2b 8c 00 14 lw r12,(sp+20)
8025f0c: 2b 8d 00 10 lw r13,(sp+16)
8025f10: 2b 8e 00 0c lw r14,(sp+12)
8025f14: 2b 8f 00 08 lw r15,(sp+8)
8025f18: 37 9c 00 24 addi sp,sp,36
8025f1c: c3 a0 00 00 ret
0800845c <pthread_attr_setschedpolicy>:
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
800845c: 34 03 00 16 mvi r3,22
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
8008460: 44 20 00 0c be r1,r0,8008490 <pthread_attr_setschedpolicy+0x34>
8008464: 28 24 00 00 lw r4,(r1+0)
8008468: 44 80 00 0a be r4,r0,8008490 <pthread_attr_setschedpolicy+0x34>
return EINVAL;
switch ( policy ) {
800846c: 48 02 00 08 bg r0,r2,800848c <pthread_attr_setschedpolicy+0x30>
8008470: 34 03 00 02 mvi r3,2
8008474: 4c 62 00 03 bge r3,r2,8008480 <pthread_attr_setschedpolicy+0x24>
8008478: 34 03 00 04 mvi r3,4
800847c: 5c 43 00 04 bne r2,r3,800848c <pthread_attr_setschedpolicy+0x30><== NEVER TAKEN
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
8008480: 58 22 00 14 sw (r1+20),r2
return 0;
8008484: 34 03 00 00 mvi r3,0
8008488: e0 00 00 02 bi 8008490 <pthread_attr_setschedpolicy+0x34>
default:
return ENOTSUP;
800848c: 34 03 00 86 mvi r3,134
}
}
8008490: b8 60 08 00 mv r1,r3
8008494: c3 a0 00 00 ret
0800343c <pthread_barrier_init>:
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
800343c: 37 9c ff dc addi sp,sp,-36
8003440: 5b 8b 00 14 sw (sp+20),r11
8003444: 5b 8c 00 10 sw (sp+16),r12
8003448: 5b 8d 00 0c sw (sp+12),r13
800344c: 5b 8e 00 08 sw (sp+8),r14
8003450: 5b 9d 00 04 sw (sp+4),ra
/*
* Error check parameters
*/
if ( !barrier )
return EINVAL;
8003454: 34 04 00 16 mvi r4,22
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
8003458: b8 20 68 00 mv r13,r1
800345c: b8 60 58 00 mv r11,r3
const pthread_barrierattr_t *the_attr;
/*
* Error check parameters
*/
if ( !barrier )
8003460: 44 20 00 2a be r1,r0,8003508 <pthread_barrier_init+0xcc>
return EINVAL;
if ( count == 0 )
8003464: 44 60 00 29 be r3,r0,8003508 <pthread_barrier_init+0xcc>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
8003468: 5c 40 00 05 bne r2,r0,800347c <pthread_barrier_init+0x40>
the_attr = attr;
} else {
(void) pthread_barrierattr_init( &my_attr );
800346c: 37 8c 00 18 addi r12,sp,24
8003470: b9 80 08 00 mv r1,r12
8003474: fb ff ff bb calli 8003360 <pthread_barrierattr_init>
the_attr = &my_attr;
8003478: b9 80 10 00 mv r2,r12
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
800347c: 28 41 00 00 lw r1,(r2+0)
return EINVAL;
8003480: 34 04 00 16 mvi r4,22
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
8003484: 44 20 00 21 be r1,r0,8003508 <pthread_barrier_init+0xcc>
return EINVAL;
switch ( the_attr->process_shared ) {
8003488: 28 4e 00 04 lw r14,(r2+4)
800348c: 5d c0 00 1f bne r14,r0,8003508 <pthread_barrier_init+0xcc> <== NEVER TAKEN
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8003490: 78 02 08 01 mvhi r2,0x801
8003494: 38 42 68 d8 ori r2,r2,0x68d8
8003498: 28 41 00 00 lw r1,(r2+0)
}
/*
* Convert from POSIX attributes to Core Barrier attributes
*/
the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE;
800349c: 5b 80 00 20 sw (sp+32),r0
the_attributes.maximum_count = count;
80034a0: 5b 8b 00 24 sw (sp+36),r11
80034a4: 34 21 00 01 addi r1,r1,1
80034a8: 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 );
80034ac: 78 0c 08 01 mvhi r12,0x801
80034b0: 39 8c 6c 0c ori r12,r12,0x6c0c
80034b4: b9 80 08 00 mv r1,r12
80034b8: f8 00 07 de calli 8005430 <_Objects_Allocate>
80034bc: b8 20 58 00 mv r11,r1
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_barrier = _POSIX_Barrier_Allocate();
if ( !the_barrier ) {
80034c0: 5c 2e 00 04 bne r1,r14,80034d0 <pthread_barrier_init+0x94>
_Thread_Enable_dispatch();
80034c4: f8 00 0c d4 calli 8006814 <_Thread_Enable_dispatch>
return EAGAIN;
80034c8: 34 04 00 0b mvi r4,11
80034cc: e0 00 00 0f bi 8003508 <pthread_barrier_init+0xcc>
}
_CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes );
80034d0: 34 21 00 10 addi r1,r1,16
80034d4: 37 82 00 20 addi r2,sp,32
80034d8: f8 00 04 e3 calli 8004864 <_CORE_barrier_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
80034dc: 29 6e 00 08 lw r14,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
80034e0: 29 8c 00 1c lw r12,(r12+28)
80034e4: 34 02 00 02 mvi r2,2
80034e8: 21 c1 ff ff andi r1,r14,0xffff
80034ec: f8 00 3d e4 calli 8012c7c <__ashlsi3>
80034f0: b5 81 08 00 add r1,r12,r1
80034f4: 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;
80034f8: 59 60 00 0c sw (r11+12),r0
);
/*
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
80034fc: 59 ae 00 00 sw (r13+0),r14
_Thread_Enable_dispatch();
8003500: f8 00 0c c5 calli 8006814 <_Thread_Enable_dispatch>
return 0;
8003504: 34 04 00 00 mvi r4,0
}
8003508: b8 80 08 00 mv r1,r4
800350c: 2b 9d 00 04 lw ra,(sp+4)
8003510: 2b 8b 00 14 lw r11,(sp+20)
8003514: 2b 8c 00 10 lw r12,(sp+16)
8003518: 2b 8d 00 0c lw r13,(sp+12)
800351c: 2b 8e 00 08 lw r14,(sp+8)
8003520: 37 9c 00 24 addi sp,sp,36
8003524: c3 a0 00 00 ret
08002cb0 <pthread_cleanup_push>:
void pthread_cleanup_push(
void (*routine)( void * ),
void *arg
)
{
8002cb0: 37 9c ff f4 addi sp,sp,-12
8002cb4: 5b 8b 00 0c sw (sp+12),r11
8002cb8: 5b 8c 00 08 sw (sp+8),r12
8002cbc: 5b 9d 00 04 sw (sp+4),ra
8002cc0: b8 20 58 00 mv r11,r1
8002cc4: 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 )
8002cc8: 44 20 00 13 be r1,r0,8002d14 <pthread_cleanup_push+0x64>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8002ccc: 78 03 08 01 mvhi r3,0x801
8002cd0: 38 63 68 c0 ori r3,r3,0x68c0
8002cd4: 28 61 00 00 lw r1,(r3+0)
8002cd8: 34 21 00 01 addi r1,r1,1
8002cdc: 58 61 00 00 sw (r3+0),r1
return;
_Thread_Disable_dispatch();
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
8002ce0: 34 01 00 10 mvi r1,16
8002ce4: f8 00 12 18 calli 8007544 <_Workspace_Allocate>
8002ce8: b8 20 10 00 mv r2,r1
if ( handler ) {
8002cec: 44 20 00 09 be r1,r0,8002d10 <pthread_cleanup_push+0x60> <== NEVER TAKEN
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
8002cf0: 78 03 08 01 mvhi r3,0x801
8002cf4: 38 63 6d 6c ori r3,r3,0x6d6c
8002cf8: 28 61 00 0c lw r1,(r3+12)
handler_stack = &thread_support->Cancellation_Handlers;
8002cfc: 28 21 01 20 lw r1,(r1+288)
handler->routine = routine;
8002d00: 58 4b 00 08 sw (r2+8),r11
handler->arg = arg;
8002d04: 58 4c 00 0c sw (r2+12),r12
_Chain_Append( handler_stack, &handler->Node );
8002d08: 34 21 00 e4 addi r1,r1,228
8002d0c: f8 00 04 ef calli 80040c8 <_Chain_Append>
}
_Thread_Enable_dispatch();
8002d10: f8 00 0c ab calli 8005fbc <_Thread_Enable_dispatch>
}
8002d14: 2b 9d 00 04 lw ra,(sp+4)
8002d18: 2b 8b 00 0c lw r11,(sp+12)
8002d1c: 2b 8c 00 08 lw r12,(sp+8)
8002d20: 37 9c 00 0c addi sp,sp,12
8002d24: c3 a0 00 00 ret
08003d80 <pthread_cond_init>:
int pthread_cond_init(
pthread_cond_t *cond,
const pthread_condattr_t *attr
)
{
8003d80: 37 9c ff ec addi sp,sp,-20
8003d84: 5b 8b 00 14 sw (sp+20),r11
8003d88: 5b 8c 00 10 sw (sp+16),r12
8003d8c: 5b 8d 00 0c sw (sp+12),r13
8003d90: 5b 8e 00 08 sw (sp+8),r14
8003d94: 5b 9d 00 04 sw (sp+4),ra
8003d98: b8 20 70 00 mv r14,r1
8003d9c: b8 40 58 00 mv r11,r2
POSIX_Condition_variables_Control *the_cond;
const pthread_condattr_t *the_attr;
if ( attr ) the_attr = attr;
8003da0: 5c 40 00 03 bne r2,r0,8003dac <pthread_cond_init+0x2c>
else the_attr = &_POSIX_Condition_variables_Default_attributes;
8003da4: 78 0b 08 01 mvhi r11,0x801
8003da8: 39 6b 5a a0 ori r11,r11,0x5aa0
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
8003dac: 29 63 00 04 lw r3,(r11+4)
8003db0: 34 02 00 01 mvi r2,1
return EINVAL;
8003db4: 34 01 00 16 mvi r1,22
else the_attr = &_POSIX_Condition_variables_Default_attributes;
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
8003db8: 44 62 00 26 be r3,r2,8003e50 <pthread_cond_init+0xd0> <== NEVER TAKEN
return EINVAL;
if ( !the_attr->is_initialized )
8003dbc: 29 62 00 00 lw r2,(r11+0)
8003dc0: 44 40 00 24 be r2,r0,8003e50 <pthread_cond_init+0xd0>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8003dc4: 78 02 08 01 mvhi r2,0x801
8003dc8: 38 42 78 d8 ori r2,r2,0x78d8
8003dcc: 28 41 00 00 lw r1,(r2+0)
8003dd0: 34 21 00 01 addi r1,r1,1
8003dd4: 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 );
8003dd8: 78 0d 08 01 mvhi r13,0x801
8003ddc: 39 ad 7c a4 ori r13,r13,0x7ca4
8003de0: b9 a0 08 00 mv r1,r13
8003de4: f8 00 09 7f calli 80063e0 <_Objects_Allocate>
8003de8: b8 20 60 00 mv r12,r1
_Thread_Disable_dispatch();
the_cond = _POSIX_Condition_variables_Allocate();
if ( !the_cond ) {
8003dec: 5c 20 00 04 bne r1,r0,8003dfc <pthread_cond_init+0x7c>
_Thread_Enable_dispatch();
8003df0: f8 00 0e e5 calli 8007984 <_Thread_Enable_dispatch>
return ENOMEM;
8003df4: 34 01 00 0c mvi r1,12
8003df8: e0 00 00 16 bi 8003e50 <pthread_cond_init+0xd0>
the_cond->process_shared = the_attr->process_shared;
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
8003dfc: 78 04 08 01 mvhi r4,0x801
if ( !the_cond ) {
_Thread_Enable_dispatch();
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
8003e00: 29 61 00 04 lw r1,(r11+4)
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
8003e04: 38 84 5a a8 ori r4,r4,0x5aa8
8003e08: 28 83 00 00 lw r3,(r4+0)
if ( !the_cond ) {
_Thread_Enable_dispatch();
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
8003e0c: 59 81 00 10 sw (r12+16),r1
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
8003e10: 34 04 00 74 mvi r4,116
8003e14: 35 81 00 18 addi r1,r12,24
8003e18: 34 02 00 00 mvi r2,0
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
8003e1c: 59 80 00 14 sw (r12+20),r0
_Thread_queue_Initialize(
8003e20: f8 00 11 1e calli 8008298 <_Thread_queue_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8003e24: 29 8b 00 08 lw r11,(r12+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8003e28: 29 ad 00 1c lw r13,(r13+28)
8003e2c: 34 02 00 02 mvi r2,2
8003e30: 21 61 ff ff andi r1,r11,0xffff
8003e34: f8 00 3f 49 calli 8013b58 <__ashlsi3>
8003e38: b5 a1 10 00 add r2,r13,r1
8003e3c: 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;
8003e40: 59 80 00 0c sw (r12+12),r0
&_POSIX_Condition_variables_Information,
&the_cond->Object,
0
);
*cond = the_cond->Object.id;
8003e44: 59 cb 00 00 sw (r14+0),r11
_Thread_Enable_dispatch();
8003e48: f8 00 0e cf calli 8007984 <_Thread_Enable_dispatch>
return 0;
8003e4c: 34 01 00 00 mvi r1,0
}
8003e50: 2b 9d 00 04 lw ra,(sp+4)
8003e54: 2b 8b 00 14 lw r11,(sp+20)
8003e58: 2b 8c 00 10 lw r12,(sp+16)
8003e5c: 2b 8d 00 0c lw r13,(sp+12)
8003e60: 2b 8e 00 08 lw r14,(sp+8)
8003e64: 37 9c 00 14 addi sp,sp,20
8003e68: c3 a0 00 00 ret
08003bf4 <pthread_condattr_destroy>:
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
if ( !attr || attr->is_initialized == false )
return EINVAL;
8003bf4: 34 02 00 16 mvi r2,22
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
if ( !attr || attr->is_initialized == false )
8003bf8: 44 20 00 05 be r1,r0,8003c0c <pthread_condattr_destroy+0x18>
8003bfc: 28 23 00 00 lw r3,(r1+0)
8003c00: 44 60 00 03 be r3,r0,8003c0c <pthread_condattr_destroy+0x18><== NEVER TAKEN
return EINVAL;
attr->is_initialized = false;
8003c04: 58 20 00 00 sw (r1+0),r0
return 0;
8003c08: 34 02 00 00 mvi r2,0
}
8003c0c: b8 40 08 00 mv r1,r2
8003c10: c3 a0 00 00 ret
080030d0 <pthread_create>:
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
80030d0: 37 9c ff a0 addi sp,sp,-96
80030d4: 5b 8b 00 3c sw (sp+60),r11
80030d8: 5b 8c 00 38 sw (sp+56),r12
80030dc: 5b 8d 00 34 sw (sp+52),r13
80030e0: 5b 8e 00 30 sw (sp+48),r14
80030e4: 5b 8f 00 2c sw (sp+44),r15
80030e8: 5b 90 00 28 sw (sp+40),r16
80030ec: 5b 91 00 24 sw (sp+36),r17
80030f0: 5b 92 00 20 sw (sp+32),r18
80030f4: 5b 93 00 1c sw (sp+28),r19
80030f8: 5b 94 00 18 sw (sp+24),r20
80030fc: 5b 95 00 14 sw (sp+20),r21
8003100: 5b 9d 00 10 sw (sp+16),ra
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
return EFAULT;
8003104: 34 0d 00 0e mvi r13,14
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
8003108: b8 20 88 00 mv r17,r1
800310c: b8 60 80 00 mv r16,r3
8003110: b8 80 90 00 mv r18,r4
int schedpolicy = SCHED_RR;
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
8003114: 44 60 00 a5 be r3,r0,80033a8 <pthread_create+0x2d8>
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
8003118: b8 40 58 00 mv r11,r2
800311c: 5c 40 00 03 bne r2,r0,8003128 <pthread_create+0x58>
8003120: 78 0b 08 01 mvhi r11,0x801
8003124: 39 6b d9 d4 ori r11,r11,0xd9d4
if ( !the_attr->is_initialized )
8003128: 29 61 00 00 lw r1,(r11+0)
return EINVAL;
800312c: 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 )
8003130: 44 20 00 9e be r1,r0,80033a8 <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) )
8003134: 29 61 00 04 lw r1,(r11+4)
8003138: 44 20 00 06 be r1,r0,8003150 <pthread_create+0x80>
800313c: 78 02 08 01 mvhi r2,0x801
8003140: 38 42 f1 10 ori r2,r2,0xf110
8003144: 29 63 00 08 lw r3,(r11+8)
8003148: 28 41 00 00 lw r1,(r2+0)
800314c: 54 23 00 97 bgu r1,r3,80033a8 <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 ) {
8003150: 29 62 00 10 lw r2,(r11+16)
8003154: 34 01 00 01 mvi r1,1
8003158: 44 41 00 05 be r2,r1,800316c <pthread_create+0x9c>
800315c: 34 01 00 02 mvi r1,2
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
break;
default:
return EINVAL;
8003160: 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 ) {
8003164: 5c 41 00 91 bne r2,r1,80033a8 <pthread_create+0x2d8>
8003168: e0 00 00 14 bi 80031b8 <pthread_create+0xe8>
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
800316c: 78 02 08 01 mvhi r2,0x801
8003170: 38 42 fd 74 ori r2,r2,0xfd74
8003174: 28 41 00 0c lw r1,(r2+12)
8003178: 28 22 01 20 lw r2,(r1+288)
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
800317c: 28 48 00 88 lw r8,(r2+136)
8003180: 28 47 00 8c lw r7,(r2+140)
8003184: 28 46 00 90 lw r6,(r2+144)
8003188: 28 45 00 94 lw r5,(r2+148)
800318c: 28 44 00 98 lw r4,(r2+152)
8003190: 28 43 00 9c lw r3,(r2+156)
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
schedpolicy = api->schedpolicy;
8003194: 28 4f 00 84 lw r15,(r2+132)
schedparam = api->schedparam;
8003198: 28 41 00 a0 lw r1,(r2+160)
800319c: 5b 88 00 40 sw (sp+64),r8
80031a0: 5b 87 00 44 sw (sp+68),r7
80031a4: 5b 86 00 48 sw (sp+72),r6
80031a8: 5b 85 00 4c sw (sp+76),r5
80031ac: 5b 84 00 50 sw (sp+80),r4
80031b0: 5b 83 00 54 sw (sp+84),r3
80031b4: e0 00 00 0f bi 80031f0 <pthread_create+0x120>
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
80031b8: 29 67 00 18 lw r7,(r11+24)
80031bc: 29 66 00 1c lw r6,(r11+28)
80031c0: 29 65 00 20 lw r5,(r11+32)
80031c4: 29 64 00 24 lw r4,(r11+36)
80031c8: 29 63 00 28 lw r3,(r11+40)
80031cc: 29 62 00 2c lw r2,(r11+44)
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
80031d0: 29 6f 00 14 lw r15,(r11+20)
schedparam = the_attr->schedparam;
80031d4: 29 61 00 30 lw r1,(r11+48)
80031d8: 5b 87 00 40 sw (sp+64),r7
80031dc: 5b 86 00 44 sw (sp+68),r6
80031e0: 5b 85 00 48 sw (sp+72),r5
80031e4: 5b 84 00 4c sw (sp+76),r4
80031e8: 5b 83 00 50 sw (sp+80),r3
80031ec: 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 )
80031f0: 29 6c 00 0c lw r12,(r11+12)
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
80031f4: 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;
80031f8: 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 )
80031fc: 5d 80 00 6b bne r12,r0,80033a8 <pthread_create+0x2d8>
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
8003200: 2b 81 00 40 lw r1,(sp+64)
return EINVAL;
8003204: 34 0d 00 16 mvi r13,22
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
8003208: f8 00 1b ef calli 800a1c4 <_POSIX_Priority_Is_valid>
800320c: 44 2c 00 67 be r1,r12,80033a8 <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);
8003210: 78 02 08 01 mvhi r2,0x801
8003214: 38 42 f1 14 ori r2,r2,0xf114
8003218: 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(
800321c: b9 e0 08 00 mv r1,r15
8003220: 37 82 00 40 addi r2,sp,64
8003224: 37 83 00 60 addi r3,sp,96
8003228: 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 );
800322c: 2b 93 00 40 lw r19,(sp+64)
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
8003230: f8 00 1b ed calli 800a1e4 <_POSIX_Thread_Translate_sched_param>
8003234: b8 20 68 00 mv r13,r1
schedpolicy,
&schedparam,
&budget_algorithm,
&budget_callout
);
if ( rc )
8003238: 5c 20 00 5c bne r1,r0,80033a8 <pthread_create+0x2d8> <== NEVER TAKEN
#endif
/*
* Lock the allocator mutex for protection
*/
_RTEMS_Lock_allocator();
800323c: 78 0c 08 01 mvhi r12,0x801
8003240: 39 8c f9 68 ori r12,r12,0xf968
8003244: 29 81 00 00 lw r1,(r12+0)
8003248: f8 00 04 f0 calli 8004608 <_API_Mutex_Lock>
* _POSIX_Threads_Allocate
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
800324c: 78 02 08 01 mvhi r2,0x801
8003250: b8 40 08 00 mv r1,r2
8003254: 38 21 fa 7c ori r1,r1,0xfa7c
8003258: f8 00 08 00 calli 8005258 <_Objects_Allocate>
800325c: 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 ) {
8003260: 5c 2d 00 03 bne r1,r13,800326c <pthread_create+0x19c>
_RTEMS_Unlock_allocator();
8003264: 29 81 00 00 lw r1,(r12+0)
8003268: e0 00 00 21 bi 80032ec <pthread_create+0x21c>
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
800326c: 78 02 08 01 mvhi r2,0x801
8003270: 38 42 f1 10 ori r2,r2,0xf110
8003274: 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(
8003278: 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 )
800327c: 34 02 00 01 mvi r2,1
8003280: f8 00 63 59 calli 801bfe4 <__ashlsi3>
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
8003284: 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 )
8003288: 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(
800328c: 50 2c 00 02 bgeu r1,r12,8003294 <pthread_create+0x1c4>
8003290: b9 80 28 00 mv r5,r12
8003294: 2b 81 00 5c lw r1,(sp+92)
8003298: 78 0c 08 01 mvhi r12,0x801
800329c: 2b 88 00 60 lw r8,(sp+96)
80032a0: 39 8c fa 7c ori r12,r12,0xfa7c
80032a4: 5b 81 00 04 sw (sp+4),r1
80032a8: b8 a0 20 00 mv r4,r5
80032ac: b9 80 08 00 mv r1,r12
80032b0: b9 c0 10 00 mv r2,r14
80032b4: ba a0 18 00 mv r3,r21
80032b8: 34 05 00 00 mvi r5,0
80032bc: ca 93 30 00 sub r6,r20,r19
80032c0: 34 07 00 01 mvi r7,1
80032c4: 5b 80 00 08 sw (sp+8),r0
80032c8: 5b 80 00 0c sw (sp+12),r0
80032cc: f8 00 0d 36 calli 80067a4 <_Thread_Initialize>
budget_callout,
0, /* isr level */
name /* posix threads don't have a name */
);
if ( !status ) {
80032d0: 5c 20 00 0a bne r1,r0,80032f8 <pthread_create+0x228> <== ALWAYS TAKEN
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
80032d4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80032d8: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
80032dc: f8 00 08 da calli 8005644 <_Objects_Free> <== NOT EXECUTED
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
80032e0: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
80032e4: 38 21 f9 68 ori r1,r1,0xf968 <== NOT EXECUTED
80032e8: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
80032ec: f8 00 04 e4 calli 800467c <_API_Mutex_Unlock>
return EAGAIN;
80032f0: 34 0d 00 0b mvi r13,11
80032f4: e0 00 00 2d bi 80033a8 <pthread_create+0x2d8>
}
/*
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
80032f8: 29 cc 01 20 lw r12,(r14+288)
api->Attributes = *the_attr;
80032fc: b9 60 10 00 mv r2,r11
8003300: 34 03 00 40 mvi r3,64
8003304: b9 80 08 00 mv r1,r12
8003308: f8 00 2a c7 calli 800de24 <memcpy>
api->detachstate = the_attr->detachstate;
800330c: 29 61 00 3c lw r1,(r11+60)
api->schedparam = schedparam;
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003310: 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;
8003314: 59 8f 00 84 sw (r12+132),r15
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
8003318: 59 81 00 40 sw (r12+64),r1
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
800331c: 2b 81 00 40 lw r1,(sp+64)
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003320: ba 00 18 00 mv r3,r16
8003324: 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;
8003328: 59 81 00 88 sw (r12+136),r1
800332c: 2b 81 00 44 lw r1,(sp+68)
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003330: 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;
8003334: 59 81 00 8c sw (r12+140),r1
8003338: 2b 81 00 48 lw r1,(sp+72)
800333c: 59 81 00 90 sw (r12+144),r1
8003340: 2b 81 00 4c lw r1,(sp+76)
8003344: 59 81 00 94 sw (r12+148),r1
8003348: 2b 81 00 50 lw r1,(sp+80)
800334c: 59 81 00 98 sw (r12+152),r1
8003350: 2b 81 00 54 lw r1,(sp+84)
8003354: 59 81 00 9c sw (r12+156),r1
8003358: 2b 81 00 58 lw r1,(sp+88)
800335c: 59 81 00 a0 sw (r12+160),r1
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003360: b9 c0 08 00 mv r1,r14
8003364: f8 00 0f da calli 80072cc <_Thread_Start>
_RTEMS_Unlock_allocator();
return EINVAL;
}
#endif
if ( schedpolicy == SCHED_SPORADIC ) {
8003368: 34 01 00 04 mvi r1,4
800336c: 5d e1 00 09 bne r15,r1,8003390 <pthread_create+0x2c0>
_Watchdog_Insert_ticks(
8003370: 35 81 00 90 addi r1,r12,144
8003374: f8 00 10 5d calli 80074e8 <_Timespec_To_ticks>
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003378: 78 02 08 01 mvhi r2,0x801
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
800337c: 59 81 00 b4 sw (r12+180),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003380: b8 40 08 00 mv r1,r2
8003384: 38 21 f9 88 ori r1,r1,0xf988
8003388: 35 82 00 a8 addi r2,r12,168
800338c: f8 00 11 8c calli 80079bc <_Watchdog_Insert>
}
/*
* Return the id and indicate we successfully created the thread
*/
*thread = the_thread->Object.id;
8003390: 29 c1 00 08 lw r1,(r14+8)
8003394: 5a 21 00 00 sw (r17+0),r1
_RTEMS_Unlock_allocator();
8003398: 78 01 08 01 mvhi r1,0x801
800339c: 38 21 f9 68 ori r1,r1,0xf968
80033a0: 28 21 00 00 lw r1,(r1+0)
80033a4: f8 00 04 b6 calli 800467c <_API_Mutex_Unlock>
return 0;
}
80033a8: b9 a0 08 00 mv r1,r13
80033ac: 2b 9d 00 10 lw ra,(sp+16)
80033b0: 2b 8b 00 3c lw r11,(sp+60)
80033b4: 2b 8c 00 38 lw r12,(sp+56)
80033b8: 2b 8d 00 34 lw r13,(sp+52)
80033bc: 2b 8e 00 30 lw r14,(sp+48)
80033c0: 2b 8f 00 2c lw r15,(sp+44)
80033c4: 2b 90 00 28 lw r16,(sp+40)
80033c8: 2b 91 00 24 lw r17,(sp+36)
80033cc: 2b 92 00 20 lw r18,(sp+32)
80033d0: 2b 93 00 1c lw r19,(sp+28)
80033d4: 2b 94 00 18 lw r20,(sp+24)
80033d8: 2b 95 00 14 lw r21,(sp+20)
80033dc: 37 9c 00 60 addi sp,sp,96
80033e0: c3 a0 00 00 ret
08010e68 <pthread_exit>:
void pthread_exit(
void *value_ptr
)
{
8010e68: 37 9c ff fc addi sp,sp,-4
8010e6c: 5b 9d 00 04 sw (sp+4),ra
_POSIX_Thread_Exit( _Thread_Executing, value_ptr );
8010e70: 78 03 08 01 mvhi r3,0x801
8010e74: 38 63 9e 3c ori r3,r3,0x9e3c
}
void pthread_exit(
void *value_ptr
)
{
8010e78: b8 20 10 00 mv r2,r1
_POSIX_Thread_Exit( _Thread_Executing, value_ptr );
8010e7c: 28 61 00 0c lw r1,(r3+12)
8010e80: fb ff ff d4 calli 8010dd0 <_POSIX_Thread_Exit>
}
8010e84: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8010e88: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
8010e8c: c3 a0 00 00 ret <== NOT EXECUTED
080260b8 <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
80260b8: 37 9c ff e4 addi sp,sp,-28
80260bc: 5b 8b 00 18 sw (sp+24),r11
80260c0: 5b 8c 00 14 sw (sp+20),r12
80260c4: 5b 8d 00 10 sw (sp+16),r13
80260c8: 5b 8e 00 0c sw (sp+12),r14
80260cc: 5b 8f 00 08 sw (sp+8),r15
80260d0: 5b 9d 00 04 sw (sp+4),ra
80260d4: b8 40 58 00 mv r11,r2
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
80260d8: 44 40 00 04 be r2,r0,80260e8 <pthread_kill+0x30>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
80260dc: 34 4f ff ff addi r15,r2,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
80260e0: 34 02 00 1f mvi r2,31
80260e4: 50 4f 00 04 bgeu r2,r15,80260f4 <pthread_kill+0x3c>
rtems_set_errno_and_return_minus_one( EINVAL );
80260e8: fb ff b3 c9 calli 801300c <__errno>
80260ec: 34 02 00 16 mvi r2,22
80260f0: e0 00 00 29 bi 8026194 <pthread_kill+0xdc>
the_thread = _Thread_Get( thread, &location );
80260f4: 37 82 00 1c addi r2,sp,28
80260f8: fb ff 98 36 calli 800c1d0 <_Thread_Get>
80260fc: b8 20 60 00 mv r12,r1
switch ( location ) {
8026100: 2b 81 00 1c lw r1,(sp+28)
8026104: 5c 20 00 22 bne r1,r0,802618c <pthread_kill+0xd4> <== NEVER TAKEN
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
8026108: 34 02 00 01 mvi r2,1
802610c: b9 60 08 00 mv r1,r11
8026110: fb ff 6f 65 calli 8001ea4 <__ashlsi3>
8026114: 78 0d 08 02 mvhi r13,0x802
8026118: b4 2b 08 00 add r1,r1,r11
802611c: 34 02 00 02 mvi r2,2
8026120: 39 ad 9f 78 ori r13,r13,0x9f78
8026124: fb ff 6f 60 calli 8001ea4 <__ashlsi3>
8026128: b5 a1 08 00 add r1,r13,r1
802612c: 28 21 00 08 lw r1,(r1+8)
8026130: 34 0d 00 01 mvi r13,1
case OBJECTS_LOCAL:
/*
* If sig == 0 then just validate arguments
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8026134: 29 8e 01 20 lw r14,(r12+288)
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
8026138: 44 2d 00 12 be r1,r13,8026180 <pthread_kill+0xc8>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
802613c: b9 e0 10 00 mv r2,r15
8026140: 34 01 00 01 mvi r1,1
8026144: fb ff 6f 58 calli 8001ea4 <__ashlsi3>
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
8026148: 29 c2 00 d4 lw r2,(r14+212)
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
802614c: 34 03 00 00 mvi r3,0
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
8026150: b8 41 08 00 or r1,r2,r1
8026154: 59 c1 00 d4 sw (r14+212),r1
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
8026158: b9 60 10 00 mv r2,r11
802615c: b9 80 08 00 mv r1,r12
8026160: fb ff ff 7b calli 8025f4c <_POSIX_signals_Unblock_thread>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
8026164: 78 02 08 02 mvhi r2,0x802
8026168: 38 42 9f 2c ori r2,r2,0x9f2c
802616c: 28 41 00 08 lw r1,(r2+8)
8026170: 44 20 00 04 be r1,r0,8026180 <pthread_kill+0xc8>
8026174: 28 41 00 0c lw r1,(r2+12)
8026178: 5d 81 00 02 bne r12,r1,8026180 <pthread_kill+0xc8>
_Thread_Dispatch_necessary = true;
802617c: 30 4d 00 18 sb (r2+24),r13
}
_Thread_Enable_dispatch();
8026180: fb ff 98 07 calli 800c19c <_Thread_Enable_dispatch>
return 0;
8026184: 34 01 00 00 mvi r1,0
8026188: e0 00 00 05 bi 802619c <pthread_kill+0xe4>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
802618c: fb ff b3 a0 calli 801300c <__errno> <== NOT EXECUTED
8026190: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
8026194: 58 22 00 00 sw (r1+0),r2
8026198: 34 01 ff ff mvi r1,-1
}
802619c: 2b 9d 00 04 lw ra,(sp+4)
80261a0: 2b 8b 00 18 lw r11,(sp+24)
80261a4: 2b 8c 00 14 lw r12,(sp+20)
80261a8: 2b 8d 00 10 lw r13,(sp+16)
80261ac: 2b 8e 00 0c lw r14,(sp+12)
80261b0: 2b 8f 00 08 lw r15,(sp+8)
80261b4: 37 9c 00 1c addi sp,sp,28
80261b8: c3 a0 00 00 ret
08005688 <pthread_mutex_timedlock>:
int pthread_mutex_timedlock(
pthread_mutex_t *mutex,
const struct timespec *abstime
)
{
8005688: 37 9c ff ec addi sp,sp,-20
800568c: 5b 8b 00 10 sw (sp+16),r11
8005690: 5b 8c 00 0c sw (sp+12),r12
8005694: 5b 8d 00 08 sw (sp+8),r13
8005698: 5b 9d 00 04 sw (sp+4),ra
800569c: b8 20 68 00 mv r13,r1
*
* 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 );
80056a0: b8 40 08 00 mv r1,r2
80056a4: 37 82 00 14 addi r2,sp,20
80056a8: f8 00 00 41 calli 80057ac <_POSIX_Absolute_timeout_to_ticks>
int _EXFUN(pthread_mutex_trylock, (pthread_mutex_t *__mutex));
int _EXFUN(pthread_mutex_unlock, (pthread_mutex_t *__mutex));
#if defined(_POSIX_TIMEOUTS)
int _EXFUN(pthread_mutex_timedlock,
80056ac: 64 2c 00 03 cmpei r12,r1,3
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
80056b0: 2b 83 00 14 lw r3,(sp+20)
*
* 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 );
80056b4: b8 20 58 00 mv r11,r1
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
80056b8: b9 80 10 00 mv r2,r12
80056bc: b9 a0 08 00 mv r1,r13
80056c0: fb ff ff a3 calli 800554c <_POSIX_Mutex_Lock_support>
* This service only gives us the option to block. We used a polling
* attempt to lock if the abstime was not in the future. If we did
* not obtain the mutex, then not look at the status immediately,
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
80056c4: 5d 80 00 0b bne r12,r0,80056f0 <pthread_mutex_timedlock+0x68>
80056c8: 34 02 00 10 mvi r2,16
80056cc: 5c 22 00 09 bne r1,r2,80056f0 <pthread_mutex_timedlock+0x68><== NEVER TAKEN
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
80056d0: 45 60 00 05 be r11,r0,80056e4 <pthread_mutex_timedlock+0x5c><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
80056d4: 35 6b ff ff addi r11,r11,-1
80056d8: 34 02 00 01 mvi r2,1
80056dc: 50 4b 00 04 bgeu r2,r11,80056ec <pthread_mutex_timedlock+0x64><== ALWAYS TAKEN
80056e0: e0 00 00 04 bi 80056f0 <pthread_mutex_timedlock+0x68> <== NOT EXECUTED
* not obtain the mutex, then not look at the status immediately,
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
80056e4: 34 01 00 16 mvi r1,22 <== NOT EXECUTED
80056e8: e0 00 00 02 bi 80056f0 <pthread_mutex_timedlock+0x68> <== NOT EXECUTED
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
80056ec: 34 01 00 74 mvi r1,116
}
return lock_status;
}
80056f0: 2b 9d 00 04 lw ra,(sp+4)
80056f4: 2b 8b 00 10 lw r11,(sp+16)
80056f8: 2b 8c 00 0c lw r12,(sp+12)
80056fc: 2b 8d 00 08 lw r13,(sp+8)
8005700: 37 9c 00 14 addi sp,sp,20
8005704: c3 a0 00 00 ret
0800298c <pthread_mutexattr_gettype>:
const pthread_mutexattr_t *attr,
int *type
)
{
if ( !attr )
return EINVAL;
800298c: 34 03 00 16 mvi r3,22
int pthread_mutexattr_gettype(
const pthread_mutexattr_t *attr,
int *type
)
{
if ( !attr )
8002990: 44 20 00 07 be r1,r0,80029ac <pthread_mutexattr_gettype+0x20>
return EINVAL;
if ( !attr->is_initialized )
8002994: 28 24 00 00 lw r4,(r1+0)
8002998: 44 80 00 05 be r4,r0,80029ac <pthread_mutexattr_gettype+0x20>
return EINVAL;
if ( !type )
800299c: 44 40 00 04 be r2,r0,80029ac <pthread_mutexattr_gettype+0x20><== NEVER TAKEN
return EINVAL;
*type = attr->type;
80029a0: 28 21 00 10 lw r1,(r1+16)
return 0;
80029a4: 34 03 00 00 mvi r3,0
return EINVAL;
if ( !type )
return EINVAL;
*type = attr->type;
80029a8: 58 41 00 00 sw (r2+0),r1
return 0;
}
80029ac: b8 60 08 00 mv r1,r3
80029b0: c3 a0 00 00 ret
080051b8 <pthread_mutexattr_setpshared>:
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
80051b8: 34 03 00 16 mvi r3,22
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
80051bc: 44 20 00 07 be r1,r0,80051d8 <pthread_mutexattr_setpshared+0x20>
80051c0: 28 24 00 00 lw r4,(r1+0)
80051c4: 44 80 00 05 be r4,r0,80051d8 <pthread_mutexattr_setpshared+0x20>
return EINVAL;
switch ( pshared ) {
80051c8: 34 04 00 01 mvi r4,1
80051cc: 54 44 00 03 bgu r2,r4,80051d8 <pthread_mutexattr_setpshared+0x20><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
80051d0: 58 22 00 04 sw (r1+4),r2
return 0;
80051d4: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
80051d8: b8 60 08 00 mv r1,r3
80051dc: c3 a0 00 00 ret
08002a00 <pthread_mutexattr_settype>:
pthread_mutexattr_t *attr,
int type
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
8002a00: 34 03 00 16 mvi r3,22
int pthread_mutexattr_settype(
pthread_mutexattr_t *attr,
int type
)
{
if ( !attr || !attr->is_initialized )
8002a04: 44 20 00 07 be r1,r0,8002a20 <pthread_mutexattr_settype+0x20>
8002a08: 28 24 00 00 lw r4,(r1+0)
8002a0c: 44 80 00 05 be r4,r0,8002a20 <pthread_mutexattr_settype+0x20><== NEVER TAKEN
return EINVAL;
switch ( type ) {
8002a10: 34 04 00 03 mvi r4,3
8002a14: 54 44 00 03 bgu r2,r4,8002a20 <pthread_mutexattr_settype+0x20>
case PTHREAD_MUTEX_NORMAL:
case PTHREAD_MUTEX_RECURSIVE:
case PTHREAD_MUTEX_ERRORCHECK:
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
8002a18: 58 22 00 10 sw (r1+16),r2
return 0;
8002a1c: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
8002a20: b8 60 08 00 mv r1,r3
8002a24: c3 a0 00 00 ret
080038d4 <pthread_once>:
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
80038d4: 37 9c ff ec addi sp,sp,-20
80038d8: 5b 8b 00 10 sw (sp+16),r11
80038dc: 5b 8c 00 0c sw (sp+12),r12
80038e0: 5b 8d 00 08 sw (sp+8),r13
80038e4: 5b 9d 00 04 sw (sp+4),ra
80038e8: b8 20 58 00 mv r11,r1
80038ec: b8 40 60 00 mv r12,r2
if ( !once_control || !init_routine )
80038f0: 64 21 00 00 cmpei r1,r1,0
80038f4: 64 42 00 00 cmpei r2,r2,0
80038f8: b8 41 10 00 or r2,r2,r1
return EINVAL;
80038fc: 34 01 00 16 mvi r1,22
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
if ( !once_control || !init_routine )
8003900: 5c 40 00 13 bne r2,r0,800394c <pthread_once+0x78>
return EINVAL;
if ( !once_control->init_executed ) {
8003904: 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;
8003908: 34 01 00 00 mvi r1,0
)
{
if ( !once_control || !init_routine )
return EINVAL;
if ( !once_control->init_executed ) {
800390c: 5d a2 00 10 bne r13,r2,800394c <pthread_once+0x78>
rtems_mode saveMode;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
8003910: 34 01 01 00 mvi r1,256
8003914: 34 02 01 00 mvi r2,256
8003918: 37 83 00 14 addi r3,sp,20
800391c: f8 00 01 96 calli 8003f74 <rtems_task_mode>
if ( !once_control->init_executed ) {
8003920: 29 61 00 04 lw r1,(r11+4)
8003924: 5c 2d 00 05 bne r1,r13,8003938 <pthread_once+0x64> <== NEVER TAKEN
once_control->is_initialized = true;
8003928: 34 01 00 01 mvi r1,1
800392c: 59 61 00 00 sw (r11+0),r1
once_control->init_executed = true;
8003930: 59 61 00 04 sw (r11+4),r1
(*init_routine)();
8003934: d9 80 00 00 call r12
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
8003938: 2b 81 00 14 lw r1,(sp+20)
800393c: 34 02 01 00 mvi r2,256
8003940: 37 83 00 14 addi r3,sp,20
8003944: f8 00 01 8c calli 8003f74 <rtems_task_mode>
}
return 0;
8003948: 34 01 00 00 mvi r1,0
}
800394c: 2b 9d 00 04 lw ra,(sp+4)
8003950: 2b 8b 00 10 lw r11,(sp+16)
8003954: 2b 8c 00 0c lw r12,(sp+12)
8003958: 2b 8d 00 08 lw r13,(sp+8)
800395c: 37 9c 00 14 addi sp,sp,20
8003960: c3 a0 00 00 ret
0800428c <pthread_rwlock_init>:
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
800428c: 37 9c ff e0 addi sp,sp,-32
8004290: 5b 8b 00 14 sw (sp+20),r11
8004294: 5b 8c 00 10 sw (sp+16),r12
8004298: 5b 8d 00 0c sw (sp+12),r13
800429c: 5b 8e 00 08 sw (sp+8),r14
80042a0: 5b 9d 00 04 sw (sp+4),ra
/*
* Error check parameters
*/
if ( !rwlock )
return EINVAL;
80042a4: 34 03 00 16 mvi r3,22
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
80042a8: b8 20 68 00 mv r13,r1
const pthread_rwlockattr_t *the_attr;
/*
* Error check parameters
*/
if ( !rwlock )
80042ac: 44 20 00 28 be r1,r0,800434c <pthread_rwlock_init+0xc0>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
80042b0: 5c 40 00 05 bne r2,r0,80042c4 <pthread_rwlock_init+0x38>
the_attr = attr;
} else {
(void) pthread_rwlockattr_init( &default_attr );
80042b4: 37 8b 00 18 addi r11,sp,24
80042b8: b9 60 08 00 mv r1,r11
80042bc: f8 00 02 ff calli 8004eb8 <pthread_rwlockattr_init>
the_attr = &default_attr;
80042c0: b9 60 10 00 mv r2,r11
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
80042c4: 28 41 00 00 lw r1,(r2+0)
return EINVAL;
80042c8: 34 03 00 16 mvi r3,22
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
80042cc: 44 20 00 20 be r1,r0,800434c <pthread_rwlock_init+0xc0> <== NEVER TAKEN
return EINVAL;
switch ( the_attr->process_shared ) {
80042d0: 28 4e 00 04 lw r14,(r2+4)
80042d4: 5d c0 00 1e bne r14,r0,800434c <pthread_rwlock_init+0xc0> <== NEVER TAKEN
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
80042d8: 78 02 08 01 mvhi r2,0x801
80042dc: 38 42 88 d8 ori r2,r2,0x88d8
80042e0: 28 41 00 00 lw r1,(r2+0)
*/
RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes(
CORE_RWLock_Attributes *the_attributes
)
{
the_attributes->XXX = 0;
80042e4: 5b 80 00 20 sw (sp+32),r0
80042e8: 34 21 00 01 addi r1,r1,1
80042ec: 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 );
80042f0: 78 0c 08 01 mvhi r12,0x801
80042f4: 39 8c 8a 4c ori r12,r12,0x8a4c
80042f8: b9 80 08 00 mv r1,r12
80042fc: f8 00 09 9c calli 800696c <_Objects_Allocate>
8004300: b8 20 58 00 mv r11,r1
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_rwlock = _POSIX_RWLock_Allocate();
if ( !the_rwlock ) {
8004304: 5c 2e 00 04 bne r1,r14,8004314 <pthread_rwlock_init+0x88>
_Thread_Enable_dispatch();
8004308: f8 00 0e 92 calli 8007d50 <_Thread_Enable_dispatch>
return EAGAIN;
800430c: 34 03 00 0b mvi r3,11
8004310: e0 00 00 0f bi 800434c <pthread_rwlock_init+0xc0>
}
_CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes );
8004314: 34 21 00 10 addi r1,r1,16
8004318: 37 82 00 20 addi r2,sp,32
800431c: f8 00 06 d9 calli 8005e80 <_CORE_RWLock_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8004320: 29 6e 00 08 lw r14,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8004324: 29 8c 00 1c lw r12,(r12+28)
8004328: 34 02 00 02 mvi r2,2
800432c: 21 c1 ff ff andi r1,r14,0xffff
8004330: f8 00 40 e8 calli 80146d0 <__ashlsi3>
8004334: b5 81 08 00 add r1,r12,r1
8004338: 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;
800433c: 59 60 00 0c sw (r11+12),r0
&_POSIX_RWLock_Information,
&the_rwlock->Object,
0
);
*rwlock = the_rwlock->Object.id;
8004340: 59 ae 00 00 sw (r13+0),r14
_Thread_Enable_dispatch();
8004344: f8 00 0e 83 calli 8007d50 <_Thread_Enable_dispatch>
return 0;
8004348: 34 03 00 00 mvi r3,0
}
800434c: b8 60 08 00 mv r1,r3
8004350: 2b 9d 00 04 lw ra,(sp+4)
8004354: 2b 8b 00 14 lw r11,(sp+20)
8004358: 2b 8c 00 10 lw r12,(sp+16)
800435c: 2b 8d 00 0c lw r13,(sp+12)
8004360: 2b 8e 00 08 lw r14,(sp+8)
8004364: 37 9c 00 20 addi sp,sp,32
8004368: c3 a0 00 00 ret
080043f4 <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
80043f4: 37 9c ff e0 addi sp,sp,-32
80043f8: 5b 8b 00 18 sw (sp+24),r11
80043fc: 5b 8c 00 14 sw (sp+20),r12
8004400: 5b 8d 00 10 sw (sp+16),r13
8004404: 5b 8e 00 0c sw (sp+12),r14
8004408: 5b 8f 00 08 sw (sp+8),r15
800440c: 5b 9d 00 04 sw (sp+4),ra
8004410: 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;
8004414: 34 0b 00 16 mvi r11,22
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004418: 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 )
800441c: 45 c0 00 25 be r14,r0,80044b0 <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 );
8004420: 37 82 00 1c addi r2,sp,28
8004424: f8 00 1c 6a calli 800b5cc <_POSIX_Absolute_timeout_to_ticks>
8004428: 29 c2 00 00 lw r2,(r14+0)
800442c: b8 20 60 00 mv r12,r1
8004430: 78 01 08 01 mvhi r1,0x801
8004434: 38 21 8a 4c ori r1,r1,0x8a4c
8004438: 37 83 00 20 addi r3,sp,32
800443c: f8 00 0a b0 calli 8006efc <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
8004440: 2b 8f 00 20 lw r15,(sp+32)
8004444: 5d e0 00 1b bne r15,r0,80044b0 <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,
8004448: 65 8d 00 03 cmpei r13,r12,3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
800444c: 29 c2 00 00 lw r2,(r14+0)
8004450: 2b 84 00 1c lw r4,(sp+28)
8004454: 34 21 00 10 addi r1,r1,16
8004458: b9 a0 18 00 mv r3,r13
800445c: 34 05 00 00 mvi r5,0
8004460: f8 00 06 95 calli 8005eb4 <_CORE_RWLock_Obtain_for_reading>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
8004464: f8 00 0e 3b calli 8007d50 <_Thread_Enable_dispatch>
if ( !do_wait ) {
8004468: 5d af 00 0c bne r13,r15,8004498 <pthread_rwlock_timedrdlock+0xa4>
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
800446c: 78 01 08 01 mvhi r1,0x801
8004470: 38 21 8d 84 ori r1,r1,0x8d84
8004474: 28 21 00 0c lw r1,(r1+12)
8004478: 28 22 00 34 lw r2,(r1+52)
800447c: 34 01 00 02 mvi r1,2
8004480: 5c 41 00 06 bne r2,r1,8004498 <pthread_rwlock_timedrdlock+0xa4>
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
8004484: 45 8d 00 0b be r12,r13,80044b0 <pthread_rwlock_timedrdlock+0xbc><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8004488: 35 8c ff ff addi r12,r12,-1
800448c: 34 01 00 01 mvi r1,1
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
8004490: 34 0b 00 74 mvi r11,116
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8004494: 50 2c 00 07 bgeu r1,r12,80044b0 <pthread_rwlock_timedrdlock+0xbc><== ALWAYS TAKEN
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
(CORE_RWLock_Status) _Thread_Executing->Wait.return_code
8004498: 78 01 08 01 mvhi r1,0x801
800449c: 38 21 8d 84 ori r1,r1,0x8d84
80044a0: 28 21 00 0c lw r1,(r1+12)
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
80044a4: 28 21 00 34 lw r1,(r1+52)
80044a8: f8 00 00 43 calli 80045b4 <_POSIX_RWLock_Translate_core_RWLock_return_code>
80044ac: b8 20 58 00 mv r11,r1
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
80044b0: b9 60 08 00 mv r1,r11
80044b4: 2b 9d 00 04 lw ra,(sp+4)
80044b8: 2b 8b 00 18 lw r11,(sp+24)
80044bc: 2b 8c 00 14 lw r12,(sp+20)
80044c0: 2b 8d 00 10 lw r13,(sp+16)
80044c4: 2b 8e 00 0c lw r14,(sp+12)
80044c8: 2b 8f 00 08 lw r15,(sp+8)
80044cc: 37 9c 00 20 addi sp,sp,32
80044d0: c3 a0 00 00 ret
080044d4 <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
80044d4: 37 9c ff e0 addi sp,sp,-32
80044d8: 5b 8b 00 18 sw (sp+24),r11
80044dc: 5b 8c 00 14 sw (sp+20),r12
80044e0: 5b 8d 00 10 sw (sp+16),r13
80044e4: 5b 8e 00 0c sw (sp+12),r14
80044e8: 5b 8f 00 08 sw (sp+8),r15
80044ec: 5b 9d 00 04 sw (sp+4),ra
80044f0: 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;
80044f4: 34 0b 00 16 mvi r11,22
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
80044f8: 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 )
80044fc: 45 c0 00 25 be r14,r0,8004590 <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 );
8004500: 37 82 00 1c addi r2,sp,28
8004504: f8 00 1c 32 calli 800b5cc <_POSIX_Absolute_timeout_to_ticks>
8004508: 29 c2 00 00 lw r2,(r14+0)
800450c: b8 20 60 00 mv r12,r1
8004510: 78 01 08 01 mvhi r1,0x801
8004514: 38 21 8a 4c ori r1,r1,0x8a4c
8004518: 37 83 00 20 addi r3,sp,32
800451c: f8 00 0a 78 calli 8006efc <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
8004520: 2b 8f 00 20 lw r15,(sp+32)
8004524: 5d e0 00 1b bne r15,r0,8004590 <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,
8004528: 65 8d 00 03 cmpei r13,r12,3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
800452c: 29 c2 00 00 lw r2,(r14+0)
8004530: 2b 84 00 1c lw r4,(sp+28)
8004534: 34 21 00 10 addi r1,r1,16
8004538: b9 a0 18 00 mv r3,r13
800453c: 34 05 00 00 mvi r5,0
8004540: f8 00 06 9f calli 8005fbc <_CORE_RWLock_Obtain_for_writing>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
8004544: f8 00 0e 03 calli 8007d50 <_Thread_Enable_dispatch>
if ( !do_wait &&
8004548: 5d af 00 0c bne r13,r15,8004578 <pthread_rwlock_timedwrlock+0xa4>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
800454c: 78 01 08 01 mvhi r1,0x801
8004550: 38 21 8d 84 ori r1,r1,0x8d84
8004554: 28 21 00 0c lw r1,(r1+12)
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
8004558: 28 22 00 34 lw r2,(r1+52)
800455c: 34 01 00 02 mvi r1,2
8004560: 5c 41 00 06 bne r2,r1,8004578 <pthread_rwlock_timedwrlock+0xa4>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
8004564: 45 8d 00 0b be r12,r13,8004590 <pthread_rwlock_timedwrlock+0xbc><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8004568: 35 8c ff ff addi r12,r12,-1
800456c: 34 01 00 01 mvi r1,1
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
8004570: 34 0b 00 74 mvi r11,116
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8004574: 50 2c 00 07 bgeu r1,r12,8004590 <pthread_rwlock_timedwrlock+0xbc><== ALWAYS TAKEN
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
(CORE_RWLock_Status) _Thread_Executing->Wait.return_code
8004578: 78 01 08 01 mvhi r1,0x801
800457c: 38 21 8d 84 ori r1,r1,0x8d84
8004580: 28 21 00 0c lw r1,(r1+12)
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
8004584: 28 21 00 34 lw r1,(r1+52)
8004588: f8 00 00 0b calli 80045b4 <_POSIX_RWLock_Translate_core_RWLock_return_code>
800458c: b8 20 58 00 mv r11,r1
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
8004590: b9 60 08 00 mv r1,r11
8004594: 2b 9d 00 04 lw ra,(sp+4)
8004598: 2b 8b 00 18 lw r11,(sp+24)
800459c: 2b 8c 00 14 lw r12,(sp+20)
80045a0: 2b 8d 00 10 lw r13,(sp+16)
80045a4: 2b 8e 00 0c lw r14,(sp+12)
80045a8: 2b 8f 00 08 lw r15,(sp+8)
80045ac: 37 9c 00 20 addi sp,sp,32
80045b0: c3 a0 00 00 ret
08004ed8 <pthread_rwlockattr_setpshared>:
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
return EINVAL;
8004ed8: 34 03 00 16 mvi r3,22
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
8004edc: 44 20 00 07 be r1,r0,8004ef8 <pthread_rwlockattr_setpshared+0x20>
return EINVAL;
if ( !attr->is_initialized )
8004ee0: 28 24 00 00 lw r4,(r1+0)
8004ee4: 44 80 00 05 be r4,r0,8004ef8 <pthread_rwlockattr_setpshared+0x20>
return EINVAL;
switch ( pshared ) {
8004ee8: 34 04 00 01 mvi r4,1
8004eec: 54 44 00 03 bgu r2,r4,8004ef8 <pthread_rwlockattr_setpshared+0x20><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
8004ef0: 58 22 00 04 sw (r1+4),r2
return 0;
8004ef4: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
8004ef8: b8 60 08 00 mv r1,r3
8004efc: c3 a0 00 00 ret
08006144 <pthread_setschedparam>:
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
8006144: 37 9c ff dc addi sp,sp,-36
8006148: 5b 8b 00 18 sw (sp+24),r11
800614c: 5b 8c 00 14 sw (sp+20),r12
8006150: 5b 8d 00 10 sw (sp+16),r13
8006154: 5b 8e 00 0c sw (sp+12),r14
8006158: 5b 8f 00 08 sw (sp+8),r15
800615c: 5b 9d 00 04 sw (sp+4),ra
/*
* Check all the parameters
*/
if ( !param )
return EINVAL;
8006160: 34 0e 00 16 mvi r14,22
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
8006164: b8 20 58 00 mv r11,r1
8006168: b8 40 78 00 mv r15,r2
800616c: b8 60 60 00 mv r12,r3
int rc;
/*
* Check all the parameters
*/
if ( !param )
8006170: 44 60 00 43 be r3,r0,800627c <pthread_setschedparam+0x138> <== NEVER TAKEN
return EINVAL;
rc = _POSIX_Thread_Translate_sched_param(
8006174: b8 40 08 00 mv r1,r2
8006178: 37 84 00 20 addi r4,sp,32
800617c: b8 60 10 00 mv r2,r3
8006180: 37 83 00 24 addi r3,sp,36
8006184: f8 00 1a 85 calli 800cb98 <_POSIX_Thread_Translate_sched_param>
8006188: b8 20 70 00 mv r14,r1
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( rc )
800618c: 5c 20 00 3c bne r1,r0,800627c <pthread_setschedparam+0x138><== NEVER TAKEN
return rc;
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _Thread_Get( thread, &location );
8006190: b9 60 08 00 mv r1,r11
8006194: 37 82 00 1c addi r2,sp,28
8006198: f8 00 0b 77 calli 8008f74 <_Thread_Get>
800619c: b8 20 68 00 mv r13,r1
switch ( location ) {
80061a0: 2b 81 00 1c lw r1,(sp+28)
80061a4: 5c 2e 00 35 bne r1,r14,8006278 <pthread_setschedparam+0x134><== NEVER TAKEN
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
80061a8: 29 ab 01 20 lw r11,(r13+288)
if ( api->schedpolicy == SCHED_SPORADIC )
80061ac: 34 01 00 04 mvi r1,4
80061b0: 29 62 00 84 lw r2,(r11+132)
80061b4: 5c 41 00 03 bne r2,r1,80061c0 <pthread_setschedparam+0x7c>
(void) _Watchdog_Remove( &api->Sporadic_timer );
80061b8: 35 61 00 a8 addi r1,r11,168
80061bc: f8 00 10 d4 calli 800a50c <_Watchdog_Remove>
api->schedpolicy = policy;
80061c0: 59 6f 00 84 sw (r11+132),r15
api->schedparam = *param;
80061c4: 29 81 00 14 lw r1,(r12+20)
80061c8: 29 82 00 00 lw r2,(r12+0)
80061cc: 29 86 00 04 lw r6,(r12+4)
80061d0: 29 85 00 08 lw r5,(r12+8)
80061d4: 29 84 00 0c lw r4,(r12+12)
80061d8: 29 83 00 10 lw r3,(r12+16)
80061dc: 29 87 00 18 lw r7,(r12+24)
80061e0: 59 61 00 9c sw (r11+156),r1
the_thread->budget_algorithm = budget_algorithm;
80061e4: 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;
80061e8: 59 62 00 88 sw (r11+136),r2
80061ec: 59 66 00 8c sw (r11+140),r6
80061f0: 59 65 00 90 sw (r11+144),r5
80061f4: 59 64 00 94 sw (r11+148),r4
80061f8: 59 63 00 98 sw (r11+152),r3
80061fc: 59 67 00 a0 sw (r11+160),r7
the_thread->budget_algorithm = budget_algorithm;
8006200: 59 a1 00 7c sw (r13+124),r1
the_thread->budget_callout = budget_callout;
8006204: 2b 81 00 20 lw r1,(sp+32)
8006208: 59 a1 00 80 sw (r13+128),r1
switch ( api->schedpolicy ) {
800620c: 48 0f 00 19 bg r0,r15,8006270 <pthread_setschedparam+0x12c><== NEVER TAKEN
8006210: 34 01 00 02 mvi r1,2
8006214: 4c 2f 00 04 bge r1,r15,8006224 <pthread_setschedparam+0xe0>
8006218: 34 01 00 04 mvi r1,4
800621c: 5d e1 00 15 bne r15,r1,8006270 <pthread_setschedparam+0x12c><== NEVER TAKEN
8006220: e0 00 00 0e bi 8006258 <pthread_setschedparam+0x114>
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
8006224: 78 01 08 01 mvhi r1,0x801
8006228: 38 21 a8 c0 ori r1,r1,0xa8c0
800622c: 28 21 00 00 lw r1,(r1+0)
the_thread->real_priority =
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
8006230: 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;
8006234: 59 a1 00 78 sw (r13+120),r1
8006238: 78 01 08 01 mvhi r1,0x801
800623c: 38 21 a1 14 ori r1,r1,0xa114
8006240: 40 21 00 00 lbu r1,(r1+0)
8006244: c8 22 10 00 sub r2,r1,r2
the_thread->real_priority =
8006248: 59 a2 00 18 sw (r13+24),r2
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
800624c: b9 a0 08 00 mv r1,r13
8006250: f8 00 0a 22 calli 8008ad8 <_Thread_Change_priority>
the_thread,
the_thread->real_priority,
true
);
break;
8006254: e0 00 00 07 bi 8006270 <pthread_setschedparam+0x12c>
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
8006258: 59 62 00 a4 sw (r11+164),r2
_Watchdog_Remove( &api->Sporadic_timer );
800625c: 35 61 00 a8 addi r1,r11,168
8006260: f8 00 10 ab calli 800a50c <_Watchdog_Remove>
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
8006264: 34 01 00 00 mvi r1,0
8006268: b9 a0 10 00 mv r2,r13
800626c: fb ff ff 65 calli 8006000 <_POSIX_Threads_Sporadic_budget_TSR>
break;
}
_Thread_Enable_dispatch();
8006270: f8 00 0b 34 calli 8008f40 <_Thread_Enable_dispatch>
return 0;
8006274: e0 00 00 02 bi 800627c <pthread_setschedparam+0x138>
#endif
case OBJECTS_ERROR:
break;
}
return ESRCH;
8006278: 34 0e 00 03 mvi r14,3
}
800627c: b9 c0 08 00 mv r1,r14
8006280: 2b 9d 00 04 lw ra,(sp+4)
8006284: 2b 8b 00 18 lw r11,(sp+24)
8006288: 2b 8c 00 14 lw r12,(sp+20)
800628c: 2b 8d 00 10 lw r13,(sp+16)
8006290: 2b 8e 00 0c lw r14,(sp+12)
8006294: 2b 8f 00 08 lw r15,(sp+8)
8006298: 37 9c 00 24 addi sp,sp,36
800629c: c3 a0 00 00 ret
080035e8 <pthread_testcancel>:
*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
void pthread_testcancel( void )
{
80035e8: 37 9c ff f8 addi sp,sp,-8
80035ec: 5b 8b 00 08 sw (sp+8),r11
80035f0: 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() )
80035f4: 78 01 08 01 mvhi r1,0x801
80035f8: 38 21 6d 6c ori r1,r1,0x6d6c
80035fc: 28 22 00 08 lw r2,(r1+8)
8003600: 5c 40 00 14 bne r2,r0,8003650 <pthread_testcancel+0x68> <== NEVER TAKEN
return;
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
8003604: 28 21 00 0c lw r1,(r1+12)
8003608: 28 22 01 20 lw r2,(r1+288)
800360c: 78 01 08 01 mvhi r1,0x801
8003610: 38 21 68 c0 ori r1,r1,0x68c0
8003614: 28 23 00 00 lw r3,(r1+0)
8003618: 34 63 00 01 addi r3,r3,1
800361c: 58 23 00 00 sw (r1+0),r3
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
8003620: 28 41 00 d8 lw r1,(r2+216)
*/
void pthread_testcancel( void )
{
POSIX_API_Control *thread_support;
bool cancel = false;
8003624: 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 &&
8003628: 5c 2b 00 03 bne r1,r11,8003634 <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));
800362c: 28 4b 00 e0 lw r11,(r2+224)
8003630: 7d 6b 00 00 cmpnei r11,r11,0
thread_support->cancelation_requested )
cancel = true;
_Thread_Enable_dispatch();
8003634: f8 00 0a 62 calli 8005fbc <_Thread_Enable_dispatch>
if ( cancel )
8003638: 45 60 00 06 be r11,r0,8003650 <pthread_testcancel+0x68>
_POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED );
800363c: 78 01 08 01 mvhi r1,0x801
8003640: 38 21 6d 6c ori r1,r1,0x6d6c
8003644: 28 21 00 0c lw r1,(r1+12)
8003648: 34 02 ff ff mvi r2,-1
800364c: f8 00 19 78 calli 8009c2c <_POSIX_Thread_Exit>
}
8003650: 2b 9d 00 04 lw ra,(sp+4)
8003654: 2b 8b 00 08 lw r11,(sp+8)
8003658: 37 9c 00 08 addi sp,sp,8
800365c: c3 a0 00 00 ret
08004200 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
8004200: 37 9c ff bc addi sp,sp,-68
8004204: 5b 8b 00 20 sw (sp+32),r11
8004208: 5b 8c 00 1c sw (sp+28),r12
800420c: 5b 8d 00 18 sw (sp+24),r13
8004210: 5b 8e 00 14 sw (sp+20),r14
8004214: 5b 8f 00 10 sw (sp+16),r15
8004218: 5b 90 00 0c sw (sp+12),r16
800421c: 5b 91 00 08 sw (sp+8),r17
8004220: 5b 9d 00 04 sw (sp+4),ra
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
8004224: 78 0c 08 01 mvhi r12,0x801
8004228: 39 8c 78 68 ori r12,r12,0x7868
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
800422c: b8 20 58 00 mv r11,r1
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
8004230: b9 80 08 00 mv r1,r12
8004234: f8 00 02 b1 calli 8004cf8 <pthread_mutex_lock>
8004238: b8 20 70 00 mv r14,r1
if (result != 0) {
800423c: 44 20 00 04 be r1,r0,800424c <rtems_aio_enqueue+0x4c> <== ALWAYS TAKEN
free (req);
8004240: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8004244: fb ff f7 c7 calli 8002160 <free> <== NOT EXECUTED
return result;
8004248: e0 00 00 79 bi 800442c <rtems_aio_enqueue+0x22c> <== NOT EXECUTED
}
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
800424c: f8 00 05 42 calli 8005754 <pthread_self>
8004250: 37 82 00 40 addi r2,sp,64
8004254: 37 83 00 24 addi r3,sp,36
8004258: f8 00 04 04 calli 8005268 <pthread_getschedparam>
req->caller_thread = pthread_self ();
800425c: f8 00 05 3e calli 8005754 <pthread_self>
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
8004260: 29 62 00 14 lw r2,(r11+20)
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
8004264: 59 61 00 10 sw (r11+16),r1
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
8004268: 2b 83 00 24 lw r3,(sp+36)
800426c: 28 41 00 10 lw r1,(r2+16)
8004270: c8 61 08 00 sub r1,r3,r1
8004274: 59 61 00 0c sw (r11+12),r1
req->policy = policy;
8004278: 2b 81 00 40 lw r1,(sp+64)
800427c: 59 61 00 08 sw (r11+8),r1
req->aiocbp->error_code = EINPROGRESS;
8004280: 34 01 00 77 mvi r1,119
8004284: 58 41 00 2c sw (r2+44),r1
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
8004288: 29 81 00 68 lw r1,(r12+104)
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
req->aiocbp->return_value = 0;
800428c: 58 40 00 30 sw (r2+48),r0
if ((aio_request_queue.idle_threads == 0) &&
8004290: 5c 2e 00 34 bne r1,r14,8004360 <rtems_aio_enqueue+0x160> <== NEVER TAKEN
8004294: 29 83 00 64 lw r3,(r12+100)
8004298: 34 01 00 04 mvi r1,4
800429c: 48 61 00 31 bg r3,r1,8004360 <rtems_aio_enqueue+0x160>
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
80042a0: 28 42 00 00 lw r2,(r2+0)
80042a4: 78 01 08 01 mvhi r1,0x801
80042a8: 38 21 78 b0 ori r1,r1,0x78b0
80042ac: 34 03 00 01 mvi r3,1
80042b0: fb ff fe 99 calli 8003d14 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
80042b4: 28 22 00 18 lw r2,(r1+24)
if ((aio_request_queue.idle_threads == 0) &&
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
80042b8: b8 20 68 00 mv r13,r1
80042bc: 34 31 00 08 addi r17,r1,8
80042c0: 34 2f 00 1c addi r15,r1,28
80042c4: 34 30 00 20 addi r16,r1,32
if (r_chain->new_fd == 1) {
80042c8: 34 01 00 01 mvi r1,1
80042cc: 5c 41 00 1c bne r2,r1,800433c <rtems_aio_enqueue+0x13c>
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
80042d0: b9 60 10 00 mv r2,r11
80042d4: ba 20 08 00 mv r1,r17
80042d8: f8 00 08 6f calli 8006494 <_Chain_Insert>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
80042dc: 34 02 00 00 mvi r2,0
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
if (r_chain->new_fd == 1) {
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
80042e0: 59 a0 00 18 sw (r13+24),r0
pthread_mutex_init (&r_chain->mutex, NULL);
80042e4: b9 e0 08 00 mv r1,r15
80042e8: f8 00 02 27 calli 8004b84 <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
80042ec: 34 02 00 00 mvi r2,0
80042f0: ba 00 08 00 mv r1,r16
80042f4: f8 00 01 02 calli 80046fc <pthread_cond_init>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
80042f8: 78 02 08 01 mvhi r2,0x801
80042fc: 78 03 08 00 mvhi r3,0x800
8004300: 37 81 00 44 addi r1,sp,68
8004304: 38 42 78 70 ori r2,r2,0x7870
8004308: 38 63 3e 38 ori r3,r3,0x3e38
800430c: b9 a0 20 00 mv r4,r13
8004310: f8 00 03 11 calli 8004f54 <pthread_create>
8004314: b8 20 58 00 mv r11,r1
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
8004318: 44 20 00 05 be r1,r0,800432c <rtems_aio_enqueue+0x12c> <== ALWAYS TAKEN
pthread_mutex_unlock (&aio_request_queue.mutex);
800431c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8004320: f8 00 02 a9 calli 8004dc4 <pthread_mutex_unlock> <== NOT EXECUTED
return result;
8004324: b9 60 70 00 mv r14,r11 <== NOT EXECUTED
8004328: e0 00 00 41 bi 800442c <rtems_aio_enqueue+0x22c> <== NOT EXECUTED
}
++aio_request_queue.active_threads;
800432c: 29 81 00 64 lw r1,(r12+100)
8004330: 34 21 00 01 addi r1,r1,1
8004334: 59 81 00 64 sw (r12+100),r1
8004338: e0 00 00 3a bi 8004420 <rtems_aio_enqueue+0x220>
}
else {
/* put request in the fd chain it belongs to */
pthread_mutex_lock (&r_chain->mutex);
800433c: b9 e0 08 00 mv r1,r15
8004340: f8 00 02 6e calli 8004cf8 <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
8004344: ba 20 08 00 mv r1,r17
8004348: b9 60 10 00 mv r2,r11
800434c: fb ff ff 5d calli 80040c0 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
8004350: ba 00 08 00 mv r1,r16
8004354: f8 00 01 25 calli 80047e8 <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
8004358: b9 e0 08 00 mv r1,r15
800435c: e0 00 00 11 bi 80043a0 <rtems_aio_enqueue+0x1a0>
else
{
/* the maximum number of threads has been already created
even though some of them might be idle.
The request belongs to one of the active fd chain */
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
8004360: 28 42 00 00 lw r2,(r2+0)
8004364: 78 01 08 01 mvhi r1,0x801
8004368: 38 21 78 b0 ori r1,r1,0x78b0
800436c: 34 03 00 00 mvi r3,0
8004370: fb ff fe 69 calli 8003d14 <rtems_aio_search_fd>
8004374: b8 20 60 00 mv r12,r1
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
8004378: 44 20 00 0c be r1,r0,80043a8 <rtems_aio_enqueue+0x1a8>
{
pthread_mutex_lock (&r_chain->mutex);
800437c: 34 2d 00 1c addi r13,r1,28
8004380: b9 a0 08 00 mv r1,r13
8004384: f8 00 02 5d calli 8004cf8 <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
8004388: 35 81 00 08 addi r1,r12,8
800438c: b9 60 10 00 mv r2,r11
8004390: fb ff ff 4c calli 80040c0 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
8004394: 35 81 00 20 addi r1,r12,32
8004398: f8 00 01 14 calli 80047e8 <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
800439c: b9 a0 08 00 mv r1,r13
80043a0: f8 00 02 89 calli 8004dc4 <pthread_mutex_unlock>
80043a4: e0 00 00 1f bi 8004420 <rtems_aio_enqueue+0x220>
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
80043a8: 29 62 00 14 lw r2,(r11+20)
80043ac: 78 01 08 01 mvhi r1,0x801
80043b0: 34 03 00 01 mvi r3,1
80043b4: 28 42 00 00 lw r2,(r2+0)
80043b8: 38 21 78 bc ori r1,r1,0x78bc
80043bc: fb ff fe 56 calli 8003d14 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
80043c0: 28 23 00 18 lw r3,(r1+24)
80043c4: 34 02 00 01 mvi r2,1
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
80043c8: b8 20 60 00 mv r12,r1
80043cc: 34 21 00 08 addi r1,r1,8
if (r_chain->new_fd == 1) {
80043d0: 5c 62 00 0b bne r3,r2,80043fc <rtems_aio_enqueue+0x1fc>
80043d4: b9 60 10 00 mv r2,r11
80043d8: f8 00 08 2f calli 8006494 <_Chain_Insert>
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
80043dc: 35 81 00 1c addi r1,r12,28
if (r_chain->new_fd == 1) {
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
80043e0: 59 80 00 18 sw (r12+24),r0
pthread_mutex_init (&r_chain->mutex, NULL);
80043e4: 34 02 00 00 mvi r2,0
80043e8: f8 00 01 e7 calli 8004b84 <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
80043ec: 35 81 00 20 addi r1,r12,32
80043f0: 34 02 00 00 mvi r2,0
80043f4: f8 00 00 c2 calli 80046fc <pthread_cond_init>
80043f8: e0 00 00 03 bi 8004404 <rtems_aio_enqueue+0x204>
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
80043fc: b9 60 10 00 mv r2,r11
8004400: fb ff ff 30 calli 80040c0 <rtems_aio_insert_prio>
if (aio_request_queue.idle_threads > 0)
8004404: 78 01 08 01 mvhi r1,0x801
8004408: 38 21 78 68 ori r1,r1,0x7868
800440c: 28 21 00 68 lw r1,(r1+104)
8004410: 4c 01 00 04 bge r0,r1,8004420 <rtems_aio_enqueue+0x220> <== ALWAYS TAKEN
pthread_cond_signal (&aio_request_queue.new_req);
8004414: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
8004418: 38 21 78 6c ori r1,r1,0x786c <== NOT EXECUTED
800441c: f8 00 00 f3 calli 80047e8 <pthread_cond_signal> <== NOT EXECUTED
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
8004420: 78 01 08 01 mvhi r1,0x801
8004424: 38 21 78 68 ori r1,r1,0x7868
8004428: f8 00 02 67 calli 8004dc4 <pthread_mutex_unlock>
return 0;
}
800442c: b9 c0 08 00 mv r1,r14
8004430: 2b 9d 00 04 lw ra,(sp+4)
8004434: 2b 8b 00 20 lw r11,(sp+32)
8004438: 2b 8c 00 1c lw r12,(sp+28)
800443c: 2b 8d 00 18 lw r13,(sp+24)
8004440: 2b 8e 00 14 lw r14,(sp+20)
8004444: 2b 8f 00 10 lw r15,(sp+16)
8004448: 2b 90 00 0c lw r16,(sp+12)
800444c: 2b 91 00 08 lw r17,(sp+8)
8004450: 37 9c 00 44 addi sp,sp,68
8004454: c3 a0 00 00 ret
08003e38 <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
8003e38: 37 9c ff a4 addi sp,sp,-92
8003e3c: 5b 8b 00 34 sw (sp+52),r11
8003e40: 5b 8c 00 30 sw (sp+48),r12
8003e44: 5b 8d 00 2c sw (sp+44),r13
8003e48: 5b 8e 00 28 sw (sp+40),r14
8003e4c: 5b 8f 00 24 sw (sp+36),r15
8003e50: 5b 90 00 20 sw (sp+32),r16
8003e54: 5b 91 00 1c sw (sp+28),r17
8003e58: 5b 92 00 18 sw (sp+24),r18
8003e5c: 5b 93 00 14 sw (sp+20),r19
8003e60: 5b 94 00 10 sw (sp+16),r20
8003e64: 5b 95 00 0c sw (sp+12),r21
8003e68: 5b 96 00 08 sw (sp+8),r22
8003e6c: 5b 9d 00 04 sw (sp+4),ra
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
8003e70: 78 0b 08 01 mvhi r11,0x801
pthread_cond_destroy (&r_chain->cond);
free (r_chain);
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003e74: 78 11 08 01 mvhi r17,0x801
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003e78: 78 10 08 01 mvhi r16,0x801
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
8003e7c: b8 20 60 00 mv r12,r1
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
8003e80: 39 6b 78 68 ori r11,r11,0x7868
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
8003e84: 37 8e 00 54 addi r14,sp,84
&aio_request_queue.mutex,
&timeout);
/* If no requests were added to the chain we delete the fd chain from
the queue and start working with idle fd chains */
if (result == ETIMEDOUT) {
8003e88: 34 14 00 74 mvi r20,116
pthread_cond_destroy (&r_chain->cond);
free (r_chain);
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003e8c: 3a 31 78 c0 ori r17,r17,0x78c0
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003e90: 3a 10 78 6c ori r16,r16,0x786c
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
8003e94: 37 93 00 38 addi r19,sp,56
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
switch (req->aiocbp->aio_lio_opcode) {
8003e98: 34 16 00 02 mvi r22,2
default:
result = -1;
}
if (result == -1) {
req->aiocbp->return_value = -1;
8003e9c: 34 12 ff ff mvi r18,-1
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
switch (req->aiocbp->aio_lio_opcode) {
8003ea0: 34 15 00 03 mvi r21,3
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
8003ea4: 35 8f 00 1c addi r15,r12,28
8003ea8: b9 e0 08 00 mv r1,r15
8003eac: f8 00 03 93 calli 8004cf8 <pthread_mutex_lock>
if (result != 0)
8003eb0: 5c 20 00 74 bne r1,r0,8004080 <rtems_aio_handle+0x248> <== NEVER TAKEN
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003eb4: 29 8d 00 08 lw r13,(r12+8)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8003eb8: 35 81 00 0c addi r1,r12,12
/* If the locked chain is not empty, take the first
request extract it, unlock the chain and process
the request, in this way the user can supply more
requests to this fd chain */
if (!rtems_chain_is_empty (chain)) {
8003ebc: 45 a1 00 2e be r13,r1,8003f74 <rtems_aio_handle+0x13c>
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
8003ec0: f8 00 06 25 calli 8005754 <pthread_self>
8003ec4: 37 82 00 5c addi r2,sp,92
8003ec8: ba 60 18 00 mv r3,r19
8003ecc: f8 00 04 e7 calli 8005268 <pthread_getschedparam>
param.sched_priority = req->priority;
8003ed0: 29 a1 00 0c lw r1,(r13+12)
8003ed4: 5b 81 00 38 sw (sp+56),r1
pthread_setschedparam (pthread_self(), req->policy, ¶m);
8003ed8: f8 00 06 1f calli 8005754 <pthread_self>
8003edc: 29 a2 00 08 lw r2,(r13+8)
8003ee0: ba 60 18 00 mv r3,r19
8003ee4: f8 00 06 21 calli 8005768 <pthread_setschedparam>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
8003ee8: b9 a0 08 00 mv r1,r13
8003eec: f8 00 09 51 calli 8006430 <_Chain_Extract>
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
8003ef0: b9 e0 08 00 mv r1,r15
8003ef4: f8 00 03 b4 calli 8004dc4 <pthread_mutex_unlock>
switch (req->aiocbp->aio_lio_opcode) {
8003ef8: 29 a4 00 14 lw r4,(r13+20)
8003efc: 28 81 00 28 lw r1,(r4+40)
8003f00: 44 36 00 0a be r1,r22,8003f28 <rtems_aio_handle+0xf0>
8003f04: 44 35 00 0f be r1,r21,8003f40 <rtems_aio_handle+0x108> <== NEVER TAKEN
8003f08: 34 02 00 01 mvi r2,1
8003f0c: 5c 22 00 10 bne r1,r2,8003f4c <rtems_aio_handle+0x114> <== NEVER TAKEN
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
8003f10: 28 82 00 08 lw r2,(r4+8)
8003f14: 28 83 00 0c lw r3,(r4+12)
8003f18: 28 81 00 00 lw r1,(r4+0)
8003f1c: 28 84 00 04 lw r4,(r4+4)
8003f20: f8 00 31 2a calli 80103c8 <pread>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
8003f24: e0 00 00 09 bi 8003f48 <rtems_aio_handle+0x110>
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
8003f28: 28 82 00 08 lw r2,(r4+8)
8003f2c: 28 83 00 0c lw r3,(r4+12)
8003f30: 28 81 00 00 lw r1,(r4+0)
8003f34: 28 84 00 04 lw r4,(r4+4)
8003f38: f8 00 31 68 calli 80104d8 <pwrite>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
8003f3c: e0 00 00 03 bi 8003f48 <rtems_aio_handle+0x110>
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
8003f40: 28 81 00 00 lw r1,(r4+0) <== NOT EXECUTED
8003f44: f8 00 1d 9e calli 800b5bc <fsync> <== NOT EXECUTED
break;
default:
result = -1;
}
if (result == -1) {
8003f48: 5c 32 00 07 bne r1,r18,8003f64 <rtems_aio_handle+0x12c> <== ALWAYS TAKEN
req->aiocbp->return_value = -1;
8003f4c: 29 ad 00 14 lw r13,(r13+20) <== NOT EXECUTED
8003f50: 59 b2 00 30 sw (r13+48),r18 <== NOT EXECUTED
req->aiocbp->error_code = errno;
8003f54: f8 00 2d 6e calli 800f50c <__errno> <== NOT EXECUTED
8003f58: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
8003f5c: 59 a1 00 2c sw (r13+44),r1 <== NOT EXECUTED
8003f60: e3 ff ff d1 bi 8003ea4 <rtems_aio_handle+0x6c> <== NOT EXECUTED
} else {
req->aiocbp->return_value = result;
8003f64: 29 a2 00 14 lw r2,(r13+20)
8003f68: 58 41 00 30 sw (r2+48),r1
req->aiocbp->error_code = 0;
8003f6c: 58 40 00 2c sw (r2+44),r0
8003f70: e3 ff ff cd bi 8003ea4 <rtems_aio_handle+0x6c>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
8003f74: b9 e0 08 00 mv r1,r15
8003f78: f8 00 03 93 calli 8004dc4 <pthread_mutex_unlock>
pthread_mutex_lock (&aio_request_queue.mutex);
8003f7c: b9 60 08 00 mv r1,r11
8003f80: f8 00 03 5e calli 8004cf8 <pthread_mutex_lock>
if (rtems_chain_is_empty (chain))
8003f84: 29 81 00 08 lw r1,(r12+8)
8003f88: 5c 2d 00 3b bne r1,r13,8004074 <rtems_aio_handle+0x23c> <== NEVER TAKEN
{
clock_gettime (CLOCK_REALTIME, &timeout);
8003f8c: b9 c0 10 00 mv r2,r14
8003f90: 34 01 00 01 mvi r1,1
8003f94: f8 00 01 84 calli 80045a4 <clock_gettime>
timeout.tv_sec += 3;
8003f98: 2b 81 00 54 lw r1,(sp+84)
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
8003f9c: 35 8d 00 20 addi r13,r12,32
8003fa0: b9 60 10 00 mv r2,r11
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
8003fa4: 34 21 00 03 addi r1,r1,3
8003fa8: 5b 81 00 54 sw (sp+84),r1
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
8003fac: b9 c0 18 00 mv r3,r14
8003fb0: b9 a0 08 00 mv r1,r13
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
8003fb4: 5b 80 00 58 sw (sp+88),r0
result = pthread_cond_timedwait (&r_chain->cond,
8003fb8: f8 00 02 30 calli 8004878 <pthread_cond_timedwait>
&aio_request_queue.mutex,
&timeout);
/* If no requests were added to the chain we delete the fd chain from
the queue and start working with idle fd chains */
if (result == ETIMEDOUT) {
8003fbc: 5c 34 00 2e bne r1,r20,8004074 <rtems_aio_handle+0x23c> <== NEVER TAKEN
8003fc0: b9 80 08 00 mv r1,r12
8003fc4: f8 00 09 1b calli 8006430 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
8003fc8: b9 e0 08 00 mv r1,r15
8003fcc: f8 00 02 91 calli 8004a10 <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->cond);
8003fd0: b9 a0 08 00 mv r1,r13
8003fd4: f8 00 01 90 calli 8004614 <pthread_cond_destroy>
free (r_chain);
8003fd8: b9 80 08 00 mv r1,r12
8003fdc: fb ff f8 61 calli 8002160 <free>
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003fe0: 29 61 00 54 lw r1,(r11+84)
8003fe4: 5c 31 00 19 bne r1,r17,8004048 <rtems_aio_handle+0x210>
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
8003fe8: 29 61 00 68 lw r1,(r11+104)
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
8003fec: b9 c0 10 00 mv r2,r14
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
8003ff0: 34 21 00 01 addi r1,r1,1
8003ff4: 59 61 00 68 sw (r11+104),r1
--aio_request_queue.active_threads;
8003ff8: 29 61 00 64 lw r1,(r11+100)
8003ffc: 34 21 ff ff addi r1,r1,-1
8004000: 59 61 00 64 sw (r11+100),r1
clock_gettime (CLOCK_REALTIME, &timeout);
8004004: 34 01 00 01 mvi r1,1
8004008: f8 00 01 67 calli 80045a4 <clock_gettime>
timeout.tv_sec += 3;
800400c: 2b 81 00 54 lw r1,(sp+84)
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8004010: b9 60 10 00 mv r2,r11
8004014: b9 c0 18 00 mv r3,r14
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
8004018: 34 21 00 03 addi r1,r1,3
800401c: 5b 81 00 54 sw (sp+84),r1
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8004020: ba 00 08 00 mv r1,r16
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
8004024: 5b 80 00 58 sw (sp+88),r0
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8004028: f8 00 02 14 calli 8004878 <pthread_cond_timedwait>
&aio_request_queue.mutex,
&timeout);
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
800402c: 5c 34 00 07 bne r1,r20,8004048 <rtems_aio_handle+0x210> <== NEVER TAKEN
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
8004030: 29 61 00 68 lw r1,(r11+104)
8004034: 34 21 ff ff addi r1,r1,-1
8004038: 59 61 00 68 sw (r11+104),r1
pthread_mutex_unlock (&aio_request_queue.mutex);
800403c: b9 60 08 00 mv r1,r11
8004040: f8 00 03 61 calli 8004dc4 <pthread_mutex_unlock>
return NULL;
8004044: e0 00 00 0f bi 8004080 <rtems_aio_handle+0x248>
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
8004048: 29 61 00 68 lw r1,(r11+104)
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
800404c: 29 6c 00 54 lw r12,(r11+84)
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
8004050: 34 21 ff ff addi r1,r1,-1
8004054: 59 61 00 68 sw (r11+104),r1
++aio_request_queue.active_threads;
8004058: 29 61 00 64 lw r1,(r11+100)
800405c: 34 21 00 01 addi r1,r1,1
8004060: 59 61 00 64 sw (r11+100),r1
8004064: b9 80 08 00 mv r1,r12
8004068: f8 00 08 f2 calli 8006430 <_Chain_Extract>
node = rtems_chain_first (&aio_request_queue.idle_req);
rtems_chain_extract (node);
r_chain = (rtems_aio_request_chain *) node;
rtems_aio_move_to_work (r_chain);
800406c: b9 80 08 00 mv r1,r12
8004070: fb ff ff 5f calli 8003dec <rtems_aio_move_to_work>
}
}
/* If there was a request added in the initial fd chain then release
the mutex and process it */
pthread_mutex_unlock (&aio_request_queue.mutex);
8004074: b9 60 08 00 mv r1,r11
8004078: f8 00 03 53 calli 8004dc4 <pthread_mutex_unlock>
800407c: e3 ff ff 8a bi 8003ea4 <rtems_aio_handle+0x6c>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8004080: 34 01 00 00 mvi r1,0
8004084: 2b 9d 00 04 lw ra,(sp+4)
8004088: 2b 8b 00 34 lw r11,(sp+52)
800408c: 2b 8c 00 30 lw r12,(sp+48)
8004090: 2b 8d 00 2c lw r13,(sp+44)
8004094: 2b 8e 00 28 lw r14,(sp+40)
8004098: 2b 8f 00 24 lw r15,(sp+36)
800409c: 2b 90 00 20 lw r16,(sp+32)
80040a0: 2b 91 00 1c lw r17,(sp+28)
80040a4: 2b 92 00 18 lw r18,(sp+24)
80040a8: 2b 93 00 14 lw r19,(sp+20)
80040ac: 2b 94 00 10 lw r20,(sp+16)
80040b0: 2b 95 00 0c lw r21,(sp+12)
80040b4: 2b 96 00 08 lw r22,(sp+8)
80040b8: 37 9c 00 5c addi sp,sp,92
80040bc: c3 a0 00 00 ret
08003c1c <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
8003c1c: 37 9c ff f4 addi sp,sp,-12
8003c20: 5b 8b 00 0c sw (sp+12),r11
8003c24: 5b 8c 00 08 sw (sp+8),r12
8003c28: 5b 9d 00 04 sw (sp+4),ra
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
8003c2c: 78 0c 08 01 mvhi r12,0x801
8003c30: 39 8c 78 70 ori r12,r12,0x7870
8003c34: b9 80 08 00 mv r1,r12
8003c38: f8 00 04 b0 calli 8004ef8 <pthread_attr_init>
8003c3c: b8 20 58 00 mv r11,r1
if (result != 0)
8003c40: 5c 20 00 2f bne r1,r0,8003cfc <rtems_aio_init+0xe0> <== NEVER TAKEN
return result;
result =
8003c44: b9 80 08 00 mv r1,r12
8003c48: 34 02 00 00 mvi r2,0
8003c4c: f8 00 04 b8 calli 8004f2c <pthread_attr_setdetachstate>
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
8003c50: 44 2b 00 03 be r1,r11,8003c5c <rtems_aio_init+0x40> <== ALWAYS TAKEN
pthread_attr_destroy (&aio_request_queue.attr);
8003c54: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8003c58: f8 00 04 a0 calli 8004ed8 <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
8003c5c: 78 01 08 01 mvhi r1,0x801
8003c60: 38 21 78 68 ori r1,r1,0x7868
8003c64: 34 02 00 00 mvi r2,0
8003c68: f8 00 03 c7 calli 8004b84 <pthread_mutex_init>
if (result != 0)
8003c6c: 44 20 00 04 be r1,r0,8003c7c <rtems_aio_init+0x60> <== ALWAYS TAKEN
pthread_attr_destroy (&aio_request_queue.attr);
8003c70: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
8003c74: 38 21 78 70 ori r1,r1,0x7870 <== NOT EXECUTED
8003c78: f8 00 04 98 calli 8004ed8 <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
8003c7c: 78 01 08 01 mvhi r1,0x801
8003c80: 38 21 78 6c ori r1,r1,0x786c
8003c84: 34 02 00 00 mvi r2,0
8003c88: f8 00 02 9d calli 80046fc <pthread_cond_init>
8003c8c: b8 20 58 00 mv r11,r1
if (result != 0) {
8003c90: 44 20 00 07 be r1,r0,8003cac <rtems_aio_init+0x90> <== ALWAYS TAKEN
pthread_mutex_destroy (&aio_request_queue.mutex);
8003c94: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
8003c98: 38 21 78 68 ori r1,r1,0x7868 <== NOT EXECUTED
8003c9c: f8 00 03 5d calli 8004a10 <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
8003ca0: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
8003ca4: 38 21 78 70 ori r1,r1,0x7870 <== NOT EXECUTED
8003ca8: f8 00 04 8c calli 8004ed8 <pthread_attr_destroy> <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8003cac: 78 02 08 01 mvhi r2,0x801
8003cb0: 78 01 08 01 mvhi r1,0x801
8003cb4: 38 42 78 68 ori r2,r2,0x7868
8003cb8: 38 21 78 b4 ori r1,r1,0x78b4
8003cbc: 58 41 00 48 sw (r2+72),r1
head->previous = NULL;
tail->previous = head;
8003cc0: 78 01 08 01 mvhi r1,0x801
8003cc4: 38 21 78 b0 ori r1,r1,0x78b0
8003cc8: 58 41 00 50 sw (r2+80),r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8003ccc: 78 01 08 01 mvhi r1,0x801
8003cd0: 38 21 78 c0 ori r1,r1,0x78c0
8003cd4: 58 41 00 54 sw (r2+84),r1
head->previous = NULL;
tail->previous = head;
8003cd8: 78 01 08 01 mvhi r1,0x801
8003cdc: 38 21 78 bc ori r1,r1,0x78bc
8003ce0: 58 41 00 5c sw (r2+92),r1
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
aio_request_queue.idle_threads = 0;
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
8003ce4: 38 01 b0 0b mvu r1,0xb00b
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
8003ce8: 58 40 00 4c sw (r2+76),r0
8003cec: 58 40 00 58 sw (r2+88),r0
}
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
8003cf0: 58 40 00 64 sw (r2+100),r0
aio_request_queue.idle_threads = 0;
8003cf4: 58 40 00 68 sw (r2+104),r0
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
8003cf8: 58 41 00 60 sw (r2+96),r1
return result;
}
8003cfc: b9 60 08 00 mv r1,r11
8003d00: 2b 9d 00 04 lw ra,(sp+4)
8003d04: 2b 8b 00 0c lw r11,(sp+12)
8003d08: 2b 8c 00 08 lw r12,(sp+8)
8003d0c: 37 9c 00 0c addi sp,sp,12
8003d10: c3 a0 00 00 ret
080040c0 <rtems_aio_insert_prio>:
* NONE
*/
void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
80040c0: 37 9c ff fc addi sp,sp,-4
80040c4: 5b 9d 00 04 sw (sp+4),ra
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
80040c8: 28 23 00 00 lw r3,(r1+0)
80040cc: 34 25 00 04 addi r5,r1,4
* NONE
*/
void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
80040d0: b8 40 20 00 mv r4,r2
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
80040d4: 44 65 00 0d be r3,r5,8004108 <rtems_aio_insert_prio+0x48> <== NEVER TAKEN
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
80040d8: 28 61 00 14 lw r1,(r3+20)
while (req->aiocbp->aio_reqprio > prio &&
80040dc: 28 42 00 14 lw r2,(r2+20)
if (rtems_chain_is_empty (chain)) {
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
80040e0: 28 21 00 10 lw r1,(r1+16)
while (req->aiocbp->aio_reqprio > prio &&
80040e4: 28 42 00 10 lw r2,(r2+16)
80040e8: e0 00 00 04 bi 80040f8 <rtems_aio_insert_prio+0x38>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
80040ec: 28 63 00 00 lw r3,(r3+0) <== NOT EXECUTED
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
!rtems_chain_is_tail (chain, node)) {
node = rtems_chain_next (node);
prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
80040f0: 28 61 00 14 lw r1,(r3+20) <== NOT EXECUTED
80040f4: 28 21 00 10 lw r1,(r1+16) <== NOT EXECUTED
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
80040f8: 4c 22 00 02 bge r1,r2,8004100 <rtems_aio_insert_prio+0x40> <== ALWAYS TAKEN
80040fc: 5c 65 ff fc bne r3,r5,80040ec <rtems_aio_insert_prio+0x2c> <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
8004100: 28 61 00 04 lw r1,(r3+4)
8004104: b8 80 10 00 mv r2,r4
8004108: f8 00 08 e3 calli 8006494 <_Chain_Insert>
}
rtems_chain_insert (node->previous, &req->next_prio);
}
}
800410c: 2b 9d 00 04 lw ra,(sp+4)
8004110: 37 9c 00 04 addi sp,sp,4
8004114: c3 a0 00 00 ret
08003dec <rtems_aio_move_to_work>:
* NONE
*/
void
rtems_aio_move_to_work (rtems_aio_request_chain *r_chain)
{
8003dec: 37 9c ff fc addi sp,sp,-4
8003df0: 5b 9d 00 04 sw (sp+4),ra
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003df4: 78 03 08 01 mvhi r3,0x801
8003df8: 38 63 78 68 ori r3,r3,0x7868
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
8003dfc: 78 04 08 01 mvhi r4,0x801
* NONE
*/
void
rtems_aio_move_to_work (rtems_aio_request_chain *r_chain)
{
8003e00: b8 20 10 00 mv r2,r1
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003e04: 28 63 00 48 lw r3,(r3+72)
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
8003e08: 28 21 00 14 lw r1,(r1+20)
8003e0c: 38 84 78 b4 ori r4,r4,0x78b4
8003e10: e0 00 00 02 bi 8003e18 <rtems_aio_move_to_work+0x2c>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003e14: 28 63 00 00 lw r3,(r3+0)
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
8003e18: 28 65 00 14 lw r5,(r3+20)
8003e1c: 4c a1 00 02 bge r5,r1,8003e24 <rtems_aio_move_to_work+0x38>
8003e20: 5c 64 ff fd bne r3,r4,8003e14 <rtems_aio_move_to_work+0x28><== ALWAYS TAKEN
8003e24: 28 61 00 04 lw r1,(r3+4)
8003e28: f8 00 09 9b calli 8006494 <_Chain_Insert>
node = rtems_chain_next (node);
temp = (rtems_aio_request_chain *) node;
}
rtems_chain_insert (rtems_chain_previous (node), &r_chain->next_fd);
}
8003e2c: 2b 9d 00 04 lw ra,(sp+4)
8003e30: 37 9c 00 04 addi sp,sp,4
8003e34: c3 a0 00 00 ret
08004190 <rtems_aio_remove_req>:
* AIO_NOTCANCELED - if request was not canceled
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
8004190: 37 9c ff f8 addi sp,sp,-8
8004194: 5b 8b 00 08 sw (sp+8),r11
8004198: 5b 9d 00 04 sw (sp+4),ra
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
800419c: 28 2b 00 00 lw r11,(r1+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
80041a0: 34 23 00 04 addi r3,r1,4
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
return AIO_ALLDONE;
80041a4: 34 01 00 02 mvi r1,2
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
80041a8: 5d 63 00 04 bne r11,r3,80041b8 <rtems_aio_remove_req+0x28>
80041ac: e0 00 00 11 bi 80041f0 <rtems_aio_remove_req+0x60>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
80041b0: 28 2b 00 00 lw r11,(r1+0) <== NOT EXECUTED
rtems_chain_node *node = rtems_chain_first (chain);
rtems_aio_request *current;
current = (rtems_aio_request *) node;
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
80041b4: 45 63 00 0e be r11,r3,80041ec <rtems_aio_remove_req+0x5c> <== NOT EXECUTED
80041b8: 29 64 00 14 lw r4,(r11+20)
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
80041bc: b9 60 08 00 mv r1,r11
rtems_chain_node *node = rtems_chain_first (chain);
rtems_aio_request *current;
current = (rtems_aio_request *) node;
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
80041c0: 5c 82 ff fc bne r4,r2,80041b0 <rtems_aio_remove_req+0x20> <== NEVER TAKEN
80041c4: f8 00 08 9b calli 8006430 <_Chain_Extract>
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
80041c8: 29 61 00 14 lw r1,(r11+20)
80041cc: 34 02 00 8c mvi r2,140
80041d0: 58 22 00 2c sw (r1+44),r2
current->aiocbp->return_value = -1;
80041d4: 34 02 ff ff mvi r2,-1
80041d8: 58 22 00 30 sw (r1+48),r2
free (current);
80041dc: b9 60 08 00 mv r1,r11
80041e0: fb ff f7 e0 calli 8002160 <free>
}
return AIO_CANCELED;
80041e4: 34 01 00 00 mvi r1,0
80041e8: e0 00 00 02 bi 80041f0 <rtems_aio_remove_req+0x60>
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
80041ec: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
80041f0: 2b 9d 00 04 lw ra,(sp+4)
80041f4: 2b 8b 00 08 lw r11,(sp+8)
80041f8: 37 9c 00 08 addi sp,sp,8
80041fc: c3 a0 00 00 ret
08003898 <rtems_chain_get_with_wait>:
rtems_chain_control *chain,
rtems_event_set events,
rtems_interval timeout,
rtems_chain_node **node_ptr
)
{
8003898: 37 9c ff e4 addi sp,sp,-28
800389c: 5b 8b 00 18 sw (sp+24),r11
80038a0: 5b 8c 00 14 sw (sp+20),r12
80038a4: 5b 8d 00 10 sw (sp+16),r13
80038a8: 5b 8e 00 0c sw (sp+12),r14
80038ac: 5b 8f 00 08 sw (sp+8),r15
80038b0: 5b 9d 00 04 sw (sp+4),ra
80038b4: b8 20 78 00 mv r15,r1
80038b8: b8 40 70 00 mv r14,r2
80038bc: b8 60 68 00 mv r13,r3
80038c0: b8 80 60 00 mv r12,r4
80038c4: e0 00 00 08 bi 80038e4 <rtems_chain_get_with_wait+0x4c>
while (
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
) {
rtems_event_set out;
sc = rtems_event_receive(
80038c8: b9 c0 08 00 mv r1,r14
80038cc: 34 02 00 00 mvi r2,0
80038d0: b9 a0 18 00 mv r3,r13
80038d4: 37 84 00 1c addi r4,sp,28
80038d8: fb ff fd d2 calli 8003020 <rtems_event_receive>
80038dc: b8 20 28 00 mv r5,r1
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
80038e0: 5c 2b 00 06 bne r1,r11,80038f8 <rtems_chain_get_with_wait+0x60><== ALWAYS TAKEN
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
80038e4: b9 e0 08 00 mv r1,r15
80038e8: f8 00 01 a1 calli 8003f6c <_Chain_Get>
80038ec: b8 20 58 00 mv r11,r1
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
80038f0: 44 20 ff f6 be r1,r0,80038c8 <rtems_chain_get_with_wait+0x30>
80038f4: 34 05 00 00 mvi r5,0
}
*node_ptr = node;
return sc;
}
80038f8: b8 a0 08 00 mv r1,r5
timeout,
&out
);
}
*node_ptr = node;
80038fc: 59 8b 00 00 sw (r12+0),r11
return sc;
}
8003900: 2b 9d 00 04 lw ra,(sp+4)
8003904: 2b 8b 00 18 lw r11,(sp+24)
8003908: 2b 8c 00 14 lw r12,(sp+20)
800390c: 2b 8d 00 10 lw r13,(sp+16)
8003910: 2b 8e 00 0c lw r14,(sp+12)
8003914: 2b 8f 00 08 lw r15,(sp+8)
8003918: 37 9c 00 1c addi sp,sp,28
800391c: c3 a0 00 00 ret
08010ad0 <rtems_clock_set_nanoseconds_extension>:
* error code - if unsuccessful
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
8010ad0: b8 20 18 00 mv r3,r1
if ( !routine )
return RTEMS_INVALID_ADDRESS;
8010ad4: 34 01 00 09 mvi r1,9
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
if ( !routine )
8010ad8: 44 60 00 05 be r3,r0,8010aec <rtems_clock_set_nanoseconds_extension+0x1c><== ALWAYS TAKEN
return RTEMS_INVALID_ADDRESS;
_Watchdog_Nanoseconds_since_tick_handler = routine;
8010adc: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
8010ae0: 38 42 c1 6c ori r2,r2,0xc16c <== NOT EXECUTED
8010ae4: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED
return RTEMS_SUCCESSFUL;
8010ae8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
8010aec: c3 a0 00 00 ret
0800605c <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)
{
800605c: 37 9c ff e4 addi sp,sp,-28
8006060: 5b 8b 00 1c sw (sp+28),r11
8006064: 5b 8c 00 18 sw (sp+24),r12
8006068: 5b 8d 00 14 sw (sp+20),r13
800606c: 5b 8e 00 10 sw (sp+16),r14
8006070: 5b 8f 00 0c sw (sp+12),r15
8006074: 5b 90 00 08 sw (sp+8),r16
8006078: 5b 9d 00 04 sw (sp+4),ra
800607c: b8 20 78 00 mv r15,r1
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006080: 44 20 00 17 be r1,r0,80060dc <rtems_iterate_over_all_threads+0x80><== NEVER TAKEN
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8006084: 78 02 08 02 mvhi r2,0x802
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006088: 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)
800608c: 38 42 1c c4 ori r2,r2,0x1cc4
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006090: 39 6b 1c c8 ori r11,r11,0x1cc8
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8006094: 34 50 00 10 addi r16,r2,16
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
8006098: 29 61 00 00 lw r1,(r11+0)
if ( !information )
800609c: 34 0e 00 04 mvi r14,4
80060a0: 34 0d 00 01 mvi r13,1
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
80060a4: 28 2c 00 04 lw r12,(r1+4)
if ( !information )
80060a8: 5d 80 00 09 bne r12,r0,80060cc <rtems_iterate_over_all_threads+0x70>
80060ac: e0 00 00 0a bi 80060d4 <rtems_iterate_over_all_threads+0x78>
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
80060b0: 29 81 00 1c lw r1,(r12+28)
80060b4: b4 2e 08 00 add r1,r1,r14
80060b8: 28 21 00 00 lw r1,(r1+0)
if ( !the_thread )
80060bc: 44 20 00 02 be r1,r0,80060c4 <rtems_iterate_over_all_threads+0x68>
continue;
(*routine)(the_thread);
80060c0: d9 e0 00 00 call r15
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
80060c4: 35 ad 00 01 addi r13,r13,1
80060c8: 35 ce 00 04 addi r14,r14,4
80060cc: 2d 81 00 10 lhu r1,(r12+16)
80060d0: 50 2d ff f8 bgeu r1,r13,80060b0 <rtems_iterate_over_all_threads+0x54>
80060d4: 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++ ) {
80060d8: 5d 70 ff f0 bne r11,r16,8006098 <rtems_iterate_over_all_threads+0x3c>
(*routine)(the_thread);
}
}
}
80060dc: 2b 9d 00 04 lw ra,(sp+4)
80060e0: 2b 8b 00 1c lw r11,(sp+28)
80060e4: 2b 8c 00 18 lw r12,(sp+24)
80060e8: 2b 8d 00 14 lw r13,(sp+20)
80060ec: 2b 8e 00 10 lw r14,(sp+16)
80060f0: 2b 8f 00 0c lw r15,(sp+12)
80060f4: 2b 90 00 08 lw r16,(sp+8)
80060f8: 37 9c 00 1c addi sp,sp,28
80060fc: c3 a0 00 00 ret
080119ec <rtems_partition_create>:
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
80119ec: 37 9c ff d8 addi sp,sp,-40
80119f0: 5b 8b 00 28 sw (sp+40),r11
80119f4: 5b 8c 00 24 sw (sp+36),r12
80119f8: 5b 8d 00 20 sw (sp+32),r13
80119fc: 5b 8e 00 1c sw (sp+28),r14
8011a00: 5b 8f 00 18 sw (sp+24),r15
8011a04: 5b 90 00 14 sw (sp+20),r16
8011a08: 5b 91 00 10 sw (sp+16),r17
8011a0c: 5b 92 00 0c sw (sp+12),r18
8011a10: 5b 93 00 08 sw (sp+8),r19
8011a14: 5b 9d 00 04 sw (sp+4),ra
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
8011a18: 34 07 00 03 mvi r7,3
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
8011a1c: b8 20 88 00 mv r17,r1
8011a20: b8 40 70 00 mv r14,r2
8011a24: b8 60 78 00 mv r15,r3
8011a28: b8 80 60 00 mv r12,r4
8011a2c: b8 a0 98 00 mv r19,r5
8011a30: b8 c0 80 00 mv r16,r6
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
8011a34: 44 20 00 36 be r1,r0,8011b0c <rtems_partition_create+0x120>
return RTEMS_INVALID_NAME;
if ( !starting_address )
return RTEMS_INVALID_ADDRESS;
8011a38: 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 )
8011a3c: 44 40 00 34 be r2,r0,8011b0c <rtems_partition_create+0x120>
return RTEMS_INVALID_ADDRESS;
if ( !id )
8011a40: 44 c0 00 33 be r6,r0,8011b0c <rtems_partition_create+0x120><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
8011a44: 64 82 00 00 cmpei r2,r4,0
8011a48: 64 61 00 00 cmpei r1,r3,0
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
8011a4c: 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 ||
8011a50: b8 41 08 00 or r1,r2,r1
8011a54: 5c 20 00 2e bne r1,r0,8011b0c <rtems_partition_create+0x120>
8011a58: 54 83 00 2d bgu r4,r3,8011b0c <rtems_partition_create+0x120>
*/
RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned (
uint32_t buffer_size
)
{
return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0);
8011a5c: 20 81 00 07 andi r1,r4,0x7
8011a60: 5c 20 00 2b bne r1,r0,8011b0c <rtems_partition_create+0x120>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
8011a64: 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;
8011a68: 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 ) )
8011a6c: 5e 41 00 28 bne r18,r1,8011b0c <rtems_partition_create+0x120>
8011a70: 78 02 08 04 mvhi r2,0x804
8011a74: 38 42 0d 10 ori r2,r2,0xd10
8011a78: 28 41 00 00 lw r1,(r2+0)
8011a7c: 34 21 00 01 addi r1,r1,1
8011a80: 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 );
8011a84: 78 0d 08 04 mvhi r13,0x804
8011a88: 39 ad 0b 68 ori r13,r13,0xb68
8011a8c: b9 a0 08 00 mv r1,r13
8011a90: f8 00 16 13 calli 80172dc <_Objects_Allocate>
8011a94: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
8011a98: 5c 32 00 04 bne r1,r18,8011aa8 <rtems_partition_create+0xbc>
_Thread_Enable_dispatch();
8011a9c: f8 00 1b f6 calli 8018a74 <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
8011aa0: 34 07 00 05 mvi r7,5
8011aa4: e0 00 00 1a bi 8011b0c <rtems_partition_create+0x120>
}
#endif
the_partition->starting_address = starting_address;
the_partition->length = length;
the_partition->buffer_size = buffer_size;
8011aa8: 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 );
8011aac: b9 80 10 00 mv r2,r12
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
8011ab0: 58 2e 00 10 sw (r1+16),r14
the_partition->length = length;
8011ab4: 58 2f 00 14 sw (r1+20),r15
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
8011ab8: 58 33 00 1c sw (r1+28),r19
the_partition->number_of_used_blocks = 0;
8011abc: 58 20 00 20 sw (r1+32),r0
_Chain_Initialize( &the_partition->Memory, starting_address,
8011ac0: 34 32 00 24 addi r18,r1,36
length / buffer_size, buffer_size );
8011ac4: b9 e0 08 00 mv r1,r15
8011ac8: f8 00 7f 87 calli 80318e4 <__udivsi3>
8011acc: 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,
8011ad0: b9 80 20 00 mv r4,r12
8011ad4: ba 40 08 00 mv r1,r18
8011ad8: b9 c0 10 00 mv r2,r14
8011adc: f8 00 0e fb calli 80156c8 <_Chain_Initialize>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8011ae0: 29 6c 00 08 lw r12,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8011ae4: 29 ad 00 1c lw r13,(r13+28)
8011ae8: 34 02 00 02 mvi r2,2
8011aec: 21 81 ff ff andi r1,r12,0xffff
8011af0: fb ff f1 01 calli 800def4 <__ashlsi3>
8011af4: b5 a1 08 00 add r1,r13,r1
8011af8: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8011afc: 59 71 00 0c sw (r11+12),r17
&_Partition_Information,
&the_partition->Object,
(Objects_Name) name
);
*id = the_partition->Object.id;
8011b00: 5a 0c 00 00 sw (r16+0),r12
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
8011b04: f8 00 1b dc calli 8018a74 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8011b08: 34 07 00 00 mvi r7,0
}
8011b0c: b8 e0 08 00 mv r1,r7
8011b10: 2b 9d 00 04 lw ra,(sp+4)
8011b14: 2b 8b 00 28 lw r11,(sp+40)
8011b18: 2b 8c 00 24 lw r12,(sp+36)
8011b1c: 2b 8d 00 20 lw r13,(sp+32)
8011b20: 2b 8e 00 1c lw r14,(sp+28)
8011b24: 2b 8f 00 18 lw r15,(sp+24)
8011b28: 2b 90 00 14 lw r16,(sp+20)
8011b2c: 2b 91 00 10 lw r17,(sp+16)
8011b30: 2b 92 00 0c lw r18,(sp+12)
8011b34: 2b 93 00 08 lw r19,(sp+8)
8011b38: 37 9c 00 28 addi sp,sp,40
8011b3c: c3 a0 00 00 ret
08010fd8 <rtems_port_internal_to_external>:
rtems_status_code rtems_port_internal_to_external(
rtems_id id,
void *internal,
void **external
)
{
8010fd8: 37 9c ff f0 addi sp,sp,-16
8010fdc: 5b 8b 00 0c sw (sp+12),r11
8010fe0: 5b 8c 00 08 sw (sp+8),r12
8010fe4: 5b 9d 00 04 sw (sp+4),ra
8010fe8: b8 20 20 00 mv r4,r1
8010fec: b8 40 60 00 mv r12,r2
8010ff0: b8 60 58 00 mv r11,r3
register Dual_ported_memory_Control *the_port;
Objects_Locations location;
uint32_t ending;
if ( !external )
return RTEMS_INVALID_ADDRESS;
8010ff4: 34 01 00 09 mvi r1,9
{
register Dual_ported_memory_Control *the_port;
Objects_Locations location;
uint32_t ending;
if ( !external )
8010ff8: 44 60 00 15 be r3,r0,801104c <rtems_port_internal_to_external+0x74><== NEVER TAKEN
8010ffc: 78 01 08 04 mvhi r1,0x804
8011000: b8 80 10 00 mv r2,r4
8011004: 38 21 0b 28 ori r1,r1,0xb28
8011008: 37 83 00 10 addi r3,sp,16
801100c: f8 00 1a 6d calli 80179c0 <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_port = _Dual_ported_memory_Get( id, &location );
switch ( location ) {
8011010: 2b 82 00 10 lw r2,(sp+16)
8011014: 5c 40 00 0d bne r2,r0,8011048 <rtems_port_internal_to_external+0x70>
RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract (
const void *left,
const void *right
)
{
return (int32_t) ((const char *) left - (const char *) right);
8011018: 28 23 00 10 lw r3,(r1+16)
case OBJECTS_LOCAL:
ending = _Addresses_Subtract( internal, the_port->internal_base );
if ( ending > the_port->length )
801101c: 28 22 00 18 lw r2,(r1+24)
8011020: c9 83 18 00 sub r3,r12,r3
8011024: 50 43 00 03 bgeu r2,r3,8011030 <rtems_port_internal_to_external+0x58>
*external = internal;
8011028: 59 6c 00 00 sw (r11+0),r12
801102c: e0 00 00 04 bi 801103c <rtems_port_internal_to_external+0x64>
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
8011030: 28 21 00 14 lw r1,(r1+20)
8011034: b4 23 18 00 add r3,r1,r3
else
*external = _Addresses_Add_offset( the_port->external_base,
8011038: 59 63 00 00 sw (r11+0),r3
ending );
_Thread_Enable_dispatch();
801103c: f8 00 1e 8e calli 8018a74 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8011040: 34 01 00 00 mvi r1,0
8011044: e0 00 00 02 bi 801104c <rtems_port_internal_to_external+0x74>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8011048: 34 01 00 04 mvi r1,4
}
801104c: 2b 9d 00 04 lw ra,(sp+4)
8011050: 2b 8b 00 0c lw r11,(sp+12)
8011054: 2b 8c 00 08 lw r12,(sp+8)
8011058: 37 9c 00 10 addi sp,sp,16
801105c: c3 a0 00 00 ret
0800b85c <rtems_rate_monotonic_get_statistics>:
rtems_status_code rtems_rate_monotonic_get_statistics(
rtems_id id,
rtems_rate_monotonic_period_statistics *statistics
)
{
800b85c: 37 9c ff f4 addi sp,sp,-12
800b860: 5b 8b 00 08 sw (sp+8),r11
800b864: 5b 9d 00 04 sw (sp+4),ra
800b868: b8 20 18 00 mv r3,r1
800b86c: 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;
800b870: 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 )
800b874: 44 40 00 28 be r2,r0,800b914 <rtems_rate_monotonic_get_statistics+0xb8><== NEVER TAKEN
800b878: 78 01 08 02 mvhi r1,0x802
800b87c: b8 60 10 00 mv r2,r3
800b880: 38 21 19 00 ori r1,r1,0x1900
800b884: 37 83 00 0c addi r3,sp,12
800b888: fb ff ec 4f calli 80069c4 <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
800b88c: 2b 82 00 0c lw r2,(sp+12)
800b890: 5c 40 00 20 bne r2,r0,800b910 <rtems_rate_monotonic_get_statistics+0xb4>
case OBJECTS_LOCAL:
dst = statistics;
src = &the_period->Statistics;
dst->count = src->count;
800b894: 28 22 00 54 lw r2,(r1+84)
800b898: 59 62 00 00 sw (r11+0),r2
dst->missed_count = src->missed_count;
800b89c: 28 22 00 58 lw r2,(r1+88)
800b8a0: 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 );
800b8a4: 28 22 00 5c lw r2,(r1+92)
800b8a8: 59 62 00 08 sw (r11+8),r2
800b8ac: 28 22 00 60 lw r2,(r1+96)
800b8b0: 59 62 00 0c sw (r11+12),r2
_Timestamp_To_timespec( &src->max_cpu_time, &dst->max_cpu_time );
800b8b4: 28 22 00 64 lw r2,(r1+100)
800b8b8: 59 62 00 10 sw (r11+16),r2
800b8bc: 28 22 00 68 lw r2,(r1+104)
800b8c0: 59 62 00 14 sw (r11+20),r2
_Timestamp_To_timespec( &src->total_cpu_time, &dst->total_cpu_time );
800b8c4: 28 22 00 6c lw r2,(r1+108)
800b8c8: 59 62 00 18 sw (r11+24),r2
800b8cc: 28 22 00 70 lw r2,(r1+112)
800b8d0: 59 62 00 1c sw (r11+28),r2
_Timestamp_To_timespec( &src->min_wall_time, &dst->min_wall_time );
800b8d4: 28 22 00 74 lw r2,(r1+116)
800b8d8: 59 62 00 20 sw (r11+32),r2
800b8dc: 28 22 00 78 lw r2,(r1+120)
800b8e0: 59 62 00 24 sw (r11+36),r2
_Timestamp_To_timespec( &src->max_wall_time, &dst->max_wall_time );
800b8e4: 28 22 00 7c lw r2,(r1+124)
800b8e8: 59 62 00 28 sw (r11+40),r2
800b8ec: 28 22 00 80 lw r2,(r1+128)
800b8f0: 59 62 00 2c sw (r11+44),r2
_Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time );
800b8f4: 28 22 00 84 lw r2,(r1+132)
800b8f8: 28 21 00 88 lw r1,(r1+136)
800b8fc: 59 62 00 30 sw (r11+48),r2
800b900: 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();
800b904: fb ff f0 02 calli 800790c <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
800b908: 34 01 00 00 mvi r1,0
800b90c: e0 00 00 02 bi 800b914 <rtems_rate_monotonic_get_statistics+0xb8>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
800b910: 34 01 00 04 mvi r1,4
}
800b914: 2b 9d 00 04 lw ra,(sp+4)
800b918: 2b 8b 00 08 lw r11,(sp+8)
800b91c: 37 9c 00 0c addi sp,sp,12
800b920: c3 a0 00 00 ret
080040f4 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
80040f4: 37 9c ff e8 addi sp,sp,-24
80040f8: 5b 8b 00 14 sw (sp+20),r11
80040fc: 5b 8c 00 10 sw (sp+16),r12
8004100: 5b 8d 00 0c sw (sp+12),r13
8004104: 5b 8e 00 08 sw (sp+8),r14
8004108: 5b 9d 00 04 sw (sp+4),ra
800410c: b8 20 60 00 mv r12,r1
Objects_Id id,
Objects_Locations *location
)
{
return (Rate_monotonic_Control *)
_Objects_Get( &_Rate_monotonic_Information, id, location );
8004110: 78 01 08 02 mvhi r1,0x802
8004114: b8 40 68 00 mv r13,r2
8004118: 38 21 19 00 ori r1,r1,0x1900
800411c: b9 80 10 00 mv r2,r12
8004120: 37 83 00 18 addi r3,sp,24
8004124: f8 00 0a 28 calli 80069c4 <_Objects_Get>
8004128: 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 ) {
800412c: 2b 81 00 18 lw r1,(sp+24)
8004130: 5c 20 00 5f bne r1,r0,80042ac <rtems_rate_monotonic_period+0x1b8>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
8004134: 78 03 08 02 mvhi r3,0x802
8004138: 38 63 1e d4 ori r3,r3,0x1ed4
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
800413c: 29 62 00 40 lw r2,(r11+64)
8004140: 28 61 00 0c lw r1,(r3+12)
8004144: 44 41 00 04 be r2,r1,8004154 <rtems_rate_monotonic_period+0x60>
_Thread_Enable_dispatch();
8004148: f8 00 0d f1 calli 800790c <_Thread_Enable_dispatch>
return RTEMS_NOT_OWNER_OF_RESOURCE;
800414c: 34 0c 00 17 mvi r12,23
8004150: e0 00 00 58 bi 80042b0 <rtems_rate_monotonic_period+0x1bc>
}
if ( length == RTEMS_PERIOD_STATUS ) {
8004154: 5d a0 00 0d bne r13,r0,8004188 <rtems_rate_monotonic_period+0x94>
switch ( the_period->state ) {
8004158: 29 61 00 38 lw r1,(r11+56)
800415c: 34 02 00 04 mvi r2,4
8004160: 34 0c 00 00 mvi r12,0
8004164: 54 22 00 07 bgu r1,r2,8004180 <rtems_rate_monotonic_period+0x8c><== NEVER TAKEN
8004168: 78 0b 08 01 mvhi r11,0x801
800416c: 34 02 00 02 mvi r2,2
8004170: fb ff f4 47 calli 800128c <__ashlsi3>
8004174: 39 6b ea 48 ori r11,r11,0xea48
8004178: b5 61 08 00 add r1,r11,r1
800417c: 28 2c 00 00 lw r12,(r1+0)
case RATE_MONOTONIC_ACTIVE:
default: /* unreached -- only to remove warnings */
return_value = RTEMS_SUCCESSFUL;
break;
}
_Thread_Enable_dispatch();
8004180: f8 00 0d e3 calli 800790c <_Thread_Enable_dispatch>
return( return_value );
8004184: e0 00 00 4b bi 80042b0 <rtems_rate_monotonic_period+0x1bc>
}
_ISR_Disable( level );
8004188: 90 00 70 00 rcsr r14,IE
800418c: 34 01 ff fe mvi r1,-2
8004190: a1 c1 08 00 and r1,r14,r1
8004194: d0 01 00 00 wcsr IE,r1
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
8004198: 29 63 00 38 lw r3,(r11+56)
800419c: 5c 60 00 13 bne r3,r0,80041e8 <rtems_rate_monotonic_period+0xf4>
_ISR_Enable( level );
80041a0: d0 0e 00 00 wcsr IE,r14
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
80041a4: b9 60 08 00 mv r1,r11
80041a8: fb ff ff 6e calli 8003f60 <_Rate_monotonic_Initiate_statistics>
the_period->state = RATE_MONOTONIC_ACTIVE;
80041ac: 34 01 00 02 mvi r1,2
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
80041b0: 78 03 08 00 mvhi r3,0x800
80041b4: 59 61 00 38 sw (r11+56),r1
80041b8: 38 63 46 34 ori r3,r3,0x4634
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80041bc: 78 01 08 02 mvhi r1,0x802
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
80041c0: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
80041c4: 59 63 00 2c sw (r11+44),r3
the_watchdog->id = id;
80041c8: 59 6c 00 30 sw (r11+48),r12
the_watchdog->user_data = user_data;
80041cc: 59 60 00 34 sw (r11+52),r0
_Rate_monotonic_Timeout,
id,
NULL
);
the_period->next_length = length;
80041d0: 59 6d 00 3c sw (r11+60),r13
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80041d4: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80041d8: 38 21 1a e8 ori r1,r1,0x1ae8
80041dc: 35 62 00 10 addi r2,r11,16
80041e0: f8 00 12 73 calli 8008bac <_Watchdog_Insert>
80041e4: e0 00 00 1f bi 8004260 <rtems_rate_monotonic_period+0x16c>
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_ACTIVE ) {
80041e8: 34 01 00 02 mvi r1,2
80041ec: 5c 61 00 20 bne r3,r1,800426c <rtems_rate_monotonic_period+0x178>
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
80041f0: b9 60 08 00 mv r1,r11
80041f4: fb ff ff 80 calli 8003ff4 <_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;
80041f8: 34 01 00 01 mvi r1,1
80041fc: 59 61 00 38 sw (r11+56),r1
the_period->next_length = length;
8004200: 59 6d 00 3c sw (r11+60),r13
_ISR_Enable( level );
8004204: d0 0e 00 00 wcsr IE,r14
_Thread_Executing->Wait.id = the_period->Object.id;
8004208: 78 01 08 02 mvhi r1,0x802
800420c: 38 21 1e d4 ori r1,r1,0x1ed4
8004210: 29 62 00 08 lw r2,(r11+8)
8004214: 28 21 00 0c lw r1,(r1+12)
8004218: 58 22 00 20 sw (r1+32),r2
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
800421c: 34 02 40 00 mvi r2,16384
8004220: f8 00 10 56 calli 8008378 <_Thread_Set_state>
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
8004224: 90 00 08 00 rcsr r1,IE
8004228: 34 02 ff fe mvi r2,-2
800422c: a0 22 10 00 and r2,r1,r2
8004230: d0 02 00 00 wcsr IE,r2
local_state = the_period->state;
the_period->state = RATE_MONOTONIC_ACTIVE;
8004234: 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;
8004238: 29 62 00 38 lw r2,(r11+56)
the_period->state = RATE_MONOTONIC_ACTIVE;
800423c: 59 63 00 38 sw (r11+56),r3
_ISR_Enable( level );
8004240: 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 )
8004244: 34 01 00 03 mvi r1,3
8004248: 5c 41 00 06 bne r2,r1,8004260 <rtems_rate_monotonic_period+0x16c><== ALWAYS TAKEN
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
800424c: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED
8004250: 38 21 1e d4 ori r1,r1,0x1ed4 <== NOT EXECUTED
8004254: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED
8004258: 34 02 40 00 mvi r2,16384 <== NOT EXECUTED
800425c: f8 00 0c e8 calli 80075fc <_Thread_Clear_state> <== NOT EXECUTED
_Thread_Enable_dispatch();
8004260: f8 00 0d ab calli 800790c <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8004264: 34 0c 00 00 mvi r12,0
8004268: e0 00 00 12 bi 80042b0 <rtems_rate_monotonic_period+0x1bc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
800426c: 34 0c 00 04 mvi r12,4
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_EXPIRED ) {
8004270: 5c 6c 00 10 bne r3,r12,80042b0 <rtems_rate_monotonic_period+0x1bc><== NEVER TAKEN
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
8004274: b9 60 08 00 mv r1,r11
8004278: fb ff ff 5f calli 8003ff4 <_Rate_monotonic_Update_statistics>
_ISR_Enable( level );
800427c: d0 0e 00 00 wcsr IE,r14
the_period->state = RATE_MONOTONIC_ACTIVE;
8004280: 34 01 00 02 mvi r1,2
8004284: 59 61 00 38 sw (r11+56),r1
8004288: 78 01 08 02 mvhi r1,0x802
800428c: 38 21 1a e8 ori r1,r1,0x1ae8
8004290: 35 62 00 10 addi r2,r11,16
the_period->next_length = length;
8004294: 59 6d 00 3c sw (r11+60),r13
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8004298: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800429c: f8 00 12 44 calli 8008bac <_Watchdog_Insert>
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
return RTEMS_TIMEOUT;
80042a0: 34 0c 00 06 mvi r12,6
the_period->state = RATE_MONOTONIC_ACTIVE;
the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
80042a4: f8 00 0d 9a calli 800790c <_Thread_Enable_dispatch>
return RTEMS_TIMEOUT;
80042a8: e0 00 00 02 bi 80042b0 <rtems_rate_monotonic_period+0x1bc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
80042ac: 34 0c 00 04 mvi r12,4
}
80042b0: b9 80 08 00 mv r1,r12
80042b4: 2b 9d 00 04 lw ra,(sp+4)
80042b8: 2b 8b 00 14 lw r11,(sp+20)
80042bc: 2b 8c 00 10 lw r12,(sp+16)
80042c0: 2b 8d 00 0c lw r13,(sp+12)
80042c4: 2b 8e 00 08 lw r14,(sp+8)
80042c8: 37 9c 00 18 addi sp,sp,24
80042cc: c3 a0 00 00 ret
080042d0 <rtems_rate_monotonic_report_statistics_with_plugin>:
*/
void rtems_rate_monotonic_report_statistics_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
80042d0: 37 9c ff 5c addi sp,sp,-164
80042d4: 5b 8b 00 44 sw (sp+68),r11
80042d8: 5b 8c 00 40 sw (sp+64),r12
80042dc: 5b 8d 00 3c sw (sp+60),r13
80042e0: 5b 8e 00 38 sw (sp+56),r14
80042e4: 5b 8f 00 34 sw (sp+52),r15
80042e8: 5b 90 00 30 sw (sp+48),r16
80042ec: 5b 91 00 2c sw (sp+44),r17
80042f0: 5b 92 00 28 sw (sp+40),r18
80042f4: 5b 93 00 24 sw (sp+36),r19
80042f8: 5b 94 00 20 sw (sp+32),r20
80042fc: 5b 95 00 1c sw (sp+28),r21
8004300: 5b 96 00 18 sw (sp+24),r22
8004304: 5b 97 00 14 sw (sp+20),r23
8004308: 5b 98 00 10 sw (sp+16),r24
800430c: 5b 99 00 0c sw (sp+12),r25
8004310: 5b 9b 00 08 sw (sp+8),fp
8004314: 5b 9d 00 04 sw (sp+4),ra
8004318: b8 20 60 00 mv r12,r1
800431c: 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 )
8004320: 44 40 00 72 be r2,r0,80044e8 <rtems_rate_monotonic_report_statistics_with_plugin+0x218><== NEVER TAKEN
return;
(*print)( context, "Period information by period\n" );
8004324: 78 02 08 01 mvhi r2,0x801
8004328: 38 42 ea 5c ori r2,r2,0xea5c
800432c: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)( context, "--- CPU times are in seconds ---\n" );
8004330: 78 02 08 01 mvhi r2,0x801
8004334: 38 42 ea 7c ori r2,r2,0xea7c
8004338: b9 80 08 00 mv r1,r12
800433c: d9 60 00 00 call r11
(*print)( context, "--- Wall times are in seconds ---\n" );
8004340: 78 02 08 01 mvhi r2,0x801
8004344: 38 42 ea a0 ori r2,r2,0xeaa0
8004348: b9 80 08 00 mv r1,r12
800434c: d9 60 00 00 call r11
Be sure to test the various cases.
(*print)( context,"\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
*/
(*print)( context, " ID OWNER COUNT MISSED "
8004350: 78 02 08 01 mvhi r2,0x801
8004354: 38 42 ea c4 ori r2,r2,0xeac4
8004358: b9 80 08 00 mv r1,r12
800435c: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
" "
#endif
" WALL TIME\n"
);
(*print)( context, " "
8004360: 78 02 08 01 mvhi r2,0x801
8004364: b9 80 08 00 mv r1,r12
8004368: 38 42 eb 10 ori r2,r2,0xeb10
800436c: 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 ;
8004370: 78 01 08 02 mvhi r1,0x802
8004374: 38 21 19 00 ori r1,r1,0x1900
rtems_object_get_name( the_status.owner, sizeof(name), name );
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8004378: 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,
800437c: 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,
8004380: 78 0f 08 01 mvhi r15,0x801
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
8004384: 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 ;
8004388: 28 2d 00 08 lw r13,(r1+8)
id <= _Rate_monotonic_Information.maximum_id ;
800438c: b8 20 a0 00 mv r20,r1
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
8004390: 37 99 00 48 addi r25,sp,72
#if defined(RTEMS_DEBUG)
status = rtems_rate_monotonic_get_status( id, &the_status );
if ( status != RTEMS_SUCCESSFUL )
continue;
#else
(void) rtems_rate_monotonic_get_status( id, &the_status );
8004394: 37 98 00 80 addi r24,sp,128
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
8004398: 37 93 00 a0 addi r19,sp,160
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
800439c: 3a 31 eb 5c ori r17,r17,0xeb5c
{
#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;
80043a0: 37 97 00 60 addi r23,sp,96
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
80043a4: 37 92 00 98 addi r18,sp,152
(*print)( context,
80043a8: 3a 10 eb 74 ori r16,r16,0xeb74
{
#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;
80043ac: 37 96 00 78 addi r22,sp,120
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
80043b0: 39 ef eb 94 ori r15,r15,0xeb94
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
80043b4: 39 ce e0 a0 ori r14,r14,0xe0a0
/*
* 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 ;
80043b8: e0 00 00 4a bi 80044e0 <rtems_rate_monotonic_report_statistics_with_plugin+0x210>
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
80043bc: b9 a0 08 00 mv r1,r13
80043c0: bb 20 10 00 mv r2,r25
80043c4: f8 00 1d 26 calli 800b85c <rtems_rate_monotonic_get_statistics>
80043c8: b8 20 a8 00 mv r21,r1
if ( status != RTEMS_SUCCESSFUL )
80043cc: 5c 20 00 44 bne r1,r0,80044dc <rtems_rate_monotonic_report_statistics_with_plugin+0x20c>
#if defined(RTEMS_DEBUG)
status = rtems_rate_monotonic_get_status( id, &the_status );
if ( status != RTEMS_SUCCESSFUL )
continue;
#else
(void) rtems_rate_monotonic_get_status( id, &the_status );
80043d0: bb 00 10 00 mv r2,r24
80043d4: b9 a0 08 00 mv r1,r13
80043d8: f8 00 1d 53 calli 800b924 <rtems_rate_monotonic_get_status>
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
80043dc: 2b 81 00 80 lw r1,(sp+128)
80043e0: 34 02 00 05 mvi r2,5
80043e4: ba 60 18 00 mv r3,r19
80043e8: f8 00 00 c3 calli 80046f4 <rtems_object_get_name>
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
80043ec: 2b 85 00 48 lw r5,(sp+72)
80043f0: 2b 86 00 4c lw r6,(sp+76)
80043f4: ba 20 10 00 mv r2,r17
80043f8: b9 80 08 00 mv r1,r12
80043fc: b9 a0 18 00 mv r3,r13
8004400: ba 60 20 00 mv r4,r19
8004404: d9 60 00 00 call r11
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
8004408: 2b 82 00 48 lw r2,(sp+72)
800440c: 5c 55 00 05 bne r2,r21,8004420 <rtems_rate_monotonic_report_statistics_with_plugin+0x150>
(*print)( context, "\n" );
8004410: b9 80 08 00 mv r1,r12
8004414: b9 c0 10 00 mv r2,r14
8004418: d9 60 00 00 call r11
continue;
800441c: e0 00 00 30 bi 80044dc <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 );
8004420: ba 40 18 00 mv r3,r18
8004424: ba e0 08 00 mv r1,r23
8004428: f8 00 10 97 calli 8008684 <_Timespec_Divide_by_integer>
(*print)( context,
800442c: 2b 81 00 54 lw r1,(sp+84)
8004430: 34 02 03 e8 mvi r2,1000
8004434: f8 00 62 1a calli 801cc9c <__divsi3>
8004438: b8 20 d8 00 mv fp,r1
800443c: 2b 81 00 5c lw r1,(sp+92)
8004440: 34 02 03 e8 mvi r2,1000
8004444: f8 00 62 16 calli 801cc9c <__divsi3>
8004448: b8 20 a8 00 mv r21,r1
800444c: 2b 81 00 9c lw r1,(sp+156)
8004450: 34 02 03 e8 mvi r2,1000
8004454: f8 00 62 12 calli 801cc9c <__divsi3>
8004458: 2b 85 00 58 lw r5,(sp+88)
800445c: 2b 87 00 98 lw r7,(sp+152)
8004460: 2b 83 00 50 lw r3,(sp+80)
8004464: b8 20 40 00 mv r8,r1
8004468: bb 60 20 00 mv r4,fp
800446c: ba a0 30 00 mv r6,r21
8004470: ba 00 10 00 mv r2,r16
8004474: b9 80 08 00 mv r1,r12
8004478: 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);
800447c: 2b 82 00 48 lw r2,(sp+72)
8004480: ba 40 18 00 mv r3,r18
8004484: ba c0 08 00 mv r1,r22
8004488: f8 00 10 7f calli 8008684 <_Timespec_Divide_by_integer>
(*print)( context,
800448c: 2b 81 00 6c lw r1,(sp+108)
8004490: 34 02 03 e8 mvi r2,1000
8004494: f8 00 62 02 calli 801cc9c <__divsi3>
8004498: b8 20 d8 00 mv fp,r1
800449c: 2b 81 00 74 lw r1,(sp+116)
80044a0: 34 02 03 e8 mvi r2,1000
80044a4: f8 00 61 fe calli 801cc9c <__divsi3>
80044a8: b8 20 a8 00 mv r21,r1
80044ac: 2b 81 00 9c lw r1,(sp+156)
80044b0: 34 02 03 e8 mvi r2,1000
80044b4: f8 00 61 fa calli 801cc9c <__divsi3>
80044b8: 2b 83 00 68 lw r3,(sp+104)
80044bc: 2b 85 00 70 lw r5,(sp+112)
80044c0: 2b 87 00 98 lw r7,(sp+152)
80044c4: b8 20 40 00 mv r8,r1
80044c8: b9 e0 10 00 mv r2,r15
80044cc: b9 80 08 00 mv r1,r12
80044d0: bb 60 20 00 mv r4,fp
80044d4: ba a0 30 00 mv r6,r21
80044d8: 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++ ) {
80044dc: 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 ;
80044e0: 2a 81 00 0c lw r1,(r20+12)
80044e4: 50 2d ff b6 bgeu r1,r13,80043bc <rtems_rate_monotonic_report_statistics_with_plugin+0xec>
the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall
);
#endif
}
}
}
80044e8: 2b 9d 00 04 lw ra,(sp+4)
80044ec: 2b 8b 00 44 lw r11,(sp+68)
80044f0: 2b 8c 00 40 lw r12,(sp+64)
80044f4: 2b 8d 00 3c lw r13,(sp+60)
80044f8: 2b 8e 00 38 lw r14,(sp+56)
80044fc: 2b 8f 00 34 lw r15,(sp+52)
8004500: 2b 90 00 30 lw r16,(sp+48)
8004504: 2b 91 00 2c lw r17,(sp+44)
8004508: 2b 92 00 28 lw r18,(sp+40)
800450c: 2b 93 00 24 lw r19,(sp+36)
8004510: 2b 94 00 20 lw r20,(sp+32)
8004514: 2b 95 00 1c lw r21,(sp+28)
8004518: 2b 96 00 18 lw r22,(sp+24)
800451c: 2b 97 00 14 lw r23,(sp+20)
8004520: 2b 98 00 10 lw r24,(sp+16)
8004524: 2b 99 00 0c lw r25,(sp+12)
8004528: 2b 9b 00 08 lw fp,(sp+8)
800452c: 37 9c 00 a4 addi sp,sp,164
8004530: c3 a0 00 00 ret
08003db0 <rtems_semaphore_create>:
uint32_t count,
rtems_attribute attribute_set,
rtems_task_priority priority_ceiling,
rtems_id *id
)
{
8003db0: 37 9c ff c8 addi sp,sp,-56
8003db4: 5b 8b 00 20 sw (sp+32),r11
8003db8: 5b 8c 00 1c sw (sp+28),r12
8003dbc: 5b 8d 00 18 sw (sp+24),r13
8003dc0: 5b 8e 00 14 sw (sp+20),r14
8003dc4: 5b 8f 00 10 sw (sp+16),r15
8003dc8: 5b 90 00 0c sw (sp+12),r16
8003dcc: 5b 91 00 08 sw (sp+8),r17
8003dd0: 5b 9d 00 04 sw (sp+4),ra
8003dd4: b8 20 80 00 mv r16,r1
8003dd8: b8 40 70 00 mv r14,r2
8003ddc: b8 60 60 00 mv r12,r3
8003de0: b8 80 88 00 mv r17,r4
8003de4: 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;
8003de8: 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 ) )
8003dec: 46 00 00 64 be r16,r0,8003f7c <rtems_semaphore_create+0x1cc><== NEVER TAKEN
return RTEMS_INVALID_NAME;
if ( !id )
return RTEMS_INVALID_ADDRESS;
8003df0: 34 01 00 09 mvi r1,9
CORE_mutex_Status mutex_status;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !id )
8003df4: 44 a0 00 62 be r5,r0,8003f7c <rtems_semaphore_create+0x1cc><== NEVER TAKEN
* id - semaphore id
* RTEMS_SUCCESSFUL - if successful
* error code - if unsuccessful
*/
rtems_status_code rtems_semaphore_create(
8003df8: 20 62 00 c0 andi r2,r3,0xc0
return RTEMS_NOT_DEFINED;
} else
#endif
if ( _Attributes_Is_inherit_priority( attribute_set ) ||
8003dfc: 44 40 00 09 be r2,r0,8003e20 <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);
8003e00: 20 64 00 30 andi r4,r3,0x30
_Attributes_Is_priority_ceiling( attribute_set ) ) {
if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) &&
8003e04: 34 03 00 10 mvi r3,16
_Attributes_Is_priority( attribute_set ) ) )
return RTEMS_NOT_DEFINED;
8003e08: 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 ) &&
8003e0c: 5c 83 00 5c bne r4,r3,8003f7c <rtems_semaphore_create+0x1cc><== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_PRIORITY ) ? true : false;
8003e10: 21 83 00 04 andi r3,r12,0x4
8003e14: 44 60 00 5a be r3,r0,8003f7c <rtems_semaphore_create+0x1cc><== NEVER TAKEN
_Attributes_Is_priority( attribute_set ) ) )
return RTEMS_NOT_DEFINED;
}
if ( _Attributes_Is_inherit_priority( attribute_set ) &&
8003e18: 34 03 00 c0 mvi r3,192
8003e1c: 44 43 00 58 be r2,r3,8003f7c <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);
8003e20: 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 ) )
8003e24: 45 a0 00 04 be r13,r0,8003e34 <rtems_semaphore_create+0x84>
8003e28: 34 02 00 01 mvi r2,1
return RTEMS_INVALID_NUMBER;
8003e2c: 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 ) )
8003e30: 55 c2 00 53 bgu r14,r2,8003f7c <rtems_semaphore_create+0x1cc><== NEVER TAKEN
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8003e34: 78 06 08 01 mvhi r6,0x801
8003e38: 38 c6 99 90 ori r6,r6,0x9990
8003e3c: 28 c1 00 00 lw r1,(r6+0)
8003e40: 34 21 00 01 addi r1,r1,1
8003e44: 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 );
8003e48: 78 01 08 01 mvhi r1,0x801
8003e4c: 38 21 98 e8 ori r1,r1,0x98e8
8003e50: f8 00 06 0b calli 800567c <_Objects_Allocate>
8003e54: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* prevents deletion */
the_semaphore = _Semaphore_Allocate();
if ( !the_semaphore ) {
8003e58: 5c 20 00 04 bne r1,r0,8003e68 <rtems_semaphore_create+0xb8>
_Thread_Enable_dispatch();
8003e5c: f8 00 0b 33 calli 8006b28 <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
8003e60: 34 01 00 05 mvi r1,5
8003e64: e0 00 00 46 bi 8003f7c <rtems_semaphore_create+0x1cc>
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_semaphore->attribute_set = attribute_set;
8003e68: 58 2c 00 10 sw (r1+16),r12
8003e6c: 21 81 00 04 andi r1,r12,0x4
/*
* Initialize it as a counting semaphore.
*/
if ( _Attributes_Is_counting_semaphore( attribute_set ) ) {
8003e70: 5d a0 00 0f bne r13,r0,8003eac <rtems_semaphore_create+0xfc>
/*
* This effectively disables limit checking.
*/
the_semaphore_attr.maximum_count = 0xFFFFFFFF;
8003e74: 34 02 ff ff mvi r2,-1
8003e78: 5b 82 00 34 sw (sp+52),r2
if ( _Attributes_Is_priority( attribute_set ) )
8003e7c: 44 2d 00 04 be r1,r13,8003e8c <rtems_semaphore_create+0xdc>
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY;
8003e80: 34 01 00 01 mvi r1,1
8003e84: 5b 81 00 38 sw (sp+56),r1
8003e88: e0 00 00 02 bi 8003e90 <rtems_semaphore_create+0xe0>
else
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
8003e8c: 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(
8003e90: 35 61 00 14 addi r1,r11,20
8003e94: 37 82 00 34 addi r2,sp,52
8003e98: 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;
8003e9c: 5b 80 00 24 sw (sp+36),r0
the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM;
8003ea0: 5b 80 00 30 sw (sp+48),r0
_CORE_semaphore_Initialize(
8003ea4: f8 00 04 2e calli 8004f5c <_CORE_semaphore_Initialize>
8003ea8: e0 00 00 28 bi 8003f48 <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 ) )
8003eac: 44 20 00 04 be r1,r0,8003ebc <rtems_semaphore_create+0x10c>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY;
8003eb0: 34 01 00 01 mvi r1,1
8003eb4: 5b 81 00 2c sw (sp+44),r1
8003eb8: e0 00 00 02 bi 8003ec0 <rtems_semaphore_create+0x110>
else
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
8003ebc: 5b 80 00 2c sw (sp+44),r0
if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
8003ec0: 34 01 00 10 mvi r1,16
8003ec4: 5d a1 00 11 bne r13,r1,8003f08 <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 ) {
8003ec8: 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;
8003ecc: 5b 91 00 30 sw (sp+48),r17
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
8003ed0: 5b 80 00 24 sw (sp+36),r0
the_mutex_attr.only_owner_release = false;
8003ed4: 33 80 00 28 sb (sp+40),r0
if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) {
8003ed8: 34 01 00 01 mvi r1,1
8003edc: 5c 41 00 0e bne r2,r1,8003f14 <rtems_semaphore_create+0x164>
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_inherit_priority(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_INHERIT_PRIORITY ) ? true : false;
8003ee0: 21 81 00 40 andi r1,r12,0x40
if ( _Attributes_Is_inherit_priority( attribute_set ) ) {
8003ee4: 44 20 00 03 be r1,r0,8003ef0 <rtems_semaphore_create+0x140>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
8003ee8: 34 01 00 02 mvi r1,2
8003eec: e0 00 00 04 bi 8003efc <rtems_semaphore_create+0x14c>
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_PRIORITY_CEILING ) ? true : false;
8003ef0: 21 8c 00 80 andi r12,r12,0x80
the_mutex_attr.only_owner_release = true;
} else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) {
8003ef4: 45 81 00 08 be r12,r1,8003f14 <rtems_semaphore_create+0x164>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
8003ef8: 34 01 00 03 mvi r1,3
8003efc: 5b 81 00 2c sw (sp+44),r1
the_mutex_attr.only_owner_release = true;
8003f00: 33 82 00 28 sb (sp+40),r2
8003f04: e0 00 00 04 bi 8003f14 <rtems_semaphore_create+0x164>
}
}
} else /* must be simple binary semaphore */ {
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS;
8003f08: 34 01 00 02 mvi r1,2
8003f0c: 5b 81 00 24 sw (sp+36),r1
the_mutex_attr.only_owner_release = false;
8003f10: 33 80 00 28 sb (sp+40),r0
}
mutex_status = _CORE_mutex_Initialize(
8003f14: 65 c3 00 01 cmpei r3,r14,1
8003f18: 37 82 00 24 addi r2,sp,36
8003f1c: 35 61 00 14 addi r1,r11,20
8003f20: f8 00 03 35 calli 8004bf4 <_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 ) {
8003f24: 34 02 00 06 mvi r2,6
8003f28: 5c 22 00 08 bne r1,r2,8003f48 <rtems_semaphore_create+0x198>
*/
RTEMS_INLINE_ROUTINE void _Semaphore_Free (
Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
8003f2c: 78 01 08 01 mvhi r1,0x801
8003f30: 38 21 98 e8 ori r1,r1,0x98e8
8003f34: b9 60 10 00 mv r2,r11
8003f38: f8 00 06 e2 calli 8005ac0 <_Objects_Free>
_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
8003f3c: f8 00 0a fb calli 8006b28 <_Thread_Enable_dispatch>
return RTEMS_INVALID_PRIORITY;
8003f40: 34 01 00 13 mvi r1,19
8003f44: e0 00 00 0e bi 8003f7c <rtems_semaphore_create+0x1cc>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8003f48: 29 6c 00 08 lw r12,(r11+8)
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
8003f4c: 78 02 08 01 mvhi r2,0x801
8003f50: 38 42 98 e8 ori r2,r2,0x98e8
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8003f54: 28 4d 00 1c lw r13,(r2+28)
8003f58: 21 81 ff ff andi r1,r12,0xffff
8003f5c: 34 02 00 02 mvi r2,2
8003f60: f8 00 4b ec calli 8016f10 <__ashlsi3>
8003f64: b5 a1 08 00 add r1,r13,r1
8003f68: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8003f6c: 59 70 00 0c sw (r11+12),r16
&_Semaphore_Information,
&the_semaphore->Object,
(Objects_Name) name
);
*id = the_semaphore->Object.id;
8003f70: 59 ec 00 00 sw (r15+0),r12
the_semaphore->Object.id,
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
8003f74: f8 00 0a ed calli 8006b28 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8003f78: 34 01 00 00 mvi r1,0
}
8003f7c: 2b 9d 00 04 lw ra,(sp+4)
8003f80: 2b 8b 00 20 lw r11,(sp+32)
8003f84: 2b 8c 00 1c lw r12,(sp+28)
8003f88: 2b 8d 00 18 lw r13,(sp+24)
8003f8c: 2b 8e 00 14 lw r14,(sp+20)
8003f90: 2b 8f 00 10 lw r15,(sp+16)
8003f94: 2b 90 00 0c lw r16,(sp+12)
8003f98: 2b 91 00 08 lw r17,(sp+8)
8003f9c: 37 9c 00 38 addi sp,sp,56
8003fa0: c3 a0 00 00 ret
08013414 <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
8013414: 37 9c ff f4 addi sp,sp,-12
8013418: 5b 8b 00 08 sw (sp+8),r11
801341c: 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;
8013420: 34 03 00 0a mvi r3,10
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
8013424: 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 )
8013428: 44 40 00 29 be r2,r0,80134cc <rtems_signal_send+0xb8>
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
801342c: 37 82 00 0c addi r2,sp,12
8013430: f8 00 15 9e calli 8018aa8 <_Thread_Get>
switch ( location ) {
8013434: 2b 82 00 0c lw r2,(sp+12)
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8013438: 34 03 00 04 mvi r3,4
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
switch ( location ) {
801343c: 5c 40 00 24 bne r2,r0,80134cc <rtems_signal_send+0xb8>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
8013440: 28 23 01 1c lw r3,(r1+284)
asr = &api->Signal;
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
8013444: 28 64 00 0c lw r4,(r3+12)
8013448: 44 82 00 1f be r4,r2,80134c4 <rtems_signal_send+0xb0>
if ( asr->is_enabled ) {
801344c: 40 62 00 08 lbu r2,(r3+8)
8013450: 44 40 00 12 be r2,r0,8013498 <rtems_signal_send+0x84>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
8013454: 90 00 10 00 rcsr r2,IE
8013458: 34 04 ff fe mvi r4,-2
801345c: a0 44 20 00 and r4,r2,r4
8013460: d0 04 00 00 wcsr IE,r4
*signal_set |= signals;
8013464: 28 64 00 14 lw r4,(r3+20)
8013468: b8 8b 58 00 or r11,r4,r11
801346c: 58 6b 00 14 sw (r3+20),r11
_ISR_Enable( _level );
8013470: 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 ) )
8013474: 78 02 08 04 mvhi r2,0x804
8013478: 38 42 11 c4 ori r2,r2,0x11c4
801347c: 28 43 00 08 lw r3,(r2+8)
8013480: 44 60 00 0e be r3,r0,80134b8 <rtems_signal_send+0xa4>
8013484: 28 43 00 0c lw r3,(r2+12)
8013488: 5c 23 00 0c bne r1,r3,80134b8 <rtems_signal_send+0xa4> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
801348c: 34 01 00 01 mvi r1,1
8013490: 30 41 00 18 sb (r2+24),r1
8013494: e0 00 00 09 bi 80134b8 <rtems_signal_send+0xa4>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
8013498: 90 00 08 00 rcsr r1,IE
801349c: 34 02 ff fe mvi r2,-2
80134a0: a0 22 10 00 and r2,r1,r2
80134a4: d0 02 00 00 wcsr IE,r2
*signal_set |= signals;
80134a8: 28 62 00 18 lw r2,(r3+24)
80134ac: b8 4b 58 00 or r11,r2,r11
80134b0: 58 6b 00 18 sw (r3+24),r11
_ISR_Enable( _level );
80134b4: d0 01 00 00 wcsr IE,r1
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
80134b8: f8 00 15 6f calli 8018a74 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
80134bc: 34 03 00 00 mvi r3,0
80134c0: e0 00 00 03 bi 80134cc <rtems_signal_send+0xb8>
}
_Thread_Enable_dispatch();
80134c4: f8 00 15 6c calli 8018a74 <_Thread_Enable_dispatch>
return RTEMS_NOT_DEFINED;
80134c8: 34 03 00 0b mvi r3,11
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
80134cc: b8 60 08 00 mv r1,r3
80134d0: 2b 9d 00 04 lw ra,(sp+4)
80134d4: 2b 8b 00 08 lw r11,(sp+8)
80134d8: 37 9c 00 0c addi sp,sp,12
80134dc: c3 a0 00 00 ret
0800e094 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
800e094: 37 9c ff e0 addi sp,sp,-32
800e098: 5b 8b 00 20 sw (sp+32),r11
800e09c: 5b 8c 00 1c sw (sp+28),r12
800e0a0: 5b 8d 00 18 sw (sp+24),r13
800e0a4: 5b 8e 00 14 sw (sp+20),r14
800e0a8: 5b 8f 00 10 sw (sp+16),r15
800e0ac: 5b 90 00 0c sw (sp+12),r16
800e0b0: 5b 91 00 08 sw (sp+8),r17
800e0b4: 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;
800e0b8: 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
)
{
800e0bc: b8 20 68 00 mv r13,r1
800e0c0: b8 40 70 00 mv r14,r2
800e0c4: 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 )
800e0c8: 44 60 00 51 be r3,r0,800e20c <rtems_task_mode+0x178>
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
800e0cc: 78 01 08 01 mvhi r1,0x801
800e0d0: 38 21 9e 3c ori r1,r1,0x9e3c
800e0d4: 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;
800e0d8: 41 8f 00 74 lbu r15,(r12+116)
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800e0dc: 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 ];
800e0e0: 29 8b 01 1c lw r11,(r12+284)
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
800e0e4: 65 ef 00 00 cmpei r15,r15,0
800e0e8: c8 0f 78 00 sub r15,r0,r15
800e0ec: 21 ef 01 00 andi r15,r15,0x100
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800e0f0: 44 20 00 02 be r1,r0,800e0f8 <rtems_task_mode+0x64>
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
800e0f4: 39 ef 02 00 ori r15,r15,0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
800e0f8: 41 71 00 08 lbu r17,(r11+8)
old_mode |= _ISR_Get_level();
800e0fc: fb ff e7 f8 calli 80080dc <_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;
800e100: 66 31 00 00 cmpei r17,r17,0
800e104: c8 11 88 00 sub r17,r0,r17
800e108: 22 31 04 00 andi r17,r17,0x400
800e10c: ba 21 08 00 or r1,r17,r1
old_mode |= _ISR_Get_level();
800e110: b8 2f 78 00 or r15,r1,r15
*previous_mode_set = old_mode;
800e114: 5a 0f 00 00 sw (r16+0),r15
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
800e118: 21 c1 01 00 andi r1,r14,0x100
800e11c: 44 20 00 04 be r1,r0,800e12c <rtems_task_mode+0x98>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
800e120: 21 a1 01 00 andi r1,r13,0x100
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
800e124: 64 21 00 00 cmpei r1,r1,0
800e128: 31 81 00 74 sb (r12+116),r1
if ( mask & RTEMS_TIMESLICE_MASK ) {
800e12c: 21 c1 02 00 andi r1,r14,0x200
800e130: 44 20 00 0b be r1,r0,800e15c <rtems_task_mode+0xc8>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
800e134: 21 a1 02 00 andi r1,r13,0x200
if ( _Modes_Is_timeslice(mode_set) ) {
800e138: 44 20 00 08 be r1,r0,800e158 <rtems_task_mode+0xc4>
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
800e13c: 34 01 00 01 mvi r1,1
800e140: 59 81 00 7c sw (r12+124),r1
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
800e144: 78 01 08 01 mvhi r1,0x801
800e148: 38 21 99 28 ori r1,r1,0x9928
800e14c: 28 21 00 00 lw r1,(r1+0)
800e150: 59 81 00 78 sw (r12+120),r1
800e154: e0 00 00 02 bi 800e15c <rtems_task_mode+0xc8>
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
800e158: 59 80 00 7c sw (r12+124),r0
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
800e15c: 21 c1 00 01 andi r1,r14,0x1
800e160: 44 20 00 04 be r1,r0,800e170 <rtems_task_mode+0xdc>
*/
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
Modes_Control mode_set
)
{
return ( mode_set & RTEMS_INTERRUPT_MASK );
800e164: 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 ) );
800e168: 64 21 00 00 cmpei r1,r1,0
800e16c: d0 01 00 00 wcsr IE,r1
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
800e170: 21 ce 04 00 andi r14,r14,0x400
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800e174: 34 03 00 00 mvi r3,0
if ( mask & RTEMS_ASR_MASK ) {
800e178: 45 c0 00 11 be r14,r0,800e1bc <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;
800e17c: 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 ) {
800e180: 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(
800e184: 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 ) {
800e188: 44 2d 00 0d be r1,r13,800e1bc <rtems_task_mode+0x128>
asr->is_enabled = is_asr_enabled;
800e18c: 31 6d 00 08 sb (r11+8),r13
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
800e190: 90 00 08 00 rcsr r1,IE
800e194: 34 02 ff fe mvi r2,-2
800e198: a0 22 10 00 and r2,r1,r2
800e19c: d0 02 00 00 wcsr IE,r2
_signals = information->signals_pending;
800e1a0: 29 62 00 18 lw r2,(r11+24)
information->signals_pending = information->signals_posted;
800e1a4: 29 63 00 14 lw r3,(r11+20)
information->signals_posted = _signals;
800e1a8: 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;
800e1ac: 59 63 00 18 sw (r11+24),r3
information->signals_posted = _signals;
_ISR_Enable( _level );
800e1b0: d0 01 00 00 wcsr IE,r1
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
800e1b4: 29 63 00 14 lw r3,(r11+20)
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800e1b8: 7c 63 00 00 cmpnei r3,r3,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
800e1bc: 78 01 08 01 mvhi r1,0x801
800e1c0: 38 21 9a e8 ori r1,r1,0x9ae8
800e1c4: 28 22 00 00 lw r2,(r1+0)
800e1c8: 34 01 00 03 mvi r1,3
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
800e1cc: 34 04 00 00 mvi r4,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
800e1d0: 5c 41 00 0f bne r2,r1,800e20c <rtems_task_mode+0x178>
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
800e1d4: 78 01 08 01 mvhi r1,0x801
800e1d8: 38 21 9e 3c ori r1,r1,0x9e3c
800e1dc: 28 22 00 0c lw r2,(r1+12)
if ( are_signals_pending ||
800e1e0: 5c 60 00 05 bne r3,r0,800e1f4 <rtems_task_mode+0x160>
800e1e4: 28 21 00 10 lw r1,(r1+16)
800e1e8: 44 41 00 09 be r2,r1,800e20c <rtems_task_mode+0x178>
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
800e1ec: 40 41 00 74 lbu r1,(r2+116)
800e1f0: 44 20 00 07 be r1,r0,800e20c <rtems_task_mode+0x178> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
800e1f4: 78 01 08 01 mvhi r1,0x801
800e1f8: 38 21 9e 3c ori r1,r1,0x9e3c
800e1fc: 34 02 00 01 mvi r2,1
800e200: 30 22 00 18 sb (r1+24),r2
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
800e204: fb ff e1 e9 calli 80069a8 <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
800e208: 34 04 00 00 mvi r4,0
}
800e20c: b8 80 08 00 mv r1,r4
800e210: 2b 9d 00 04 lw ra,(sp+4)
800e214: 2b 8b 00 20 lw r11,(sp+32)
800e218: 2b 8c 00 1c lw r12,(sp+28)
800e21c: 2b 8d 00 18 lw r13,(sp+24)
800e220: 2b 8e 00 14 lw r14,(sp+20)
800e224: 2b 8f 00 10 lw r15,(sp+16)
800e228: 2b 90 00 0c lw r16,(sp+12)
800e22c: 2b 91 00 08 lw r17,(sp+8)
800e230: 37 9c 00 20 addi sp,sp,32
800e234: c3 a0 00 00 ret
080084c8 <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
80084c8: 37 9c ff f0 addi sp,sp,-16
80084cc: 5b 8b 00 0c sw (sp+12),r11
80084d0: 5b 8c 00 08 sw (sp+8),r12
80084d4: 5b 9d 00 04 sw (sp+4),ra
80084d8: b8 40 58 00 mv r11,r2
80084dc: b8 60 60 00 mv r12,r3
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
80084e0: 44 40 00 06 be r2,r0,80084f8 <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 ) );
80084e4: 78 02 08 01 mvhi r2,0x801
80084e8: 38 42 a0 f0 ori r2,r2,0xa0f0
80084ec: 40 43 00 00 lbu r3,(r2+0)
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
80084f0: 34 02 00 13 mvi r2,19
)
{
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
80084f4: 55 63 00 16 bgu r11,r3,800854c <rtems_task_set_priority+0x84>
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
return RTEMS_INVALID_ADDRESS;
80084f8: 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 )
80084fc: 45 80 00 14 be r12,r0,800854c <rtems_task_set_priority+0x84>
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
8008500: 37 82 00 10 addi r2,sp,16
8008504: f8 00 0a f8 calli 800b0e4 <_Thread_Get>
switch ( location ) {
8008508: 2b 82 00 10 lw r2,(sp+16)
800850c: 5c 40 00 0f bne r2,r0,8008548 <rtems_task_set_priority+0x80>
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
8008510: 28 23 00 14 lw r3,(r1+20)
8008514: 59 83 00 00 sw (r12+0),r3
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
8008518: 45 62 00 09 be r11,r2,800853c <rtems_task_set_priority+0x74>
the_thread->real_priority = new_priority;
if ( the_thread->resource_count == 0 ||
800851c: 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;
8008520: 58 2b 00 18 sw (r1+24),r11
if ( the_thread->resource_count == 0 ||
8008524: 44 40 00 03 be r2,r0,8008530 <rtems_task_set_priority+0x68>
8008528: 28 22 00 14 lw r2,(r1+20)
800852c: 51 62 00 04 bgeu r11,r2,800853c <rtems_task_set_priority+0x74><== ALWAYS TAKEN
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
8008530: b9 60 10 00 mv r2,r11
8008534: 34 03 00 00 mvi r3,0
8008538: f8 00 09 ad calli 800abec <_Thread_Change_priority>
}
_Thread_Enable_dispatch();
800853c: f8 00 0a dd calli 800b0b0 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8008540: 34 02 00 00 mvi r2,0
8008544: e0 00 00 02 bi 800854c <rtems_task_set_priority+0x84>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8008548: 34 02 00 04 mvi r2,4
}
800854c: b8 40 08 00 mv r1,r2
8008550: 2b 9d 00 04 lw ra,(sp+4)
8008554: 2b 8b 00 0c lw r11,(sp+12)
8008558: 2b 8c 00 08 lw r12,(sp+8)
800855c: 37 9c 00 10 addi sp,sp,16
8008560: c3 a0 00 00 ret
08013f48 <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
8013f48: 37 9c ff f8 addi sp,sp,-8
8013f4c: 5b 9d 00 04 sw (sp+4),ra
8013f50: b8 20 10 00 mv r2,r1
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
_Objects_Get( &_Timer_Information, id, location );
8013f54: 78 01 08 04 mvhi r1,0x804
8013f58: 38 21 15 f4 ori r1,r1,0x15f4
8013f5c: 37 83 00 08 addi r3,sp,8
8013f60: f8 00 0e 98 calli 80179c0 <_Objects_Get>
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
8013f64: 2b 82 00 08 lw r2,(sp+8)
8013f68: 5c 40 00 09 bne r2,r0,8013f8c <rtems_timer_cancel+0x44>
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
8013f6c: 28 23 00 38 lw r3,(r1+56)
8013f70: 34 02 00 04 mvi r2,4
8013f74: 44 62 00 03 be r3,r2,8013f80 <rtems_timer_cancel+0x38> <== NEVER TAKEN
(void) _Watchdog_Remove( &the_timer->Ticker );
8013f78: 34 21 00 10 addi r1,r1,16
8013f7c: f8 00 18 62 calli 801a104 <_Watchdog_Remove>
_Thread_Enable_dispatch();
8013f80: f8 00 12 bd calli 8018a74 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8013f84: 34 01 00 00 mvi r1,0
8013f88: e0 00 00 02 bi 8013f90 <rtems_timer_cancel+0x48>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8013f8c: 34 01 00 04 mvi r1,4
}
8013f90: 2b 9d 00 04 lw ra,(sp+4)
8013f94: 37 9c 00 08 addi sp,sp,8
8013f98: c3 a0 00 00 ret
08003388 <rtems_timer_create>:
rtems_status_code rtems_timer_create(
rtems_name name,
rtems_id *id
)
{
8003388: 37 9c ff e8 addi sp,sp,-24
800338c: 5b 8b 00 18 sw (sp+24),r11
8003390: 5b 8c 00 14 sw (sp+20),r12
8003394: 5b 8d 00 10 sw (sp+16),r13
8003398: 5b 8e 00 0c sw (sp+12),r14
800339c: 5b 8f 00 08 sw (sp+8),r15
80033a0: 5b 9d 00 04 sw (sp+4),ra
80033a4: b8 20 78 00 mv r15,r1
80033a8: b8 40 68 00 mv r13,r2
Timer_Control *the_timer;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
80033ac: 34 01 00 03 mvi r1,3
rtems_id *id
)
{
Timer_Control *the_timer;
if ( !rtems_is_name_valid( name ) )
80033b0: 45 e0 00 22 be r15,r0,8003438 <rtems_timer_create+0xb0> <== NEVER TAKEN
return RTEMS_INVALID_NAME;
if ( !id )
return RTEMS_INVALID_ADDRESS;
80033b4: 34 01 00 09 mvi r1,9
Timer_Control *the_timer;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !id )
80033b8: 44 40 00 20 be r2,r0,8003438 <rtems_timer_create+0xb0> <== NEVER TAKEN
80033bc: 78 03 08 01 mvhi r3,0x801
80033c0: 38 63 f9 00 ori r3,r3,0xf900
80033c4: 28 61 00 00 lw r1,(r3+0)
80033c8: 34 21 00 01 addi r1,r1,1
80033cc: 58 61 00 00 sw (r3+0),r1
* This function allocates a timer control block from
* the inactive chain of free timer control blocks.
*/
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
{
return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
80033d0: 78 0c 08 02 mvhi r12,0x802
80033d4: 39 8c 01 98 ori r12,r12,0x198
80033d8: b9 80 08 00 mv r1,r12
80033dc: f8 00 04 9b calli 8004648 <_Objects_Allocate>
80033e0: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* to prevent deletion */
the_timer = _Timer_Allocate();
if ( !the_timer ) {
80033e4: 5c 20 00 04 bne r1,r0,80033f4 <rtems_timer_create+0x6c>
_Thread_Enable_dispatch();
80033e8: f8 00 09 80 calli 80059e8 <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
80033ec: 34 01 00 05 mvi r1,5
80033f0: e0 00 00 12 bi 8003438 <rtems_timer_create+0xb0>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
80033f4: 29 6e 00 08 lw r14,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
80033f8: 29 8c 00 1c lw r12,(r12+28)
}
the_timer->the_class = TIMER_DORMANT;
80033fc: 34 01 00 04 mvi r1,4
8003400: 59 61 00 38 sw (r11+56),r1
8003404: 34 02 00 02 mvi r2,2
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8003408: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
800340c: 59 60 00 2c sw (r11+44),r0
the_watchdog->id = id;
8003410: 59 60 00 30 sw (r11+48),r0
the_watchdog->user_data = user_data;
8003414: 59 60 00 34 sw (r11+52),r0
8003418: 21 c1 ff ff andi r1,r14,0xffff
800341c: f8 00 5e b4 calli 801aeec <__ashlsi3>
8003420: b5 81 08 00 add r1,r12,r1
8003424: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8003428: 59 6f 00 0c sw (r11+12),r15
&_Timer_Information,
&the_timer->Object,
(Objects_Name) name
);
*id = the_timer->Object.id;
800342c: 59 ae 00 00 sw (r13+0),r14
_Thread_Enable_dispatch();
8003430: f8 00 09 6e calli 80059e8 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8003434: 34 01 00 00 mvi r1,0
}
8003438: 2b 9d 00 04 lw ra,(sp+4)
800343c: 2b 8b 00 18 lw r11,(sp+24)
8003440: 2b 8c 00 14 lw r12,(sp+20)
8003444: 2b 8d 00 10 lw r13,(sp+16)
8003448: 2b 8e 00 0c lw r14,(sp+12)
800344c: 2b 8f 00 08 lw r15,(sp+8)
8003450: 37 9c 00 18 addi sp,sp,24
8003454: c3 a0 00 00 ret
08014564 <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
8014564: 37 9c ff dc addi sp,sp,-36
8014568: 5b 8b 00 20 sw (sp+32),r11
801456c: 5b 8c 00 1c sw (sp+28),r12
8014570: 5b 8d 00 18 sw (sp+24),r13
8014574: 5b 8e 00 14 sw (sp+20),r14
8014578: 5b 8f 00 10 sw (sp+16),r15
801457c: 5b 90 00 0c sw (sp+12),r16
8014580: 5b 91 00 08 sw (sp+8),r17
8014584: 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;
8014588: 78 05 08 04 mvhi r5,0x804
801458c: 38 a5 16 34 ori r5,r5,0x1634
8014590: 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
)
{
8014594: b8 20 78 00 mv r15,r1
8014598: b8 40 60 00 mv r12,r2
801459c: b8 60 80 00 mv r16,r3
80145a0: 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;
80145a4: 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 )
80145a8: 45 a0 00 2e be r13,r0,8014660 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
80145ac: 78 05 08 04 mvhi r5,0x804
80145b0: 38 a5 0d 20 ori r5,r5,0xd20
80145b4: 40 a1 00 00 lbu r1,(r5+0)
return RTEMS_NOT_DEFINED;
80145b8: 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 )
80145bc: 44 20 00 29 be r1,r0,8014660 <rtems_timer_server_fire_when+0xfc><== NEVER TAKEN
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
80145c0: 34 0b 00 09 mvi r11,9
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
if ( !routine )
80145c4: 44 60 00 27 be r3,r0,8014660 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
80145c8: b8 40 08 00 mv r1,r2
80145cc: fb ff f1 c0 calli 8010ccc <_TOD_Validate>
return RTEMS_INVALID_CLOCK;
80145d0: 34 0b 00 14 mvi r11,20
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
80145d4: 44 20 00 23 be r1,r0,8014660 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
80145d8: b9 80 08 00 mv r1,r12
if ( seconds <= _TOD_Seconds_since_epoch() )
80145dc: 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 );
80145e0: fb ff f1 7b calli 8010bcc <_TOD_To_seconds>
if ( seconds <= _TOD_Seconds_since_epoch() )
80145e4: 39 8c 0d 98 ori r12,r12,0xd98
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
80145e8: b8 20 70 00 mv r14,r1
if ( seconds <= _TOD_Seconds_since_epoch() )
80145ec: 29 81 00 00 lw r1,(r12+0)
80145f0: 50 2e 00 1c bgeu r1,r14,8014660 <rtems_timer_server_fire_when+0xfc>
80145f4: 78 01 08 04 mvhi r1,0x804
80145f8: 38 21 15 f4 ori r1,r1,0x15f4
80145fc: b9 e0 10 00 mv r2,r15
8014600: 37 83 00 24 addi r3,sp,36
8014604: f8 00 0c ef calli 80179c0 <_Objects_Get>
8014608: b8 20 58 00 mv r11,r1
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
801460c: 2b 81 00 24 lw r1,(sp+36)
8014610: 5c 20 00 13 bne r1,r0,801465c <rtems_timer_server_fire_when+0xf8>
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
8014614: 35 61 00 10 addi r1,r11,16
8014618: f8 00 16 bb calli 801a104 <_Watchdog_Remove>
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
801461c: 34 01 00 03 mvi r1,3
8014620: 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();
8014624: 29 81 00 00 lw r1,(r12+0)
(*timer_server->schedule_operation)( timer_server, the_timer );
8014628: 29 a3 00 04 lw r3,(r13+4)
801462c: 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();
8014630: c9 c1 70 00 sub r14,r14,r1
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8014634: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8014638: 59 70 00 2c sw (r11+44),r16
the_watchdog->id = id;
801463c: 59 6f 00 30 sw (r11+48),r15
the_watchdog->user_data = user_data;
8014640: 59 71 00 34 sw (r11+52),r17
8014644: 59 6e 00 1c sw (r11+28),r14
(*timer_server->schedule_operation)( timer_server, the_timer );
8014648: b9 a0 08 00 mv r1,r13
801464c: d8 60 00 00 call r3
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
8014650: 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();
8014654: f8 00 11 08 calli 8018a74 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8014658: e0 00 00 02 bi 8014660 <rtems_timer_server_fire_when+0xfc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
801465c: 34 0b 00 04 mvi r11,4
}
8014660: b9 60 08 00 mv r1,r11
8014664: 2b 9d 00 04 lw ra,(sp+4)
8014668: 2b 8b 00 20 lw r11,(sp+32)
801466c: 2b 8c 00 1c lw r12,(sp+28)
8014670: 2b 8d 00 18 lw r13,(sp+24)
8014674: 2b 8e 00 14 lw r14,(sp+20)
8014678: 2b 8f 00 10 lw r15,(sp+16)
801467c: 2b 90 00 0c lw r16,(sp+12)
8014680: 2b 91 00 08 lw r17,(sp+8)
8014684: 37 9c 00 24 addi sp,sp,36
8014688: c3 a0 00 00 ret
08003978 <sched_get_priority_max>:
#include <rtems/posix/priority.h>
int sched_get_priority_max(
int policy
)
{
8003978: 37 9c ff fc addi sp,sp,-4
800397c: 5b 9d 00 04 sw (sp+4),ra
switch ( policy ) {
8003980: 48 01 00 05 bg r0,r1,8003994 <sched_get_priority_max+0x1c>
8003984: 34 02 00 02 mvi r2,2
8003988: 4c 41 00 08 bge r2,r1,80039a8 <sched_get_priority_max+0x30>
800398c: 34 02 00 04 mvi r2,4
8003990: 44 22 00 06 be r1,r2,80039a8 <sched_get_priority_max+0x30> <== ALWAYS TAKEN
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
8003994: f8 00 26 6e calli 800d34c <__errno>
8003998: 34 02 00 16 mvi r2,22
800399c: 58 22 00 00 sw (r1+0),r2
80039a0: 34 01 ff ff mvi r1,-1
80039a4: e0 00 00 05 bi 80039b8 <sched_get_priority_max+0x40>
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
80039a8: 78 01 08 01 mvhi r1,0x801
80039ac: 38 21 f1 14 ori r1,r1,0xf114
80039b0: 40 21 00 00 lbu r1,(r1+0)
80039b4: 34 21 ff ff addi r1,r1,-1
}
80039b8: 2b 9d 00 04 lw ra,(sp+4)
80039bc: 37 9c 00 04 addi sp,sp,4
80039c0: c3 a0 00 00 ret
080039c4 <sched_get_priority_min>:
#include <rtems/posix/priority.h>
int sched_get_priority_min(
int policy
)
{
80039c4: 37 9c ff fc addi sp,sp,-4
80039c8: 5b 9d 00 04 sw (sp+4),ra
switch ( policy ) {
80039cc: 48 01 00 05 bg r0,r1,80039e0 <sched_get_priority_min+0x1c>
80039d0: 34 02 00 02 mvi r2,2
80039d4: 4c 41 00 08 bge r2,r1,80039f4 <sched_get_priority_min+0x30><== ALWAYS TAKEN
80039d8: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
80039dc: 44 22 00 06 be r1,r2,80039f4 <sched_get_priority_min+0x30> <== NOT EXECUTED
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
80039e0: f8 00 26 5b calli 800d34c <__errno>
80039e4: 34 02 00 16 mvi r2,22
80039e8: 58 22 00 00 sw (r1+0),r2
80039ec: 34 01 ff ff mvi r1,-1
80039f0: e0 00 00 02 bi 80039f8 <sched_get_priority_min+0x34>
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
80039f4: 34 01 00 01 mvi r1,1
}
80039f8: 2b 9d 00 04 lw ra,(sp+4)
80039fc: 37 9c 00 04 addi sp,sp,4
8003a00: c3 a0 00 00 ret
08003a04 <sched_rr_get_interval>:
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
)
{
8003a04: 37 9c ff f4 addi sp,sp,-12
8003a08: 5b 8b 00 08 sw (sp+8),r11
8003a0c: 5b 9d 00 04 sw (sp+4),ra
8003a10: b8 20 58 00 mv r11,r1
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid && pid != getpid() )
8003a14: 44 20 00 08 be r1,r0,8003a34 <sched_rr_get_interval+0x30> <== NEVER TAKEN
8003a18: 5b 82 00 0c sw (sp+12),r2
8003a1c: fb ff f8 a4 calli 8001cac <getpid>
8003a20: 2b 82 00 0c lw r2,(sp+12)
8003a24: 45 61 00 04 be r11,r1,8003a34 <sched_rr_get_interval+0x30>
rtems_set_errno_and_return_minus_one( ESRCH );
8003a28: f8 00 26 49 calli 800d34c <__errno>
8003a2c: 34 02 00 03 mvi r2,3
8003a30: e0 00 00 04 bi 8003a40 <sched_rr_get_interval+0x3c>
if ( !interval )
8003a34: 5c 40 00 06 bne r2,r0,8003a4c <sched_rr_get_interval+0x48>
rtems_set_errno_and_return_minus_one( EINVAL );
8003a38: f8 00 26 45 calli 800d34c <__errno>
8003a3c: 34 02 00 16 mvi r2,22
8003a40: 58 22 00 00 sw (r1+0),r2
8003a44: 34 01 ff ff mvi r1,-1
8003a48: e0 00 00 06 bi 8003a60 <sched_rr_get_interval+0x5c>
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
8003a4c: 78 01 08 01 mvhi r1,0x801
8003a50: 38 21 f8 60 ori r1,r1,0xf860
8003a54: 28 21 00 00 lw r1,(r1+0)
8003a58: f8 00 0e 76 calli 8007430 <_Timespec_From_ticks>
return 0;
8003a5c: 34 01 00 00 mvi r1,0
}
8003a60: 2b 9d 00 04 lw ra,(sp+4)
8003a64: 2b 8b 00 08 lw r11,(sp+8)
8003a68: 37 9c 00 0c addi sp,sp,12
8003a6c: c3 a0 00 00 ret
08006160 <sem_open>:
int oflag,
...
/* mode_t mode, */
/* unsigned int value */
)
{
8006160: 37 9c ff c0 addi sp,sp,-64
8006164: 5b 8b 00 18 sw (sp+24),r11
8006168: 5b 8c 00 14 sw (sp+20),r12
800616c: 5b 8d 00 10 sw (sp+16),r13
8006170: 5b 8e 00 0c sw (sp+12),r14
8006174: 5b 8f 00 08 sw (sp+8),r15
8006178: 5b 9d 00 04 sw (sp+4),ra
800617c: 5b 83 00 2c sw (sp+44),r3
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8006180: 78 03 08 02 mvhi r3,0x802
8006184: 5b 82 00 28 sw (sp+40),r2
8006188: 5b 84 00 30 sw (sp+48),r4
800618c: 5b 85 00 34 sw (sp+52),r5
8006190: 5b 86 00 38 sw (sp+56),r6
8006194: 5b 87 00 3c sw (sp+60),r7
8006198: 5b 88 00 40 sw (sp+64),r8
800619c: 38 63 4a c0 ori r3,r3,0x4ac0
80061a0: b8 20 60 00 mv r12,r1
80061a4: 28 61 00 00 lw r1,(r3+0)
80061a8: b8 40 70 00 mv r14,r2
80061ac: 34 21 00 01 addi r1,r1,1
80061b0: 58 61 00 00 sw (r3+0),r1
POSIX_Semaphore_Control *the_semaphore;
Objects_Locations location;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
80061b4: 20 4f 02 00 andi r15,r2,0x200
/* unsigned int value */
)
{
va_list arg;
mode_t mode;
unsigned int value = 0;
80061b8: 34 0d 00 00 mvi r13,0
POSIX_Semaphore_Control *the_semaphore;
Objects_Locations location;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
80061bc: 45 e0 00 02 be r15,r0,80061c4 <sem_open+0x64>
va_start(arg, oflag);
mode = (mode_t) va_arg( arg, unsigned int );
value = va_arg( arg, unsigned int );
80061c0: 2b 8d 00 30 lw r13,(sp+48)
va_end(arg);
}
status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
80061c4: b9 80 08 00 mv r1,r12
80061c8: 37 82 00 24 addi r2,sp,36
80061cc: f8 00 1b 5d calli 800cf40 <_POSIX_Semaphore_Name_to_id>
80061d0: 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 ) {
80061d4: 44 20 00 08 be r1,r0,80061f4 <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) ) ) {
80061d8: 34 01 00 02 mvi r1,2
80061dc: 5d 61 00 02 bne r11,r1,80061e4 <sem_open+0x84> <== NEVER TAKEN
80061e0: 5d e0 00 1a bne r15,r0,8006248 <sem_open+0xe8>
_Thread_Enable_dispatch();
80061e4: f8 00 0b 2a calli 8008e8c <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
80061e8: f8 00 2a 43 calli 8010af4 <__errno>
80061ec: 58 2b 00 00 sw (r1+0),r11
80061f0: e0 00 00 08 bi 8006210 <sem_open+0xb0>
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
80061f4: 21 ce 0a 00 andi r14,r14,0xa00
80061f8: 34 01 0a 00 mvi r1,2560
80061fc: 5d c1 00 07 bne r14,r1,8006218 <sem_open+0xb8>
_Thread_Enable_dispatch();
8006200: f8 00 0b 23 calli 8008e8c <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
8006204: f8 00 2a 3c calli 8010af4 <__errno>
8006208: 34 02 00 11 mvi r2,17
800620c: 58 22 00 00 sw (r1+0),r2
8006210: 34 01 ff ff mvi r1,-1
8006214: e0 00 00 18 bi 8006274 <sem_open+0x114>
8006218: 2b 82 00 24 lw r2,(sp+36)
800621c: 78 01 08 02 mvhi r1,0x802
8006220: 37 83 00 1c addi r3,sp,28
8006224: 38 21 4c f4 ori r1,r1,0x4cf4
8006228: f8 00 07 56 calli 8007f80 <_Objects_Get>
}
the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location );
the_semaphore->open_count += 1;
800622c: 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 );
8006230: 5b 81 00 20 sw (sp+32),r1
the_semaphore->open_count += 1;
8006234: 34 42 00 01 addi r2,r2,1
8006238: 58 22 00 18 sw (r1+24),r2
_Thread_Enable_dispatch();
800623c: f8 00 0b 14 calli 8008e8c <_Thread_Enable_dispatch>
_Thread_Enable_dispatch();
8006240: f8 00 0b 13 calli 8008e8c <_Thread_Enable_dispatch>
goto return_id;
8006244: e0 00 00 0a bi 800626c <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(
8006248: 34 02 00 00 mvi r2,0
800624c: b9 a0 18 00 mv r3,r13
8006250: 37 84 00 20 addi r4,sp,32
8006254: b9 80 08 00 mv r1,r12
8006258: f8 00 1a d6 calli 800cdb0 <_POSIX_Semaphore_Create_support>
800625c: b8 20 58 00 mv r11,r1
/*
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
8006260: f8 00 0b 0b calli 8008e8c <_Thread_Enable_dispatch>
if ( status == -1 )
return SEM_FAILED;
8006264: 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 )
8006268: 45 61 00 03 be r11,r1,8006274 <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;
800626c: 2b 81 00 20 lw r1,(sp+32)
8006270: 34 21 00 08 addi r1,r1,8
#endif
return id;
}
8006274: 2b 9d 00 04 lw ra,(sp+4)
8006278: 2b 8b 00 18 lw r11,(sp+24)
800627c: 2b 8c 00 14 lw r12,(sp+20)
8006280: 2b 8d 00 10 lw r13,(sp+16)
8006284: 2b 8e 00 0c lw r14,(sp+12)
8006288: 2b 8f 00 08 lw r15,(sp+8)
800628c: 37 9c 00 40 addi sp,sp,64
8006290: c3 a0 00 00 ret
08003868 <sigaction>:
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
8003868: 37 9c ff ec addi sp,sp,-20
800386c: 5b 8b 00 14 sw (sp+20),r11
8003870: 5b 8c 00 10 sw (sp+16),r12
8003874: 5b 8d 00 0c sw (sp+12),r13
8003878: 5b 8e 00 08 sw (sp+8),r14
800387c: 5b 9d 00 04 sw (sp+4),ra
8003880: b8 20 58 00 mv r11,r1
8003884: b8 40 60 00 mv r12,r2
8003888: b8 60 68 00 mv r13,r3
ISR_Level level;
if ( oact )
800388c: 44 60 00 0f be r3,r0,80038c8 <sigaction+0x60>
*oact = _POSIX_signals_Vectors[ sig ];
8003890: 34 02 00 01 mvi r2,1
8003894: f8 00 67 13 calli 801d4e0 <__ashlsi3>
8003898: 34 02 00 02 mvi r2,2
800389c: 78 0e 08 02 mvhi r14,0x802
80038a0: b4 2b 08 00 add r1,r1,r11
80038a4: f8 00 67 0f calli 801d4e0 <__ashlsi3>
80038a8: 39 ce 0e 10 ori r14,r14,0xe10
80038ac: b5 c1 08 00 add r1,r14,r1
80038b0: 28 23 00 00 lw r3,(r1+0)
80038b4: 28 22 00 04 lw r2,(r1+4)
80038b8: 28 21 00 08 lw r1,(r1+8)
80038bc: 59 a3 00 00 sw (r13+0),r3
80038c0: 59 a2 00 04 sw (r13+4),r2
80038c4: 59 a1 00 08 sw (r13+8),r1
if ( !sig )
80038c8: 45 60 00 07 be r11,r0,80038e4 <sigaction+0x7c>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
80038cc: 35 61 ff ff addi r1,r11,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
80038d0: 34 02 00 1f mvi r2,31
80038d4: 50 41 00 02 bgeu r2,r1,80038dc <sigaction+0x74>
80038d8: e0 00 00 03 bi 80038e4 <sigaction+0x7c>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
80038dc: 34 01 00 09 mvi r1,9
80038e0: 5d 61 00 06 bne r11,r1,80038f8 <sigaction+0x90>
rtems_set_errno_and_return_minus_one( EINVAL );
80038e4: f8 00 27 ed calli 800d898 <__errno>
80038e8: 34 02 00 16 mvi r2,22
80038ec: 58 22 00 00 sw (r1+0),r2
80038f0: 34 01 ff ff mvi r1,-1
80038f4: e0 00 00 31 bi 80039b8 <sigaction+0x150>
* 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;
80038f8: 34 01 00 00 mvi r1,0
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
80038fc: 45 80 00 2f be r12,r0,80039b8 <sigaction+0x150> <== 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 );
8003900: 90 00 70 00 rcsr r14,IE
8003904: 34 01 ff fe mvi r1,-2
8003908: a1 c1 08 00 and r1,r14,r1
800390c: d0 01 00 00 wcsr IE,r1
if ( act->sa_handler == SIG_DFL ) {
8003910: 29 81 00 08 lw r1,(r12+8)
8003914: 78 0d 08 02 mvhi r13,0x802
8003918: 39 ad 0e 10 ori r13,r13,0xe10
800391c: 5c 20 00 16 bne r1,r0,8003974 <sigaction+0x10c>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
8003920: b9 60 08 00 mv r1,r11
8003924: 34 02 00 01 mvi r2,1
8003928: f8 00 66 ee calli 801d4e0 <__ashlsi3>
800392c: b4 2b 58 00 add r11,r1,r11
8003930: 34 02 00 02 mvi r2,2
8003934: b9 60 08 00 mv r1,r11
8003938: f8 00 66 ea calli 801d4e0 <__ashlsi3>
800393c: b5 a1 68 00 add r13,r13,r1
8003940: 34 02 00 02 mvi r2,2
8003944: 78 0c 08 01 mvhi r12,0x801
8003948: b9 60 08 00 mv r1,r11
800394c: f8 00 66 e5 calli 801d4e0 <__ashlsi3>
8003950: 39 8c ee cc ori r12,r12,0xeecc
8003954: b5 81 08 00 add r1,r12,r1
8003958: 28 23 00 00 lw r3,(r1+0)
800395c: 28 22 00 04 lw r2,(r1+4)
8003960: 28 21 00 08 lw r1,(r1+8)
8003964: 59 a3 00 00 sw (r13+0),r3
8003968: 59 a2 00 04 sw (r13+4),r2
800396c: 59 a1 00 08 sw (r13+8),r1
8003970: e0 00 00 10 bi 80039b0 <sigaction+0x148>
} else {
_POSIX_signals_Clear_process_signals( sig );
8003974: b9 60 08 00 mv r1,r11
8003978: f8 00 18 f1 calli 8009d3c <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
800397c: 34 02 00 01 mvi r2,1
8003980: b9 60 08 00 mv r1,r11
8003984: f8 00 66 d7 calli 801d4e0 <__ashlsi3>
8003988: 34 02 00 02 mvi r2,2
800398c: b4 2b 08 00 add r1,r1,r11
8003990: f8 00 66 d4 calli 801d4e0 <__ashlsi3>
8003994: 29 83 00 00 lw r3,(r12+0)
8003998: 29 82 00 04 lw r2,(r12+4)
800399c: 29 84 00 08 lw r4,(r12+8)
80039a0: b5 a1 08 00 add r1,r13,r1
80039a4: 58 23 00 00 sw (r1+0),r3
80039a8: 58 22 00 04 sw (r1+4),r2
80039ac: 58 24 00 08 sw (r1+8),r4
}
_ISR_Enable( level );
80039b0: 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;
80039b4: 34 01 00 00 mvi r1,0
}
80039b8: 2b 9d 00 04 lw ra,(sp+4)
80039bc: 2b 8b 00 14 lw r11,(sp+20)
80039c0: 2b 8c 00 10 lw r12,(sp+16)
80039c4: 2b 8d 00 0c lw r13,(sp+12)
80039c8: 2b 8e 00 08 lw r14,(sp+8)
80039cc: 37 9c 00 14 addi sp,sp,20
80039d0: c3 a0 00 00 ret
08003e64 <sigtimedwait>:
int sigtimedwait(
const sigset_t *set,
siginfo_t *info,
const struct timespec *timeout
)
{
8003e64: 37 9c ff dc addi sp,sp,-36
8003e68: 5b 8b 00 18 sw (sp+24),r11
8003e6c: 5b 8c 00 14 sw (sp+20),r12
8003e70: 5b 8d 00 10 sw (sp+16),r13
8003e74: 5b 8e 00 0c sw (sp+12),r14
8003e78: 5b 8f 00 08 sw (sp+8),r15
8003e7c: 5b 9d 00 04 sw (sp+4),ra
8003e80: b8 20 68 00 mv r13,r1
8003e84: b8 40 58 00 mv r11,r2
8003e88: b8 60 60 00 mv r12,r3
ISR_Level level;
/*
* Error check parameters before disabling interrupts.
*/
if ( !set )
8003e8c: 44 20 00 09 be r1,r0,8003eb0 <sigtimedwait+0x4c>
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
if ( timeout ) {
8003e90: 44 60 00 0b be r3,r0,8003ebc <sigtimedwait+0x58>
if ( !_Timespec_Is_valid( timeout ) )
8003e94: b8 60 08 00 mv r1,r3
8003e98: f8 00 0e dc calli 8007a08 <_Timespec_Is_valid>
8003e9c: 44 20 00 05 be r1,r0,8003eb0 <sigtimedwait+0x4c>
rtems_set_errno_and_return_minus_one( EINVAL );
interval = _Timespec_To_ticks( timeout );
8003ea0: b9 80 08 00 mv r1,r12
8003ea4: f8 00 0e f7 calli 8007a80 <_Timespec_To_ticks>
8003ea8: b8 20 10 00 mv r2,r1
if ( !interval )
8003eac: 5c 20 00 05 bne r1,r0,8003ec0 <sigtimedwait+0x5c> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
8003eb0: f8 00 28 46 calli 800dfc8 <__errno>
8003eb4: 34 02 00 16 mvi r2,22
8003eb8: e0 00 00 61 bi 800403c <sigtimedwait+0x1d8>
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
8003ebc: 34 02 00 00 mvi r2,0
/*
* Initialize local variables.
*/
the_info = ( info ) ? info : &signal_information;
8003ec0: 5d 60 00 02 bne r11,r0,8003ec8 <sigtimedwait+0x64>
8003ec4: 37 8b 00 1c addi r11,sp,28
the_thread = _Thread_Executing;
8003ec8: 78 01 08 02 mvhi r1,0x802
8003ecc: 38 21 1d c4 ori r1,r1,0x1dc4
8003ed0: 28 23 00 0c lw r3,(r1+12)
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8003ed4: 28 6e 01 20 lw r14,(r3+288)
* What if they are already pending?
*/
/* API signals pending? */
_ISR_Disable( level );
8003ed8: 90 00 78 00 rcsr r15,IE
8003edc: 34 01 ff fe mvi r1,-2
8003ee0: a1 e1 08 00 and r1,r15,r1
8003ee4: d0 01 00 00 wcsr IE,r1
if ( *set & api->signals_pending ) {
8003ee8: 29 a5 00 00 lw r5,(r13+0)
8003eec: 29 c1 00 d4 lw r1,(r14+212)
8003ef0: a0 a1 20 00 and r4,r5,r1
8003ef4: 44 80 00 0f be r4,r0,8003f30 <sigtimedwait+0xcc>
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending );
8003ef8: fb ff ff bc calli 8003de8 <_POSIX_signals_Get_lowest>
8003efc: b8 20 10 00 mv r2,r1
8003f00: 59 61 00 00 sw (r11+0),r1
_POSIX_signals_Clear_signals(
8003f04: b9 60 18 00 mv r3,r11
8003f08: b9 c0 08 00 mv r1,r14
8003f0c: 34 04 00 00 mvi r4,0
8003f10: 34 05 00 00 mvi r5,0
8003f14: f8 00 1a 49 calli 800a838 <_POSIX_signals_Clear_signals>
the_info->si_signo,
the_info,
false,
false
);
_ISR_Enable( level );
8003f18: d0 0f 00 00 wcsr IE,r15
the_info->si_code = SI_USER;
8003f1c: 34 01 00 01 mvi r1,1
8003f20: 59 61 00 04 sw (r11+4),r1
the_info->si_value.sival_int = 0;
8003f24: 59 60 00 08 sw (r11+8),r0
return the_info->si_signo;
8003f28: 29 6c 00 00 lw r12,(r11+0)
8003f2c: e0 00 00 46 bi 8004044 <sigtimedwait+0x1e0>
}
/* Process pending signals? */
if ( *set & _POSIX_signals_Pending ) {
8003f30: 78 01 08 02 mvhi r1,0x802
8003f34: 38 21 20 04 ori r1,r1,0x2004
8003f38: 28 21 00 00 lw r1,(r1+0)
8003f3c: a0 a1 28 00 and r5,r5,r1
8003f40: 44 a4 00 0f be r5,r4,8003f7c <sigtimedwait+0x118>
signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending );
8003f44: fb ff ff a9 calli 8003de8 <_POSIX_signals_Get_lowest>
8003f48: b8 20 60 00 mv r12,r1
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
8003f4c: b9 80 10 00 mv r2,r12
8003f50: b9 c0 08 00 mv r1,r14
8003f54: b9 60 18 00 mv r3,r11
8003f58: 34 04 00 01 mvi r4,1
8003f5c: 34 05 00 00 mvi r5,0
8003f60: f8 00 1a 36 calli 800a838 <_POSIX_signals_Clear_signals>
_ISR_Enable( level );
8003f64: d0 0f 00 00 wcsr IE,r15
the_info->si_signo = signo;
the_info->si_code = SI_USER;
8003f68: 34 01 00 01 mvi r1,1
if ( *set & _POSIX_signals_Pending ) {
signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending );
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
_ISR_Enable( level );
the_info->si_signo = signo;
8003f6c: 59 6c 00 00 sw (r11+0),r12
the_info->si_code = SI_USER;
8003f70: 59 61 00 04 sw (r11+4),r1
the_info->si_value.sival_int = 0;
8003f74: 59 60 00 08 sw (r11+8),r0
return signo;
8003f78: e0 00 00 33 bi 8004044 <sigtimedwait+0x1e0>
}
the_info->si_signo = -1;
8003f7c: 34 01 ff ff mvi r1,-1
8003f80: 59 61 00 00 sw (r11+0),r1
8003f84: 78 01 08 02 mvhi r1,0x802
8003f88: 38 21 19 18 ori r1,r1,0x1918
8003f8c: 28 24 00 00 lw r4,(r1+0)
8003f90: 34 84 00 01 addi r4,r4,1
8003f94: 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;
8003f98: 34 04 00 04 mvi r4,4
8003f9c: 58 64 00 34 sw (r3+52),r4
the_thread->Wait.option = *set;
8003fa0: 29 a4 00 00 lw r4,(r13+0)
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
8003fa4: 78 01 08 02 mvhi r1,0x802
8003fa8: 38 21 1f 9c ori r1,r1,0x1f9c
the_thread->Wait.return_code = EINTR;
the_thread->Wait.option = *set;
8003fac: 58 64 00 30 sw (r3+48),r4
the_thread->Wait.return_argument = the_info;
8003fb0: 58 6b 00 28 sw (r3+40),r11
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
8003fb4: 58 61 00 44 sw (r3+68),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;
8003fb8: 34 03 00 01 mvi r3,1
8003fbc: 58 23 00 30 sw (r1+48),r3
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 );
8003fc0: d0 0f 00 00 wcsr IE,r15
_Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval );
8003fc4: 78 01 08 02 mvhi r1,0x802
8003fc8: 78 03 08 00 mvhi r3,0x800
8003fcc: 38 21 1f 9c ori r1,r1,0x1f9c
8003fd0: 38 63 76 98 ori r3,r3,0x7698
8003fd4: f8 00 0c 87 calli 80071f0 <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
8003fd8: f8 00 0b 1e calli 8006c50 <_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 );
8003fdc: 29 62 00 00 lw r2,(r11+0)
8003fe0: b9 c0 08 00 mv r1,r14
8003fe4: b9 60 18 00 mv r3,r11
8003fe8: 34 04 00 00 mvi r4,0
8003fec: 34 05 00 00 mvi r5,0
8003ff0: f8 00 1a 12 calli 800a838 <_POSIX_signals_Clear_signals>
/* Set errno only if return code is not EINTR or
* if EINTR was caused by a signal being caught, which
* was not in our set.
*/
if ( (_Thread_Executing->Wait.return_code != EINTR)
8003ff4: 78 01 08 02 mvhi r1,0x802
8003ff8: 38 21 1d c4 ori r1,r1,0x1dc4
8003ffc: 28 21 00 0c lw r1,(r1+12)
8004000: 28 22 00 34 lw r2,(r1+52)
8004004: 34 01 00 04 mvi r1,4
8004008: 5c 41 00 08 bne r2,r1,8004028 <sigtimedwait+0x1c4>
|| !(*set & signo_to_mask( the_info->si_signo )) ) {
800400c: 29 6c 00 00 lw r12,(r11+0)
8004010: 34 01 00 01 mvi r1,1
8004014: 35 82 ff ff addi r2,r12,-1
8004018: f8 00 66 e7 calli 801dbb4 <__ashlsi3>
800401c: 29 a2 00 00 lw r2,(r13+0)
8004020: a0 22 08 00 and r1,r1,r2
8004024: 5c 20 00 08 bne r1,r0,8004044 <sigtimedwait+0x1e0>
errno = _Thread_Executing->Wait.return_code;
8004028: f8 00 27 e8 calli 800dfc8 <__errno>
800402c: 78 02 08 02 mvhi r2,0x802
8004030: 38 42 1d c4 ori r2,r2,0x1dc4
8004034: 28 42 00 0c lw r2,(r2+12)
8004038: 28 42 00 34 lw r2,(r2+52)
800403c: 58 22 00 00 sw (r1+0),r2
return -1;
8004040: 34 0c ff ff mvi r12,-1
}
return the_info->si_signo;
}
8004044: b9 80 08 00 mv r1,r12
8004048: 2b 9d 00 04 lw ra,(sp+4)
800404c: 2b 8b 00 18 lw r11,(sp+24)
8004050: 2b 8c 00 14 lw r12,(sp+20)
8004054: 2b 8d 00 10 lw r13,(sp+16)
8004058: 2b 8e 00 0c lw r14,(sp+12)
800405c: 2b 8f 00 08 lw r15,(sp+8)
8004060: 37 9c 00 24 addi sp,sp,36
8004064: c3 a0 00 00 ret
08006278 <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
8006278: 37 9c ff f8 addi sp,sp,-8
800627c: 5b 8b 00 08 sw (sp+8),r11
8006280: 5b 9d 00 04 sw (sp+4),ra
int status;
status = sigtimedwait( set, NULL, NULL );
8006284: 34 03 00 00 mvi r3,0
int sigwait(
const sigset_t *set,
int *sig
)
{
8006288: b8 40 58 00 mv r11,r2
int status;
status = sigtimedwait( set, NULL, NULL );
800628c: 34 02 00 00 mvi r2,0
8006290: fb ff ff 72 calli 8006058 <sigtimedwait>
8006294: b8 20 18 00 mv r3,r1
if ( status != -1 ) {
8006298: 34 01 ff ff mvi r1,-1
800629c: 44 61 00 05 be r3,r1,80062b0 <sigwait+0x38>
if ( sig )
*sig = status;
return 0;
80062a0: 34 01 00 00 mvi r1,0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
80062a4: 45 60 00 05 be r11,r0,80062b8 <sigwait+0x40> <== NEVER TAKEN
*sig = status;
80062a8: 59 63 00 00 sw (r11+0),r3
80062ac: e0 00 00 03 bi 80062b8 <sigwait+0x40>
return 0;
}
return errno;
80062b0: f8 00 26 b0 calli 800fd70 <__errno>
80062b4: 28 21 00 00 lw r1,(r1+0)
}
80062b8: 2b 9d 00 04 lw ra,(sp+4)
80062bc: 2b 8b 00 08 lw r11,(sp+8)
80062c0: 37 9c 00 08 addi sp,sp,8
80062c4: c3 a0 00 00 ret
08002e60 <timer_create>:
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
)
{
8002e60: 37 9c ff ec addi sp,sp,-20
8002e64: 5b 8b 00 14 sw (sp+20),r11
8002e68: 5b 8c 00 10 sw (sp+16),r12
8002e6c: 5b 8d 00 0c sw (sp+12),r13
8002e70: 5b 8e 00 08 sw (sp+8),r14
8002e74: 5b 9d 00 04 sw (sp+4),ra
8002e78: b8 40 60 00 mv r12,r2
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
8002e7c: 34 02 00 01 mvi r2,1
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
)
{
8002e80: b8 60 68 00 mv r13,r3
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
8002e84: 5c 22 00 0c bne r1,r2,8002eb4 <timer_create+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !timerid )
8002e88: 44 60 00 0b be r3,r0,8002eb4 <timer_create+0x54>
/*
* The data of the structure evp are checked in order to verify if they
* are coherent.
*/
if (evp != NULL) {
8002e8c: 45 80 00 0d be r12,r0,8002ec0 <timer_create+0x60>
/* The structure has data */
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
8002e90: 29 82 00 00 lw r2,(r12+0)
8002e94: 34 42 ff ff addi r2,r2,-1
8002e98: 50 22 00 02 bgeu r1,r2,8002ea0 <timer_create+0x40> <== ALWAYS TAKEN
8002e9c: e0 00 00 06 bi 8002eb4 <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 )
8002ea0: 29 81 00 04 lw r1,(r12+4)
8002ea4: 44 20 00 04 be r1,r0,8002eb4 <timer_create+0x54> <== NEVER TAKEN
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
8002ea8: 34 21 ff ff addi r1,r1,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(evp->sigev_signo) )
8002eac: 34 02 00 1f mvi r2,31
8002eb0: 50 41 00 04 bgeu r2,r1,8002ec0 <timer_create+0x60> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
8002eb4: f8 00 29 bc calli 800d5a4 <__errno>
8002eb8: 34 02 00 16 mvi r2,22
8002ebc: e0 00 00 0e bi 8002ef4 <timer_create+0x94>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8002ec0: 78 01 08 01 mvhi r1,0x801
8002ec4: 38 21 f9 18 ori r1,r1,0xf918
8002ec8: 28 22 00 00 lw r2,(r1+0)
8002ecc: 34 42 00 01 addi r2,r2,1
8002ed0: 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 );
8002ed4: 78 01 08 01 mvhi r1,0x801
8002ed8: 38 21 fb 8c ori r1,r1,0xfb8c
8002edc: f8 00 07 0c calli 8004b0c <_Objects_Allocate>
8002ee0: b8 20 58 00 mv r11,r1
/*
* Allocate a timer
*/
ptimer = _POSIX_Timer_Allocate();
if ( !ptimer ) {
8002ee4: 5c 20 00 07 bne r1,r0,8002f00 <timer_create+0xa0>
_Thread_Enable_dispatch();
8002ee8: f8 00 0b df calli 8005e64 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
8002eec: f8 00 29 ae calli 800d5a4 <__errno>
8002ef0: 34 02 00 0b mvi r2,11
8002ef4: 58 22 00 00 sw (r1+0),r2
8002ef8: 34 01 ff ff mvi r1,-1
8002efc: e0 00 00 25 bi 8002f90 <timer_create+0x130>
}
/* The data of the created timer are stored to use them later */
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
8002f00: 34 01 00 02 mvi r1,2
8002f04: 31 61 00 3c sb (r11+60),r1
ptimer->thread_id = _Thread_Executing->Object.id;
8002f08: 78 01 08 01 mvhi r1,0x801
8002f0c: 38 21 fd c4 ori r1,r1,0xfdc4
8002f10: 28 21 00 0c lw r1,(r1+12)
8002f14: 28 21 00 08 lw r1,(r1+8)
8002f18: 59 61 00 38 sw (r11+56),r1
if ( evp != NULL ) {
8002f1c: 45 80 00 07 be r12,r0,8002f38 <timer_create+0xd8>
ptimer->inf.sigev_notify = evp->sigev_notify;
8002f20: 29 81 00 00 lw r1,(r12+0)
8002f24: 59 61 00 40 sw (r11+64),r1
ptimer->inf.sigev_signo = evp->sigev_signo;
8002f28: 29 81 00 04 lw r1,(r12+4)
8002f2c: 59 61 00 44 sw (r11+68),r1
ptimer->inf.sigev_value = evp->sigev_value;
8002f30: 29 81 00 08 lw r1,(r12+8)
8002f34: 59 61 00 48 sw (r11+72),r1
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8002f38: 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;
}
8002f3c: 78 01 08 01 mvhi r1,0x801
8002f40: 38 21 fb 8c ori r1,r1,0xfb8c
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8002f44: 28 2e 00 1c lw r14,(r1+28)
8002f48: 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;
8002f4c: 59 60 00 68 sw (r11+104),r0
ptimer->timer_data.it_value.tv_sec = 0;
8002f50: 59 60 00 5c sw (r11+92),r0
ptimer->timer_data.it_value.tv_nsec = 0;
8002f54: 59 60 00 60 sw (r11+96),r0
ptimer->timer_data.it_interval.tv_sec = 0;
8002f58: 59 60 00 54 sw (r11+84),r0
ptimer->timer_data.it_interval.tv_nsec = 0;
8002f5c: 59 60 00 58 sw (r11+88),r0
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8002f60: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8002f64: 59 60 00 2c sw (r11+44),r0
the_watchdog->id = id;
8002f68: 59 60 00 30 sw (r11+48),r0
the_watchdog->user_data = user_data;
8002f6c: 59 60 00 34 sw (r11+52),r0
8002f70: 21 81 ff ff andi r1,r12,0xffff
8002f74: f8 00 62 cd calli 801baa8 <__ashlsi3>
8002f78: b5 c1 08 00 add r1,r14,r1
8002f7c: 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;
8002f80: 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;
8002f84: 59 ac 00 00 sw (r13+0),r12
_Thread_Enable_dispatch();
8002f88: f8 00 0b b7 calli 8005e64 <_Thread_Enable_dispatch>
return 0;
8002f8c: 34 01 00 00 mvi r1,0
}
8002f90: 2b 9d 00 04 lw ra,(sp+4)
8002f94: 2b 8b 00 14 lw r11,(sp+20)
8002f98: 2b 8c 00 10 lw r12,(sp+16)
8002f9c: 2b 8d 00 0c lw r13,(sp+12)
8002fa0: 2b 8e 00 08 lw r14,(sp+8)
8002fa4: 37 9c 00 14 addi sp,sp,20
8002fa8: c3 a0 00 00 ret
08002fac <timer_settime>:
timer_t timerid,
int flags,
const struct itimerspec *value,
struct itimerspec *ovalue
)
{
8002fac: 37 9c ff cc addi sp,sp,-52
8002fb0: 5b 8b 00 18 sw (sp+24),r11
8002fb4: 5b 8c 00 14 sw (sp+20),r12
8002fb8: 5b 8d 00 10 sw (sp+16),r13
8002fbc: 5b 8e 00 0c sw (sp+12),r14
8002fc0: 5b 8f 00 08 sw (sp+8),r15
8002fc4: 5b 9d 00 04 sw (sp+4),ra
8002fc8: b8 20 78 00 mv r15,r1
8002fcc: b8 40 58 00 mv r11,r2
8002fd0: b8 60 60 00 mv r12,r3
8002fd4: b8 80 68 00 mv r13,r4
Objects_Locations location;
bool activated;
uint32_t initial_period;
struct itimerspec normalize;
if ( !value )
8002fd8: 44 60 00 69 be r3,r0,800317c <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) ) ) {
8002fdc: 34 61 00 08 addi r1,r3,8
8002fe0: f8 00 0f 0a calli 8006c08 <_Timespec_Is_valid>
8002fe4: 44 20 00 66 be r1,r0,800317c <timer_settime+0x1d0>
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !_Timespec_Is_valid( &(value->it_interval) ) ) {
8002fe8: b9 80 08 00 mv r1,r12
8002fec: f8 00 0f 07 calli 8006c08 <_Timespec_Is_valid>
8002ff0: 44 20 00 63 be r1,r0,800317c <timer_settime+0x1d0> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) {
8002ff4: 7d 62 00 00 cmpnei r2,r11,0
8002ff8: 7d 61 00 04 cmpnei r1,r11,4
8002ffc: a0 41 08 00 and r1,r2,r1
8003000: 5c 20 00 5f bne r1,r0,800317c <timer_settime+0x1d0>
rtems_set_errno_and_return_minus_one( EINVAL );
}
normalize = *value;
8003004: 29 81 00 0c lw r1,(r12+12)
8003008: 29 84 00 00 lw r4,(r12+0)
800300c: 29 83 00 04 lw r3,(r12+4)
8003010: 29 82 00 08 lw r2,(r12+8)
8003014: 5b 81 00 28 sw (sp+40),r1
8003018: 5b 84 00 1c sw (sp+28),r4
800301c: 5b 83 00 20 sw (sp+32),r3
8003020: 5b 82 00 24 sw (sp+36),r2
/* Convert absolute to relative time */
if (flags == TIMER_ABSTIME) {
8003024: 34 01 00 04 mvi r1,4
8003028: 5d 61 00 0d bne r11,r1,800305c <timer_settime+0xb0>
struct timespec now;
_TOD_Get( &now );
800302c: 37 8b 00 2c addi r11,sp,44
8003030: b9 60 08 00 mv r1,r11
8003034: f8 00 04 ef calli 80043f0 <_TOD_Get>
/* Check for seconds in the past */
if ( _Timespec_Greater_than( &now, &normalize.it_value ) )
8003038: 37 8e 00 24 addi r14,sp,36
800303c: b9 60 08 00 mv r1,r11
8003040: b9 c0 10 00 mv r2,r14
8003044: f8 00 0e e6 calli 8006bdc <_Timespec_Greater_than>
8003048: 5c 20 00 4d bne r1,r0,800317c <timer_settime+0x1d0>
rtems_set_errno_and_return_minus_one( EINVAL );
_Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value );
800304c: b9 60 08 00 mv r1,r11
8003050: b9 c0 10 00 mv r2,r14
8003054: b9 c0 18 00 mv r3,r14
8003058: f8 00 0e f8 calli 8006c38 <_Timespec_Subtract>
timer_t id,
Objects_Locations *location
)
{
return (POSIX_Timer_Control *)
_Objects_Get( &_POSIX_Timer_Information, (Objects_Id) id, location );
800305c: 78 03 08 01 mvhi r3,0x801
8003060: b8 60 08 00 mv r1,r3
8003064: b9 e0 10 00 mv r2,r15
8003068: 38 21 fb 8c ori r1,r1,0xfb8c
800306c: 37 83 00 34 addi r3,sp,52
8003070: f8 00 07 f5 calli 8005044 <_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 ) {
8003074: 2b 82 00 34 lw r2,(sp+52)
8003078: b8 20 58 00 mv r11,r1
800307c: 5c 40 00 40 bne r2,r0,800317c <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 ) {
8003080: 2b 81 00 24 lw r1,(sp+36)
8003084: 5c 22 00 19 bne r1,r2,80030e8 <timer_settime+0x13c>
8003088: 2b 8e 00 28 lw r14,(sp+40)
800308c: 5d c1 00 17 bne r14,r1,80030e8 <timer_settime+0x13c>
/* Stop the timer */
(void) _Watchdog_Remove( &ptimer->Timer );
8003090: 35 61 00 10 addi r1,r11,16
8003094: f8 00 10 60 calli 8007214 <_Watchdog_Remove>
/* The old data of the timer are returned */
if ( ovalue )
8003098: 45 ae 00 09 be r13,r14,80030bc <timer_settime+0x110>
*ovalue = ptimer->timer_data;
800309c: 29 64 00 54 lw r4,(r11+84)
80030a0: 29 63 00 58 lw r3,(r11+88)
80030a4: 29 62 00 5c lw r2,(r11+92)
80030a8: 29 61 00 60 lw r1,(r11+96)
80030ac: 59 a4 00 00 sw (r13+0),r4
80030b0: 59 a3 00 04 sw (r13+4),r3
80030b4: 59 a2 00 08 sw (r13+8),r2
80030b8: 59 a1 00 0c sw (r13+12),r1
/* The new data are set */
ptimer->timer_data = normalize;
80030bc: 2b 81 00 1c lw r1,(sp+28)
80030c0: 59 61 00 54 sw (r11+84),r1
80030c4: 2b 81 00 20 lw r1,(sp+32)
80030c8: 59 61 00 58 sw (r11+88),r1
80030cc: 2b 81 00 24 lw r1,(sp+36)
80030d0: 59 61 00 5c sw (r11+92),r1
80030d4: 2b 81 00 28 lw r1,(sp+40)
80030d8: 59 61 00 60 sw (r11+96),r1
/* Indicates that the timer is created and stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
80030dc: 34 01 00 04 mvi r1,4
80030e0: 31 61 00 3c sb (r11+60),r1
80030e4: e0 00 00 23 bi 8003170 <timer_settime+0x1c4>
_Thread_Enable_dispatch();
return 0;
}
/* Convert from seconds and nanoseconds to ticks */
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
80030e8: b9 80 08 00 mv r1,r12
80030ec: f8 00 0e e5 calli 8006c80 <_Timespec_To_ticks>
80030f0: 59 61 00 64 sw (r11+100),r1
initial_period = _Timespec_To_ticks( &normalize.it_value );
80030f4: 37 81 00 24 addi r1,sp,36
80030f8: f8 00 0e e2 calli 8006c80 <_Timespec_To_ticks>
activated = _POSIX_Timer_Insert_helper(
80030fc: 29 63 00 08 lw r3,(r11+8)
8003100: 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 );
8003104: b8 20 10 00 mv r2,r1
activated = _POSIX_Timer_Insert_helper(
8003108: 38 84 31 ac ori r4,r4,0x31ac
800310c: 35 61 00 10 addi r1,r11,16
8003110: b9 60 28 00 mv r5,r11
8003114: f8 00 1a fa calli 8009cfc <_POSIX_Timer_Insert_helper>
initial_period,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated ) {
8003118: 44 20 00 16 be r1,r0,8003170 <timer_settime+0x1c4>
/*
* The timer has been started and is running. So we return the
* old ones in "ovalue"
*/
if ( ovalue )
800311c: 45 a0 00 09 be r13,r0,8003140 <timer_settime+0x194>
*ovalue = ptimer->timer_data;
8003120: 29 64 00 54 lw r4,(r11+84)
8003124: 29 63 00 58 lw r3,(r11+88)
8003128: 29 62 00 5c lw r2,(r11+92)
800312c: 29 61 00 60 lw r1,(r11+96)
8003130: 59 a4 00 00 sw (r13+0),r4
8003134: 59 a3 00 04 sw (r13+4),r3
8003138: 59 a2 00 08 sw (r13+8),r2
800313c: 59 a1 00 0c sw (r13+12),r1
ptimer->timer_data = normalize;
8003140: 2b 81 00 1c lw r1,(sp+28)
8003144: 59 61 00 54 sw (r11+84),r1
8003148: 2b 81 00 20 lw r1,(sp+32)
800314c: 59 61 00 58 sw (r11+88),r1
8003150: 2b 81 00 24 lw r1,(sp+36)
8003154: 59 61 00 5c sw (r11+92),r1
8003158: 2b 81 00 28 lw r1,(sp+40)
800315c: 59 61 00 60 sw (r11+96),r1
/* Indicate that the time is running */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
8003160: 34 01 00 03 mvi r1,3
8003164: 31 61 00 3c sb (r11+60),r1
_TOD_Get( &ptimer->time );
8003168: 35 61 00 6c addi r1,r11,108
800316c: f8 00 04 a1 calli 80043f0 <_TOD_Get>
_Thread_Enable_dispatch();
8003170: f8 00 0b 3d calli 8005e64 <_Thread_Enable_dispatch>
return 0;
8003174: 34 01 00 00 mvi r1,0
8003178: e0 00 00 05 bi 800318c <timer_settime+0x1e0>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EINVAL );
800317c: f8 00 29 0a calli 800d5a4 <__errno>
8003180: 34 02 00 16 mvi r2,22
8003184: 58 22 00 00 sw (r1+0),r2
8003188: 34 01 ff ff mvi r1,-1
}
800318c: 2b 9d 00 04 lw ra,(sp+4)
8003190: 2b 8b 00 18 lw r11,(sp+24)
8003194: 2b 8c 00 14 lw r12,(sp+20)
8003198: 2b 8d 00 10 lw r13,(sp+16)
800319c: 2b 8e 00 0c lw r14,(sp+12)
80031a0: 2b 8f 00 08 lw r15,(sp+8)
80031a4: 37 9c 00 34 addi sp,sp,52
80031a8: c3 a0 00 00 ret
08002d74 <ualarm>:
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
8002d74: 37 9c ff e8 addi sp,sp,-24
8002d78: 5b 8b 00 10 sw (sp+16),r11
8002d7c: 5b 8c 00 0c sw (sp+12),r12
8002d80: 5b 8d 00 08 sw (sp+8),r13
8002d84: 5b 9d 00 04 sw (sp+4),ra
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
8002d88: 78 0b 08 01 mvhi r11,0x801
8002d8c: 39 6b 71 98 ori r11,r11,0x7198
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
8002d90: b8 20 68 00 mv r13,r1
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
8002d94: 29 61 00 1c lw r1,(r11+28)
8002d98: 5c 20 00 09 bne r1,r0,8002dbc <ualarm+0x48>
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
8002d9c: 78 01 08 00 mvhi r1,0x800
8002da0: 38 21 2d 2c ori r1,r1,0x2d2c
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8002da4: 59 60 00 08 sw (r11+8),r0
the_watchdog->routine = routine;
8002da8: 59 61 00 1c sw (r11+28),r1
the_watchdog->id = id;
8002dac: 59 60 00 20 sw (r11+32),r0
the_watchdog->user_data = user_data;
8002db0: 59 60 00 24 sw (r11+36),r0
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
8002db4: 34 0c 00 00 mvi r12,0
8002db8: e0 00 00 18 bi 8002e18 <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 );
8002dbc: b9 60 08 00 mv r1,r11
8002dc0: f8 00 0f 7e calli 8006bb8 <_Watchdog_Remove>
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
8002dc4: 34 21 ff fe addi r1,r1,-2
8002dc8: 34 02 00 01 mvi r2,1
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
8002dcc: 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) ) {
8002dd0: 54 22 00 12 bgu r1,r2,8002e18 <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);
8002dd4: 29 61 00 0c lw r1,(r11+12)
8002dd8: 29 62 00 14 lw r2,(r11+20)
8002ddc: b4 41 10 00 add r2,r2,r1
8002de0: 29 61 00 18 lw r1,(r11+24)
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
8002de4: c8 41 08 00 sub r1,r2,r1
8002de8: 37 82 00 14 addi r2,sp,20
8002dec: f8 00 0d a9 calli 8006490 <_Timespec_From_ticks>
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
8002df0: 78 03 08 01 mvhi r3,0x801
8002df4: 38 63 4e 30 ori r3,r3,0x4e30
8002df8: 28 62 00 00 lw r2,(r3+0)
8002dfc: 2b 81 00 14 lw r1,(sp+20)
8002e00: f8 00 43 57 calli 8013b5c <__mulsi3>
8002e04: b8 20 60 00 mv r12,r1
remaining += tp.tv_nsec / 1000;
8002e08: 2b 81 00 18 lw r1,(sp+24)
8002e0c: 34 02 03 e8 mvi r2,1000
8002e10: f8 00 43 5f calli 8013b8c <__divsi3>
8002e14: 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 ) {
8002e18: 45 a0 00 1a be r13,r0,8002e80 <ualarm+0x10c>
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
8002e1c: 78 03 08 01 mvhi r3,0x801
8002e20: 38 63 4e 30 ori r3,r3,0x4e30
8002e24: 28 62 00 00 lw r2,(r3+0)
8002e28: b9 a0 08 00 mv r1,r13
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
ticks = _Timespec_To_ticks( &tp );
8002e2c: 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;
8002e30: f8 00 43 b0 calli 8013cf0 <__udivsi3>
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
8002e34: 78 03 08 01 mvhi r3,0x801
8002e38: 38 63 4e 30 ori r3,r3,0x4e30
8002e3c: 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;
8002e40: 5b 81 00 14 sw (sp+20),r1
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
8002e44: b9 a0 08 00 mv r1,r13
8002e48: f8 00 43 ba calli 8013d30 <__umodsi3>
8002e4c: 34 02 03 e8 mvi r2,1000
8002e50: f8 00 43 43 calli 8013b5c <__mulsi3>
8002e54: 5b 81 00 18 sw (sp+24),r1
ticks = _Timespec_To_ticks( &tp );
8002e58: b9 60 08 00 mv r1,r11
8002e5c: f8 00 0d bb calli 8006548 <_Timespec_To_ticks>
if ( ticks == 0 )
ticks = 1;
_Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) );
8002e60: b9 60 08 00 mv r1,r11
8002e64: f8 00 0d b9 calli 8006548 <_Timespec_To_ticks>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8002e68: 78 02 08 01 mvhi r2,0x801
8002e6c: 38 42 71 98 ori r2,r2,0x7198
8002e70: 58 41 00 0c sw (r2+12),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8002e74: 78 01 08 01 mvhi r1,0x801
8002e78: 38 21 69 e8 ori r1,r1,0x69e8
8002e7c: f8 00 0e f0 calli 8006a3c <_Watchdog_Insert>
}
return remaining;
}
8002e80: b9 80 08 00 mv r1,r12
8002e84: 2b 9d 00 04 lw ra,(sp+4)
8002e88: 2b 8b 00 10 lw r11,(sp+16)
8002e8c: 2b 8c 00 0c lw r12,(sp+12)
8002e90: 2b 8d 00 08 lw r13,(sp+8)
8002e94: 37 9c 00 18 addi sp,sp,24
8002e98: c3 a0 00 00 ret