RTEMS 4.11Annotated Report
Mon Jan 10 11:01:46 2011
080155ec <_CORE_message_queue_Broadcast>:
Objects_Id id __attribute__((unused)),
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)),
#endif
uint32_t *count
)
{
80155ec: 37 9c ff e4 addi sp,sp,-28
80155f0: 5b 8b 00 1c sw (sp+28),r11
80155f4: 5b 8c 00 18 sw (sp+24),r12
80155f8: 5b 8d 00 14 sw (sp+20),r13
80155fc: 5b 8e 00 10 sw (sp+16),r14
8015600: 5b 8f 00 0c sw (sp+12),r15
8015604: 5b 90 00 08 sw (sp+8),r16
8015608: 5b 9d 00 04 sw (sp+4),ra
801560c: b8 40 80 00 mv r16,r2
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
8015610: 28 22 00 4c lw r2,(r1+76)
Objects_Id id __attribute__((unused)),
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)),
#endif
uint32_t *count
)
{
8015614: b8 20 58 00 mv r11,r1
8015618: b8 60 68 00 mv r13,r3
801561c: b8 c0 78 00 mv r15,r6
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE;
8015620: 34 01 00 01 mvi r1,1
{
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
8015624: 54 62 00 13 bgu r3,r2,8015670 <_CORE_message_queue_Broadcast+0x84><== NEVER TAKEN
* NOTE: This check is critical because threads can block on
* send and receive and this ensures that we are broadcasting
* the message to threads waiting to receive -- not to send.
*/
if ( the_message_queue->number_of_pending_messages != 0 ) {
8015628: 29 61 00 48 lw r1,(r11+72)
801562c: 34 0c 00 00 mvi r12,0
8015630: 44 20 00 0a be r1,r0,8015658 <_CORE_message_queue_Broadcast+0x6c>
*count = 0;
8015634: 58 c0 00 00 sw (r6+0),r0
8015638: e0 00 00 0d bi 801566c <_CORE_message_queue_Broadcast+0x80>
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
801563c: 29 c1 00 2c lw r1,(r14+44)
8015640: ba 00 10 00 mv r2,r16
8015644: b9 a0 18 00 mv r3,r13
8015648: f8 00 25 98 calli 801eca8 <memcpy>
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
801564c: 29 c1 00 28 lw r1,(r14+40)
*/
number_broadcasted = 0;
while ((the_thread =
_Thread_queue_Dequeue(&the_message_queue->Wait_queue))) {
waitp = &the_thread->Wait;
number_broadcasted += 1;
8015650: 35 8c 00 01 addi r12,r12,1
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
8015654: 58 2d 00 00 sw (r1+0),r13
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
8015658: b9 60 08 00 mv r1,r11
801565c: f8 00 0c f0 calli 8018a1c <_Thread_queue_Dequeue>
8015660: b8 20 70 00 mv r14,r1
8015664: 5c 20 ff f6 bne r1,r0,801563c <_CORE_message_queue_Broadcast+0x50>
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_message_queue_mp_support) ( the_thread, id );
#endif
}
*count = number_broadcasted;
8015668: 59 ec 00 00 sw (r15+0),r12
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
801566c: 34 01 00 00 mvi r1,0
}
8015670: 2b 9d 00 04 lw ra,(sp+4)
8015674: 2b 8b 00 1c lw r11,(sp+28)
8015678: 2b 8c 00 18 lw r12,(sp+24)
801567c: 2b 8d 00 14 lw r13,(sp+20)
8015680: 2b 8e 00 10 lw r14,(sp+16)
8015684: 2b 8f 00 0c lw r15,(sp+12)
8015688: 2b 90 00 08 lw r16,(sp+8)
801568c: 37 9c 00 1c addi sp,sp,28
8015690: c3 a0 00 00 ret
0800da64 <_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
)
{
800da64: 37 9c ff e4 addi sp,sp,-28
800da68: 5b 8b 00 1c sw (sp+28),r11
800da6c: 5b 8c 00 18 sw (sp+24),r12
800da70: 5b 8d 00 14 sw (sp+20),r13
800da74: 5b 8e 00 10 sw (sp+16),r14
800da78: 5b 8f 00 0c sw (sp+12),r15
800da7c: 5b 90 00 08 sw (sp+8),r16
800da80: 5b 9d 00 04 sw (sp+4),ra
800da84: 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;
800da88: 58 20 00 48 sw (r1+72),r0
the_message_queue->maximum_message_size = maximum_message_size;
800da8c: 58 24 00 4c sw (r1+76),r4
)
{
size_t message_buffering_required;
size_t allocated_message_size;
the_message_queue->maximum_pending_messages = maximum_pending_messages;
800da90: 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)) {
800da94: 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
)
{
800da98: b8 40 80 00 mv r16,r2
800da9c: 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)) {
800daa0: b8 80 60 00 mv r12,r4
800daa4: 44 20 00 06 be r1,r0,800dabc <_CORE_message_queue_Initialize+0x58>
allocated_message_size += sizeof(uint32_t);
800daa8: 34 8c 00 04 addi r12,r4,4
allocated_message_size &= ~(sizeof(uint32_t) - 1);
800daac: 34 01 ff fc mvi r1,-4
800dab0: a1 81 60 00 and r12,r12,r1
}
if (allocated_message_size < maximum_message_size)
return false;
800dab4: 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)
800dab8: 54 8c 00 1c bgu r4,r12,800db28 <_CORE_message_queue_Initialize+0xc4><== 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));
800dabc: 35 8f 00 10 addi r15,r12,16
/*
* 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 *
800dac0: b9 e0 08 00 mv r1,r15
800dac4: b9 c0 10 00 mv r2,r14
800dac8: f8 00 58 54 calli 8023c18 <__mulsi3>
(allocated_message_size + sizeof(CORE_message_queue_Buffer_control));
if (message_buffering_required < allocated_message_size)
return false;
800dacc: 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)
800dad0: 55 81 00 16 bgu r12,r1,800db28 <_CORE_message_queue_Initialize+0xc4><== NEVER TAKEN
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
_Workspace_Allocate( message_buffering_required );
800dad4: f8 00 0e 39 calli 80113b8 <_Workspace_Allocate>
return false;
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
800dad8: 59 61 00 5c sw (r11+92),r1
_Workspace_Allocate( message_buffering_required );
800dadc: b8 20 28 00 mv r5,r1
if (the_message_queue->message_buffers == 0)
800dae0: 44 20 00 12 be r1,r0,800db28 <_CORE_message_queue_Initialize+0xc4>
/*
* Initialize the pool of inactive messages, pending messages,
* and set of waiting threads.
*/
_Chain_Initialize (
800dae4: b8 a0 10 00 mv r2,r5
800dae8: 35 61 00 60 addi r1,r11,96
800daec: b9 c0 18 00 mv r3,r14
800daf0: b9 e0 20 00 mv r4,r15
800daf4: f8 00 16 e6 calli 801368c <_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 );
800daf8: 35 61 00 54 addi r1,r11,84
head->next = tail;
800dafc: 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 );
800db00: 35 61 00 50 addi r1,r11,80
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
800db04: 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;
800db08: 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(
800db0c: 2a 02 00 00 lw r2,(r16+0)
800db10: b9 60 08 00 mv r1,r11
800db14: 34 03 00 80 mvi r3,128
800db18: 64 42 00 01 cmpei r2,r2,1
800db1c: 34 04 00 06 mvi r4,6
800db20: f8 00 0b 04 calli 8010730 <_Thread_queue_Initialize>
THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
STATES_WAITING_FOR_MESSAGE,
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
);
return true;
800db24: 34 0d 00 01 mvi r13,1
}
800db28: b9 a0 08 00 mv r1,r13
800db2c: 2b 9d 00 04 lw ra,(sp+4)
800db30: 2b 8b 00 1c lw r11,(sp+28)
800db34: 2b 8c 00 18 lw r12,(sp+24)
800db38: 2b 8d 00 14 lw r13,(sp+20)
800db3c: 2b 8e 00 10 lw r14,(sp+16)
800db40: 2b 8f 00 0c lw r15,(sp+12)
800db44: 2b 90 00 08 lw r16,(sp+8)
800db48: 37 9c 00 1c addi sp,sp,28
800db4c: c3 a0 00 00 ret
0800db50 <_CORE_message_queue_Seize>:
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800db50: 37 9c ff f4 addi sp,sp,-12
800db54: 5b 8b 00 0c sw (sp+12),r11
800db58: 5b 8c 00 08 sw (sp+8),r12
800db5c: 5b 9d 00 04 sw (sp+4),ra
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
800db60: 78 07 08 02 mvhi r7,0x802
800db64: 38 e7 7b 88 ori r7,r7,0x7b88
800db68: 28 e7 00 0c lw r7,(r7+12)
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800db6c: b8 20 58 00 mv r11,r1
800db70: 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;
800db74: 58 e0 00 34 sw (r7+52),r0
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800db78: 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 );
800db7c: 90 00 40 00 rcsr r8,IE
800db80: 34 03 ff fe mvi r3,-2
800db84: a1 03 18 00 and r3,r8,r3
800db88: 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 );
}
800db8c: 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 );
800db90: 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))
800db94: 45 83 00 07 be r12,r3,800dbb0 <_CORE_message_queue_Seize+0x60>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
800db98: 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 );
800db9c: 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;
800dba0: 59 63 00 50 sw (r11+80),r3
new_first->previous = head;
800dba4: 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 ) {
800dba8: 5d 80 00 04 bne r12,r0,800dbb8 <_CORE_message_queue_Seize+0x68><== ALWAYS TAKEN
800dbac: e0 00 00 13 bi 800dbf8 <_CORE_message_queue_Seize+0xa8> <== NOT EXECUTED
)
{
if ( !_Chain_Is_empty(the_chain))
return _Chain_Get_first_unprotected(the_chain);
else
return NULL;
800dbb0: 34 0c 00 00 mvi r12,0
800dbb4: e0 00 00 11 bi 800dbf8 <_CORE_message_queue_Seize+0xa8>
the_message_queue->number_of_pending_messages -= 1;
800dbb8: 29 62 00 48 lw r2,(r11+72)
800dbbc: 34 42 ff ff addi r2,r2,-1
800dbc0: 59 62 00 48 sw (r11+72),r2
_ISR_Enable( level );
800dbc4: d0 08 00 00 wcsr IE,r8
*size_p = the_message->Contents.size;
_Thread_Executing->Wait.count =
800dbc8: 78 02 08 02 mvhi r2,0x802
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;
800dbcc: 29 83 00 08 lw r3,(r12+8)
_Thread_Executing->Wait.count =
800dbd0: 38 42 7b 88 ori r2,r2,0x7b88
800dbd4: 28 42 00 0c lw r2,(r2+12)
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;
800dbd8: 58 83 00 00 sw (r4+0),r3
_Thread_Executing->Wait.count =
800dbdc: 58 40 00 24 sw (r2+36),r0
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800dbe0: 35 82 00 0c addi r2,r12,12
800dbe4: f8 00 22 cb calli 8016710 <memcpy>
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 );
800dbe8: 35 61 00 60 addi r1,r11,96
800dbec: b9 80 10 00 mv r2,r12
800dbf0: fb ff ff 6d calli 800d9a4 <_Chain_Append>
/*
* There is not an API with blocking sends enabled.
* So return immediately.
*/
_CORE_message_queue_Free_message_buffer(the_message_queue, the_message);
return;
800dbf4: e0 00 00 12 bi 800dc3c <_CORE_message_queue_Seize+0xec>
return;
}
#endif
}
if ( !wait ) {
800dbf8: 5c ac 00 05 bne r5,r12,800dc0c <_CORE_message_queue_Seize+0xbc>
_ISR_Enable( level );
800dbfc: d0 08 00 00 wcsr IE,r8
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
800dc00: 34 01 00 04 mvi r1,4
800dc04: 58 e1 00 34 sw (r7+52),r1
return;
800dc08: e0 00 00 0d bi 800dc3c <_CORE_message_queue_Seize+0xec>
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;
800dc0c: 34 03 00 01 mvi r3,1
800dc10: 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;
800dc14: 58 eb 00 44 sw (r7+68),r11
executing->Wait.id = id;
800dc18: 58 e2 00 20 sw (r7+32),r2
executing->Wait.return_argument_second.mutable_object = buffer;
800dc1c: 58 e1 00 2c sw (r7+44),r1
executing->Wait.return_argument = size_p;
800dc20: 58 e4 00 28 sw (r7+40),r4
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
800dc24: d0 08 00 00 wcsr IE,r8
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
800dc28: 78 03 08 01 mvhi r3,0x801
800dc2c: b9 60 08 00 mv r1,r11
800dc30: b8 c0 10 00 mv r2,r6
800dc34: 38 63 08 70 ori r3,r3,0x870
800dc38: f8 00 09 d3 calli 8010384 <_Thread_queue_Enqueue_with_handler>
}
800dc3c: 2b 9d 00 04 lw ra,(sp+4)
800dc40: 2b 8b 00 0c lw r11,(sp+12)
800dc44: 2b 8c 00 08 lw r12,(sp+8)
800dc48: 37 9c 00 0c addi sp,sp,12
800dc4c: c3 a0 00 00 ret
080036a0 <_CORE_mutex_Seize>:
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
80036a0: 37 9c ff e8 addi sp,sp,-24
80036a4: 5b 8b 00 14 sw (sp+20),r11
80036a8: 5b 8c 00 10 sw (sp+16),r12
80036ac: 5b 8d 00 0c sw (sp+12),r13
80036b0: 5b 8e 00 08 sw (sp+8),r14
80036b4: 5b 9d 00 04 sw (sp+4),ra
80036b8: b8 20 58 00 mv r11,r1
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
80036bc: 78 01 08 01 mvhi r1,0x801
80036c0: 38 21 38 28 ori r1,r1,0x3828
80036c4: 28 21 00 00 lw r1,(r1+0)
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
80036c8: 5b 85 00 18 sw (sp+24),r5
80036cc: b8 40 70 00 mv r14,r2
80036d0: b8 80 68 00 mv r13,r4
80036d4: 20 6c 00 ff andi r12,r3,0xff
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
80036d8: 44 20 00 0b be r1,r0,8003704 <_CORE_mutex_Seize+0x64>
80036dc: 45 80 00 0a be r12,r0,8003704 <_CORE_mutex_Seize+0x64> <== NEVER TAKEN
80036e0: 78 01 08 01 mvhi r1,0x801
80036e4: 38 21 39 a0 ori r1,r1,0x39a0
80036e8: 28 21 00 00 lw r1,(r1+0)
80036ec: 34 02 00 01 mvi r2,1
80036f0: 50 41 00 05 bgeu r2,r1,8003704 <_CORE_mutex_Seize+0x64>
80036f4: 34 01 00 00 mvi r1,0
80036f8: 34 02 00 00 mvi r2,0
80036fc: 34 03 00 12 mvi r3,18
8003700: f8 00 02 2a calli 8003fa8 <_Internal_error_Occurred>
8003704: b9 60 08 00 mv r1,r11
8003708: 37 82 00 18 addi r2,sp,24
800370c: f8 00 15 90 calli 8008d4c <_CORE_mutex_Seize_interrupt_trylock>
8003710: 44 20 00 19 be r1,r0,8003774 <_CORE_mutex_Seize+0xd4>
8003714: 78 01 08 01 mvhi r1,0x801
8003718: 38 21 39 e8 ori r1,r1,0x39e8
800371c: 5d 80 00 07 bne r12,r0,8003738 <_CORE_mutex_Seize+0x98>
8003720: 2b 82 00 18 lw r2,(sp+24)
8003724: d0 02 00 00 wcsr IE,r2
8003728: 28 21 00 0c lw r1,(r1+12)
800372c: 34 02 00 01 mvi r2,1
8003730: 58 22 00 34 sw (r1+52),r2
8003734: e0 00 00 10 bi 8003774 <_CORE_mutex_Seize+0xd4>
8003738: 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;
800373c: 34 02 00 01 mvi r2,1
8003740: 59 62 00 30 sw (r11+48),r2
8003744: 58 2b 00 44 sw (r1+68),r11
8003748: 58 2e 00 20 sw (r1+32),r14
800374c: 78 01 08 01 mvhi r1,0x801
8003750: 38 21 38 28 ori r1,r1,0x3828
8003754: 28 22 00 00 lw r2,(r1+0)
8003758: 34 42 00 01 addi r2,r2,1
800375c: 58 22 00 00 sw (r1+0),r2
8003760: 2b 81 00 18 lw r1,(sp+24)
8003764: d0 01 00 00 wcsr IE,r1
8003768: b9 60 08 00 mv r1,r11
800376c: b9 a0 10 00 mv r2,r13
8003770: fb ff ff ab calli 800361c <_CORE_mutex_Seize_interrupt_blocking>
}
8003774: 2b 9d 00 04 lw ra,(sp+4)
8003778: 2b 8b 00 14 lw r11,(sp+20)
800377c: 2b 8c 00 10 lw r12,(sp+16)
8003780: 2b 8d 00 0c lw r13,(sp+12)
8003784: 2b 8e 00 08 lw r14,(sp+8)
8003788: 37 9c 00 18 addi sp,sp,24
800378c: c3 a0 00 00 ret
08008d4c <_CORE_mutex_Seize_interrupt_trylock>:
#if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__)
int _CORE_mutex_Seize_interrupt_trylock(
CORE_mutex_Control *the_mutex,
ISR_Level *level_p
)
{
8008d4c: 37 9c ff fc addi sp,sp,-4
8008d50: 5b 9d 00 04 sw (sp+4),ra
8008d54: b8 20 18 00 mv r3,r1
{
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
8008d58: 78 01 08 01 mvhi r1,0x801
8008d5c: 38 21 39 e8 ori r1,r1,0x39e8
8008d60: 28 24 00 0c lw r4,(r1+12)
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
8008d64: 28 61 00 50 lw r1,(r3+80)
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
8008d68: 58 80 00 34 sw (r4+52),r0
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
8008d6c: 44 20 00 31 be r1,r0,8008e30 <_CORE_mutex_Seize_interrupt_trylock+0xe4>
the_mutex->lock = CORE_MUTEX_LOCKED;
the_mutex->holder = executing;
the_mutex->holder_id = executing->Object.id;
8008d70: 28 81 00 08 lw r1,(r4+8)
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
the_mutex->lock = CORE_MUTEX_LOCKED;
8008d74: 58 60 00 50 sw (r3+80),r0
the_mutex->holder = executing;
8008d78: 58 64 00 5c sw (r3+92),r4
the_mutex->holder_id = executing->Object.id;
8008d7c: 58 61 00 60 sw (r3+96),r1
the_mutex->nest_count = 1;
8008d80: 34 01 00 01 mvi r1,1
8008d84: 58 61 00 54 sw (r3+84),r1
return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p );
}
8008d88: 28 61 00 48 lw r1,(r3+72)
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
8008d8c: 34 05 00 02 mvi r5,2
8008d90: 44 25 00 03 be r1,r5,8008d9c <_CORE_mutex_Seize_interrupt_trylock+0x50>
8008d94: 34 05 00 03 mvi r5,3
8008d98: 5c 25 00 06 bne r1,r5,8008db0 <_CORE_mutex_Seize_interrupt_trylock+0x64>
_Chain_Prepend_unprotected( &executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = executing->current_priority;
#endif
executing->resource_count++;
8008d9c: 28 85 00 1c lw r5,(r4+28)
8008da0: 34 a6 00 01 addi r6,r5,1
8008da4: 58 86 00 1c sw (r4+28),r6
}
if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
8008da8: 34 06 00 03 mvi r6,3
8008dac: 44 26 00 04 be r1,r6,8008dbc <_CORE_mutex_Seize_interrupt_trylock+0x70>
_ISR_Enable( *level_p );
8008db0: 28 41 00 00 lw r1,(r2+0)
8008db4: d0 01 00 00 wcsr IE,r1
8008db8: e0 00 00 2f bi 8008e74 <_CORE_mutex_Seize_interrupt_trylock+0x128>
*/
{
Priority_Control ceiling;
Priority_Control current;
ceiling = the_mutex->Attributes.priority_ceiling;
8008dbc: 28 66 00 4c lw r6,(r3+76)
current = executing->current_priority;
8008dc0: 28 81 00 14 lw r1,(r4+20)
if ( current == ceiling ) {
8008dc4: 5c 26 00 04 bne r1,r6,8008dd4 <_CORE_mutex_Seize_interrupt_trylock+0x88>
_ISR_Enable( *level_p );
8008dc8: 28 41 00 00 lw r1,(r2+0)
8008dcc: d0 01 00 00 wcsr IE,r1
8008dd0: e0 00 00 29 bi 8008e74 <_CORE_mutex_Seize_interrupt_trylock+0x128>
return 0;
}
if ( current > ceiling ) {
8008dd4: 50 c1 00 0e bgeu r6,r1,8008e0c <_CORE_mutex_Seize_interrupt_trylock+0xc0>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8008dd8: 78 01 08 01 mvhi r1,0x801
8008ddc: 38 21 38 28 ori r1,r1,0x3828
8008de0: 28 24 00 00 lw r4,(r1+0)
8008de4: 34 84 00 01 addi r4,r4,1
8008de8: 58 24 00 00 sw (r1+0),r4
_Thread_Disable_dispatch();
_ISR_Enable( *level_p );
8008dec: 28 41 00 00 lw r1,(r2+0)
8008df0: d0 01 00 00 wcsr IE,r1
_Thread_Change_priority(
8008df4: 28 61 00 5c lw r1,(r3+92)
8008df8: 28 62 00 4c lw r2,(r3+76)
8008dfc: 34 03 00 00 mvi r3,0
8008e00: fb ff f0 55 calli 8004f54 <_Thread_Change_priority>
the_mutex->holder,
the_mutex->Attributes.priority_ceiling,
false
);
_Thread_Enable_dispatch();
8008e04: fb ff f1 8a calli 800542c <_Thread_Enable_dispatch>
8008e08: e0 00 00 1b bi 8008e74 <_CORE_mutex_Seize_interrupt_trylock+0x128>
return 0;
}
/* if ( current < ceiling ) */ {
executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED;
8008e0c: 34 01 00 06 mvi r1,6
8008e10: 58 81 00 34 sw (r4+52),r1
the_mutex->lock = CORE_MUTEX_UNLOCKED;
8008e14: 34 01 00 01 mvi r1,1
8008e18: 58 61 00 50 sw (r3+80),r1
the_mutex->nest_count = 0; /* undo locking above */
8008e1c: 58 60 00 54 sw (r3+84),r0
executing->resource_count--; /* undo locking above */
8008e20: 58 85 00 1c sw (r4+28),r5
_ISR_Enable( *level_p );
8008e24: 28 41 00 00 lw r1,(r2+0)
8008e28: d0 01 00 00 wcsr IE,r1
8008e2c: e0 00 00 12 bi 8008e74 <_CORE_mutex_Seize_interrupt_trylock+0x128>
/*
* At this point, we know the mutex was not available. If this thread
* is the thread that has locked the mutex, let's see if we are allowed
* to nest access.
*/
if ( _Thread_Is_executing( the_mutex->holder ) ) {
8008e30: 28 65 00 5c lw r5,(r3+92)
/*
* The mutex is not available and the caller must deal with the possibility
* of blocking.
*/
return 1;
8008e34: 34 01 00 01 mvi r1,1
/*
* At this point, we know the mutex was not available. If this thread
* is the thread that has locked the mutex, let's see if we are allowed
* to nest access.
*/
if ( _Thread_Is_executing( the_mutex->holder ) ) {
8008e38: 5c a4 00 10 bne r5,r4,8008e78 <_CORE_mutex_Seize_interrupt_trylock+0x12c>
switch ( the_mutex->Attributes.lock_nesting_behavior ) {
8008e3c: 28 64 00 40 lw r4,(r3+64)
8008e40: 44 80 00 03 be r4,r0,8008e4c <_CORE_mutex_Seize_interrupt_trylock+0x100>
8008e44: 5c 81 00 0d bne r4,r1,8008e78 <_CORE_mutex_Seize_interrupt_trylock+0x12c><== ALWAYS TAKEN
8008e48: e0 00 00 07 bi 8008e64 <_CORE_mutex_Seize_interrupt_trylock+0x118><== NOT EXECUTED
case CORE_MUTEX_NESTING_ACQUIRES:
the_mutex->nest_count++;
8008e4c: 28 61 00 54 lw r1,(r3+84)
8008e50: 34 21 00 01 addi r1,r1,1
8008e54: 58 61 00 54 sw (r3+84),r1
_ISR_Enable( *level_p );
8008e58: 28 41 00 00 lw r1,(r2+0)
8008e5c: d0 01 00 00 wcsr IE,r1
8008e60: e0 00 00 05 bi 8008e74 <_CORE_mutex_Seize_interrupt_trylock+0x128>
return 0;
case CORE_MUTEX_NESTING_IS_ERROR:
executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
8008e64: 34 01 00 02 mvi r1,2 <== NOT EXECUTED
8008e68: 58 a1 00 34 sw (r5+52),r1 <== NOT EXECUTED
_ISR_Enable( *level_p );
8008e6c: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
8008e70: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED
return 0;
8008e74: 34 01 00 00 mvi r1,0
8008e78: 2b 9d 00 04 lw ra,(sp+4)
8008e7c: 37 9c 00 04 addi sp,sp,4
8008e80: c3 a0 00 00 ret
080038f0 <_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
)
{
80038f0: 37 9c ff f8 addi sp,sp,-8
80038f4: 5b 8b 00 08 sw (sp+8),r11
80038f8: 5b 9d 00 04 sw (sp+4),ra
80038fc: 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)) ) {
8003900: f8 00 07 b5 calli 80057d4 <_Thread_queue_Dequeue>
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
8003904: 34 02 00 00 mvi r2,0
if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
8003908: 5c 20 00 0d bne r1,r0,800393c <_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 );
800390c: 90 00 08 00 rcsr r1,IE
8003910: 34 02 ff fe mvi r2,-2
8003914: a0 22 10 00 and r2,r1,r2
8003918: d0 02 00 00 wcsr IE,r2
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
800391c: 29 63 00 48 lw r3,(r11+72)
8003920: 29 64 00 40 lw r4,(r11+64)
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
8003924: 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 )
8003928: 50 64 00 04 bgeu r3,r4,8003938 <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN
the_semaphore->count += 1;
800392c: 34 63 00 01 addi r3,r3,1
8003930: 59 63 00 48 sw (r11+72),r3
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
8003934: 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 );
8003938: d0 01 00 00 wcsr IE,r1
}
return status;
}
800393c: b8 40 08 00 mv r1,r2
8003940: 2b 9d 00 04 lw ra,(sp+4)
8003944: 2b 8b 00 08 lw r11,(sp+8)
8003948: 37 9c 00 08 addi sp,sp,8
800394c: c3 a0 00 00 ret
0800ce10 <_Event_Surrender>:
*/
void _Event_Surrender(
Thread_Control *the_thread
)
{
800ce10: 37 9c ff f8 addi sp,sp,-8
800ce14: 5b 8b 00 08 sw (sp+8),r11
800ce18: 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 ];
800ce1c: 28 24 01 18 lw r4,(r1+280)
option_set = (rtems_option) the_thread->Wait.option;
800ce20: 28 28 00 30 lw r8,(r1+48)
*/
void _Event_Surrender(
Thread_Control *the_thread
)
{
800ce24: 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 );
800ce28: 90 00 08 00 rcsr r1,IE
800ce2c: 34 07 ff fe mvi r7,-2
800ce30: a0 27 38 00 and r7,r1,r7
800ce34: d0 07 00 00 wcsr IE,r7
pending_events = api->pending_events;
800ce38: 28 85 00 00 lw r5,(r4+0)
event_condition = (rtems_event_set) the_thread->Wait.count;
800ce3c: 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 );
800ce40: 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 ) ) {
800ce44: 5c 40 00 03 bne r2,r0,800ce50 <_Event_Surrender+0x40>
_ISR_Enable( level );
800ce48: d0 01 00 00 wcsr IE,r1
return;
800ce4c: e0 00 00 3d bi 800cf40 <_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() &&
800ce50: 78 03 08 01 mvhi r3,0x801
800ce54: 38 63 8a 68 ori r3,r3,0x8a68
800ce58: 28 69 00 08 lw r9,(r3+8)
800ce5c: 45 20 00 1a be r9,r0,800cec4 <_Event_Surrender+0xb4>
800ce60: 28 63 00 0c lw r3,(r3+12)
800ce64: 5d 63 00 18 bne r11,r3,800cec4 <_Event_Surrender+0xb4>
_Thread_Is_executing( the_thread ) &&
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
800ce68: 78 03 08 01 mvhi r3,0x801
800ce6c: 38 63 8b c0 ori r3,r3,0x8bc0
800ce70: 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 ) &&
800ce74: 34 09 00 02 mvi r9,2
800ce78: 45 49 00 04 be r10,r9,800ce88 <_Event_Surrender+0x78> <== NEVER TAKEN
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
800ce7c: 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) ||
800ce80: 34 03 00 01 mvi r3,1
800ce84: 5d 23 00 10 bne r9,r3,800cec4 <_Event_Surrender+0xb4> <== NEVER TAKEN
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
800ce88: 44 46 00 03 be r2,r6,800ce94 <_Event_Surrender+0x84>
*/
RTEMS_INLINE_ROUTINE bool _Options_Is_any (
rtems_option option_set
)
{
return (option_set & RTEMS_EVENT_ANY) ? true : false;
800ce8c: 21 08 00 02 andi r8,r8,0x2
800ce90: 45 00 00 0b be r8,r0,800cebc <_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) );
800ce94: a4 40 18 00 not r3,r2
800ce98: 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;
800ce9c: 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 );
800cea0: 58 85 00 00 sw (r4+0),r5
the_thread->Wait.count = 0;
800cea4: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800cea8: 58 62 00 00 sw (r3+0),r2
_Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
800ceac: 78 02 08 01 mvhi r2,0x801
800ceb0: 38 42 8b c0 ori r2,r2,0x8bc0
800ceb4: 34 03 00 03 mvi r3,3
800ceb8: 58 43 00 00 sw (r2+0),r3
}
_ISR_Enable( level );
800cebc: d0 01 00 00 wcsr IE,r1
return;
800cec0: e0 00 00 20 bi 800cf40 <_Event_Surrender+0x130>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event (
States_Control the_states
)
{
return (the_states & STATES_WAITING_FOR_EVENT);
800cec4: 29 63 00 10 lw r3,(r11+16)
800cec8: 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 ) ) {
800cecc: 44 60 00 1c be r3,r0,800cf3c <_Event_Surrender+0x12c>
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
800ced0: 44 46 00 03 be r2,r6,800cedc <_Event_Surrender+0xcc>
800ced4: 21 08 00 02 andi r8,r8,0x2
800ced8: 45 00 00 19 be r8,r0,800cf3c <_Event_Surrender+0x12c> <== NEVER TAKEN
800cedc: a4 40 18 00 not r3,r2
800cee0: 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;
800cee4: 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 );
800cee8: 58 85 00 00 sw (r4+0),r5
the_thread->Wait.count = 0;
800ceec: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800cef0: 58 62 00 00 sw (r3+0),r2
_ISR_Flash( level );
800cef4: d0 01 00 00 wcsr IE,r1
800cef8: d0 07 00 00 wcsr IE,r7
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
800cefc: 29 63 00 50 lw r3,(r11+80)
800cf00: 34 02 00 02 mvi r2,2
800cf04: 44 62 00 03 be r3,r2,800cf10 <_Event_Surrender+0x100>
_ISR_Enable( level );
800cf08: d0 01 00 00 wcsr IE,r1
800cf0c: e0 00 00 06 bi 800cf24 <_Event_Surrender+0x114>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
800cf10: 34 02 00 03 mvi r2,3
800cf14: 59 62 00 50 sw (r11+80),r2
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
800cf18: d0 01 00 00 wcsr IE,r1
(void) _Watchdog_Remove( &the_thread->Timer );
800cf1c: 35 61 00 48 addi r1,r11,72
800cf20: fb ff eb 0a calli 8007b48 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800cf24: 78 03 08 01 mvhi r3,0x801
800cf28: 38 63 6e ec ori r3,r3,0x6eec
800cf2c: 28 62 00 00 lw r2,(r3+0)
800cf30: b9 60 08 00 mv r1,r11
800cf34: f8 00 05 6d calli 800e4e8 <_Thread_Clear_state>
800cf38: e0 00 00 02 bi 800cf40 <_Event_Surrender+0x130>
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
800cf3c: d0 01 00 00 wcsr IE,r1
}
800cf40: 2b 9d 00 04 lw ra,(sp+4)
800cf44: 2b 8b 00 08 lw r11,(sp+8)
800cf48: 37 9c 00 08 addi sp,sp,8
800cf4c: c3 a0 00 00 ret
0800cf50 <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *ignored
)
{
800cf50: 37 9c ff f8 addi sp,sp,-8
800cf54: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
ISR_Level level;
the_thread = _Thread_Get( id, &location );
800cf58: 37 82 00 08 addi r2,sp,8
800cf5c: fb ff e6 61 calli 80068e0 <_Thread_Get>
switch ( location ) {
800cf60: 2b 82 00 08 lw r2,(sp+8)
800cf64: 5c 40 00 1d bne r2,r0,800cfd8 <_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 );
800cf68: 90 00 18 00 rcsr r3,IE
800cf6c: 34 02 ff fe mvi r2,-2
800cf70: a0 62 10 00 and r2,r3,r2
800cf74: d0 02 00 00 wcsr IE,r2
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
800cf78: 78 02 08 01 mvhi r2,0x801
800cf7c: 38 42 8a 68 ori r2,r2,0x8a68
return;
}
#endif
the_thread->Wait.count = 0;
if ( _Thread_Is_executing( the_thread ) ) {
800cf80: 28 42 00 0c lw r2,(r2+12)
_ISR_Enable( level );
return;
}
#endif
the_thread->Wait.count = 0;
800cf84: 58 20 00 24 sw (r1+36),r0
if ( _Thread_Is_executing( the_thread ) ) {
800cf88: 5c 22 00 08 bne r1,r2,800cfa8 <_Event_Timeout+0x58>
if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
800cf8c: 78 02 08 01 mvhi r2,0x801
800cf90: 38 42 8b c0 ori r2,r2,0x8bc0
800cf94: 28 45 00 00 lw r5,(r2+0)
800cf98: 34 04 00 01 mvi r4,1
800cf9c: 5c a4 00 03 bne r5,r4,800cfa8 <_Event_Timeout+0x58>
_Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
800cfa0: 34 04 00 02 mvi r4,2
800cfa4: 58 44 00 00 sw (r2+0),r4
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
800cfa8: 34 02 00 06 mvi r2,6
800cfac: 58 22 00 34 sw (r1+52),r2
_ISR_Enable( level );
800cfb0: d0 03 00 00 wcsr IE,r3
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800cfb4: 78 03 08 01 mvhi r3,0x801
800cfb8: 38 63 6e ec ori r3,r3,0x6eec
800cfbc: 28 62 00 00 lw r2,(r3+0)
800cfc0: f8 00 05 4a calli 800e4e8 <_Thread_Clear_state>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
800cfc4: 78 01 08 01 mvhi r1,0x801
800cfc8: 38 21 88 a8 ori r1,r1,0x88a8
800cfcc: 28 22 00 00 lw r2,(r1+0)
800cfd0: 34 42 ff ff addi r2,r2,-1
800cfd4: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
800cfd8: 2b 9d 00 04 lw ra,(sp+4)
800cfdc: 37 9c 00 08 addi sp,sp,8
800cfe0: c3 a0 00 00 ret
080092e4 <_Heap_Extend>:
Heap_Control *heap,
void *extend_area_begin_ptr,
uintptr_t extend_area_size,
uintptr_t *extended_size_ptr
)
{
80092e4: 37 9c ff b8 addi sp,sp,-72
80092e8: 5b 8b 00 40 sw (sp+64),r11
80092ec: 5b 8c 00 3c sw (sp+60),r12
80092f0: 5b 8d 00 38 sw (sp+56),r13
80092f4: 5b 8e 00 34 sw (sp+52),r14
80092f8: 5b 8f 00 30 sw (sp+48),r15
80092fc: 5b 90 00 2c sw (sp+44),r16
8009300: 5b 91 00 28 sw (sp+40),r17
8009304: 5b 92 00 24 sw (sp+36),r18
8009308: 5b 93 00 20 sw (sp+32),r19
800930c: 5b 94 00 1c sw (sp+28),r20
8009310: 5b 95 00 18 sw (sp+24),r21
8009314: 5b 96 00 14 sw (sp+20),r22
8009318: 5b 97 00 10 sw (sp+16),r23
800931c: 5b 98 00 0c sw (sp+12),r24
8009320: 5b 99 00 08 sw (sp+8),r25
8009324: 5b 9d 00 04 sw (sp+4),ra
8009328: 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;
800932c: 5b 80 00 48 sw (sp+72),r0
Heap_Block *extend_last_block = NULL;
8009330: 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;
8009334: 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
)
{
8009338: b8 80 a0 00 mv r20,r4
800933c: b8 20 58 00 mv r11,r1
8009340: b8 60 10 00 mv r2,r3
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const first_block = heap->first_block;
8009344: 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;
8009348: 28 36 00 10 lw r22,(r1+16)
uintptr_t const min_block_size = heap->min_block_size;
800934c: 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;
8009350: 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;
8009354: 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 ) {
8009358: 55 cd 00 8e bgu r14,r13,8009590 <_Heap_Extend+0x2ac>
return false;
}
extend_area_ok = _Heap_Get_first_and_last_block(
800935c: b9 c0 08 00 mv r1,r14
8009360: ba c0 18 00 mv r3,r22
8009364: 37 85 00 48 addi r5,sp,72
8009368: 37 86 00 44 addi r6,sp,68
800936c: fb ff ea ef calli 8003f28 <_Heap_Get_first_and_last_block>
page_size,
min_block_size,
&extend_first_block,
&extend_last_block
);
if (!extend_area_ok ) {
8009370: 44 20 00 88 be r1,r0,8009590 <_Heap_Extend+0x2ac>
8009374: ba a0 78 00 mv r15,r21
8009378: 34 11 00 00 mvi r17,0
800937c: 34 13 00 00 mvi r19,0
8009380: 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;
8009384: 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;
8009388: 34 18 ff fe mvi r24,-2
800938c: e0 00 00 02 bi 8009394 <_Heap_Extend+0xb0>
8009390: b9 e0 08 00 mv r1,r15
uintptr_t const sub_area_end = start_block->prev_size;
8009394: 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
8009398: f5 a1 18 00 cmpgu r3,r13,r1
800939c: 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 (
80093a0: a0 62 10 00 and r2,r3,r2
80093a4: 5c 40 00 7a bne r2,r0,800958c <_Heap_Extend+0x2a8>
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
}
if ( extend_area_end == sub_area_begin ) {
80093a8: 45 a1 00 03 be r13,r1,80093b4 <_Heap_Extend+0xd0> <== NEVER TAKEN
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
80093ac: 56 4d 00 04 bgu r18,r13,80093bc <_Heap_Extend+0xd8>
80093b0: e0 00 00 04 bi 80093c0 <_Heap_Extend+0xdc>
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
}
if ( extend_area_end == sub_area_begin ) {
80093b4: b9 e0 80 00 mv r16,r15 <== NOT EXECUTED
80093b8: e0 00 00 02 bi 80093c0 <_Heap_Extend+0xdc> <== NOT EXECUTED
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
80093bc: 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);
80093c0: ba 40 08 00 mv r1,r18
80093c4: ba c0 10 00 mv r2,r22
80093c8: 36 59 ff f8 addi r25,r18,-8
80093cc: f8 00 1e de calli 8010f44 <__umodsi3>
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
80093d0: cb 21 08 00 sub r1,r25,r1
link_below_block = start_block;
}
if ( sub_area_end == extend_area_begin ) {
80093d4: 5d d2 00 04 bne r14,r18,80093e4 <_Heap_Extend+0x100>
start_block->prev_size = extend_area_end;
80093d8: 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 )
80093dc: b8 20 60 00 mv r12,r1
80093e0: e0 00 00 04 bi 80093f0 <_Heap_Extend+0x10c>
merge_above_block = end_block;
} else if ( sub_area_end < extend_area_begin ) {
80093e4: 55 d2 00 02 bgu r14,r18,80093ec <_Heap_Extend+0x108>
80093e8: e0 00 00 02 bi 80093f0 <_Heap_Extend+0x10c>
80093ec: 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;
80093f0: 28 2f 00 04 lw r15,(r1+4)
80093f4: 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);
80093f8: 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 );
80093fc: 5d f5 ff e5 bne r15,r21,8009390 <_Heap_Extend+0xac>
if ( extend_area_begin < heap->area_begin ) {
8009400: 29 61 00 18 lw r1,(r11+24)
8009404: 51 c1 00 03 bgeu r14,r1,8009410 <_Heap_Extend+0x12c>
heap->area_begin = extend_area_begin;
8009408: 59 6e 00 18 sw (r11+24),r14
800940c: e0 00 00 04 bi 800941c <_Heap_Extend+0x138>
} else if ( heap->area_end < extend_area_end ) {
8009410: 29 61 00 1c lw r1,(r11+28)
8009414: 50 2d 00 02 bgeu r1,r13,800941c <_Heap_Extend+0x138>
heap->area_end = extend_area_end;
8009418: 59 6d 00 1c sw (r11+28),r13
}
extend_first_block_size =
(uintptr_t) extend_last_block - (uintptr_t) extend_first_block;
800941c: 2b 81 00 44 lw r1,(sp+68)
8009420: 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 =
8009424: 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;
8009428: 58 4d 00 00 sw (r2+0),r13
extend_first_block->size_and_flag =
extend_first_block_size | HEAP_PREV_BLOCK_USED;
800942c: 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;
8009430: 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 ) {
8009434: 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 =
8009438: 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;
800943c: 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 ) {
8009440: 50 43 00 03 bgeu r2,r3,800944c <_Heap_Extend+0x168>
heap->first_block = extend_first_block;
8009444: 59 62 00 20 sw (r11+32),r2
8009448: e0 00 00 04 bi 8009458 <_Heap_Extend+0x174>
} else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) {
800944c: 29 62 00 24 lw r2,(r11+36)
8009450: 50 41 00 02 bgeu r2,r1,8009458 <_Heap_Extend+0x174>
heap->last_block = extend_last_block;
8009454: 59 61 00 24 sw (r11+36),r1
}
if ( merge_below_block != NULL ) {
8009458: 46 00 00 12 be r16,r0,80094a0 <_Heap_Extend+0x1bc> <== ALWAYS TAKEN
Heap_Control *heap,
uintptr_t extend_area_begin,
Heap_Block *first_block
)
{
uintptr_t const page_size = heap->page_size;
800945c: 29 6f 00 10 lw r15,(r11+16) <== NOT EXECUTED
uintptr_t const new_first_block_alloc_begin =
_Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size );
8009460: 35 ce 00 08 addi r14,r14,8 <== NOT EXECUTED
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up(
uintptr_t value,
uintptr_t alignment
)
{
uintptr_t remainder = value % alignment;
8009464: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
8009468: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
800946c: f8 00 1e b6 calli 8010f44 <__umodsi3> <== NOT EXECUTED
if ( remainder != 0 ) {
8009470: 44 20 00 03 be r1,r0,800947c <_Heap_Extend+0x198> <== NOT EXECUTED
return value - remainder + alignment;
8009474: b5 cf 70 00 add r14,r14,r15 <== NOT EXECUTED
8009478: c9 c1 70 00 sub r14,r14,r1 <== NOT EXECUTED
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
800947c: 2a 01 00 00 lw r1,(r16+0) <== NOT EXECUTED
)
{
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 =
8009480: 35 c2 ff f8 addi r2,r14,-8 <== NOT EXECUTED
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
8009484: 59 c1 ff f8 sw (r14+-8),r1 <== NOT EXECUTED
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 =
8009488: ca 02 08 00 sub r1,r16,r2 <== NOT EXECUTED
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;
800948c: 38 21 00 01 ori r1,r1,0x1 <== NOT EXECUTED
8009490: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED
_Heap_Free_block( heap, new_first_block );
8009494: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8009498: fb ff ff 86 calli 80092b0 <_Heap_Free_block> <== NOT EXECUTED
800949c: e0 00 00 06 bi 80094b4 <_Heap_Extend+0x1d0> <== NOT EXECUTED
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 ) {
80094a0: 46 70 00 05 be r19,r16,80094b4 <_Heap_Extend+0x1d0>
_Heap_Link_below(
80094a4: 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;
80094a8: ca 61 98 00 sub r19,r19,r1
80094ac: 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 =
80094b0: 58 33 00 04 sw (r1+4),r19
link_below_block,
extend_last_block
);
}
if ( merge_above_block != NULL ) {
80094b4: 45 80 00 14 be r12,r0,8009504 <_Heap_Extend+0x220>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
80094b8: 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,
80094bc: 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(
80094c0: c9 ac 68 00 sub r13,r13,r12
80094c4: b9 a0 08 00 mv r1,r13
80094c8: f8 00 1e 9f calli 8010f44 <__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)
80094cc: 29 83 00 04 lw r3,(r12+4)
80094d0: 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 =
80094d4: b4 2c 10 00 add r2,r1,r12
(last_block->size_and_flag - last_block_new_size)
80094d8: c8 61 18 00 sub r3,r3,r1
| HEAP_PREV_BLOCK_USED;
80094dc: 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 =
80094e0: 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;
80094e4: 29 82 00 04 lw r2,(r12+4)
80094e8: 20 42 00 01 andi r2,r2,0x1
block->size_and_flag = size | flag;
80094ec: b8 22 08 00 or r1,r1,r2
80094f0: 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 );
80094f4: b9 80 10 00 mv r2,r12
80094f8: b9 60 08 00 mv r1,r11
80094fc: fb ff ff 6d calli 80092b0 <_Heap_Free_block>
8009500: e0 00 00 0c bi 8009530 <_Heap_Extend+0x24c>
);
}
if ( merge_above_block != NULL ) {
_Heap_Merge_above( heap, merge_above_block, extend_area_end );
} else if ( link_above_block != NULL ) {
8009504: 46 2c 00 0b be r17,r12,8009530 <_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;
8009508: 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 );
800950c: 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(
8009510: 2b 82 00 44 lw r2,(sp+68)
8009514: 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 );
8009518: c8 71 18 00 sub r3,r3,r17
block->size_and_flag = size | flag;
800951c: b8 61 08 00 or r1,r3,r1
8009520: 5a 21 00 04 sw (r17+4),r1
last_block->size_and_flag |= HEAP_PREV_BLOCK_USED;
8009524: 28 41 00 04 lw r1,(r2+4)
8009528: 38 21 00 01 ori r1,r1,0x1
800952c: 58 41 00 04 sw (r2+4),r1
extend_first_block,
extend_last_block
);
}
if ( merge_below_block == NULL && merge_above_block == NULL ) {
8009530: 65 8c 00 00 cmpei r12,r12,0
8009534: 66 10 00 00 cmpei r16,r16,0
8009538: a1 90 60 00 and r12,r12,r16
800953c: 45 80 00 04 be r12,r0,800954c <_Heap_Extend+0x268>
_Heap_Free_block( heap, extend_first_block );
8009540: 2b 82 00 48 lw r2,(sp+72)
8009544: b9 60 08 00 mv r1,r11
8009548: fb ff ff 5a calli 80092b0 <_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
800954c: 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(
8009550: 29 63 00 20 lw r3,(r11+32)
stats->size += extended_size;
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
8009554: 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;
8009558: 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(
800955c: 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;
8009560: 20 42 00 01 andi r2,r2,0x1
block->size_and_flag = size | flag;
8009564: b8 62 10 00 or r2,r3,r2
8009568: 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;
800956c: 29 61 00 30 lw r1,(r11+48)
/* Statistics */
stats->size += extended_size;
8009570: 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;
8009574: c8 37 08 00 sub r1,r1,r23
/* Statistics */
stats->size += extended_size;
8009578: b4 41 10 00 add r2,r2,r1
800957c: 59 62 00 2c sw (r11+44),r2
if ( extended_size_ptr != NULL )
8009580: 46 80 00 04 be r20,r0,8009590 <_Heap_Extend+0x2ac> <== NEVER TAKEN
*extended_size_ptr = extended_size;
8009584: 5a 81 00 00 sw (r20+0),r1
8009588: e0 00 00 02 bi 8009590 <_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;
800958c: 34 0c 00 00 mvi r12,0
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
}
8009590: b9 80 08 00 mv r1,r12
8009594: 2b 9d 00 04 lw ra,(sp+4)
8009598: 2b 8b 00 40 lw r11,(sp+64)
800959c: 2b 8c 00 3c lw r12,(sp+60)
80095a0: 2b 8d 00 38 lw r13,(sp+56)
80095a4: 2b 8e 00 34 lw r14,(sp+52)
80095a8: 2b 8f 00 30 lw r15,(sp+48)
80095ac: 2b 90 00 2c lw r16,(sp+44)
80095b0: 2b 91 00 28 lw r17,(sp+40)
80095b4: 2b 92 00 24 lw r18,(sp+36)
80095b8: 2b 93 00 20 lw r19,(sp+32)
80095bc: 2b 94 00 1c lw r20,(sp+28)
80095c0: 2b 95 00 18 lw r21,(sp+24)
80095c4: 2b 96 00 14 lw r22,(sp+20)
80095c8: 2b 97 00 10 lw r23,(sp+16)
80095cc: 2b 98 00 0c lw r24,(sp+12)
80095d0: 2b 99 00 08 lw r25,(sp+8)
80095d4: 37 9c 00 48 addi sp,sp,72
80095d8: c3 a0 00 00 ret
0800913c <_Heap_Free>:
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
800913c: 37 9c ff f4 addi sp,sp,-12
8009140: 5b 8b 00 0c sw (sp+12),r11
8009144: 5b 8c 00 08 sw (sp+8),r12
8009148: 5b 9d 00 04 sw (sp+4),ra
800914c: b8 20 58 00 mv r11,r1
8009150: 34 4c ff f8 addi r12,r2,-8
8009154: b8 40 08 00 mv r1,r2
8009158: 29 62 00 10 lw r2,(r11+16)
800915c: f8 00 1e 92 calli 8010ba4 <__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
8009160: 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);
8009164: 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;
8009168: 34 01 00 00 mvi r1,0
800916c: 54 e3 00 03 bgu r7,r3,8009178 <_Heap_Free+0x3c>
8009170: 29 61 00 24 lw r1,(r11+36)
8009174: f0 23 08 00 cmpgeu r1,r1,r3
uintptr_t next_block_size = 0;
bool next_is_free = false;
_Heap_Protection_block_check( heap, block );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
8009178: b8 20 10 00 mv r2,r1
return false;
800917c: 34 01 00 00 mvi r1,0
uintptr_t next_block_size = 0;
bool next_is_free = false;
_Heap_Protection_block_check( heap, block );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
8009180: 44 40 00 66 be r2,r0,8009318 <_Heap_Free+0x1dc>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
8009184: 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;
8009188: 34 04 ff fe mvi r4,-2
800918c: 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);
8009190: 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;
8009194: 54 e2 00 03 bgu r7,r2,80091a0 <_Heap_Free+0x64> <== NEVER TAKEN
8009198: 29 61 00 24 lw r1,(r11+36)
800919c: f0 22 08 00 cmpgeu r1,r1,r2
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
80091a0: b8 20 28 00 mv r5,r1
_HAssert( false );
return false;
80091a4: 34 01 00 00 mvi r1,0
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
80091a8: 44 a0 00 5c be r5,r0,8009318 <_Heap_Free+0x1dc> <== NEVER TAKEN
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
80091ac: 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;
80091b0: 20 a8 00 01 andi r8,r5,0x1
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
_HAssert( false );
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
80091b4: 45 00 00 59 be r8,r0,8009318 <_Heap_Free+0x1dc> <== 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
80091b8: 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;
80091bc: 34 01 ff fe mvi r1,-2
80091c0: a0 a1 28 00 and r5,r5,r1
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
80091c4: 34 08 00 00 mvi r8,0
80091c8: 45 22 00 05 be r9,r2,80091dc <_Heap_Free+0xa0>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
80091cc: 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;
80091d0: 28 28 00 04 lw r8,(r1+4)
80091d4: 21 08 00 01 andi r8,r8,0x1
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
80091d8: 65 08 00 00 cmpei r8,r8,0
80091dc: 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
80091e0: 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 ) ) {
80091e4: 5c c0 00 24 bne r6,r0,8009274 <_Heap_Free+0x138>
uintptr_t const prev_size = block->prev_size;
80091e8: 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;
80091ec: 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);
80091f0: 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;
80091f4: 54 e3 00 02 bgu r7,r3,80091fc <_Heap_Free+0xc0> <== NEVER TAKEN
80091f8: 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 ) ) {
80091fc: b8 20 38 00 mv r7,r1
_HAssert( false );
return( false );
8009200: 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 ) ) {
8009204: 44 e0 00 45 be r7,r0,8009318 <_Heap_Free+0x1dc> <== NEVER TAKEN
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
8009208: 28 67 00 04 lw r7,(r3+4)
800920c: 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) ) {
8009210: 44 e0 00 42 be r7,r0,8009318 <_Heap_Free+0x1dc> <== NEVER TAKEN
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
8009214: 45 00 00 0f be r8,r0,8009250 <_Heap_Free+0x114>
return _Heap_Free_list_tail(heap)->prev;
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
8009218: 28 41 00 08 lw r1,(r2+8)
Heap_Block *prev = block->prev;
800921c: 28 42 00 0c lw r2,(r2+12)
uintptr_t const size = block_size + prev_size + next_block_size;
8009220: b4 85 28 00 add r5,r4,r5
8009224: b4 a6 30 00 add r6,r5,r6
prev->next = next;
8009228: 58 41 00 08 sw (r2+8),r1
next->prev = prev;
800922c: 58 22 00 0c sw (r1+12),r2
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
8009230: 29 61 00 38 lw r1,(r11+56)
8009234: 34 21 ff ff addi r1,r1,-1
8009238: 59 61 00 38 sw (r11+56),r1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800923c: 38 c1 00 01 ori r1,r6,0x1
8009240: 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;
8009244: b4 66 18 00 add r3,r3,r6
8009248: 58 66 00 00 sw (r3+0),r6
800924c: e0 00 00 29 bi 80092f0 <_Heap_Free+0x1b4>
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
8009250: b4 86 30 00 add r6,r4,r6
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
8009254: 38 c1 00 01 ori r1,r6,0x1
8009258: 58 61 00 04 sw (r3+4),r1
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
800925c: 28 43 00 04 lw r3,(r2+4)
8009260: 34 01 ff fe mvi r1,-2
next_block->prev_size = size;
8009264: 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;
8009268: a0 61 08 00 and r1,r3,r1
800926c: 58 41 00 04 sw (r2+4),r1
8009270: e0 00 00 20 bi 80092f0 <_Heap_Free+0x1b4>
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
8009274: 45 00 00 0d be r8,r0,80092a8 <_Heap_Free+0x16c>
uintptr_t const size = block_size + next_block_size;
8009278: 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;
800927c: 28 45 00 08 lw r5,(r2+8)
Heap_Block *prev = old_block->prev;
8009280: 28 42 00 0c lw r2,(r2+12)
new_block->next = next;
8009284: 58 65 00 08 sw (r3+8),r5
new_block->prev = prev;
8009288: 58 62 00 0c sw (r3+12),r2
next->prev = new_block;
prev->next = new_block;
800928c: 58 43 00 08 sw (r2+8),r3
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
8009290: 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;
8009294: 58 a3 00 0c sw (r5+12),r3
8009298: 58 62 00 04 sw (r3+4),r2
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
800929c: b4 61 18 00 add r3,r3,r1
80092a0: 58 61 00 00 sw (r3+0),r1
80092a4: e0 00 00 13 bi 80092f0 <_Heap_Free+0x1b4>
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
80092a8: 29 61 00 08 lw r1,(r11+8)
new_block->next = next;
new_block->prev = block_before;
80092ac: 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;
80092b0: 58 44 00 00 sw (r2+0),r4
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
80092b4: 58 61 00 08 sw (r3+8),r1
new_block->prev = block_before;
block_before->next = new_block;
next->prev = new_block;
80092b8: 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;
80092bc: 38 81 00 01 ori r1,r4,0x1
80092c0: 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;
80092c4: 59 63 00 08 sw (r11+8),r3
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
80092c8: 28 43 00 04 lw r3,(r2+4)
80092cc: 34 01 ff fe mvi r1,-2
80092d0: a0 61 08 00 and r1,r3,r1
80092d4: 58 41 00 04 sw (r2+4),r1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
80092d8: 29 61 00 38 lw r1,(r11+56)
if ( stats->max_free_blocks < stats->free_blocks ) {
80092dc: 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;
80092e0: 34 21 00 01 addi r1,r1,1
80092e4: 59 61 00 38 sw (r11+56),r1
if ( stats->max_free_blocks < stats->free_blocks ) {
80092e8: 50 41 00 02 bgeu r2,r1,80092f0 <_Heap_Free+0x1b4>
stats->max_free_blocks = stats->free_blocks;
80092ec: 59 61 00 3c sw (r11+60),r1
}
}
/* Statistics */
--stats->used_blocks;
80092f0: 29 61 00 40 lw r1,(r11+64)
80092f4: 34 21 ff ff addi r1,r1,-1
80092f8: 59 61 00 40 sw (r11+64),r1
++stats->frees;
80092fc: 29 61 00 50 lw r1,(r11+80)
8009300: 34 21 00 01 addi r1,r1,1
8009304: 59 61 00 50 sw (r11+80),r1
stats->free_size += block_size;
8009308: 29 61 00 30 lw r1,(r11+48)
800930c: b4 24 20 00 add r4,r1,r4
8009310: 59 64 00 30 sw (r11+48),r4
return( true );
8009314: 34 01 00 01 mvi r1,1
}
8009318: 2b 9d 00 04 lw ra,(sp+4)
800931c: 2b 8b 00 0c lw r11,(sp+12)
8009320: 2b 8c 00 08 lw r12,(sp+8)
8009324: 37 9c 00 0c addi sp,sp,12
8009328: c3 a0 00 00 ret
08011588 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
8011588: 37 9c ff ec addi sp,sp,-20
801158c: 5b 8b 00 14 sw (sp+20),r11
8011590: 5b 8c 00 10 sw (sp+16),r12
8011594: 5b 8d 00 0c sw (sp+12),r13
8011598: 5b 8e 00 08 sw (sp+8),r14
801159c: 5b 9d 00 04 sw (sp+4),ra
80115a0: 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);
80115a4: 34 4e ff f8 addi r14,r2,-8
80115a8: b8 40 08 00 mv r1,r2
80115ac: b8 40 60 00 mv r12,r2
80115b0: 29 62 00 10 lw r2,(r11+16)
80115b4: b8 60 68 00 mv r13,r3
80115b8: fb ff fd 7b calli 8010ba4 <__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
80115bc: 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);
80115c0: 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;
80115c4: 34 01 00 00 mvi r1,0
80115c8: 54 44 00 03 bgu r2,r4,80115d4 <_Heap_Size_of_alloc_area+0x4c>
80115cc: 29 61 00 24 lw r1,(r11+36)
80115d0: 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 ) ) {
80115d4: b8 20 18 00 mv r3,r1
return false;
80115d8: 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 ) ) {
80115dc: 44 60 00 13 be r3,r0,8011628 <_Heap_Size_of_alloc_area+0xa0>
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
80115e0: 28 83 00 04 lw r3,(r4+4)
80115e4: 34 01 ff fe mvi r1,-2
80115e8: 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);
80115ec: 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;
80115f0: 34 01 00 00 mvi r1,0
80115f4: 54 44 00 03 bgu r2,r4,8011600 <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN
80115f8: 29 61 00 24 lw r1,(r11+36)
80115fc: f0 24 08 00 cmpgeu r1,r1,r4
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
8011600: b8 20 10 00 mv r2,r1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
8011604: 34 01 00 00 mvi r1,0
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
8011608: 44 40 00 08 be r2,r0,8011628 <_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;
801160c: 28 82 00 04 lw r2,(r4+4)
8011610: 20 42 00 01 andi r2,r2,0x1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
8011614: 44 40 00 05 be r2,r0,8011628 <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
8011618: c8 8c 20 00 sub r4,r4,r12
801161c: 34 84 00 04 addi r4,r4,4
8011620: 59 a4 00 00 sw (r13+0),r4
return true;
8011624: 34 01 00 01 mvi r1,1
}
8011628: 2b 9d 00 04 lw ra,(sp+4)
801162c: 2b 8b 00 14 lw r11,(sp+20)
8011630: 2b 8c 00 10 lw r12,(sp+16)
8011634: 2b 8d 00 0c lw r13,(sp+12)
8011638: 2b 8e 00 08 lw r14,(sp+8)
801163c: 37 9c 00 14 addi sp,sp,20
8011640: c3 a0 00 00 ret
08004ba4 <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
8004ba4: 37 9c ff a0 addi sp,sp,-96
8004ba8: 5b 8b 00 50 sw (sp+80),r11
8004bac: 5b 8c 00 4c sw (sp+76),r12
8004bb0: 5b 8d 00 48 sw (sp+72),r13
8004bb4: 5b 8e 00 44 sw (sp+68),r14
8004bb8: 5b 8f 00 40 sw (sp+64),r15
8004bbc: 5b 90 00 3c sw (sp+60),r16
8004bc0: 5b 91 00 38 sw (sp+56),r17
8004bc4: 5b 92 00 34 sw (sp+52),r18
8004bc8: 5b 93 00 30 sw (sp+48),r19
8004bcc: 5b 94 00 2c sw (sp+44),r20
8004bd0: 5b 95 00 28 sw (sp+40),r21
8004bd4: 5b 96 00 24 sw (sp+36),r22
8004bd8: 5b 97 00 20 sw (sp+32),r23
8004bdc: 5b 98 00 1c sw (sp+28),r24
8004be0: 5b 99 00 18 sw (sp+24),r25
8004be4: 5b 9b 00 14 sw (sp+20),fp
8004be8: 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;
8004bec: 78 0d 08 00 mvhi r13,0x800
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
8004bf0: 20 63 00 ff andi r3,r3,0xff
8004bf4: b8 20 60 00 mv r12,r1
8004bf8: b8 40 70 00 mv r14,r2
uintptr_t const page_size = heap->page_size;
8004bfc: 28 33 00 10 lw r19,(r1+16)
uintptr_t const min_block_size = heap->min_block_size;
8004c00: 28 35 00 14 lw r21,(r1+20)
Heap_Block *const first_block = heap->first_block;
8004c04: 28 34 00 20 lw r20,(r1+32)
Heap_Block *const last_block = heap->last_block;
8004c08: 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;
8004c0c: 39 ad 4b 0c ori r13,r13,0x4b0c
8004c10: 44 60 00 03 be r3,r0,8004c1c <_Heap_Walk+0x78>
8004c14: 78 0d 08 00 mvhi r13,0x800
8004c18: 39 ad 4b 30 ori r13,r13,0x4b30
if ( !_System_state_Is_up( _System_state_Get() ) ) {
8004c1c: 78 03 08 01 mvhi r3,0x801
8004c20: 38 63 59 e8 ori r3,r3,0x59e8
8004c24: 28 67 00 00 lw r7,(r3+0)
8004c28: 34 02 00 03 mvi r2,3
return true;
8004c2c: 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() ) ) {
8004c30: 5c e2 01 08 bne r7,r2,8005050 <_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)(
8004c34: 29 81 00 08 lw r1,(r12+8)
8004c38: 29 86 00 18 lw r6,(r12+24)
8004c3c: 29 87 00 1c lw r7,(r12+28)
8004c40: 5b 81 00 08 sw (sp+8),r1
8004c44: 29 81 00 0c lw r1,(r12+12)
8004c48: 78 03 08 01 mvhi r3,0x801
8004c4c: 5b 96 00 04 sw (sp+4),r22
8004c50: 5b 81 00 0c sw (sp+12),r1
8004c54: 34 02 00 00 mvi r2,0
8004c58: b9 c0 08 00 mv r1,r14
8004c5c: 38 63 2d 50 ori r3,r3,0x2d50
8004c60: ba 60 20 00 mv r4,r19
8004c64: ba a0 28 00 mv r5,r21
8004c68: ba 80 40 00 mv r8,r20
8004c6c: 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 ) {
8004c70: 5e 60 00 06 bne r19,r0,8004c88 <_Heap_Walk+0xe4>
(*printer)( source, true, "page size is zero\n" );
8004c74: 78 03 08 01 mvhi r3,0x801
8004c78: b9 c0 08 00 mv r1,r14
8004c7c: 34 02 00 01 mvi r2,1
8004c80: 38 63 2d e4 ori r3,r3,0x2de4
8004c84: e0 00 00 25 bi 8004d18 <_Heap_Walk+0x174>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
8004c88: 22 6f 00 07 andi r15,r19,0x7
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
8004c8c: 45 e0 00 07 be r15,r0,8004ca8 <_Heap_Walk+0x104>
(*printer)(
8004c90: 78 03 08 01 mvhi r3,0x801
8004c94: b9 c0 08 00 mv r1,r14
8004c98: 34 02 00 01 mvi r2,1
8004c9c: 38 63 2d f8 ori r3,r3,0x2df8
8004ca0: ba 60 20 00 mv r4,r19
8004ca4: e0 00 01 04 bi 80050b4 <_Heap_Walk+0x510>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004ca8: ba a0 08 00 mv r1,r21
8004cac: ba 60 10 00 mv r2,r19
8004cb0: fb ff ef b2 calli 8000b78 <__umodsi3>
8004cb4: b8 20 58 00 mv r11,r1
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
8004cb8: 44 2f 00 07 be r1,r15,8004cd4 <_Heap_Walk+0x130>
(*printer)(
8004cbc: 78 03 08 01 mvhi r3,0x801
8004cc0: b9 c0 08 00 mv r1,r14
8004cc4: 34 02 00 01 mvi r2,1
8004cc8: 38 63 2e 18 ori r3,r3,0x2e18
8004ccc: ba a0 20 00 mv r4,r21
8004cd0: e0 00 00 f9 bi 80050b4 <_Heap_Walk+0x510>
8004cd4: 36 81 00 08 addi r1,r20,8
8004cd8: ba 60 10 00 mv r2,r19
8004cdc: fb ff ef a7 calli 8000b78 <__umodsi3>
);
return false;
}
if (
8004ce0: 44 2b 00 07 be r1,r11,8004cfc <_Heap_Walk+0x158>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
8004ce4: 78 03 08 01 mvhi r3,0x801
8004ce8: b9 c0 08 00 mv r1,r14
8004cec: 34 02 00 01 mvi r2,1
8004cf0: 38 63 2e 3c ori r3,r3,0x2e3c
8004cf4: ba 80 20 00 mv r4,r20
8004cf8: e0 00 00 ef bi 80050b4 <_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;
8004cfc: 2a 82 00 04 lw r2,(r20+4)
8004d00: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
8004d04: 5c 41 00 07 bne r2,r1,8004d20 <_Heap_Walk+0x17c>
(*printer)(
8004d08: 78 03 08 01 mvhi r3,0x801
8004d0c: b9 c0 08 00 mv r1,r14
8004d10: 34 02 00 01 mvi r2,1
8004d14: 38 63 2e 70 ori r3,r3,0x2e70
8004d18: d9 a0 00 00 call r13
8004d1c: e0 00 00 40 bi 8004e1c <_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;
8004d20: 2a cf 00 04 lw r15,(r22+4)
8004d24: 34 02 ff fe mvi r2,-2
8004d28: 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);
8004d2c: 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;
8004d30: 29 e2 00 04 lw r2,(r15+4)
8004d34: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
8004d38: 5c 41 00 06 bne r2,r1,8004d50 <_Heap_Walk+0x1ac>
(*printer)(
8004d3c: 78 03 08 01 mvhi r3,0x801
8004d40: b9 c0 08 00 mv r1,r14
8004d44: 34 02 00 01 mvi r2,1
8004d48: 38 63 2e a0 ori r3,r3,0x2ea0
8004d4c: e3 ff ff f3 bi 8004d18 <_Heap_Walk+0x174>
);
return false;
}
if (
8004d50: 45 f4 00 06 be r15,r20,8004d68 <_Heap_Walk+0x1c4> <== ALWAYS TAKEN
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
8004d54: 78 03 08 01 mvhi r3,0x801 <== NOT EXECUTED
8004d58: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
8004d5c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8004d60: 38 63 2e b8 ori r3,r3,0x2eb8 <== NOT EXECUTED
8004d64: e3 ff ff ed bi 8004d18 <_Heap_Walk+0x174> <== NOT EXECUTED
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
8004d68: 29 92 00 10 lw r18,(r12+16)
block = next_block;
} while ( block != first_block );
return true;
}
8004d6c: 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 );
8004d70: 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;
8004d74: 34 11 ff fe mvi r17,-2
8004d78: e0 00 00 2d bi 8004e2c <_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;
8004d7c: 29 83 00 20 lw r3,(r12+32)
8004d80: 34 01 00 00 mvi r1,0
8004d84: 54 6b 00 03 bgu r3,r11,8004d90 <_Heap_Walk+0x1ec>
8004d88: 29 81 00 24 lw r1,(r12+36)
8004d8c: 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 ) ) {
8004d90: 5c 20 00 06 bne r1,r0,8004da8 <_Heap_Walk+0x204>
(*printer)(
8004d94: 78 03 08 01 mvhi r3,0x801
8004d98: b9 c0 08 00 mv r1,r14
8004d9c: 34 02 00 01 mvi r2,1
8004da0: 38 63 2e e8 ori r3,r3,0x2ee8
8004da4: e0 00 00 14 bi 8004df4 <_Heap_Walk+0x250>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004da8: 35 61 00 08 addi r1,r11,8
8004dac: ba 40 10 00 mv r2,r18
8004db0: fb ff ef 72 calli 8000b78 <__umodsi3>
);
return false;
}
if (
8004db4: 44 20 00 06 be r1,r0,8004dcc <_Heap_Walk+0x228>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
8004db8: 78 03 08 01 mvhi r3,0x801
8004dbc: b9 c0 08 00 mv r1,r14
8004dc0: 34 02 00 01 mvi r2,1
8004dc4: 38 63 2f 08 ori r3,r3,0x2f08
8004dc8: e0 00 00 0b bi 8004df4 <_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;
8004dcc: 29 63 00 04 lw r3,(r11+4)
8004dd0: a2 23 18 00 and r3,r17,r3
block = next_block;
} while ( block != first_block );
return true;
}
8004dd4: 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;
8004dd8: 28 63 00 04 lw r3,(r3+4)
8004ddc: 20 63 00 01 andi r3,r3,0x1
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
8004de0: 44 61 00 07 be r3,r1,8004dfc <_Heap_Walk+0x258>
(*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 2f 38 ori r3,r3,0x2f38
8004df4: b9 60 20 00 mv r4,r11
8004df8: e0 00 00 af bi 80050b4 <_Heap_Walk+0x510>
);
return false;
}
if ( free_block->prev != prev_block ) {
8004dfc: 29 65 00 0c lw r5,(r11+12)
8004e00: 44 b0 00 09 be r5,r16,8004e24 <_Heap_Walk+0x280>
(*printer)(
8004e04: 78 03 08 01 mvhi r3,0x801
8004e08: b9 c0 08 00 mv r1,r14
8004e0c: 34 02 00 01 mvi r2,1
8004e10: 38 63 2f 54 ori r3,r3,0x2f54
8004e14: b9 60 20 00 mv r4,r11
8004e18: 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;
8004e1c: 34 03 00 00 mvi r3,0
8004e20: e0 00 00 8c bi 8005050 <_Heap_Walk+0x4ac>
return false;
}
prev_block = free_block;
free_block = free_block->next;
8004e24: b9 60 80 00 mv r16,r11
8004e28: 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 ) {
8004e2c: 5d 6c ff d4 bne r11,r12,8004d7c <_Heap_Walk+0x1d8>
8004e30: e0 00 00 03 bi 8004e3c <_Heap_Walk+0x298>
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
8004e34: ba 20 78 00 mv r15,r17
8004e38: e0 00 00 15 bi 8004e8c <_Heap_Walk+0x2e8>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
8004e3c: 78 01 08 01 mvhi r1,0x801
8004e40: 38 21 31 04 ori r1,r1,0x3104
8004e44: 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)(
8004e48: 78 01 08 01 mvhi r1,0x801
8004e4c: 38 21 30 ec ori r1,r1,0x30ec
8004e50: 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)(
8004e54: 78 01 08 01 mvhi r1,0x801
8004e58: 38 21 2d 18 ori r1,r1,0x2d18
8004e5c: 5b 81 00 5c sw (sp+92),r1
8004e60: 78 01 08 01 mvhi r1,0x801
8004e64: 38 21 2d 34 ori r1,r1,0x2d34
8004e68: 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)" : "")
8004e6c: 78 17 08 01 mvhi r23,0x801
8004e70: 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)" : ""),
8004e74: 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)(
8004e78: 5b 81 00 60 sw (sp+96),r1
8004e7c: 3b 7b 30 48 ori fp,fp,0x3048
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
8004e80: 3a f7 30 b8 ori r23,r23,0x30b8
8004e84: 3b 39 2d 44 ori r25,r25,0x2d44
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
8004e88: 3b 18 2d 28 ori r24,r24,0x2d28
block = next_block;
} while ( block != first_block );
return true;
}
8004e8c: 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;
8004e90: 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;
8004e94: 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;
8004e98: 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);
8004e9c: 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;
8004ea0: 34 06 00 00 mvi r6,0
8004ea4: 54 91 00 03 bgu r4,r17,8004eb0 <_Heap_Walk+0x30c> <== NEVER TAKEN
8004ea8: 29 86 00 24 lw r6,(r12+36)
8004eac: 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 ) ) {
8004eb0: 5c c0 00 06 bne r6,r0,8004ec8 <_Heap_Walk+0x324>
(*printer)(
8004eb4: 78 03 08 01 mvhi r3,0x801
8004eb8: b9 c0 08 00 mv r1,r14
8004ebc: 34 02 00 01 mvi r2,1
8004ec0: 38 63 2f 88 ori r3,r3,0x2f88
8004ec4: e0 00 00 1f bi 8004f40 <_Heap_Walk+0x39c>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004ec8: ba 00 08 00 mv r1,r16
8004ecc: 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;
8004ed0: fd f6 58 00 cmpne r11,r15,r22
8004ed4: fb ff ef 29 calli 8000b78 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
8004ed8: 44 20 00 09 be r1,r0,8004efc <_Heap_Walk+0x358>
8004edc: 45 60 00 08 be r11,r0,8004efc <_Heap_Walk+0x358>
(*printer)(
8004ee0: 78 03 08 01 mvhi r3,0x801
8004ee4: b9 c0 08 00 mv r1,r14
8004ee8: 34 02 00 01 mvi r2,1
8004eec: 38 63 2f b8 ori r3,r3,0x2fb8
8004ef0: b9 e0 20 00 mv r4,r15
8004ef4: ba 00 28 00 mv r5,r16
8004ef8: e3 ff ff c8 bi 8004e18 <_Heap_Walk+0x274>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
8004efc: 52 15 00 0b bgeu r16,r21,8004f28 <_Heap_Walk+0x384>
8004f00: 45 60 00 0a be r11,r0,8004f28 <_Heap_Walk+0x384> <== NEVER TAKEN
(*printer)(
8004f04: 78 03 08 01 mvhi r3,0x801
8004f08: b9 c0 08 00 mv r1,r14
8004f0c: 34 02 00 01 mvi r2,1
8004f10: 38 63 2f e8 ori r3,r3,0x2fe8
8004f14: b9 e0 20 00 mv r4,r15
8004f18: ba 00 28 00 mv r5,r16
8004f1c: ba a0 30 00 mv r6,r21
8004f20: d9 a0 00 00 call r13
8004f24: e3 ff ff be bi 8004e1c <_Heap_Walk+0x278>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
8004f28: 56 2f 00 09 bgu r17,r15,8004f4c <_Heap_Walk+0x3a8>
8004f2c: 45 60 00 08 be r11,r0,8004f4c <_Heap_Walk+0x3a8>
(*printer)(
8004f30: 78 03 08 01 mvhi r3,0x801
8004f34: b9 c0 08 00 mv r1,r14
8004f38: 34 02 00 01 mvi r2,1
8004f3c: 38 63 30 14 ori r3,r3,0x3014
8004f40: b9 e0 20 00 mv r4,r15
8004f44: ba 20 28 00 mv r5,r17
8004f48: e3 ff ff b4 bi 8004e18 <_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;
8004f4c: 2a 24 00 04 lw r4,(r17+4)
8004f50: 22 52 00 01 andi r18,r18,0x1
8004f54: 20 84 00 01 andi r4,r4,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
8004f58: 5c 80 00 2d bne r4,r0,800500c <_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 ?
8004f5c: 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)(
8004f60: 29 85 00 08 lw r5,(r12+8)
block = next_block;
} while ( block != first_block );
return true;
}
8004f64: 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)(
8004f68: 2b 87 00 5c lw r7,(sp+92)
8004f6c: 44 c5 00 04 be r6,r5,8004f7c <_Heap_Walk+0x3d8>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
8004f70: ba e0 38 00 mv r7,r23
8004f74: 5c cc 00 02 bne r6,r12,8004f7c <_Heap_Walk+0x3d8>
8004f78: bb 00 38 00 mv r7,r24
block->next,
block->next == last_free_block ?
8004f7c: 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)(
8004f80: 2b 89 00 60 lw r9,(sp+96)
8004f84: 45 04 00 04 be r8,r4,8004f94 <_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)" : "")
8004f88: ba e0 48 00 mv r9,r23
8004f8c: 5d 0c 00 02 bne r8,r12,8004f94 <_Heap_Walk+0x3f0>
8004f90: 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)(
8004f94: 5b 89 00 04 sw (sp+4),r9
8004f98: b9 c0 08 00 mv r1,r14
8004f9c: 34 02 00 00 mvi r2,0
8004fa0: bb 60 18 00 mv r3,fp
8004fa4: b9 e0 20 00 mv r4,r15
8004fa8: ba 00 28 00 mv r5,r16
8004fac: 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 ) {
8004fb0: 2a 26 00 00 lw r6,(r17+0)
8004fb4: 46 06 00 0a be r16,r6,8004fdc <_Heap_Walk+0x438>
(*printer)(
8004fb8: 78 03 08 01 mvhi r3,0x801
8004fbc: b9 c0 08 00 mv r1,r14
8004fc0: 34 02 00 01 mvi r2,1
8004fc4: 38 63 30 80 ori r3,r3,0x3080
8004fc8: b9 e0 20 00 mv r4,r15
8004fcc: ba 00 28 00 mv r5,r16
8004fd0: ba 20 38 00 mv r7,r17
8004fd4: d9 a0 00 00 call r13
8004fd8: e3 ff ff 91 bi 8004e1c <_Heap_Walk+0x278>
);
return false;
}
if ( !prev_used ) {
8004fdc: 5e 40 00 06 bne r18,r0,8004ff4 <_Heap_Walk+0x450>
(*printer)(
8004fe0: 78 03 08 01 mvhi r3,0x801
8004fe4: b9 c0 08 00 mv r1,r14
8004fe8: 34 02 00 01 mvi r2,1
8004fec: 38 63 30 bc ori r3,r3,0x30bc
8004ff0: e0 00 00 30 bi 80050b0 <_Heap_Walk+0x50c>
block = next_block;
} while ( block != first_block );
return true;
}
8004ff4: 29 85 00 08 lw r5,(r12+8)
8004ff8: e0 00 00 03 bi 8005004 <_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 ) {
8004ffc: 44 af 00 13 be r5,r15,8005048 <_Heap_Walk+0x4a4>
return true;
}
free_block = free_block->next;
8005000: 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 ) {
8005004: 5c ac ff fe bne r5,r12,8004ffc <_Heap_Walk+0x458>
8005008: e0 00 00 26 bi 80050a0 <_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) {
800500c: 46 40 00 08 be r18,r0,800502c <_Heap_Walk+0x488>
(*printer)(
8005010: 2b 83 00 58 lw r3,(sp+88)
8005014: b9 c0 08 00 mv r1,r14
8005018: 34 02 00 00 mvi r2,0
800501c: b9 e0 20 00 mv r4,r15
8005020: ba 00 28 00 mv r5,r16
8005024: d9 a0 00 00 call r13
8005028: e0 00 00 08 bi 8005048 <_Heap_Walk+0x4a4>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
800502c: 2b 83 00 54 lw r3,(sp+84)
8005030: 29 e6 00 00 lw r6,(r15+0)
8005034: b9 c0 08 00 mv r1,r14
8005038: 34 02 00 00 mvi r2,0
800503c: b9 e0 20 00 mv r4,r15
8005040: ba 00 28 00 mv r5,r16
8005044: d9 a0 00 00 call r13
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
8005048: 5e 91 ff 7b bne r20,r17,8004e34 <_Heap_Walk+0x290>
return true;
800504c: 34 03 00 01 mvi r3,1
}
8005050: b8 60 08 00 mv r1,r3
8005054: 2b 9d 00 10 lw ra,(sp+16)
8005058: 2b 8b 00 50 lw r11,(sp+80)
800505c: 2b 8c 00 4c lw r12,(sp+76)
8005060: 2b 8d 00 48 lw r13,(sp+72)
8005064: 2b 8e 00 44 lw r14,(sp+68)
8005068: 2b 8f 00 40 lw r15,(sp+64)
800506c: 2b 90 00 3c lw r16,(sp+60)
8005070: 2b 91 00 38 lw r17,(sp+56)
8005074: 2b 92 00 34 lw r18,(sp+52)
8005078: 2b 93 00 30 lw r19,(sp+48)
800507c: 2b 94 00 2c lw r20,(sp+44)
8005080: 2b 95 00 28 lw r21,(sp+40)
8005084: 2b 96 00 24 lw r22,(sp+36)
8005088: 2b 97 00 20 lw r23,(sp+32)
800508c: 2b 98 00 1c lw r24,(sp+28)
8005090: 2b 99 00 18 lw r25,(sp+24)
8005094: 2b 9b 00 14 lw fp,(sp+20)
8005098: 37 9c 00 60 addi sp,sp,96
800509c: c3 a0 00 00 ret
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
80050a0: 78 03 08 01 mvhi r3,0x801
80050a4: b9 c0 08 00 mv r1,r14
80050a8: 34 02 00 01 mvi r2,1
80050ac: 38 63 31 2c ori r3,r3,0x312c
80050b0: b9 e0 20 00 mv r4,r15
80050b4: d9 a0 00 00 call r13
80050b8: e3 ff ff 59 bi 8004e1c <_Heap_Walk+0x278>
080030d4 <_IO_Manager_initialization>:
* workspace.
*
*/
void _IO_Manager_initialization(void)
{
80030d4: 37 9c ff e8 addi sp,sp,-24
80030d8: 5b 8b 00 18 sw (sp+24),r11
80030dc: 5b 8c 00 14 sw (sp+20),r12
80030e0: 5b 8d 00 10 sw (sp+16),r13
80030e4: 5b 8e 00 0c sw (sp+12),r14
80030e8: 5b 8f 00 08 sw (sp+8),r15
80030ec: 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;
80030f0: 78 01 08 01 mvhi r1,0x801
80030f4: 38 21 30 c4 ori r1,r1,0x30c4
drivers_in_table = Configuration.number_of_device_drivers;
80030f8: 28 2d 00 34 lw r13,(r1+52)
number_of_drivers = Configuration.maximum_drivers;
80030fc: 28 2b 00 30 lw r11,(r1+48)
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;
8003100: 28 2e 00 38 lw r14,(r1+56)
/*
* 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 )
8003104: 51 ab 00 03 bgeu r13,r11,8003110 <_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 ) {
8003108: 5d 6d 00 0a bne r11,r13,8003130 <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN
800310c: e0 00 00 02 bi 8003114 <_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 )
8003110: 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;
8003114: 78 01 08 01 mvhi r1,0x801
8003118: 38 21 3a 7c ori r1,r1,0x3a7c
800311c: 58 2e 00 00 sw (r1+0),r14
_IO_Number_of_drivers = number_of_drivers;
8003120: 78 01 08 01 mvhi r1,0x801
8003124: 38 21 3a 78 ori r1,r1,0x3a78
8003128: 58 2b 00 00 sw (r1+0),r11
return;
800312c: e0 00 00 27 bi 80031c8 <_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 )
8003130: 34 02 00 01 mvi r2,1
8003134: b9 60 08 00 mv r1,r11
8003138: f8 00 35 b1 calli 80107fc <__ashlsi3>
800313c: 34 02 00 03 mvi r2,3
8003140: b4 2b 08 00 add r1,r1,r11
8003144: f8 00 35 ae calli 80107fc <__ashlsi3>
8003148: 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(
800314c: f8 00 0e 25 calli 80069e0 <_Workspace_Allocate_or_fatal_error>
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
8003150: 78 02 08 01 mvhi r2,0x801
8003154: 38 42 3a 78 ori r2,r2,0x3a78
/*
* 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 *)
8003158: 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;
800315c: 58 4b 00 00 sw (r2+0),r11
memset(
8003160: 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 *)
8003164: 39 8c 3a 7c ori r12,r12,0x3a7c
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
memset(
8003168: 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 *)
800316c: 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(
8003170: f8 00 23 97 calli 800bfcc <memset>
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
8003174: 34 03 00 00 mvi r3,0
8003178: 34 04 00 00 mvi r4,0
800317c: e0 00 00 12 bi 80031c4 <_IO_Manager_initialization+0xf0>
_IO_Driver_address_table[index] = driver_table[index];
8003180: 29 82 00 00 lw r2,(r12+0)
* registration. The driver table is now allocated in the
* workspace.
*
*/
void _IO_Manager_initialization(void)
8003184: 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];
8003188: 28 29 00 00 lw r9,(r1+0)
800318c: 28 28 00 04 lw r8,(r1+4)
8003190: 28 27 00 08 lw r7,(r1+8)
8003194: 28 26 00 0c lw r6,(r1+12)
8003198: 28 25 00 10 lw r5,(r1+16)
800319c: 28 21 00 14 lw r1,(r1+20)
80031a0: b4 43 10 00 add r2,r2,r3
80031a4: 58 49 00 00 sw (r2+0),r9
80031a8: 58 48 00 04 sw (r2+4),r8
80031ac: 58 47 00 08 sw (r2+8),r7
80031b0: 58 46 00 0c sw (r2+12),r6
80031b4: 58 45 00 10 sw (r2+16),r5
80031b8: 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++ )
80031bc: 34 84 00 01 addi r4,r4,1
80031c0: 34 63 00 18 addi r3,r3,24
80031c4: 55 a4 ff ef bgu r13,r4,8003180 <_IO_Manager_initialization+0xac>
_IO_Driver_address_table[index] = driver_table[index];
}
80031c8: 2b 9d 00 04 lw ra,(sp+4)
80031cc: 2b 8b 00 18 lw r11,(sp+24)
80031d0: 2b 8c 00 14 lw r12,(sp+20)
80031d4: 2b 8d 00 10 lw r13,(sp+16)
80031d8: 2b 8e 00 0c lw r14,(sp+12)
80031dc: 2b 8f 00 08 lw r15,(sp+8)
80031e0: 37 9c 00 18 addi sp,sp,24
80031e4: c3 a0 00 00 ret
0800406c <_Objects_Allocate>:
*/
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
800406c: 37 9c ff ec addi sp,sp,-20
8004070: 5b 8b 00 14 sw (sp+20),r11
8004074: 5b 8c 00 10 sw (sp+16),r12
8004078: 5b 8d 00 0c sw (sp+12),r13
800407c: 5b 8e 00 08 sw (sp+8),r14
8004080: 5b 9d 00 04 sw (sp+4),ra
8004084: 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 )
8004088: 28 21 00 18 lw r1,(r1+24)
return NULL;
800408c: 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 )
8004090: 44 20 00 1e be r1,r0,8004108 <_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 );
8004094: 35 6d 00 20 addi r13,r11,32
8004098: b9 a0 08 00 mv r1,r13
800409c: fb ff fd 23 calli 8003528 <_Chain_Get>
80040a0: b8 20 60 00 mv r12,r1
80040a4: b8 20 70 00 mv r14,r1
if ( information->auto_extend ) {
80040a8: 41 61 00 12 lbu r1,(r11+18)
80040ac: 44 20 00 17 be r1,r0,8004108 <_Objects_Allocate+0x9c>
/*
* If the list is empty then we are out of objects and need to
* extend information base.
*/
if ( !the_object ) {
80040b0: 5d 80 00 07 bne r12,r0,80040cc <_Objects_Allocate+0x60>
_Objects_Extend_information( information );
80040b4: b9 60 08 00 mv r1,r11
80040b8: f8 00 00 1c calli 8004128 <_Objects_Extend_information>
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
80040bc: b9 a0 08 00 mv r1,r13
80040c0: fb ff fd 1a calli 8003528 <_Chain_Get>
80040c4: b8 20 60 00 mv r12,r1
}
if ( the_object ) {
80040c8: 44 2e 00 10 be r1,r14,8004108 <_Objects_Allocate+0x9c>
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
80040cc: 2d 82 00 0a lhu r2,(r12+10)
80040d0: 2d 61 00 0a lhu r1,(r11+10)
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
80040d4: c8 41 08 00 sub r1,r2,r1
80040d8: 2d 62 00 14 lhu r2,(r11+20)
80040dc: f8 00 32 a2 calli 8010b64 <__udivsi3>
information->inactive_per_block[ block ]--;
80040e0: 34 02 00 02 mvi r2,2
80040e4: f8 00 31 c6 calli 80107fc <__ashlsi3>
80040e8: 29 62 00 30 lw r2,(r11+48)
80040ec: b4 41 08 00 add r1,r2,r1
80040f0: 28 22 00 00 lw r2,(r1+0)
80040f4: 34 42 ff ff addi r2,r2,-1
80040f8: 58 22 00 00 sw (r1+0),r2
information->inactive--;
80040fc: 2d 61 00 2c lhu r1,(r11+44)
8004100: 34 21 ff ff addi r1,r1,-1
8004104: 0d 61 00 2c sh (r11+44),r1
);
}
#endif
return the_object;
}
8004108: b9 80 08 00 mv r1,r12
800410c: 2b 9d 00 04 lw ra,(sp+4)
8004110: 2b 8b 00 14 lw r11,(sp+20)
8004114: 2b 8c 00 10 lw r12,(sp+16)
8004118: 2b 8d 00 0c lw r13,(sp+12)
800411c: 2b 8e 00 08 lw r14,(sp+8)
8004120: 37 9c 00 14 addi sp,sp,20
8004124: c3 a0 00 00 ret
0800454c <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint16_t the_class
)
{
800454c: 37 9c ff ec addi sp,sp,-20
8004550: 5b 8b 00 14 sw (sp+20),r11
8004554: 5b 8c 00 10 sw (sp+16),r12
8004558: 5b 8d 00 0c sw (sp+12),r13
800455c: 5b 8e 00 08 sw (sp+8),r14
8004560: 5b 9d 00 04 sw (sp+4),ra
8004564: 20 4c ff ff andi r12,r2,0xffff
8004568: b8 20 70 00 mv r14,r1
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
return NULL;
800456c: 34 0b 00 00 mvi r11,0
)
{
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
8004570: 45 80 00 16 be r12,r0,80045c8 <_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 );
8004574: f8 00 13 6e calli 800932c <_Objects_API_maximum_class>
if ( the_class_api_maximum == 0 )
8004578: 44 20 00 14 be r1,r0,80045c8 <_Objects_Get_information+0x7c>
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
800457c: 55 81 00 13 bgu r12,r1,80045c8 <_Objects_Get_information+0x7c>
return NULL;
if ( !_Objects_Information_table[ the_api ] )
8004580: 78 0d 08 01 mvhi r13,0x801
8004584: b9 c0 08 00 mv r1,r14
8004588: 34 02 00 02 mvi r2,2
800458c: 39 ad 37 c4 ori r13,r13,0x37c4
8004590: f8 00 30 9b calli 80107fc <__ashlsi3>
8004594: b5 a1 08 00 add r1,r13,r1
8004598: 28 2d 00 00 lw r13,(r1+0)
800459c: 45 a0 00 0b be r13,r0,80045c8 <_Objects_Get_information+0x7c><== NEVER TAKEN
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
80045a0: b9 80 08 00 mv r1,r12
80045a4: 34 02 00 02 mvi r2,2
80045a8: f8 00 30 95 calli 80107fc <__ashlsi3>
80045ac: b5 a1 08 00 add r1,r13,r1
80045b0: 28 2b 00 00 lw r11,(r1+0)
if ( !info )
80045b4: 45 60 00 05 be r11,r0,80045c8 <_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 )
80045b8: 2d 61 00 10 lhu r1,(r11+16)
return NULL;
80045bc: 7c 21 00 00 cmpnei r1,r1,0
80045c0: c8 01 08 00 sub r1,r0,r1
80045c4: a1 61 58 00 and r11,r11,r1
#endif
return info;
}
80045c8: b9 60 08 00 mv r1,r11
80045cc: 2b 9d 00 04 lw ra,(sp+4)
80045d0: 2b 8b 00 14 lw r11,(sp+20)
80045d4: 2b 8c 00 10 lw r12,(sp+16)
80045d8: 2b 8d 00 0c lw r13,(sp+12)
80045dc: 2b 8e 00 08 lw r14,(sp+8)
80045e0: 37 9c 00 14 addi sp,sp,20
80045e4: c3 a0 00 00 ret
08017758 <_Objects_Get_no_protection>:
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
8017758: 37 9c ff f4 addi sp,sp,-12
801775c: 5b 8b 00 0c sw (sp+12),r11
8017760: 5b 8c 00 08 sw (sp+8),r12
8017764: 5b 9d 00 04 sw (sp+4),ra
8017768: 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;
801776c: 28 21 00 08 lw r1,(r1+8)
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
8017770: 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;
8017774: c8 41 08 00 sub r1,r2,r1
if ( information->maximum >= index ) {
8017778: 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;
801777c: 34 21 00 01 addi r1,r1,1
if ( information->maximum >= index ) {
8017780: 54 22 00 09 bgu r1,r2,80177a4 <_Objects_Get_no_protection+0x4c>
if ( (the_object = information->local_table[ index ]) != NULL ) {
8017784: 28 8c 00 1c lw r12,(r4+28)
8017788: 34 02 00 02 mvi r2,2
801778c: fb ff d9 b2 calli 800de54 <__ashlsi3>
8017790: b5 81 08 00 add r1,r12,r1
8017794: 28 21 00 00 lw r1,(r1+0)
8017798: 44 20 00 03 be r1,r0,80177a4 <_Objects_Get_no_protection+0x4c><== NEVER TAKEN
*location = OBJECTS_LOCAL;
801779c: 59 60 00 00 sw (r11+0),r0
return the_object;
80177a0: e0 00 00 04 bi 80177b0 <_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;
80177a4: 34 01 00 01 mvi r1,1
80177a8: 59 61 00 00 sw (r11+0),r1
return NULL;
80177ac: 34 01 00 00 mvi r1,0
}
80177b0: 2b 9d 00 04 lw ra,(sp+4)
80177b4: 2b 8b 00 0c lw r11,(sp+12)
80177b8: 2b 8c 00 08 lw r12,(sp+8)
80177bc: 37 9c 00 0c addi sp,sp,12
80177c0: c3 a0 00 00 ret
08006208 <_Objects_Id_to_name>:
*/
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
8006208: 37 9c ff e8 addi sp,sp,-24
800620c: 5b 8b 00 14 sw (sp+20),r11
8006210: 5b 8c 00 10 sw (sp+16),r12
8006214: 5b 8d 00 0c sw (sp+12),r13
8006218: 5b 8e 00 08 sw (sp+8),r14
800621c: 5b 9d 00 04 sw (sp+4),ra
8006220: b8 40 70 00 mv r14,r2
/*
* Caller is trusted for name != NULL.
*/
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
8006224: b8 20 58 00 mv r11,r1
8006228: 5c 20 00 05 bne r1,r0,800623c <_Objects_Id_to_name+0x34>
800622c: 78 01 08 01 mvhi r1,0x801
8006230: 38 21 ea 38 ori r1,r1,0xea38
8006234: 28 21 00 0c lw r1,(r1+12)
8006238: 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);
800623c: 34 02 00 18 mvi r2,24
8006240: b9 60 08 00 mv r1,r11
8006244: f8 00 52 d9 calli 801ada8 <__lshrsi3>
8006248: 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 )
800624c: 34 23 ff ff addi r3,r1,-1
8006250: 34 02 00 02 mvi r2,2
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
8006254: 34 0d 00 03 mvi r13,3
8006258: 54 62 00 12 bgu r3,r2,80062a0 <_Objects_Id_to_name+0x98>
800625c: e0 00 00 19 bi 80062c0 <_Objects_Id_to_name+0xb8>
*/
RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
Objects_Id id
)
{
return (uint32_t)
8006260: 34 02 00 1b mvi r2,27
8006264: b9 60 08 00 mv r1,r11
8006268: f8 00 52 d0 calli 801ada8 <__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 ];
800626c: 34 02 00 02 mvi r2,2
8006270: fb ff ec f3 calli 800163c <__ashlsi3>
8006274: b5 81 08 00 add r1,r12,r1
8006278: 28 21 00 00 lw r1,(r1+0)
if ( !information )
800627c: 44 20 00 09 be r1,r0,80062a0 <_Objects_Id_to_name+0x98> <== NEVER TAKEN
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
return OBJECTS_INVALID_ID;
#endif
the_object = _Objects_Get( information, tmpId, &ignored_location );
8006280: b9 60 10 00 mv r2,r11
8006284: 37 83 00 18 addi r3,sp,24
8006288: fb ff ff ba calli 8006170 <_Objects_Get>
if ( !the_object )
800628c: 44 20 00 05 be r1,r0,80062a0 <_Objects_Id_to_name+0x98>
return OBJECTS_INVALID_ID;
*name = the_object->name;
8006290: 28 21 00 0c lw r1,(r1+12)
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
8006294: 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;
8006298: 59 c1 00 00 sw (r14+0),r1
_Thread_Enable_dispatch();
800629c: f8 00 03 64 calli 800702c <_Thread_Enable_dispatch>
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
}
80062a0: b9 a0 08 00 mv r1,r13
80062a4: 2b 9d 00 04 lw ra,(sp+4)
80062a8: 2b 8b 00 14 lw r11,(sp+20)
80062ac: 2b 8c 00 10 lw r12,(sp+16)
80062b0: 2b 8d 00 0c lw r13,(sp+12)
80062b4: 2b 8e 00 08 lw r14,(sp+8)
80062b8: 37 9c 00 18 addi sp,sp,24
80062bc: 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 ] )
80062c0: 78 0c 08 01 mvhi r12,0x801
80062c4: 34 02 00 02 mvi r2,2
80062c8: 39 8c e8 14 ori r12,r12,0xe814
80062cc: fb ff ec dc calli 800163c <__ashlsi3>
80062d0: b5 81 08 00 add r1,r12,r1
80062d4: 28 2c 00 00 lw r12,(r1+0)
80062d8: 5d 80 ff e2 bne r12,r0,8006260 <_Objects_Id_to_name+0x58>
80062dc: e3 ff ff f1 bi 80062a0 <_Objects_Id_to_name+0x98>
08004728 <_Objects_Initialize_information>:
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8004728: 37 9c ff e4 addi sp,sp,-28
800472c: 5b 8b 00 1c sw (sp+28),r11
8004730: 5b 8c 00 18 sw (sp+24),r12
8004734: 5b 8d 00 14 sw (sp+20),r13
8004738: 5b 8e 00 10 sw (sp+16),r14
800473c: 5b 8f 00 0c sw (sp+12),r15
8004740: 5b 90 00 08 sw (sp+8),r16
8004744: 5b 9d 00 04 sw (sp+4),ra
8004748: 20 6d ff ff andi r13,r3,0xffff
800474c: b8 20 58 00 mv r11,r1
8004750: 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;
8004754: 58 25 00 18 sw (r1+24),r5
uint32_t maximum_per_allocation;
#if defined(RTEMS_MULTIPROCESSING)
uint32_t index;
#endif
information->the_api = the_api;
8004758: 59 62 00 00 sw (r11+0),r2
information->the_class = the_class;
800475c: 0c 2d 00 04 sh (r1+4),r13
information->size = size;
information->local_table = 0;
8004760: 58 20 00 1c sw (r1+28),r0
information->inactive_per_block = 0;
8004764: 58 20 00 30 sw (r1+48),r0
information->object_blocks = 0;
8004768: 58 20 00 34 sw (r1+52),r0
information->inactive = 0;
800476c: 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;
8004770: 0c 20 00 10 sh (r1+16),r0
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8004774: 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;
8004778: b8 40 08 00 mv r1,r2
800477c: 78 0f 08 01 mvhi r15,0x801
8004780: 34 02 00 02 mvi r2,2
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8004784: b8 80 60 00 mv r12,r4
8004788: 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;
800478c: 39 ef 37 c4 ori r15,r15,0x37c4
8004790: f8 00 30 1b calli 80107fc <__ashlsi3>
8004794: b5 e1 08 00 add r1,r15,r1
8004798: 28 2f 00 00 lw r15,(r1+0)
800479c: 34 02 00 02 mvi r2,2
80047a0: b9 a0 08 00 mv r1,r13
80047a4: f8 00 30 16 calli 80107fc <__ashlsi3>
80047a8: b5 e1 08 00 add r1,r15,r1
80047ac: 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;
80047b0: 34 02 00 1f mvi r2,31
80047b4: b9 80 08 00 mv r1,r12
80047b8: f8 00 30 5f calli 8010934 <__lshrsi3>
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
80047bc: 78 03 08 01 mvhi r3,0x801
80047c0: 38 63 1d 74 ori r3,r3,0x1d74
/*
* Are we operating in limited or unlimited (e.g. auto-extend) mode.
*/
information->auto_extend =
(maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false;
80047c4: 20 22 00 ff andi r2,r1,0xff
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
80047c8: 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 =
80047cc: 31 62 00 12 sb (r11+18),r2
(maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false;
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
80047d0: a1 81 60 00 and r12,r12,r1
/*
* Unlimited and maximum of zero is illogical.
*/
if ( information->auto_extend && maximum_per_allocation == 0) {
80047d4: 44 40 00 06 be r2,r0,80047ec <_Objects_Initialize_information+0xc4>
80047d8: 5d 80 00 05 bne r12,r0,80047ec <_Objects_Initialize_information+0xc4><== ALWAYS TAKEN
_Internal_error_Occurred(
80047dc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
80047e0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
80047e4: 34 03 00 13 mvi r3,19 <== NOT EXECUTED
80047e8: fb ff fd f0 calli 8003fa8 <_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;
80047ec: 78 01 08 01 mvhi r1,0x801
80047f0: 38 21 36 38 ori r1,r1,0x3638
80047f4: 59 61 00 1c sw (r11+28),r1
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
80047f8: 34 02 00 18 mvi r2,24
80047fc: b9 c0 08 00 mv r1,r14
}
/*
* The allocation unit is the maximum value
*/
information->allocation_size = maximum_per_allocation;
8004800: 0d 6c 00 14 sh (r11+20),r12
8004804: f8 00 2f fe calli 80107fc <__ashlsi3>
8004808: 78 0e 00 01 mvhi r14,0x1
800480c: b8 2e 70 00 or r14,r1,r14
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
8004810: 34 02 00 1b mvi r2,27
8004814: b9 a0 08 00 mv r1,r13
8004818: f8 00 2f f9 calli 80107fc <__ashlsi3>
information->local_table = &null_local_table;
/*
* Calculate minimum and maximum Id's
*/
minimum_index = (maximum_per_allocation == 0) ? 0 : 1;
800481c: 7d 82 00 00 cmpnei r2,r12,0
8004820: 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) |
8004824: b8 22 08 00 or r1,r1,r2
information->minimum_id =
8004828: 59 61 00 08 sw (r11+8),r1
/*
* Calculate the maximum name length
*/
name_length = maximum_name_length;
if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) )
800482c: 22 01 00 03 andi r1,r16,0x3
8004830: ba 00 38 00 mv r7,r16
8004834: 44 20 00 04 be r1,r0,8004844 <_Objects_Initialize_information+0x11c><== ALWAYS TAKEN
name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
8004838: 36 07 00 04 addi r7,r16,4 <== NOT EXECUTED
800483c: 34 01 ff fc mvi r1,-4 <== NOT EXECUTED
8004840: a0 e1 38 00 and r7,r7,r1 <== NOT EXECUTED
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 );
8004844: 35 61 00 24 addi r1,r11,36
head->next = tail;
8004848: 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 );
800484c: 35 61 00 20 addi r1,r11,32
~(OBJECTS_NAME_ALIGNMENT-1);
information->name_length = name_length;
8004850: 0d 67 00 38 sh (r11+56),r7
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
8004854: 59 60 00 24 sw (r11+36),r0
tail->previous = head;
8004858: 59 61 00 28 sw (r11+40),r1
_Chain_Initialize_empty( &information->Inactive );
/*
* Initialize objects .. if there are any
*/
if ( maximum_per_allocation ) {
800485c: 45 80 00 03 be r12,r0,8004868 <_Objects_Initialize_information+0x140>
/*
* 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 );
8004860: b9 60 08 00 mv r1,r11
8004864: fb ff fe 31 calli 8004128 <_Objects_Extend_information>
_Chain_Initialize_empty( &information->global_table[ index ] );
}
else
information->global_table = NULL;
#endif
}
8004868: 2b 9d 00 04 lw ra,(sp+4)
800486c: 2b 8b 00 1c lw r11,(sp+28)
8004870: 2b 8c 00 18 lw r12,(sp+24)
8004874: 2b 8d 00 14 lw r13,(sp+20)
8004878: 2b 8e 00 10 lw r14,(sp+16)
800487c: 2b 8f 00 0c lw r15,(sp+12)
8004880: 2b 90 00 08 lw r16,(sp+8)
8004884: 37 9c 00 1c addi sp,sp,28
8004888: c3 a0 00 00 ret
08002e3c <_RTEMS_tasks_Initialize_user_tasks_body>:
*
* Output parameters: NONE
*/
void _RTEMS_tasks_Initialize_user_tasks_body( void )
{
8002e3c: 37 9c ff e8 addi sp,sp,-24
8002e40: 5b 8b 00 14 sw (sp+20),r11
8002e44: 5b 8c 00 10 sw (sp+16),r12
8002e48: 5b 8d 00 0c sw (sp+12),r13
8002e4c: 5b 8e 00 08 sw (sp+8),r14
8002e50: 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;
8002e54: 78 01 08 01 mvhi r1,0x801
8002e58: 38 21 30 8c ori r1,r1,0x308c
8002e5c: 28 2b 00 2c lw r11,(r1+44)
maximum = Configuration_RTEMS_API.number_of_initialization_tasks;
8002e60: 28 2e 00 28 lw r14,(r1+40)
/*
* Verify that we have a set of user tasks to iterate
*/
if ( !user_tasks )
8002e64: 34 0d 00 00 mvi r13,0
8002e68: 5d 60 00 1a bne r11,r0,8002ed0 <_RTEMS_tasks_Initialize_user_tasks_body+0x94>
8002e6c: e0 00 00 1a bi 8002ed4 <_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(
8002e70: 29 61 00 00 lw r1,(r11+0)
8002e74: 29 62 00 08 lw r2,(r11+8)
8002e78: 29 63 00 04 lw r3,(r11+4)
8002e7c: 29 64 00 14 lw r4,(r11+20)
8002e80: 29 65 00 0c lw r5,(r11+12)
8002e84: 37 86 00 18 addi r6,sp,24
8002e88: fb ff ff 53 calli 8002bd4 <rtems_task_create>
8002e8c: 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 ) )
8002e90: 44 20 00 05 be r1,r0,8002ea4 <_RTEMS_tasks_Initialize_user_tasks_body+0x68><== ALWAYS TAKEN
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
8002e94: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8002e98: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8002e9c: b9 80 18 00 mv r3,r12 <== NOT EXECUTED
8002ea0: e0 00 00 0a bi 8002ec8 <_RTEMS_tasks_Initialize_user_tasks_body+0x8c><== NOT EXECUTED
return_value = rtems_task_start(
8002ea4: 29 63 00 18 lw r3,(r11+24)
8002ea8: 29 62 00 10 lw r2,(r11+16)
8002eac: 2b 81 00 18 lw r1,(sp+24)
8002eb0: 35 6b 00 1c addi r11,r11,28
8002eb4: f8 00 00 0f calli 8002ef0 <rtems_task_start>
8002eb8: b8 20 18 00 mv r3,r1
id,
user_tasks[ index ].entry_point,
user_tasks[ index ].argument
);
if ( !rtems_is_status_successful( return_value ) )
8002ebc: 44 2c 00 04 be r1,r12,8002ecc <_RTEMS_tasks_Initialize_user_tasks_body+0x90><== ALWAYS TAKEN
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
8002ec0: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8002ec4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8002ec8: f8 00 04 38 calli 8003fa8 <_Internal_error_Occurred> <== NOT EXECUTED
return;
/*
* Now iterate over the initialization tasks and create/start them.
*/
for ( index=0 ; index < maximum ; index++ ) {
8002ecc: 35 ad 00 01 addi r13,r13,1
8002ed0: 55 cd ff e8 bgu r14,r13,8002e70 <_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 );
}
}
8002ed4: 2b 9d 00 04 lw ra,(sp+4)
8002ed8: 2b 8b 00 14 lw r11,(sp+20)
8002edc: 2b 8c 00 10 lw r12,(sp+16)
8002ee0: 2b 8d 00 0c lw r13,(sp+12)
8002ee4: 2b 8e 00 08 lw r14,(sp+8)
8002ee8: 37 9c 00 18 addi sp,sp,24
8002eec: c3 a0 00 00 ret
080089c8 <_RTEMS_tasks_Post_switch_extension>:
*/
void _RTEMS_tasks_Post_switch_extension(
Thread_Control *executing
)
{
80089c8: 37 9c ff f0 addi sp,sp,-16
80089cc: 5b 8b 00 0c sw (sp+12),r11
80089d0: 5b 8c 00 08 sw (sp+8),r12
80089d4: 5b 9d 00 04 sw (sp+4),ra
RTEMS_API_Control *api;
ASR_Information *asr;
rtems_signal_set signal_set;
Modes_Control prev_mode;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
80089d8: 28 2b 01 18 lw r11,(r1+280)
if ( !api )
80089dc: 45 60 00 1a be r11,r0,8008a44 <_RTEMS_tasks_Post_switch_extension+0x7c><== NEVER TAKEN
* Signal Processing
*/
asr = &api->Signal;
_ISR_Disable( level );
80089e0: 90 00 08 00 rcsr r1,IE
80089e4: 34 02 ff fe mvi r2,-2
80089e8: a0 22 10 00 and r2,r1,r2
80089ec: d0 02 00 00 wcsr IE,r2
signal_set = asr->signals_posted;
80089f0: 29 6c 00 14 lw r12,(r11+20)
asr->signals_posted = 0;
80089f4: 59 60 00 14 sw (r11+20),r0
_ISR_Enable( level );
80089f8: d0 01 00 00 wcsr IE,r1
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
80089fc: 45 80 00 12 be r12,r0,8008a44 <_RTEMS_tasks_Post_switch_extension+0x7c>
return;
asr->nest_level += 1;
8008a00: 29 61 00 1c lw r1,(r11+28)
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
8008a04: 37 83 00 10 addi r3,sp,16
8008a08: 38 02 ff ff mvu r2,0xffff
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
return;
asr->nest_level += 1;
8008a0c: 34 21 00 01 addi r1,r1,1
8008a10: 59 61 00 1c sw (r11+28),r1
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
8008a14: 29 61 00 10 lw r1,(r11+16)
8008a18: f8 00 08 ec calli 800adc8 <rtems_task_mode>
(*asr->handler)( signal_set );
8008a1c: 29 62 00 0c lw r2,(r11+12)
8008a20: b9 80 08 00 mv r1,r12
8008a24: d8 40 00 00 call r2
asr->nest_level -= 1;
8008a28: 29 61 00 1c lw r1,(r11+28)
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
8008a2c: 38 02 ff ff mvu r2,0xffff
8008a30: 37 83 00 10 addi r3,sp,16
asr->nest_level += 1;
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
(*asr->handler)( signal_set );
asr->nest_level -= 1;
8008a34: 34 21 ff ff addi r1,r1,-1
8008a38: 59 61 00 1c sw (r11+28),r1
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
8008a3c: 2b 81 00 10 lw r1,(sp+16)
8008a40: f8 00 08 e2 calli 800adc8 <rtems_task_mode>
}
8008a44: 2b 9d 00 04 lw ra,(sp+4)
8008a48: 2b 8b 00 0c lw r11,(sp+12)
8008a4c: 2b 8c 00 08 lw r12,(sp+8)
8008a50: 37 9c 00 10 addi sp,sp,16
8008a54: c3 a0 00 00 ret
08004608 <_Rate_monotonic_Timeout>:
void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
)
{
8004608: 37 9c ff f4 addi sp,sp,-12
800460c: 5b 8b 00 08 sw (sp+8),r11
8004610: 5b 9d 00 04 sw (sp+4),ra
8004614: b8 20 10 00 mv r2,r1
8004618: 78 01 08 01 mvhi r1,0x801
800461c: 38 21 f8 18 ori r1,r1,0xf818
8004620: 37 83 00 0c addi r3,sp,12
8004624: f8 00 08 c3 calli 8006930 <_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 ) {
8004628: 2b 82 00 0c lw r2,(sp+12)
800462c: b8 20 58 00 mv r11,r1
8004630: 5c 40 00 22 bne r2,r0,80046b8 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN
case OBJECTS_LOCAL:
the_thread = the_period->owner;
8004634: 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);
8004638: 28 23 00 10 lw r3,(r1+16)
800463c: 20 63 40 00 andi r3,r3,0x4000
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
8004640: 44 62 00 09 be r3,r2,8004664 <_Rate_monotonic_Timeout+0x5c>
8004644: 28 23 00 20 lw r3,(r1+32)
8004648: 29 62 00 08 lw r2,(r11+8)
800464c: 5c 62 00 06 bne r3,r2,8004664 <_Rate_monotonic_Timeout+0x5c>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
8004650: 78 03 08 01 mvhi r3,0x801
8004654: 38 63 cd 8c ori r3,r3,0xcd8c
8004658: 28 62 00 00 lw r2,(r3+0)
800465c: f8 00 0b 4b calli 8007388 <_Thread_Clear_state>
8004660: e0 00 00 06 bi 8004678 <_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 ) {
8004664: 29 62 00 38 lw r2,(r11+56)
8004668: 34 01 00 01 mvi r1,1
800466c: 5c 41 00 0c bne r2,r1,800469c <_Rate_monotonic_Timeout+0x94>
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
8004670: 34 01 00 03 mvi r1,3
8004674: 59 61 00 38 sw (r11+56),r1
_Rate_monotonic_Initiate_statistics( the_period );
8004678: b9 60 08 00 mv r1,r11
800467c: fb ff fe 2e calli 8003f34 <_Rate_monotonic_Initiate_statistics>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8004680: 29 61 00 3c lw r1,(r11+60)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8004684: 35 62 00 10 addi r2,r11,16
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8004688: 59 61 00 1c sw (r11+28),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800468c: 78 01 08 01 mvhi r1,0x801
8004690: 38 21 fa 20 ori r1,r1,0xfa20
8004694: f8 00 10 bf calli 8008990 <_Watchdog_Insert>
8004698: e0 00 00 03 bi 80046a4 <_Rate_monotonic_Timeout+0x9c>
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
800469c: 34 01 00 04 mvi r1,4
80046a0: 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;
80046a4: 78 01 08 01 mvhi r1,0x801
80046a8: 38 21 f9 40 ori r1,r1,0xf940
80046ac: 28 22 00 00 lw r2,(r1+0)
80046b0: 34 42 ff ff addi r2,r2,-1
80046b4: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
80046b8: 2b 9d 00 04 lw ra,(sp+4)
80046bc: 2b 8b 00 08 lw r11,(sp+8)
80046c0: 37 9c 00 0c addi sp,sp,12
80046c4: c3 a0 00 00 ret
08003fc8 <_Rate_monotonic_Update_statistics>:
void _Rate_monotonic_Update_statistics(
Rate_monotonic_Control *the_period
)
{
8003fc8: 37 9c ff e4 addi sp,sp,-28
8003fcc: 5b 8b 00 0c sw (sp+12),r11
8003fd0: 5b 8c 00 08 sw (sp+8),r12
8003fd4: 5b 9d 00 04 sw (sp+4),ra
8003fd8: b8 20 58 00 mv r11,r1
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8003fdc: 28 21 00 54 lw r1,(r1+84)
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
8003fe0: 29 62 00 38 lw r2,(r11+56)
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8003fe4: 34 21 00 01 addi r1,r1,1
8003fe8: 59 61 00 54 sw (r11+84),r1
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
8003fec: 34 01 00 04 mvi r1,4
8003ff0: 5c 41 00 04 bne r2,r1,8004000 <_Rate_monotonic_Update_statistics+0x38>
stats->missed_count++;
8003ff4: 29 61 00 58 lw r1,(r11+88)
8003ff8: 34 21 00 01 addi r1,r1,1
8003ffc: 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 );
8004000: 37 8c 00 18 addi r12,sp,24
stats->missed_count++;
/*
* Grab status for time statistics.
*/
valid_status =
8004004: b9 60 08 00 mv r1,r11
8004008: 37 82 00 10 addi r2,sp,16
800400c: b9 80 18 00 mv r3,r12
8004010: fb ff ff 90 calli 8003e50 <_Rate_monotonic_Get_status>
_Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
if (!valid_status)
8004014: 44 20 00 28 be r1,r0,80040b4 <_Rate_monotonic_Update_statistics+0xec><== NEVER TAKEN
/*
* Update CPU time
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Add_to( &stats->total_cpu_time, &executed );
8004018: b9 80 10 00 mv r2,r12
800401c: 35 61 00 6c addi r1,r11,108
8004020: f8 00 10 f9 calli 8008404 <_Timespec_Add_to>
if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) )
8004024: b9 80 08 00 mv r1,r12
8004028: 35 62 00 5c addi r2,r11,92
800402c: f8 00 11 54 calli 800857c <_Timespec_Less_than>
8004030: 44 20 00 05 be r1,r0,8004044 <_Rate_monotonic_Update_statistics+0x7c>
stats->min_cpu_time = executed;
8004034: 2b 81 00 18 lw r1,(sp+24)
8004038: 59 61 00 5c sw (r11+92),r1
800403c: 2b 81 00 1c lw r1,(sp+28)
8004040: 59 61 00 60 sw (r11+96),r1
if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
8004044: 37 81 00 18 addi r1,sp,24
8004048: 35 62 00 64 addi r2,r11,100
800404c: f8 00 11 41 calli 8008550 <_Timespec_Greater_than>
8004050: 44 20 00 05 be r1,r0,8004064 <_Rate_monotonic_Update_statistics+0x9c>
stats->max_cpu_time = executed;
8004054: 2b 81 00 18 lw r1,(sp+24)
8004058: 59 61 00 64 sw (r11+100),r1
800405c: 2b 81 00 1c lw r1,(sp+28)
8004060: 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 );
8004064: 37 8c 00 10 addi r12,sp,16
8004068: b9 80 10 00 mv r2,r12
800406c: 35 61 00 84 addi r1,r11,132
8004070: f8 00 10 e5 calli 8008404 <_Timespec_Add_to>
if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
8004074: b9 80 08 00 mv r1,r12
8004078: 35 62 00 74 addi r2,r11,116
800407c: f8 00 11 40 calli 800857c <_Timespec_Less_than>
8004080: 44 20 00 05 be r1,r0,8004094 <_Rate_monotonic_Update_statistics+0xcc>
stats->min_wall_time = since_last_period;
8004084: 2b 81 00 10 lw r1,(sp+16)
8004088: 59 61 00 74 sw (r11+116),r1
800408c: 2b 81 00 14 lw r1,(sp+20)
8004090: 59 61 00 78 sw (r11+120),r1
if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
8004094: 37 81 00 10 addi r1,sp,16
8004098: 35 62 00 7c addi r2,r11,124
800409c: f8 00 11 2d calli 8008550 <_Timespec_Greater_than>
80040a0: 44 20 00 05 be r1,r0,80040b4 <_Rate_monotonic_Update_statistics+0xec>
stats->max_wall_time = since_last_period;
80040a4: 2b 81 00 10 lw r1,(sp+16)
80040a8: 59 61 00 7c sw (r11+124),r1
80040ac: 2b 81 00 14 lw r1,(sp+20)
80040b0: 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
}
80040b4: 2b 9d 00 04 lw ra,(sp+4)
80040b8: 2b 8b 00 0c lw r11,(sp+12)
80040bc: 2b 8c 00 08 lw r12,(sp+8)
80040c0: 37 9c 00 1c addi sp,sp,28
80040c4: c3 a0 00 00 ret
080093d4 <_Scheduler_priority_Block>:
void _Scheduler_priority_Block(
Scheduler_Control *the_scheduler,
Thread_Control *the_thread
)
{
80093d4: 37 9c ff ec addi sp,sp,-20
80093d8: 5b 8b 00 14 sw (sp+20),r11
80093dc: 5b 8c 00 10 sw (sp+16),r12
80093e0: 5b 8d 00 0c sw (sp+12),r13
80093e4: 5b 8e 00 08 sw (sp+8),r14
80093e8: 5b 9d 00 04 sw (sp+4),ra
80093ec: b8 40 60 00 mv r12,r2
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_extract(
Thread_Control *the_thread
)
{
Chain_Control *ready = the_thread->scheduler.priority->ready_chain;
80093f0: 28 42 00 8c lw r2,(r2+140)
80093f4: 28 43 00 00 lw r3,(r2+0)
if ( _Chain_Has_only_one_node( ready ) ) {
80093f8: 28 64 00 00 lw r4,(r3+0)
80093fc: 28 62 00 08 lw r2,(r3+8)
8009400: 5c 82 00 13 bne r4,r2,800944c <_Scheduler_priority_Block+0x78>
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 );
8009404: 34 62 00 04 addi r2,r3,4
head->next = tail;
8009408: 58 62 00 00 sw (r3+0),r2
head->previous = NULL;
800940c: 58 60 00 04 sw (r3+4),r0
tail->previous = head;
8009410: 58 63 00 08 sw (r3+8),r3
_Chain_Initialize_empty( ready );
_Priority_bit_map_Remove( &the_thread->scheduler.priority->Priority_map );
8009414: 29 82 00 8c lw r2,(r12+140)
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove (
Priority_bit_map_Information *the_priority_map
)
{
*the_priority_map->minor &= the_priority_map->block_minor;
8009418: 28 44 00 04 lw r4,(r2+4)
800941c: 2c 45 00 0e lhu r5,(r2+14)
8009420: 2c 83 00 00 lhu r3,(r4+0)
8009424: a0 65 18 00 and r3,r3,r5
8009428: 0c 83 00 00 sh (r4+0),r3
if ( *the_priority_map->minor == 0 )
800942c: 5c 60 00 0c bne r3,r0,800945c <_Scheduler_priority_Block+0x88>
_Priority_Major_bit_map &= the_priority_map->block_major;
8009430: 78 03 08 01 mvhi r3,0x801
8009434: 38 63 3a 08 ori r3,r3,0x3a08
8009438: 2c 64 00 00 lhu r4,(r3+0)
800943c: 2c 42 00 0c lhu r2,(r2+12)
8009440: a0 44 10 00 and r2,r2,r4
8009444: 0c 62 00 00 sh (r3+0),r2
8009448: e0 00 00 05 bi 800945c <_Scheduler_priority_Block+0x88>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
800944c: 29 83 00 00 lw r3,(r12+0)
previous = the_node->previous;
8009450: 29 82 00 04 lw r2,(r12+4)
next->previous = previous;
8009454: 58 62 00 04 sw (r3+4),r2
previous->next = next;
8009458: 58 43 00 00 sw (r2+0),r3
RTEMS_INLINE_ROUTINE bool _Thread_Is_heir (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Heir );
800945c: 78 02 08 01 mvhi r2,0x801
8009460: 38 42 39 e8 ori r2,r2,0x39e8
{
_Scheduler_priority_Ready_queue_extract(the_thread);
/* TODO: flash critical section */
if ( _Thread_Is_heir( the_thread ) )
8009464: 28 42 00 10 lw r2,(r2+16)
8009468: 5d 82 00 39 bne r12,r2,800954c <_Scheduler_priority_Block+0x178>
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 );
800946c: 78 02 08 01 mvhi r2,0x801
8009470: 38 42 3a 08 ori r2,r2,0x3a08
_Scheduler_priority_Block_body(the_scheduler, the_thread);
}
8009474: 28 2e 00 00 lw r14,(r1+0)
8009478: 2c 41 00 00 lhu r1,(r2+0)
800947c: 78 0b 08 01 mvhi r11,0x801
8009480: 34 02 00 ff mvi r2,255
8009484: 20 21 ff ff andi r1,r1,0xffff
8009488: 39 6b 1c 00 ori r11,r11,0x1c00
800948c: 54 22 00 05 bgu r1,r2,80094a0 <_Scheduler_priority_Block+0xcc>
8009490: b5 61 58 00 add r11,r11,r1
8009494: 41 6d 00 00 lbu r13,(r11+0)
8009498: 35 ad 00 08 addi r13,r13,8
800949c: e0 00 00 05 bi 80094b0 <_Scheduler_priority_Block+0xdc>
80094a0: 34 02 00 08 mvi r2,8
80094a4: f8 00 1d 24 calli 8010934 <__lshrsi3>
80094a8: b5 61 58 00 add r11,r11,r1
80094ac: 41 6d 00 00 lbu r13,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
80094b0: 34 02 00 01 mvi r2,1
80094b4: 78 0b 08 01 mvhi r11,0x801
80094b8: b9 a0 08 00 mv r1,r13
80094bc: f8 00 1c d0 calli 80107fc <__ashlsi3>
80094c0: 39 6b 3a 10 ori r11,r11,0x3a10
80094c4: b5 61 58 00 add r11,r11,r1
80094c8: 2d 62 00 00 lhu r2,(r11+0)
80094cc: 34 01 00 ff mvi r1,255
80094d0: 78 0b 08 01 mvhi r11,0x801
80094d4: 39 6b 1c 00 ori r11,r11,0x1c00
80094d8: 54 41 00 05 bgu r2,r1,80094ec <_Scheduler_priority_Block+0x118>
80094dc: b5 62 58 00 add r11,r11,r2
80094e0: 41 6b 00 00 lbu r11,(r11+0)
80094e4: 35 6b 00 08 addi r11,r11,8
80094e8: e0 00 00 06 bi 8009500 <_Scheduler_priority_Block+0x12c>
80094ec: b8 40 08 00 mv r1,r2
80094f0: 34 02 00 08 mvi r2,8
80094f4: f8 00 1d 10 calli 8010934 <__lshrsi3>
80094f8: b5 61 58 00 add r11,r11,r1
80094fc: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
8009500: 34 02 00 04 mvi r2,4
8009504: b9 a0 08 00 mv r1,r13
8009508: f8 00 1c bd calli 80107fc <__ashlsi3>
800950c: 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 ] ) )
8009510: 34 02 00 01 mvi r2,1
8009514: b9 60 08 00 mv r1,r11
8009518: f8 00 1c b9 calli 80107fc <__ashlsi3>
800951c: 34 02 00 02 mvi r2,2
8009520: b4 2b 08 00 add r1,r1,r11
8009524: f8 00 1c b6 calli 80107fc <__ashlsi3>
8009528: b5 c1 08 00 add r1,r14,r1
800952c: 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 );
8009530: 34 21 00 04 addi r1,r1,4
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
8009534: 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 ] ) )
8009538: 44 61 00 02 be r3,r1,8009540 <_Scheduler_priority_Block+0x16c><== NEVER TAKEN
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
800953c: b8 60 10 00 mv r2,r3
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(
Scheduler_Control *the_scheduler
)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8009540: 78 01 08 01 mvhi r1,0x801
8009544: 38 21 39 e8 ori r1,r1,0x39e8
8009548: 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 );
800954c: 78 01 08 01 mvhi r1,0x801
8009550: 38 21 39 e8 ori r1,r1,0x39e8
/* TODO: flash critical section */
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_priority_Schedule_body(the_scheduler);
if ( _Thread_Is_executing( the_thread ) )
8009554: 28 22 00 0c lw r2,(r1+12)
8009558: 5d 82 00 03 bne r12,r2,8009564 <_Scheduler_priority_Block+0x190>
_Thread_Dispatch_necessary = true;
800955c: 34 02 00 01 mvi r2,1
8009560: 30 22 00 18 sb (r1+24),r2
8009564: 2b 9d 00 04 lw ra,(sp+4)
8009568: 2b 8b 00 14 lw r11,(sp+20)
800956c: 2b 8c 00 10 lw r12,(sp+16)
8009570: 2b 8d 00 0c lw r13,(sp+12)
8009574: 2b 8e 00 08 lw r14,(sp+8)
8009578: 37 9c 00 14 addi sp,sp,20
800957c: c3 a0 00 00 ret
08004c0c <_Scheduler_priority_Schedule>:
*/
void _Scheduler_priority_Schedule(
Scheduler_Control *the_scheduler
)
{
8004c0c: 37 9c ff f0 addi sp,sp,-16
8004c10: 5b 8b 00 10 sw (sp+16),r11
8004c14: 5b 8c 00 0c sw (sp+12),r12
8004c18: 5b 8d 00 08 sw (sp+8),r13
8004c1c: 5b 9d 00 04 sw (sp+4),ra
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 );
8004c20: 78 02 08 01 mvhi r2,0x801
8004c24: 38 42 3a 08 ori r2,r2,0x3a08
_Scheduler_priority_Schedule_body( the_scheduler );
}
8004c28: 28 2d 00 00 lw r13,(r1+0)
8004c2c: 2c 41 00 00 lhu r1,(r2+0)
8004c30: 78 0b 08 01 mvhi r11,0x801
8004c34: 34 02 00 ff mvi r2,255
8004c38: 20 21 ff ff andi r1,r1,0xffff
8004c3c: 39 6b 1c 00 ori r11,r11,0x1c00
8004c40: 54 22 00 05 bgu r1,r2,8004c54 <_Scheduler_priority_Schedule+0x48>
8004c44: b5 61 58 00 add r11,r11,r1
8004c48: 41 6c 00 00 lbu r12,(r11+0)
8004c4c: 35 8c 00 08 addi r12,r12,8
8004c50: e0 00 00 05 bi 8004c64 <_Scheduler_priority_Schedule+0x58>
8004c54: 34 02 00 08 mvi r2,8
8004c58: f8 00 2f 37 calli 8010934 <__lshrsi3>
8004c5c: b5 61 58 00 add r11,r11,r1
8004c60: 41 6c 00 00 lbu r12,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
8004c64: 34 02 00 01 mvi r2,1
8004c68: 78 0b 08 01 mvhi r11,0x801
8004c6c: b9 80 08 00 mv r1,r12
8004c70: f8 00 2e e3 calli 80107fc <__ashlsi3>
8004c74: 39 6b 3a 10 ori r11,r11,0x3a10
8004c78: b5 61 58 00 add r11,r11,r1
8004c7c: 2d 62 00 00 lhu r2,(r11+0)
8004c80: 34 01 00 ff mvi r1,255
8004c84: 78 0b 08 01 mvhi r11,0x801
8004c88: 39 6b 1c 00 ori r11,r11,0x1c00
8004c8c: 54 41 00 05 bgu r2,r1,8004ca0 <_Scheduler_priority_Schedule+0x94>
8004c90: b5 62 58 00 add r11,r11,r2
8004c94: 41 6b 00 00 lbu r11,(r11+0)
8004c98: 35 6b 00 08 addi r11,r11,8
8004c9c: e0 00 00 06 bi 8004cb4 <_Scheduler_priority_Schedule+0xa8>
8004ca0: b8 40 08 00 mv r1,r2
8004ca4: 34 02 00 08 mvi r2,8
8004ca8: f8 00 2f 23 calli 8010934 <__lshrsi3>
8004cac: b5 61 58 00 add r11,r11,r1
8004cb0: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
8004cb4: 34 02 00 04 mvi r2,4
8004cb8: b9 80 08 00 mv r1,r12
8004cbc: f8 00 2e d0 calli 80107fc <__ashlsi3>
8004cc0: 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 ] ) )
8004cc4: 34 02 00 01 mvi r2,1
8004cc8: b9 60 08 00 mv r1,r11
8004ccc: f8 00 2e cc calli 80107fc <__ashlsi3>
8004cd0: 34 02 00 02 mvi r2,2
8004cd4: b4 2b 08 00 add r1,r1,r11
8004cd8: f8 00 2e c9 calli 80107fc <__ashlsi3>
8004cdc: b5 a1 08 00 add r1,r13,r1
8004ce0: 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 );
8004ce4: 34 21 00 04 addi r1,r1,4
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
8004ce8: 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 ] ) )
8004cec: 44 61 00 02 be r3,r1,8004cf4 <_Scheduler_priority_Schedule+0xe8><== NEVER TAKEN
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
8004cf0: b8 60 10 00 mv r2,r3
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(
Scheduler_Control *the_scheduler
)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8004cf4: 78 01 08 01 mvhi r1,0x801
8004cf8: 38 21 39 e8 ori r1,r1,0x39e8
8004cfc: 58 22 00 10 sw (r1+16),r2
8004d00: 2b 9d 00 04 lw ra,(sp+4)
8004d04: 2b 8b 00 10 lw r11,(sp+16)
8004d08: 2b 8c 00 0c lw r12,(sp+12)
8004d0c: 2b 8d 00 08 lw r13,(sp+8)
8004d10: 37 9c 00 10 addi sp,sp,16
8004d14: c3 a0 00 00 ret
08004eb0 <_Scheduler_priority_Yield>:
{
ISR_Level level;
Thread_Control *executing;
Chain_Control *ready;
executing = _Thread_Executing;
8004eb0: 78 01 08 01 mvhi r1,0x801
8004eb4: 38 21 39 e8 ori r1,r1,0x39e8
8004eb8: 28 21 00 0c lw r1,(r1+12)
ready = executing->scheduler.priority->ready_chain;
8004ebc: 28 22 00 8c lw r2,(r1+140)
8004ec0: 28 42 00 00 lw r2,(r2+0)
_ISR_Disable( level );
8004ec4: 90 00 20 00 rcsr r4,IE
8004ec8: 34 05 ff fe mvi r5,-2
8004ecc: a0 85 28 00 and r5,r4,r5
8004ed0: d0 05 00 00 wcsr IE,r5
if ( !_Chain_Has_only_one_node( ready ) ) {
8004ed4: 28 47 00 00 lw r7,(r2+0)
8004ed8: 28 46 00 08 lw r6,(r2+8)
8004edc: 78 03 08 01 mvhi r3,0x801
8004ee0: 38 63 39 e8 ori r3,r3,0x39e8
8004ee4: 44 e6 00 16 be r7,r6,8004f3c <_Scheduler_priority_Yield+0x8c>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
8004ee8: 28 27 00 00 lw r7,(r1+0)
previous = the_node->previous;
8004eec: 28 26 00 04 lw r6,(r1+4)
next->previous = previous;
8004ef0: 58 e6 00 04 sw (r7+4),r6
previous->next = next;
8004ef4: 58 c7 00 00 sw (r6+0),r7
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
8004ef8: 28 46 00 08 lw r6,(r2+8)
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
8004efc: 34 47 00 04 addi r7,r2,4
Chain_Node *old_last = tail->previous;
the_node->next = tail;
8004f00: 58 27 00 00 sw (r1+0),r7
tail->previous = the_node;
8004f04: 58 41 00 08 sw (r2+8),r1
old_last->next = the_node;
8004f08: 58 c1 00 00 sw (r6+0),r1
the_node->previous = old_last;
8004f0c: 58 26 00 04 sw (r1+4),r6
_Chain_Extract_unprotected( &executing->Object.Node );
_Chain_Append_unprotected( ready, &executing->Object.Node );
_ISR_Flash( level );
8004f10: d0 04 00 00 wcsr IE,r4
8004f14: d0 05 00 00 wcsr IE,r5
if ( _Thread_Is_heir( executing ) )
8004f18: 28 65 00 10 lw r5,(r3+16)
8004f1c: 5c 25 00 03 bne r1,r5,8004f28 <_Scheduler_priority_Yield+0x78><== NEVER TAKEN
_Thread_Heir = (Thread_Control *) _Chain_First( ready );
8004f20: 28 41 00 00 lw r1,(r2+0)
8004f24: 58 61 00 10 sw (r3+16),r1
_Thread_Dispatch_necessary = true;
8004f28: 78 01 08 01 mvhi r1,0x801
8004f2c: 38 21 39 e8 ori r1,r1,0x39e8
8004f30: 34 02 00 01 mvi r2,1
8004f34: 30 22 00 18 sb (r1+24),r2
8004f38: e0 00 00 05 bi 8004f4c <_Scheduler_priority_Yield+0x9c>
}
else if ( !_Thread_Is_heir( executing ) )
8004f3c: 28 62 00 10 lw r2,(r3+16)
8004f40: 44 22 00 03 be r1,r2,8004f4c <_Scheduler_priority_Yield+0x9c><== ALWAYS TAKEN
_Thread_Dispatch_necessary = true;
8004f44: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8004f48: 30 61 00 18 sb (r3+24),r1 <== NOT EXECUTED
_ISR_Enable( level );
8004f4c: d0 04 00 00 wcsr IE,r4
}
8004f50: c3 a0 00 00 ret
0800424c <_TOD_Validate>:
*/
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
800424c: 37 9c ff f0 addi sp,sp,-16
8004250: 5b 8b 00 10 sw (sp+16),r11
8004254: 5b 8c 00 0c sw (sp+12),r12
8004258: 5b 8d 00 08 sw (sp+8),r13
800425c: 5b 9d 00 04 sw (sp+4),ra
8004260: 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();
8004264: 78 01 08 01 mvhi r1,0x801
8004268: 38 21 f0 c4 ori r1,r1,0xf0c4
800426c: 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;
8004270: 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) ||
8004274: 45 60 00 22 be r11,r0,80042fc <_TOD_Validate+0xb0> <== NEVER TAKEN
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
8004278: 78 03 08 01 mvhi r3,0x801
800427c: 38 63 cb 6c ori r3,r3,0xcb6c
8004280: 28 61 00 00 lw r1,(r3+0)
8004284: f8 00 5d ff calli 801ba80 <__udivsi3>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
8004288: 29 62 00 18 lw r2,(r11+24)
800428c: 50 41 00 1c bgeu r2,r1,80042fc <_TOD_Validate+0xb0>
(the_tod->ticks >= ticks_per_second) ||
8004290: 29 62 00 14 lw r2,(r11+20)
8004294: 34 01 00 3b mvi r1,59
8004298: 54 41 00 19 bgu r2,r1,80042fc <_TOD_Validate+0xb0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
800429c: 29 62 00 10 lw r2,(r11+16)
80042a0: 54 41 00 17 bgu r2,r1,80042fc <_TOD_Validate+0xb0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
80042a4: 29 62 00 0c lw r2,(r11+12)
80042a8: 34 01 00 17 mvi r1,23
80042ac: 54 41 00 14 bgu r2,r1,80042fc <_TOD_Validate+0xb0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
80042b0: 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) ||
80042b4: 44 20 00 12 be r1,r0,80042fc <_TOD_Validate+0xb0> <== NEVER TAKEN
(the_tod->month == 0) ||
80042b8: 34 02 00 0c mvi r2,12
80042bc: 54 22 00 10 bgu r1,r2,80042fc <_TOD_Validate+0xb0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
80042c0: 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) ||
80042c4: 34 03 07 c3 mvi r3,1987
80042c8: 50 62 00 0d bgeu r3,r2,80042fc <_TOD_Validate+0xb0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
80042cc: 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) ||
80042d0: 45 a0 00 0b be r13,r0,80042fc <_TOD_Validate+0xb0> <== NEVER TAKEN
80042d4: 78 0b 08 01 mvhi r11,0x801
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
80042d8: 20 42 00 03 andi r2,r2,0x3
80042dc: 39 6b d4 24 ori r11,r11,0xd424
80042e0: 5c 40 00 02 bne r2,r0,80042e8 <_TOD_Validate+0x9c>
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
80042e4: 34 21 00 0d addi r1,r1,13
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
80042e8: 34 02 00 02 mvi r2,2
80042ec: fb ff f3 ed calli 80012a0 <__ashlsi3>
80042f0: b5 61 08 00 add r1,r11,r1
80042f4: 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(
80042f8: f1 8d 60 00 cmpgeu r12,r12,r13
if ( the_tod->day > days_in_month )
return false;
return true;
}
80042fc: b9 80 08 00 mv r1,r12
8004300: 2b 9d 00 04 lw ra,(sp+4)
8004304: 2b 8b 00 10 lw r11,(sp+16)
8004308: 2b 8c 00 0c lw r12,(sp+12)
800430c: 2b 8d 00 08 lw r13,(sp+8)
8004310: 37 9c 00 10 addi sp,sp,16
8004314: c3 a0 00 00 ret
08004f54 <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
8004f54: 37 9c ff e8 addi sp,sp,-24
8004f58: 5b 8b 00 14 sw (sp+20),r11
8004f5c: 5b 8c 00 10 sw (sp+16),r12
8004f60: 5b 8d 00 0c sw (sp+12),r13
8004f64: 5b 8e 00 08 sw (sp+8),r14
8004f68: 5b 9d 00 04 sw (sp+4),ra
*/
/*
* Save original state
*/
original_state = the_thread->current_state;
8004f6c: 28 2e 00 10 lw r14,(r1+16)
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
8004f70: b8 20 58 00 mv r11,r1
/*
* 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 );
8004f74: 5b 82 00 18 sw (sp+24),r2
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
8004f78: 20 6d 00 ff andi r13,r3,0xff
/*
* Set a transient state for the thread so it is pulled off the Ready chains.
* This will prevent it from being scheduled no matter what happens in an
* ISR.
*/
_Thread_Set_transient( the_thread );
8004f7c: f8 00 03 e7 calli 8005f18 <_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 )
8004f80: 29 61 00 14 lw r1,(r11+20)
8004f84: 2b 82 00 18 lw r2,(sp+24)
8004f88: 44 22 00 03 be r1,r2,8004f94 <_Thread_Change_priority+0x40>
_Thread_Set_priority( the_thread, new_priority );
8004f8c: b9 60 08 00 mv r1,r11
8004f90: f8 00 03 bd calli 8005e84 <_Thread_Set_priority>
_ISR_Disable( level );
8004f94: 90 00 60 00 rcsr r12,IE
8004f98: 34 05 ff fe mvi r5,-2
8004f9c: a1 85 28 00 and r5,r12,r5
8004fa0: d0 05 00 00 wcsr IE,r5
/*
* 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;
8004fa4: 29 61 00 10 lw r1,(r11+16)
if ( state != STATES_TRANSIENT ) {
8004fa8: 34 02 00 04 mvi r2,4
8004fac: 21 c4 00 04 andi r4,r14,0x4
8004fb0: 44 22 00 0f be r1,r2,8004fec <_Thread_Change_priority+0x98>
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
8004fb4: 5c 80 00 04 bne r4,r0,8004fc4 <_Thread_Change_priority+0x70><== NEVER TAKEN
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
8004fb8: 34 02 ff fb mvi r2,-5
8004fbc: a0 22 10 00 and r2,r1,r2
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
8004fc0: 59 62 00 10 sw (r11+16),r2
_ISR_Enable( level );
8004fc4: 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);
8004fc8: 78 03 08 01 mvhi r3,0x801
8004fcc: 38 63 1d 78 ori r3,r3,0x1d78
8004fd0: 28 62 00 00 lw r2,(r3+0)
8004fd4: a0 22 08 00 and r1,r1,r2
if ( _States_Is_waiting_on_thread_queue( state ) ) {
8004fd8: 44 20 00 3d be r1,r0,80050cc <_Thread_Change_priority+0x178>
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
8004fdc: 29 61 00 44 lw r1,(r11+68)
8004fe0: b9 60 10 00 mv r2,r11
8004fe4: f8 00 03 73 calli 8005db0 <_Thread_queue_Requeue>
8004fe8: e0 00 00 39 bi 80050cc <_Thread_Change_priority+0x178>
}
return;
}
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) ) {
8004fec: 5c 80 00 28 bne r4,r0,800508c <_Thread_Change_priority+0x138><== NEVER TAKEN
8004ff0: 78 02 08 01 mvhi r2,0x801
* Ready Queue with interrupts off.
*
* FIXME: hard-coded for priority scheduling. Might be ok since this
* function is specific to priority scheduling?
*/
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
8004ff4: 59 60 00 10 sw (r11+16),r0
8004ff8: 29 61 00 8c lw r1,(r11+140)
8004ffc: 38 42 3a 08 ori r2,r2,0x3a08
if ( prepend_it )
8005000: 45 a4 00 12 be r13,r4,8005048 <_Thread_Change_priority+0xf4>
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add (
Priority_bit_map_Information *the_priority_map
)
{
*the_priority_map->minor |= the_priority_map->ready_minor;
8005004: 28 23 00 04 lw r3,(r1+4)
8005008: 2c 24 00 0a lhu r4,(r1+10)
800500c: 2c 66 00 00 lhu r6,(r3+0)
8005010: b8 c4 20 00 or r4,r6,r4
8005014: 0c 64 00 00 sh (r3+0),r4
_Priority_Major_bit_map |= the_priority_map->ready_major;
8005018: 2c 43 00 00 lhu r3,(r2+0)
800501c: 2c 24 00 08 lhu r4,(r1+8)
Thread_Control *the_thread
)
{
_Priority_bit_map_Add( &the_thread->scheduler.priority->Priority_map );
_Chain_Prepend_unprotected( the_thread->scheduler.priority->ready_chain,
8005020: 28 21 00 00 lw r1,(r1+0)
8005024: b8 83 18 00 or r3,r4,r3
8005028: 20 63 ff ff andi r3,r3,0xffff
800502c: 0c 43 00 00 sh (r2+0),r3
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
8005030: 28 22 00 00 lw r2,(r1+0)
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
8005034: 59 61 00 04 sw (r11+4),r1
before_node = after_node->next;
after_node->next = the_node;
8005038: 58 2b 00 00 sw (r1+0),r11
the_node->next = before_node;
800503c: 59 62 00 00 sw (r11+0),r2
before_node->previous = the_node;
8005040: 58 4b 00 04 sw (r2+4),r11
8005044: e0 00 00 12 bi 800508c <_Thread_Change_priority+0x138>
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add (
Priority_bit_map_Information *the_priority_map
)
{
*the_priority_map->minor |= the_priority_map->ready_minor;
8005048: 28 23 00 04 lw r3,(r1+4)
800504c: 2c 24 00 0a lhu r4,(r1+10)
8005050: 2c 66 00 00 lhu r6,(r3+0)
8005054: b8 c4 20 00 or r4,r6,r4
8005058: 0c 64 00 00 sh (r3+0),r4
_Priority_Major_bit_map |= the_priority_map->ready_major;
800505c: 2c 24 00 08 lhu r4,(r1+8)
8005060: 2c 43 00 00 lhu r3,(r2+0)
Thread_Control *the_thread
)
{
_Priority_bit_map_Add( &the_thread->scheduler.priority->Priority_map );
_Chain_Append_unprotected( the_thread->scheduler.priority->ready_chain,
8005064: 28 21 00 00 lw r1,(r1+0)
8005068: b8 83 18 00 or r3,r4,r3
800506c: 20 63 ff ff andi r3,r3,0xffff
8005070: 0c 43 00 00 sh (r2+0),r3
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
8005074: 28 22 00 08 lw r2,(r1+8)
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
8005078: 34 23 00 04 addi r3,r1,4
Chain_Node *old_last = tail->previous;
the_node->next = tail;
800507c: 59 63 00 00 sw (r11+0),r3
tail->previous = the_node;
8005080: 58 2b 00 08 sw (r1+8),r11
old_last->next = the_node;
8005084: 58 4b 00 00 sw (r2+0),r11
the_node->previous = old_last;
8005088: 59 62 00 04 sw (r11+4),r2
_Scheduler_priority_Ready_queue_enqueue_first( the_thread );
else
_Scheduler_priority_Ready_queue_enqueue( the_thread );
}
_ISR_Flash( level );
800508c: d0 0c 00 00 wcsr IE,r12
8005090: d0 05 00 00 wcsr IE,r5
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Schedule(
Scheduler_Control *the_scheduler
)
{
the_scheduler->Operations.schedule( the_scheduler );
8005094: 78 01 08 01 mvhi r1,0x801
8005098: 38 21 38 ac ori r1,r1,0x38ac
800509c: 28 22 00 04 lw r2,(r1+4)
80050a0: d8 40 00 00 call r2
* is also the heir thread, and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void )
{
return ( _Thread_Executing == _Thread_Heir );
80050a4: 78 01 08 01 mvhi r1,0x801
80050a8: 38 21 39 e8 ori r1,r1,0x39e8
80050ac: 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(&_Scheduler);
if ( !_Thread_Is_executing_also_the_heir() &&
80050b0: 28 23 00 10 lw r3,(r1+16)
80050b4: 44 43 00 05 be r2,r3,80050c8 <_Thread_Change_priority+0x174>
80050b8: 40 42 00 74 lbu r2,(r2+116)
80050bc: 44 40 00 03 be r2,r0,80050c8 <_Thread_Change_priority+0x174>
_Thread_Executing->is_preemptible )
_Thread_Dispatch_necessary = true;
80050c0: 34 02 00 01 mvi r2,1
80050c4: 30 22 00 18 sb (r1+24),r2
_ISR_Enable( level );
80050c8: d0 0c 00 00 wcsr IE,r12
}
80050cc: 2b 9d 00 04 lw ra,(sp+4)
80050d0: 2b 8b 00 14 lw r11,(sp+20)
80050d4: 2b 8c 00 10 lw r12,(sp+16)
80050d8: 2b 8d 00 0c lw r13,(sp+12)
80050dc: 2b 8e 00 08 lw r14,(sp+8)
80050e0: 37 9c 00 18 addi sp,sp,24
80050e4: c3 a0 00 00 ret
0800bd64 <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
800bd64: 37 9c ff f8 addi sp,sp,-8
800bd68: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
800bd6c: 37 82 00 08 addi r2,sp,8
800bd70: f8 00 00 7c calli 800bf60 <_Thread_Get>
switch ( location ) {
800bd74: 2b 82 00 08 lw r2,(sp+8)
800bd78: 5c 40 00 0a bne r2,r0,800bda0 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
800bd7c: 78 03 08 02 mvhi r3,0x802
800bd80: 38 63 53 3c ori r3,r3,0x533c
800bd84: 28 62 00 00 lw r2,(r3+0)
800bd88: fb ff ff 6d calli 800bb3c <_Thread_Clear_state>
800bd8c: 78 01 08 02 mvhi r1,0x802
800bd90: 38 21 79 a8 ori r1,r1,0x79a8
800bd94: 28 22 00 00 lw r2,(r1+0)
800bd98: 34 42 ff ff addi r2,r2,-1
800bd9c: 58 22 00 00 sw (r1+0),r2
| STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Thread_Unnest_dispatch();
break;
}
}
800bda0: 2b 9d 00 04 lw ra,(sp+4)
800bda4: 37 9c 00 08 addi sp,sp,8
800bda8: c3 a0 00 00 ret
080052ac <_Thread_Dispatch>:
* dispatch thread
* no dispatch thread
*/
void _Thread_Dispatch( void )
{
80052ac: 37 9c ff c0 addi sp,sp,-64
80052b0: 5b 8b 00 30 sw (sp+48),r11
80052b4: 5b 8c 00 2c sw (sp+44),r12
80052b8: 5b 8d 00 28 sw (sp+40),r13
80052bc: 5b 8e 00 24 sw (sp+36),r14
80052c0: 5b 8f 00 20 sw (sp+32),r15
80052c4: 5b 90 00 1c sw (sp+28),r16
80052c8: 5b 91 00 18 sw (sp+24),r17
80052cc: 5b 92 00 14 sw (sp+20),r18
80052d0: 5b 93 00 10 sw (sp+16),r19
80052d4: 5b 94 00 0c sw (sp+12),r20
80052d8: 5b 95 00 08 sw (sp+8),r21
80052dc: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *executing;
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
80052e0: 78 01 08 01 mvhi r1,0x801
80052e4: 38 21 39 e8 ori r1,r1,0x39e8
80052e8: 28 2d 00 0c lw r13,(r1+12)
_ISR_Disable( level );
80052ec: 90 00 20 00 rcsr r4,IE
80052f0: 34 01 ff fe mvi r1,-2
80052f4: a0 81 08 00 and r1,r4,r1
80052f8: d0 01 00 00 wcsr IE,r1
while ( _Thread_Dispatch_necessary == true ) {
80052fc: 78 0c 08 01 mvhi r12,0x801
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
8005300: 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;
8005304: 78 0f 08 01 mvhi r15,0x801
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
8005308: 78 0e 08 01 mvhi r14,0x801
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
800530c: 78 10 08 01 mvhi r16,0x801
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
8005310: 39 8c 39 e8 ori r12,r12,0x39e8
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
8005314: 3a 31 38 28 ori r17,r17,0x3828
8005318: 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;
800531c: 39 ef 37 c0 ori r15,r15,0x37c0
_ISR_Enable( level );
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
8005320: 37 93 00 3c addi r19,sp,60
_Timestamp_Subtract(
8005324: 39 ce 38 f4 ori r14,r14,0x38f4
8005328: 37 92 00 34 addi r18,sp,52
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
800532c: 3a 10 38 cc ori r16,r16,0x38cc
#endif
#endif
executing = _Thread_Executing;
_ISR_Disable( level );
8005330: 34 15 ff fe mvi r21,-2
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
8005334: e0 00 00 28 bi 80053d4 <_Thread_Dispatch+0x128>
heir = _Thread_Heir;
8005338: 29 8b 00 10 lw r11,(r12+16)
_Thread_Dispatch_disable_level = 1;
800533c: 5a 34 00 00 sw (r17+0),r20
_Thread_Dispatch_necessary = false;
8005340: 31 80 00 18 sb (r12+24),r0
_Thread_Executing = heir;
8005344: 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 )
8005348: 45 6d 00 26 be r11,r13,80053e0 <_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 )
800534c: 29 61 00 7c lw r1,(r11+124)
8005350: 5c 34 00 03 bne r1,r20,800535c <_Thread_Dispatch+0xb0>
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
8005354: 29 e1 00 00 lw r1,(r15+0)
8005358: 59 61 00 78 sw (r11+120),r1
_ISR_Enable( level );
800535c: d0 04 00 00 wcsr IE,r4
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
8005360: ba 60 08 00 mv r1,r19
8005364: f8 00 0e ce calli 8008e9c <_TOD_Get_uptime>
_Timestamp_Subtract(
8005368: b9 c0 08 00 mv r1,r14
800536c: ba 60 10 00 mv r2,r19
8005370: ba 40 18 00 mv r3,r18
8005374: f8 00 03 98 calli 80061d4 <_Timespec_Subtract>
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
8005378: 35 a1 00 84 addi r1,r13,132
800537c: ba 40 10 00 mv r2,r18
8005380: f8 00 03 7c calli 8006170 <_Timespec_Add_to>
_Thread_Time_of_last_context_switch = uptime;
8005384: 2b 81 00 3c lw r1,(sp+60)
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8005388: 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;
800538c: 59 c1 00 00 sw (r14+0),r1
8005390: 2b 81 00 40 lw r1,(sp+64)
8005394: 59 c1 00 04 sw (r14+4),r1
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8005398: 44 80 00 05 be r4,r0,80053ac <_Thread_Dispatch+0x100> <== NEVER TAKEN
executing->libc_reent = *_Thread_libc_reent;
800539c: 28 81 00 00 lw r1,(r4+0)
80053a0: 59 a1 01 14 sw (r13+276),r1
*_Thread_libc_reent = heir->libc_reent;
80053a4: 29 61 01 14 lw r1,(r11+276)
80053a8: 58 81 00 00 sw (r4+0),r1
}
_User_extensions_Thread_switch( executing, heir );
80053ac: b9 a0 08 00 mv r1,r13
80053b0: b9 60 10 00 mv r2,r11
80053b4: f8 00 04 83 calli 80065c0 <_User_extensions_Thread_switch>
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
80053b8: 35 a1 00 c0 addi r1,r13,192
80053bc: 35 62 00 c0 addi r2,r11,192
80053c0: f8 00 05 97 calli 8006a1c <_CPU_Context_switch>
if ( executing->fp_context != NULL )
_Context_Restore_fp( &executing->fp_context );
#endif
#endif
executing = _Thread_Executing;
80053c4: 29 8d 00 0c lw r13,(r12+12)
_ISR_Disable( level );
80053c8: 90 00 20 00 rcsr r4,IE
80053cc: a0 95 08 00 and r1,r4,r21
80053d0: d0 01 00 00 wcsr IE,r1
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
80053d4: 41 81 00 18 lbu r1,(r12+24)
80053d8: 20 21 00 ff andi r1,r1,0xff
80053dc: 5c 20 ff d7 bne r1,r0,8005338 <_Thread_Dispatch+0x8c>
_ISR_Disable( level );
}
post_switch:
_Thread_Dispatch_disable_level = 0;
80053e0: 78 01 08 01 mvhi r1,0x801
80053e4: 38 21 38 28 ori r1,r1,0x3828
80053e8: 58 20 00 00 sw (r1+0),r0
_ISR_Enable( level );
80053ec: d0 04 00 00 wcsr IE,r4
_API_extensions_Run_postswitch();
80053f0: fb ff f7 cb calli 800331c <_API_extensions_Run_postswitch>
}
80053f4: 2b 9d 00 04 lw ra,(sp+4)
80053f8: 2b 8b 00 30 lw r11,(sp+48)
80053fc: 2b 8c 00 2c lw r12,(sp+44)
8005400: 2b 8d 00 28 lw r13,(sp+40)
8005404: 2b 8e 00 24 lw r14,(sp+36)
8005408: 2b 8f 00 20 lw r15,(sp+32)
800540c: 2b 90 00 1c lw r16,(sp+28)
8005410: 2b 91 00 18 lw r17,(sp+24)
8005414: 2b 92 00 14 lw r18,(sp+20)
8005418: 2b 93 00 10 lw r19,(sp+16)
800541c: 2b 94 00 0c lw r20,(sp+12)
8005420: 2b 95 00 08 lw r21,(sp+8)
8005424: 37 9c 00 40 addi sp,sp,64
8005428: c3 a0 00 00 ret
08005460 <_Thread_Get>:
*/
Thread_Control *_Thread_Get (
Objects_Id id,
Objects_Locations *location
)
{
8005460: 37 9c ff e8 addi sp,sp,-24
8005464: 5b 8b 00 18 sw (sp+24),r11
8005468: 5b 8c 00 14 sw (sp+20),r12
800546c: 5b 8d 00 10 sw (sp+16),r13
8005470: 5b 8e 00 0c sw (sp+12),r14
8005474: 5b 8f 00 08 sw (sp+8),r15
8005478: 5b 9d 00 04 sw (sp+4),ra
800547c: b8 20 68 00 mv r13,r1
8005480: b8 40 58 00 mv r11,r2
uint32_t the_class;
Objects_Information **api_information;
Objects_Information *information;
Thread_Control *tp = (Thread_Control *) 0;
if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
8005484: 5c 20 00 0b bne r1,r0,80054b0 <_Thread_Get+0x50>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8005488: 78 01 08 01 mvhi r1,0x801
800548c: 38 21 38 28 ori r1,r1,0x3828
8005490: 28 22 00 00 lw r2,(r1+0)
8005494: 34 42 00 01 addi r2,r2,1
8005498: 58 22 00 00 sw (r1+0),r2
_Thread_Disable_dispatch();
*location = OBJECTS_LOCAL;
tp = _Thread_Executing;
800549c: 78 01 08 01 mvhi r1,0x801
80054a0: 38 21 39 e8 ori r1,r1,0x39e8
Objects_Information *information;
Thread_Control *tp = (Thread_Control *) 0;
if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
_Thread_Disable_dispatch();
*location = OBJECTS_LOCAL;
80054a4: 59 60 00 00 sw (r11+0),r0
tp = _Thread_Executing;
80054a8: 28 21 00 0c lw r1,(r1+12)
goto done;
80054ac: e0 00 00 1c bi 800551c <_Thread_Get+0xbc>
*/
RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API(
Objects_Id id
)
{
return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS);
80054b0: 34 02 00 18 mvi r2,24
80054b4: f8 00 2d 20 calli 8010934 <__lshrsi3>
80054b8: 20 2f 00 07 andi r15,r1,0x7
*/
RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid(
uint32_t the_api
)
{
if ( !the_api || the_api > OBJECTS_APIS_LAST )
80054bc: 35 e1 ff ff addi r1,r15,-1
80054c0: 34 02 00 02 mvi r2,2
80054c4: 50 41 00 1e bgeu r2,r1,800553c <_Thread_Get+0xdc>
}
the_api = _Objects_Get_API( id );
if ( !_Objects_Is_api_valid( the_api ) ) {
*location = OBJECTS_ERROR;
80054c8: 34 01 00 01 mvi r1,1
80054cc: 59 61 00 00 sw (r11+0),r1
80054d0: e0 00 00 02 bi 80054d8 <_Thread_Get+0x78>
goto done;
}
the_class = _Objects_Get_class( id );
if ( the_class != 1 ) { /* threads are always first class :) */
*location = OBJECTS_ERROR;
80054d4: 59 62 00 00 sw (r11+0),r2
{
uint32_t the_api;
uint32_t the_class;
Objects_Information **api_information;
Objects_Information *information;
Thread_Control *tp = (Thread_Control *) 0;
80054d8: 34 01 00 00 mvi r1,0
}
the_class = _Objects_Get_class( id );
if ( the_class != 1 ) { /* threads are always first class :) */
*location = OBJECTS_ERROR;
goto done;
80054dc: e0 00 00 10 bi 800551c <_Thread_Get+0xbc>
}
api_information = _Objects_Information_table[ the_api ];
80054e0: 78 0e 08 01 mvhi r14,0x801
80054e4: b9 e0 08 00 mv r1,r15
80054e8: 34 02 00 02 mvi r2,2
80054ec: f8 00 2c c4 calli 80107fc <__ashlsi3>
80054f0: 39 ce 37 c4 ori r14,r14,0x37c4
80054f4: b5 c1 08 00 add r1,r14,r1
80054f8: 28 21 00 00 lw r1,(r1+0)
/*
* There is no way for this to happen if POSIX is enabled.
*/
#if !defined(RTEMS_POSIX_API)
if ( !api_information ) {
80054fc: 44 20 00 03 be r1,r0,8005508 <_Thread_Get+0xa8> <== NEVER TAKEN
*location = OBJECTS_ERROR;
goto done;
}
#endif
information = api_information[ the_class ];
8005500: 28 21 00 04 lw r1,(r1+4)
if ( !information ) {
8005504: 5c 20 00 03 bne r1,r0,8005510 <_Thread_Get+0xb0>
*location = OBJECTS_ERROR;
8005508: 59 6c 00 00 sw (r11+0),r12
goto done;
800550c: e0 00 00 04 bi 800551c <_Thread_Get+0xbc>
}
tp = (Thread_Control *) _Objects_Get( information, id, location );
8005510: b9 a0 10 00 mv r2,r13
8005514: b9 60 18 00 mv r3,r11
8005518: fb ff fc 5e calli 8004690 <_Objects_Get>
done:
return tp;
}
800551c: 2b 9d 00 04 lw ra,(sp+4)
8005520: 2b 8b 00 18 lw r11,(sp+24)
8005524: 2b 8c 00 14 lw r12,(sp+20)
8005528: 2b 8d 00 10 lw r13,(sp+16)
800552c: 2b 8e 00 0c lw r14,(sp+12)
8005530: 2b 8f 00 08 lw r15,(sp+8)
8005534: 37 9c 00 18 addi sp,sp,24
8005538: c3 a0 00 00 ret
*/
RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
Objects_Id id
)
{
return (uint32_t)
800553c: 34 02 00 1b mvi r2,27
8005540: b9 a0 08 00 mv r1,r13
8005544: f8 00 2c fc calli 8010934 <__lshrsi3>
*location = OBJECTS_ERROR;
goto done;
}
the_class = _Objects_Get_class( id );
if ( the_class != 1 ) { /* threads are always first class :) */
8005548: 34 02 00 01 mvi r2,1
800554c: b8 20 60 00 mv r12,r1
8005550: 44 22 ff e4 be r1,r2,80054e0 <_Thread_Get+0x80>
8005554: e3 ff ff e0 bi 80054d4 <_Thread_Get+0x74>
0800b250 <_Thread_Handler>:
*
* Output parameters: NONE
*/
void _Thread_Handler( void )
{
800b250: 37 9c ff f4 addi sp,sp,-12
800b254: 5b 8b 00 0c sw (sp+12),r11
800b258: 5b 8c 00 08 sw (sp+8),r12
800b25c: 5b 9d 00 04 sw (sp+4),ra
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static char doneConstructors;
char doneCons;
#endif
executing = _Thread_Executing;
800b260: 78 01 08 01 mvhi r1,0x801
800b264: 38 21 39 e8 ori r1,r1,0x39e8
800b268: 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;
800b26c: 29 61 00 ac lw r1,(r11+172)
_ISR_Set_level(level);
800b270: 64 21 00 00 cmpei r1,r1,0
800b274: d0 01 00 00 wcsr IE,r1
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
doneCons = doneConstructors;
800b278: 78 01 08 01 mvhi r1,0x801
800b27c: 38 21 36 40 ori r1,r1,0x3640
800b280: 40 2c 00 00 lbu r12,(r1+0)
doneConstructors = 1;
800b284: 34 02 00 01 mvi r2,1
800b288: 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 );
800b28c: b9 60 08 00 mv r1,r11
800b290: fb ff ec 24 calli 8006320 <_User_extensions_Thread_begin>
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
800b294: fb ff e8 66 calli 800542c <_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) */ {
800b298: 5d 80 00 02 bne r12,r0,800b2a0 <_Thread_Handler+0x50>
INIT_NAME ();
800b29c: fb ff d3 59 calli 8000000 <RamBase>
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
800b2a0: 29 61 00 94 lw r1,(r11+148)
800b2a4: 5c 20 00 05 bne r1,r0,800b2b8 <_Thread_Handler+0x68> <== NEVER TAKEN
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
800b2a8: 29 62 00 90 lw r2,(r11+144)
800b2ac: 29 61 00 9c lw r1,(r11+156)
800b2b0: d8 40 00 00 call r2
INIT_NAME ();
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
executing->Wait.return_argument =
800b2b4: 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 );
800b2b8: b9 60 08 00 mv r1,r11
800b2bc: fb ff ec 31 calli 8006380 <_User_extensions_Thread_exitted>
_Internal_error_Occurred(
800b2c0: 34 01 00 00 mvi r1,0
800b2c4: 34 02 00 01 mvi r2,1
800b2c8: 34 03 00 05 mvi r3,5
800b2cc: fb ff e3 37 calli 8003fa8 <_Internal_error_Occurred>
08005558 <_Thread_Initialize>:
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
8005558: 37 9c ff e4 addi sp,sp,-28
800555c: 5b 8b 00 1c sw (sp+28),r11
8005560: 5b 8c 00 18 sw (sp+24),r12
8005564: 5b 8d 00 14 sw (sp+20),r13
8005568: 5b 8e 00 10 sw (sp+16),r14
800556c: 5b 8f 00 0c sw (sp+12),r15
8005570: 5b 90 00 08 sw (sp+8),r16
8005574: 5b 9d 00 04 sw (sp+4),ra
/*
* Zero out all the allocated memory fields
*/
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
the_thread->API_Extensions[i] = NULL;
8005578: 58 40 01 18 sw (r2+280),r0
800557c: 58 40 01 1c sw (r2+284),r0
extensions_area = NULL;
the_thread->libc_reent = NULL;
8005580: 58 40 01 14 sw (r2+276),r0
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
8005584: b8 20 78 00 mv r15,r1
8005588: b8 40 58 00 mv r11,r2
/*
* Allocate and Initialize the stack for this thread.
*/
#if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
800558c: b8 40 08 00 mv r1,r2
8005590: b8 80 10 00 mv r2,r4
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
8005594: b8 80 60 00 mv r12,r4
8005598: b8 c0 70 00 mv r14,r6
800559c: b9 00 68 00 mv r13,r8
80055a0: 20 f0 00 ff andi r16,r7,0xff
/*
* Allocate and Initialize the stack for this thread.
*/
#if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
80055a4: f8 00 02 82 calli 8005fac <_Thread_Stack_Allocate>
if ( !actual_stack_size || actual_stack_size < stack_size )
80055a8: f5 81 60 00 cmpgu r12,r12,r1
80055ac: 64 22 00 00 cmpei r2,r1,0
return false; /* stack allocation failed */
80055b0: 34 03 00 00 mvi r3,0
/*
* Allocate and Initialize the stack for this thread.
*/
#if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
if ( !actual_stack_size || actual_stack_size < stack_size )
80055b4: b9 82 60 00 or r12,r12,r2
80055b8: 5d 80 00 57 bne r12,r0,8005714 <_Thread_Initialize+0x1bc>
Stack_Control *the_stack,
void *starting_address,
size_t size
)
{
the_stack->area = starting_address;
80055bc: 29 62 00 bc lw r2,(r11+188)
the_stack->size = size;
80055c0: 59 61 00 b4 sw (r11+180),r1
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
80055c4: 59 60 00 50 sw (r11+80),r0
Stack_Control *the_stack,
void *starting_address,
size_t size
)
{
the_stack->area = starting_address;
80055c8: 59 62 00 b8 sw (r11+184),r2
#endif
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
80055cc: 78 02 08 01 mvhi r2,0x801
80055d0: 38 42 38 d8 ori r2,r2,0x38d8
80055d4: 28 42 00 00 lw r2,(r2+0)
the_watchdog->routine = routine;
80055d8: 59 60 00 64 sw (r11+100),r0
the_watchdog->id = id;
80055dc: 59 60 00 68 sw (r11+104),r0
the_watchdog->user_data = user_data;
80055e0: 59 60 00 6c sw (r11+108),r0
80055e4: 44 4c 00 07 be r2,r12,8005600 <_Thread_Initialize+0xa8>
extensions_area = _Workspace_Allocate(
(_Thread_Maximum_extensions + 1) * sizeof( void * )
80055e8: 34 41 00 01 addi r1,r2,1
80055ec: 34 02 00 02 mvi r2,2
80055f0: f8 00 2c 83 calli 80107fc <__ashlsi3>
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
extensions_area = _Workspace_Allocate(
80055f4: f8 00 04 e7 calli 8006990 <_Workspace_Allocate>
80055f8: b8 20 60 00 mv r12,r1
(_Thread_Maximum_extensions + 1) * sizeof( void * )
);
if ( !extensions_area )
80055fc: 44 20 00 33 be r1,r0,80056c8 <_Thread_Initialize+0x170>
goto failed;
}
the_thread->extensions = (void **) extensions_area;
8005600: 59 6c 01 20 sw (r11+288),r12
* if they are linked to the thread. An extension user may
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
8005604: 45 80 00 0b be r12,r0,8005630 <_Thread_Initialize+0xd8>
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
8005608: 78 02 08 01 mvhi r2,0x801
800560c: 38 42 38 d8 ori r2,r2,0x38d8
8005610: 28 41 00 00 lw r1,(r2+0)
8005614: b9 80 18 00 mv r3,r12
8005618: 34 02 00 00 mvi r2,0
800561c: e0 00 00 04 bi 800562c <_Thread_Initialize+0xd4>
the_thread->extensions[i] = NULL;
8005620: 58 60 00 00 sw (r3+0),r0
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
8005624: 34 42 00 01 addi r2,r2,1
8005628: 34 63 00 04 addi r3,r3,4
800562c: 50 22 ff fd bgeu r1,r2,8005620 <_Thread_Initialize+0xc8>
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
the_thread->Start.budget_callout = budget_callout;
8005630: 2b 81 00 20 lw r1,(sp+32)
Scheduler_Control *the_scheduler,
Thread_Control *the_thread
)
{
return
the_scheduler->Operations.scheduler_allocate( the_scheduler, the_thread );
8005634: 78 03 08 01 mvhi r3,0x801
8005638: 38 63 38 ac ori r3,r3,0x38ac
800563c: 59 61 00 a8 sw (r11+168),r1
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
8005640: 2b 81 00 24 lw r1,(sp+36)
RTEMS_INLINE_ROUTINE void* _Scheduler_Thread_scheduler_allocate(
Scheduler_Control *the_scheduler,
Thread_Control *the_thread
)
{
return
8005644: 28 64 00 14 lw r4,(r3+20)
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
8005648: 59 6d 00 a4 sw (r11+164),r13
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
800564c: 59 61 00 ac sw (r11+172),r1
the_thread->current_state = STATES_DORMANT;
8005650: 34 01 00 01 mvi r1,1
8005654: 59 61 00 10 sw (r11+16),r1
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
8005658: 31 70 00 a0 sb (r11+160),r16
}
the_thread->Start.isr_level = isr_level;
the_thread->current_state = STATES_DORMANT;
the_thread->Wait.queue = NULL;
800565c: 59 60 00 44 sw (r11+68),r0
the_thread->resource_count = 0;
8005660: 59 60 00 1c sw (r11+28),r0
the_thread->real_priority = priority;
8005664: 59 6e 00 18 sw (r11+24),r14
the_thread->Start.initial_priority = priority;
8005668: 59 6e 00 b0 sw (r11+176),r14
800566c: b8 60 08 00 mv r1,r3
8005670: b9 60 10 00 mv r2,r11
8005674: d8 80 00 00 call r4
8005678: b8 20 68 00 mv r13,r1
sched =_Scheduler_Thread_scheduler_allocate( &_Scheduler, the_thread );
if ( !sched )
800567c: 44 20 00 14 be r1,r0,80056cc <_Thread_Initialize+0x174>
goto failed;
_Thread_Set_priority( the_thread, priority );
8005680: b9 c0 10 00 mv r2,r14
8005684: b9 60 08 00 mv r1,r11
8005688: f8 00 01 ff calli 8005e84 <_Thread_Set_priority>
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
800568c: 2d 61 00 0a lhu r1,(r11+10)
_Thread_Stack_Free( the_thread );
return false;
}
8005690: 29 ee 00 1c lw r14,(r15+28)
8005694: 34 02 00 02 mvi r2,2
/*
* Initialize the CPU usage statistics
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Set_to_zero( &the_thread->cpu_time_used );
8005698: 59 60 00 84 sw (r11+132),r0
800569c: 59 60 00 88 sw (r11+136),r0
80056a0: f8 00 2c 57 calli 80107fc <__ashlsi3>
80056a4: b5 c1 08 00 add r1,r14,r1
80056a8: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
80056ac: 2b 81 00 28 lw r1,(sp+40)
80056b0: 59 61 00 0c sw (r11+12),r1
* enabled when we get here. We want to be able to run the
* user extensions with dispatching enabled. The Allocator
* Mutex provides sufficient protection to let the user extensions
* run safely.
*/
extension_status = _User_extensions_Thread_create( the_thread );
80056b4: b9 60 08 00 mv r1,r11
80056b8: f8 00 03 68 calli 8006458 <_User_extensions_Thread_create>
if ( extension_status )
return true;
80056bc: 34 03 00 01 mvi r3,1
* user extensions with dispatching enabled. The Allocator
* Mutex provides sufficient protection to let the user extensions
* run safely.
*/
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
80056c0: 44 20 00 03 be r1,r0,80056cc <_Thread_Initialize+0x174>
80056c4: e0 00 00 14 bi 8005714 <_Thread_Initialize+0x1bc>
size_t actual_stack_size = 0;
void *stack = NULL;
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
void *fp_area;
#endif
void *sched = NULL;
80056c8: 34 0d 00 00 mvi r13,0
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
return true;
failed:
if ( the_thread->libc_reent )
80056cc: 29 61 01 14 lw r1,(r11+276)
80056d0: 44 20 00 02 be r1,r0,80056d8 <_Thread_Initialize+0x180>
_Workspace_Free( the_thread->libc_reent );
80056d4: f8 00 04 ba calli 80069bc <_Workspace_Free>
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
if ( the_thread->API_Extensions[i] )
80056d8: 29 61 01 18 lw r1,(r11+280)
80056dc: 44 20 00 02 be r1,r0,80056e4 <_Thread_Initialize+0x18c>
_Workspace_Free( the_thread->API_Extensions[i] );
80056e0: f8 00 04 b7 calli 80069bc <_Workspace_Free>
failed:
if ( the_thread->libc_reent )
_Workspace_Free( the_thread->libc_reent );
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
if ( the_thread->API_Extensions[i] )
80056e4: 29 61 01 1c lw r1,(r11+284)
80056e8: 44 20 00 02 be r1,r0,80056f0 <_Thread_Initialize+0x198> <== ALWAYS TAKEN
_Workspace_Free( the_thread->API_Extensions[i] );
80056ec: f8 00 04 b4 calli 80069bc <_Workspace_Free> <== NOT EXECUTED
if ( extensions_area )
80056f0: 45 80 00 03 be r12,r0,80056fc <_Thread_Initialize+0x1a4>
(void) _Workspace_Free( extensions_area );
80056f4: b9 80 08 00 mv r1,r12
80056f8: f8 00 04 b1 calli 80069bc <_Workspace_Free>
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
if ( fp_area )
(void) _Workspace_Free( fp_area );
#endif
if ( sched )
80056fc: 45 a0 00 03 be r13,r0,8005708 <_Thread_Initialize+0x1b0>
(void) _Workspace_Free( sched );
8005700: b9 a0 08 00 mv r1,r13
8005704: f8 00 04 ae calli 80069bc <_Workspace_Free>
_Thread_Stack_Free( the_thread );
8005708: b9 60 08 00 mv r1,r11
800570c: f8 00 02 46 calli 8006024 <_Thread_Stack_Free>
return false;
8005710: 34 03 00 00 mvi r3,0
}
8005714: b8 60 08 00 mv r1,r3
8005718: 2b 9d 00 04 lw ra,(sp+4)
800571c: 2b 8b 00 1c lw r11,(sp+28)
8005720: 2b 8c 00 18 lw r12,(sp+24)
8005724: 2b 8d 00 14 lw r13,(sp+20)
8005728: 2b 8e 00 10 lw r14,(sp+16)
800572c: 2b 8f 00 0c lw r15,(sp+12)
8005730: 2b 90 00 08 lw r16,(sp+8)
8005734: 37 9c 00 1c addi sp,sp,28
8005738: c3 a0 00 00 ret
0800a264 <_Thread_Resume>:
void _Thread_Resume(
Thread_Control *the_thread,
bool force
)
{
800a264: 37 9c ff f8 addi sp,sp,-8
800a268: 5b 8b 00 08 sw (sp+8),r11
800a26c: 5b 9d 00 04 sw (sp+4),ra
800a270: b8 20 10 00 mv r2,r1
ISR_Level level;
States_Control current_state;
_ISR_Disable( level );
800a274: 90 00 58 00 rcsr r11,IE
800a278: 34 01 ff fe mvi r1,-2
800a27c: a1 61 08 00 and r1,r11,r1
800a280: d0 01 00 00 wcsr IE,r1
current_state = the_thread->current_state;
800a284: 28 41 00 10 lw r1,(r2+16)
if ( current_state & STATES_SUSPENDED ) {
800a288: 20 23 00 02 andi r3,r1,0x2
800a28c: 44 60 00 09 be r3,r0,800a2b0 <_Thread_Resume+0x4c> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
800a290: 34 03 ff fd mvi r3,-3
800a294: a0 23 08 00 and r1,r1,r3
current_state =
the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state);
800a298: 58 41 00 10 sw (r2+16),r1
if ( _States_Is_ready( current_state ) ) {
800a29c: 5c 20 00 05 bne r1,r0,800a2b0 <_Thread_Resume+0x4c>
RTEMS_INLINE_ROUTINE void _Scheduler_Unblock(
Scheduler_Control *the_scheduler,
Thread_Control *the_thread
)
{
the_scheduler->Operations.unblock( the_scheduler, the_thread );
800a2a0: 78 01 08 01 mvhi r1,0x801
800a2a4: 38 21 89 7c ori r1,r1,0x897c
800a2a8: 28 23 00 10 lw r3,(r1+16)
800a2ac: d8 60 00 00 call r3
_Scheduler_Unblock( &_Scheduler, the_thread );
}
}
_ISR_Enable( level );
800a2b0: d0 0b 00 00 wcsr IE,r11
}
800a2b4: 2b 9d 00 04 lw ra,(sp+4)
800a2b8: 2b 8b 00 08 lw r11,(sp+8)
800a2bc: 37 9c 00 08 addi sp,sp,8
800a2c0: c3 a0 00 00 ret
08005a64 <_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
)
{
8005a64: 37 9c ff cc addi sp,sp,-52
8005a68: 5b 8b 00 34 sw (sp+52),r11
8005a6c: 5b 8c 00 30 sw (sp+48),r12
8005a70: 5b 8d 00 2c sw (sp+44),r13
8005a74: 5b 8e 00 28 sw (sp+40),r14
8005a78: 5b 8f 00 24 sw (sp+36),r15
8005a7c: 5b 90 00 20 sw (sp+32),r16
8005a80: 5b 91 00 1c sw (sp+28),r17
8005a84: 5b 92 00 18 sw (sp+24),r18
8005a88: 5b 93 00 14 sw (sp+20),r19
8005a8c: 5b 94 00 10 sw (sp+16),r20
8005a90: 5b 95 00 0c sw (sp+12),r21
8005a94: 5b 96 00 08 sw (sp+8),r22
8005a98: 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;
8005a9c: 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
)
{
8005aa0: 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 );
8005aa4: 34 41 00 3c addi r1,r2,60
head->next = tail;
8005aa8: 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 );
8005aac: 34 41 00 38 addi r1,r2,56
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
8005ab0: 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;
8005ab4: 58 40 00 3c sw (r2+60),r0
8005ab8: 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);
8005abc: ba 00 08 00 mv r1,r16
8005ac0: 34 02 00 06 mvi r2,6
8005ac4: b8 60 a8 00 mv r21,r3
8005ac8: f8 00 2b 9b calli 8010934 <__lshrsi3>
8005acc: 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;
8005ad0: 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 );
8005ad4: 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;
8005ad8: 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;
8005adc: 3a 52 30 c0 ori r18,r18,0x30c0
_ISR_Disable( level );
8005ae0: 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 ) )
8005ae4: 5c 20 00 30 bne r1,r0,8005ba4 <_Thread_queue_Enqueue_priority+0x140>
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
8005ae8: 34 14 ff fe mvi r20,-2
8005aec: 90 00 78 00 rcsr r15,IE
8005af0: a1 f4 90 00 and r18,r15,r20
8005af4: d0 12 00 00 wcsr IE,r18
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
8005af8: 34 02 00 01 mvi r2,1
8005afc: b9 c0 08 00 mv r1,r14
8005b00: f8 00 2b 3f calli 80107fc <__ashlsi3>
8005b04: b4 2e 08 00 add r1,r1,r14
8005b08: 34 02 00 02 mvi r2,2
8005b0c: f8 00 2b 3c calli 80107fc <__ashlsi3>
8005b10: 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 );
8005b14: 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;
8005b18: 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 ) ) {
8005b1c: e0 00 00 0b bi 8005b48 <_Thread_queue_Enqueue_priority+0xe4>
search_priority = search_thread->current_priority;
8005b20: 29 71 00 14 lw r17,(r11+20)
if ( priority <= search_priority )
8005b24: 52 30 00 12 bgeu r17,r16,8005b6c <_Thread_queue_Enqueue_priority+0x108>
break;
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
8005b28: d0 0f 00 00 wcsr IE,r15
8005b2c: 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);
8005b30: 29 61 00 10 lw r1,(r11+16)
8005b34: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
8005b38: 5c 20 00 03 bne r1,r0,8005b44 <_Thread_queue_Enqueue_priority+0xe0><== ALWAYS TAKEN
_ISR_Enable( level );
8005b3c: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_forward_search;
8005b40: e3 ff ff eb bi 8005aec <_Thread_queue_Enqueue_priority+0x88><== NOT EXECUTED
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
8005b44: 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));
8005b48: 34 02 00 01 mvi r2,1
8005b4c: b9 c0 08 00 mv r1,r14
8005b50: f8 00 2b 2b calli 80107fc <__ashlsi3>
8005b54: b4 2e 08 00 add r1,r1,r14
8005b58: 34 02 00 02 mvi r2,2
8005b5c: f8 00 2b 28 calli 80107fc <__ashlsi3>
8005b60: b5 a1 08 00 add r1,r13,r1
8005b64: 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 ) ) {
8005b68: 5d 61 ff ee bne r11,r1,8005b20 <_Thread_queue_Enqueue_priority+0xbc>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
8005b6c: 29 a3 00 30 lw r3,(r13+48)
8005b70: 34 02 00 01 mvi r2,1
8005b74: b9 e0 08 00 mv r1,r15
8005b78: 5c 62 00 43 bne r3,r2,8005c84 <_Thread_queue_Enqueue_priority+0x220>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8005b7c: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
8005b80: 46 11 00 38 be r16,r17,8005c60 <_Thread_queue_Enqueue_priority+0x1fc>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
8005b84: 29 61 00 04 lw r1,(r11+4)
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8005b88: 59 8b 00 00 sw (r12+0),r11
the_node->previous = previous_node;
8005b8c: 59 81 00 04 sw (r12+4),r1
previous_node->next = the_node;
8005b90: 58 2c 00 00 sw (r1+0),r12
search_node->previous = the_node;
8005b94: 59 6c 00 04 sw (r11+4),r12
the_thread->Wait.queue = the_thread_queue;
8005b98: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
8005b9c: d0 0f 00 00 wcsr IE,r15
8005ba0: e0 00 00 2e bi 8005c58 <_Thread_queue_Enqueue_priority+0x1f4>
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
8005ba4: 42 51 00 00 lbu r17,(r18+0)
8005ba8: 36 31 00 01 addi r17,r17,1
_ISR_Disable( level );
8005bac: 90 00 78 00 rcsr r15,IE
8005bb0: a1 f6 a0 00 and r20,r15,r22
8005bb4: d0 14 00 00 wcsr IE,r20
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
8005bb8: 34 02 00 01 mvi r2,1
8005bbc: b9 c0 08 00 mv r1,r14
8005bc0: f8 00 2b 0f calli 80107fc <__ashlsi3>
8005bc4: b4 2e 08 00 add r1,r1,r14
8005bc8: 34 02 00 02 mvi r2,2
8005bcc: f8 00 2b 0c calli 80107fc <__ashlsi3>
8005bd0: 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 );
8005bd4: 28 2b 00 08 lw r11,(r1+8)
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
8005bd8: e0 00 00 0b bi 8005c04 <_Thread_queue_Enqueue_priority+0x1a0>
search_priority = search_thread->current_priority;
8005bdc: 29 71 00 14 lw r17,(r11+20)
if ( priority >= search_priority )
8005be0: 52 11 00 11 bgeu r16,r17,8005c24 <_Thread_queue_Enqueue_priority+0x1c0>
break;
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
8005be4: d0 0f 00 00 wcsr IE,r15
8005be8: d0 14 00 00 wcsr IE,r20
8005bec: 29 61 00 10 lw r1,(r11+16)
8005bf0: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
8005bf4: 5c 20 00 03 bne r1,r0,8005c00 <_Thread_queue_Enqueue_priority+0x19c><== ALWAYS TAKEN
_ISR_Enable( level );
8005bf8: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_reverse_search;
8005bfc: e3 ff ff ea bi 8005ba4 <_Thread_queue_Enqueue_priority+0x140><== NOT EXECUTED
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
8005c00: 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));
8005c04: 34 02 00 01 mvi r2,1
8005c08: b9 c0 08 00 mv r1,r14
8005c0c: f8 00 2a fc calli 80107fc <__ashlsi3>
8005c10: b4 2e 08 00 add r1,r1,r14
8005c14: 34 02 00 02 mvi r2,2
8005c18: f8 00 2a f9 calli 80107fc <__ashlsi3>
8005c1c: 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 ) ) {
8005c20: 5d 61 ff ef bne r11,r1,8005bdc <_Thread_queue_Enqueue_priority+0x178>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
8005c24: 29 a3 00 30 lw r3,(r13+48)
8005c28: 34 02 00 01 mvi r2,1
8005c2c: b9 e0 08 00 mv r1,r15
8005c30: 5c 62 00 15 bne r3,r2,8005c84 <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8005c34: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
8005c38: 46 11 00 0a be r16,r17,8005c60 <_Thread_queue_Enqueue_priority+0x1fc><== NEVER TAKEN
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
8005c3c: 29 61 00 00 lw r1,(r11+0)
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
8005c40: 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;
8005c44: 59 81 00 00 sw (r12+0),r1
the_node->previous = search_node;
search_node->next = the_node;
8005c48: 59 6c 00 00 sw (r11+0),r12
next_node->previous = the_node;
8005c4c: 58 2c 00 04 sw (r1+4),r12
the_thread->Wait.queue = the_thread_queue;
8005c50: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
8005c54: d0 0f 00 00 wcsr IE,r15
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
8005c58: 34 01 00 01 mvi r1,1
8005c5c: e0 00 00 0c bi 8005c8c <_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;
8005c60: 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 );
8005c64: 35 62 00 3c addi r2,r11,60
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8005c68: 59 82 00 00 sw (r12+0),r2
the_node->previous = previous_node;
8005c6c: 59 81 00 04 sw (r12+4),r1
previous_node->next = the_node;
8005c70: 58 2c 00 00 sw (r1+0),r12
search_node->previous = the_node;
8005c74: 59 6c 00 40 sw (r11+64),r12
the_thread->Wait.queue = the_thread_queue;
8005c78: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
8005c7c: d0 0f 00 00 wcsr IE,r15
8005c80: e3 ff ff f6 bi 8005c58 <_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;
8005c84: 5a a1 00 00 sw (r21+0),r1
return the_thread_queue->sync_state;
8005c88: 29 a1 00 30 lw r1,(r13+48)
}
8005c8c: 2b 9d 00 04 lw ra,(sp+4)
8005c90: 2b 8b 00 34 lw r11,(sp+52)
8005c94: 2b 8c 00 30 lw r12,(sp+48)
8005c98: 2b 8d 00 2c lw r13,(sp+44)
8005c9c: 2b 8e 00 28 lw r14,(sp+40)
8005ca0: 2b 8f 00 24 lw r15,(sp+36)
8005ca4: 2b 90 00 20 lw r16,(sp+32)
8005ca8: 2b 91 00 1c lw r17,(sp+28)
8005cac: 2b 92 00 18 lw r18,(sp+24)
8005cb0: 2b 93 00 14 lw r19,(sp+20)
8005cb4: 2b 94 00 10 lw r20,(sp+16)
8005cb8: 2b 95 00 0c lw r21,(sp+12)
8005cbc: 2b 96 00 08 lw r22,(sp+8)
8005cc0: 37 9c 00 34 addi sp,sp,52
8005cc4: c3 a0 00 00 ret
080098ec <_Thread_queue_Process_timeout>:
#include <rtems/score/tqdata.h>
void _Thread_queue_Process_timeout(
Thread_Control *the_thread
)
{
80098ec: 37 9c ff fc addi sp,sp,-4
80098f0: 5b 9d 00 04 sw (sp+4),ra
80098f4: b8 20 10 00 mv r2,r1
Thread_queue_Control *the_thread_queue = the_thread->Wait.queue;
80098f8: 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 &&
80098fc: 28 24 00 30 lw r4,(r1+48)
8009900: 44 80 00 0c be r4,r0,8009930 <_Thread_queue_Process_timeout+0x44>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
8009904: 78 03 08 01 mvhi r3,0x801
8009908: 38 63 39 e8 ori r3,r3,0x39e8
800990c: 28 63 00 0c lw r3,(r3+12)
8009910: 5c 43 00 08 bne r2,r3,8009930 <_Thread_queue_Process_timeout+0x44>
_Thread_Is_executing( the_thread ) ) {
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
8009914: 34 03 00 03 mvi r3,3
8009918: 44 83 00 09 be r4,r3,800993c <_Thread_queue_Process_timeout+0x50><== ALWAYS TAKEN
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
800991c: 28 23 00 3c lw r3,(r1+60) <== NOT EXECUTED
8009920: 58 43 00 34 sw (r2+52),r3 <== NOT EXECUTED
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
8009924: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
8009928: 58 22 00 30 sw (r1+48),r2 <== NOT EXECUTED
800992c: e0 00 00 04 bi 800993c <_Thread_queue_Process_timeout+0x50><== NOT EXECUTED
}
} else {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
8009930: 28 23 00 3c lw r3,(r1+60)
8009934: 58 43 00 34 sw (r2+52),r3
_Thread_queue_Extract( the_thread->Wait.queue, the_thread );
8009938: fb ff ff 92 calli 8009780 <_Thread_queue_Extract>
}
}
800993c: 2b 9d 00 04 lw ra,(sp+4)
8009940: 37 9c 00 04 addi sp,sp,4
8009944: c3 a0 00 00 ret
08005db0 <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
8005db0: 37 9c ff ec addi sp,sp,-20
8005db4: 5b 8b 00 10 sw (sp+16),r11
8005db8: 5b 8c 00 0c sw (sp+12),r12
8005dbc: 5b 8d 00 08 sw (sp+8),r13
8005dc0: 5b 9d 00 04 sw (sp+4),ra
8005dc4: b8 20 58 00 mv r11,r1
8005dc8: 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 )
8005dcc: 44 20 00 19 be r1,r0,8005e30 <_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 ) {
8005dd0: 28 22 00 34 lw r2,(r1+52)
8005dd4: 34 01 00 01 mvi r1,1
8005dd8: 5c 41 00 16 bne r2,r1,8005e30 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
8005ddc: 90 00 68 00 rcsr r13,IE
8005de0: 34 01 ff fe mvi r1,-2
8005de4: a1 a1 08 00 and r1,r13,r1
8005de8: d0 01 00 00 wcsr IE,r1
8005dec: 78 03 08 01 mvhi r3,0x801
8005df0: 38 63 1d 78 ori r3,r3,0x1d78
8005df4: 29 82 00 10 lw r2,(r12+16)
8005df8: 28 61 00 00 lw r1,(r3+0)
8005dfc: a0 41 08 00 and r1,r2,r1
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
8005e00: 44 20 00 0b be r1,r0,8005e2c <_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;
8005e04: 34 01 00 01 mvi r1,1
8005e08: 59 61 00 30 sw (r11+48),r1
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
8005e0c: b9 80 10 00 mv r2,r12
8005e10: b9 60 08 00 mv r1,r11
8005e14: 34 03 00 01 mvi r3,1
8005e18: f8 00 0e 66 calli 80097b0 <_Thread_queue_Extract_priority_helper>
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
8005e1c: b9 60 08 00 mv r1,r11
8005e20: b9 80 10 00 mv r2,r12
8005e24: 37 83 00 14 addi r3,sp,20
8005e28: fb ff ff 0f calli 8005a64 <_Thread_queue_Enqueue_priority>
}
_ISR_Enable( level );
8005e2c: d0 0d 00 00 wcsr IE,r13
}
}
8005e30: 2b 9d 00 04 lw ra,(sp+4)
8005e34: 2b 8b 00 10 lw r11,(sp+16)
8005e38: 2b 8c 00 0c lw r12,(sp+12)
8005e3c: 2b 8d 00 08 lw r13,(sp+8)
8005e40: 37 9c 00 14 addi sp,sp,20
8005e44: c3 a0 00 00 ret
08005e48 <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
8005e48: 37 9c ff f8 addi sp,sp,-8
8005e4c: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
8005e50: 37 82 00 08 addi r2,sp,8
8005e54: fb ff fd 83 calli 8005460 <_Thread_Get>
switch ( location ) {
8005e58: 2b 82 00 08 lw r2,(sp+8)
8005e5c: 5c 40 00 07 bne r2,r0,8005e78 <_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 );
8005e60: f8 00 0e a3 calli 80098ec <_Thread_queue_Process_timeout>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
8005e64: 78 01 08 01 mvhi r1,0x801
8005e68: 38 21 38 28 ori r1,r1,0x3828
8005e6c: 28 22 00 00 lw r2,(r1+0)
8005e70: 34 42 ff ff addi r2,r2,-1
8005e74: 58 22 00 00 sw (r1+0),r2
_Thread_Unnest_dispatch();
break;
}
}
8005e78: 2b 9d 00 04 lw ra,(sp+4)
8005e7c: 37 9c 00 08 addi sp,sp,8
8005e80: c3 a0 00 00 ret
080146bc <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
80146bc: 37 9c ff a8 addi sp,sp,-88
80146c0: 5b 8b 00 40 sw (sp+64),r11
80146c4: 5b 8c 00 3c sw (sp+60),r12
80146c8: 5b 8d 00 38 sw (sp+56),r13
80146cc: 5b 8e 00 34 sw (sp+52),r14
80146d0: 5b 8f 00 30 sw (sp+48),r15
80146d4: 5b 90 00 2c sw (sp+44),r16
80146d8: 5b 91 00 28 sw (sp+40),r17
80146dc: 5b 92 00 24 sw (sp+36),r18
80146e0: 5b 93 00 20 sw (sp+32),r19
80146e4: 5b 94 00 1c sw (sp+28),r20
80146e8: 5b 95 00 18 sw (sp+24),r21
80146ec: 5b 96 00 14 sw (sp+20),r22
80146f0: 5b 97 00 10 sw (sp+16),r23
80146f4: 5b 98 00 0c sw (sp+12),r24
80146f8: 5b 99 00 08 sw (sp+8),r25
80146fc: 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;
8014700: 78 10 08 03 mvhi r16,0x803
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
8014704: b8 20 58 00 mv r11,r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8014708: 37 82 00 54 addi r2,sp,84
801470c: 37 81 00 50 addi r1,sp,80
8014710: 37 8f 00 44 addi r15,sp,68
8014714: 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();
8014718: 78 0e 08 03 mvhi r14,0x803
801471c: 5b 82 00 50 sw (sp+80),r2
head->previous = NULL;
8014720: 5b 80 00 54 sw (sp+84),r0
tail->previous = head;
8014724: 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;
8014728: 5b 91 00 44 sw (sp+68),r17
head->previous = NULL;
801472c: 5b 80 00 48 sw (sp+72),r0
tail->previous = head;
8014730: 5b 8f 00 4c sw (sp+76),r15
Chain_Control *tmp;
/*
* 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;
8014734: 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;
8014738: 3a 10 ed 68 ori r16,r16,0xed68
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
801473c: 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();
8014740: 39 ce ec e0 ori r14,r14,0xece0
/*
* 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 );
8014744: 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 ) {
8014748: 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 );
801474c: 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;
8014750: 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;
8014754: 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 );
8014758: 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 );
801475c: 35 74 00 40 addi r20,r11,64
Chain_Control *tmp;
/*
* 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;
8014760: 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;
8014764: 2a 02 00 00 lw r2,(r16+0)
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
8014768: 29 63 00 3c lw r3,(r11+60)
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
801476c: ba 60 08 00 mv r1,r19
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
8014770: 59 62 00 3c sw (r11+60),r2
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
8014774: c8 43 10 00 sub r2,r2,r3
8014778: b9 e0 18 00 mv r3,r15
801477c: f8 00 15 0b calli 8019ba8 <_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;
8014780: 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();
8014784: 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 ) {
8014788: 50 8c 00 06 bgeu r4,r12,80147a0 <_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 );
801478c: b9 a0 08 00 mv r1,r13
8014790: c9 84 10 00 sub r2,r12,r4
8014794: b9 e0 18 00 mv r3,r15
8014798: f8 00 15 04 calli 8019ba8 <_Watchdog_Adjust_to_chain>
801479c: e0 00 00 06 bi 80147b4 <_Timer_server_Body+0xf8>
} else if ( snapshot < last_snapshot ) {
80147a0: 51 84 00 05 bgeu r12,r4,80147b4 <_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 );
80147a4: b9 a0 08 00 mv r1,r13
80147a8: 34 02 00 01 mvi r2,1
80147ac: c8 8c 18 00 sub r3,r4,r12
80147b0: f8 00 14 c7 calli 8019acc <_Watchdog_Adjust>
}
watchdogs->last_snapshot = snapshot;
80147b4: 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 ) {
80147b8: 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 );
80147bc: 29 63 00 78 lw r3,(r11+120)
80147c0: b8 60 08 00 mv r1,r3
80147c4: f8 00 03 6e calli 801557c <_Chain_Get>
80147c8: b8 20 10 00 mv r2,r1
if ( timer == NULL ) {
80147cc: 44 20 00 09 be r1,r0,80147f0 <_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 ) {
80147d0: 28 23 00 38 lw r3,(r1+56) <== NOT EXECUTED
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
80147d4: 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 ) {
80147d8: 44 6c 00 03 be r3,r12,80147e4 <_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 ) {
80147dc: 5c 78 ff f8 bne r3,r24,80147bc <_Timer_server_Body+0x100> <== NOT EXECUTED
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
80147e0: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
80147e4: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED
80147e8: f8 00 15 15 calli 8019c3c <_Watchdog_Insert> <== NOT EXECUTED
80147ec: e3 ff ff f4 bi 80147bc <_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 );
80147f0: 90 00 20 00 rcsr r4,IE
80147f4: a0 92 08 00 and r1,r4,r18
80147f8: d0 01 00 00 wcsr IE,r1
tmp = ts->insert_chain;
80147fc: 29 61 00 78 lw r1,(r11+120)
if ( _Chain_Is_empty( insert_chain ) ) {
8014800: 2b 81 00 50 lw r1,(sp+80)
8014804: 34 03 00 01 mvi r3,1
8014808: 5c 37 00 03 bne r1,r23,8014814 <_Timer_server_Body+0x158> <== NEVER TAKEN
ts->insert_chain = NULL;
801480c: 59 60 00 78 sw (r11+120),r0
do_loop = false;
8014810: 34 03 00 00 mvi r3,0
}
_ISR_Enable( level );
8014814: d0 04 00 00 wcsr IE,r4
* 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;
while ( do_loop ) {
8014818: 5c 60 ff d3 bne r3,r0,8014764 <_Timer_server_Body+0xa8> <== NEVER TAKEN
_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 ) ) {
801481c: 2b 81 00 44 lw r1,(sp+68)
8014820: 44 31 00 13 be r1,r17,801486c <_Timer_server_Body+0x1b0>
/*
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
8014824: 90 00 18 00 rcsr r3,IE
8014828: a0 72 08 00 and r1,r3,r18
801482c: d0 01 00 00 wcsr IE,r1
initialized = false;
}
#endif
return status;
}
8014830: 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))
8014834: 44 51 00 0c be r2,r17,8014864 <_Timer_server_Body+0x1a8>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
8014838: 28 44 00 00 lw r4,(r2+0)
head->next = new_first;
801483c: 5b 84 00 44 sw (sp+68),r4
new_first->previous = head;
8014840: 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 ) {
8014844: 44 40 00 08 be r2,r0,8014864 <_Timer_server_Body+0x1a8> <== NEVER TAKEN
watchdog->state = WATCHDOG_INACTIVE;
8014848: 58 40 00 08 sw (r2+8),r0
_ISR_Enable( level );
801484c: 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 );
8014850: 28 43 00 1c lw r3,(r2+28)
8014854: 28 41 00 20 lw r1,(r2+32)
8014858: 28 42 00 24 lw r2,(r2+36)
801485c: d8 60 00 00 call r3
}
8014860: e3 ff ff f1 bi 8014824 <_Timer_server_Body+0x168>
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
_ISR_Enable( level );
} else {
_ISR_Enable( level );
8014864: d0 03 00 00 wcsr IE,r3
8014868: e3 ff ff be bi 8014760 <_Timer_server_Body+0xa4>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
801486c: 31 60 00 7c sb (r11+124),r0
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
8014870: fb ff ff 53 calli 80145bc <_Thread_Disable_dispatch>
_Thread_Set_state( ts->thread, STATES_DELAYING );
8014874: 29 61 00 00 lw r1,(r11+0)
8014878: 34 02 00 08 mvi r2,8
801487c: f8 00 12 6a calli 8019224 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
8014880: b9 60 08 00 mv r1,r11
8014884: fb ff ff 54 calli 80145d4 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
8014888: b9 60 08 00 mv r1,r11
801488c: fb ff ff 6f calli 8014648 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
8014890: f8 00 0f 79 calli 8018674 <_Thread_Enable_dispatch>
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
8014894: 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;
8014898: 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 );
801489c: f8 00 15 47 calli 8019db8 <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
80148a0: ba 80 08 00 mv r1,r20
80148a4: f8 00 15 45 calli 8019db8 <_Watchdog_Remove>
80148a8: e3 ff ff ae bi 8014760 <_Timer_server_Body+0xa4>
080148ac <_Timer_server_Schedule_operation_method>:
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
80148ac: 37 9c ff f4 addi sp,sp,-12
80148b0: 5b 8b 00 0c sw (sp+12),r11
80148b4: 5b 8c 00 08 sw (sp+8),r12
80148b8: 5b 9d 00 04 sw (sp+4),ra
80148bc: b8 20 58 00 mv r11,r1
if ( ts->insert_chain == NULL ) {
80148c0: 28 21 00 78 lw r1,(r1+120)
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
80148c4: b8 40 60 00 mv r12,r2
if ( ts->insert_chain == NULL ) {
80148c8: 5c 20 00 43 bne r1,r0,80149d4 <_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();
80148cc: fb ff ff 3c calli 80145bc <_Thread_Disable_dispatch>
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
80148d0: 29 81 00 38 lw r1,(r12+56)
80148d4: 34 02 00 01 mvi r2,1
80148d8: 5c 22 00 1d bne r1,r2,801494c <_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 );
80148dc: 90 00 10 00 rcsr r2,IE
80148e0: 34 01 ff fe mvi r1,-2
80148e4: a0 41 08 00 and r1,r2,r1
80148e8: d0 01 00 00 wcsr IE,r1
snapshot = _Watchdog_Ticks_since_boot;
80148ec: 78 01 08 03 mvhi r1,0x803
80148f0: 38 21 ed 68 ori r1,r1,0xed68
80148f4: 28 23 00 00 lw r3,(r1+0)
initialized = false;
}
#endif
return status;
}
80148f8: 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;
80148fc: 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 );
8014900: 35 64 00 34 addi r4,r11,52
if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) {
8014904: 44 24 00 07 be r1,r4,8014920 <_Timer_server_Schedule_operation_method+0x74>
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
8014908: 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;
801490c: 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;
8014910: 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) {
8014914: 50 a6 00 02 bgeu r5,r6,801491c <_Timer_server_Schedule_operation_method+0x70>
delta_interval -= delta;
8014918: c8 c5 20 00 sub r4,r6,r5
} else {
delta_interval = 0;
}
first_watchdog->delta_interval = delta_interval;
801491c: 58 24 00 10 sw (r1+16),r4
}
ts->Interval_watchdogs.last_snapshot = snapshot;
8014920: 59 63 00 3c sw (r11+60),r3
_ISR_Enable( level );
8014924: d0 02 00 00 wcsr IE,r2
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
8014928: 35 61 00 30 addi r1,r11,48
801492c: 35 82 00 10 addi r2,r12,16
8014930: f8 00 14 c3 calli 8019c3c <_Watchdog_Insert>
if ( !ts->active ) {
8014934: 41 61 00 7c lbu r1,(r11+124)
8014938: 20 21 00 ff andi r1,r1,0xff
801493c: 5c 20 00 24 bne r1,r0,80149cc <_Timer_server_Schedule_operation_method+0x120>
_Timer_server_Reset_interval_system_watchdog( ts );
8014940: b9 60 08 00 mv r1,r11
8014944: fb ff ff 24 calli 80145d4 <_Timer_server_Reset_interval_system_watchdog>
8014948: e0 00 00 21 bi 80149cc <_Timer_server_Schedule_operation_method+0x120>
}
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
801494c: 34 02 00 03 mvi r2,3
8014950: 5c 22 00 1f bne r1,r2,80149cc <_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 );
8014954: 90 00 30 00 rcsr r6,IE
8014958: 34 01 ff fe mvi r1,-2
801495c: a0 c1 08 00 and r1,r6,r1
8014960: d0 01 00 00 wcsr IE,r1
initialized = false;
}
#endif
return status;
}
8014964: 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();
8014968: 78 01 08 03 mvhi r1,0x803
last_snapshot = ts->TOD_watchdogs.last_snapshot;
801496c: 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();
8014970: 38 21 ec e0 ori r1,r1,0xece0
8014974: 35 63 00 6c addi r3,r11,108
8014978: 28 21 00 00 lw r1,(r1+0)
last_snapshot = ts->TOD_watchdogs.last_snapshot;
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
801497c: 44 43 00 0a be r2,r3,80149a4 <_Timer_server_Schedule_operation_method+0xf8>
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
8014980: 28 44 00 10 lw r4,(r2+16)
}
} else {
/*
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
8014984: b4 85 18 00 add r3,r4,r5
delta_interval += delta;
8014988: 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 ) {
801498c: 50 a1 00 05 bgeu r5,r1,80149a0 <_Timer_server_Schedule_operation_method+0xf4>
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
8014990: c8 25 28 00 sub r5,r1,r5
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
8014994: 34 03 00 00 mvi r3,0
if ( snapshot > last_snapshot ) {
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
if (delta_interval > delta) {
8014998: 50 a4 00 02 bgeu r5,r4,80149a0 <_Timer_server_Schedule_operation_method+0xf4><== NEVER TAKEN
delta_interval -= delta;
801499c: 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;
80149a0: 58 43 00 10 sw (r2+16),r3
}
ts->TOD_watchdogs.last_snapshot = snapshot;
80149a4: 59 61 00 74 sw (r11+116),r1
_ISR_Enable( level );
80149a8: d0 06 00 00 wcsr IE,r6
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
80149ac: 35 61 00 68 addi r1,r11,104
80149b0: 35 82 00 10 addi r2,r12,16
80149b4: f8 00 14 a2 calli 8019c3c <_Watchdog_Insert>
if ( !ts->active ) {
80149b8: 41 61 00 7c lbu r1,(r11+124)
80149bc: 20 21 00 ff andi r1,r1,0xff
80149c0: 5c 20 00 03 bne r1,r0,80149cc <_Timer_server_Schedule_operation_method+0x120>
_Timer_server_Reset_tod_system_watchdog( ts );
80149c4: b9 60 08 00 mv r1,r11
80149c8: fb ff ff 20 calli 8014648 <_Timer_server_Reset_tod_system_watchdog>
}
}
_Thread_Enable_dispatch();
80149cc: f8 00 0f 2a calli 8018674 <_Thread_Enable_dispatch>
80149d0: e0 00 00 03 bi 80149dc <_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 );
80149d4: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED
80149d8: f8 00 02 d3 calli 8015524 <_Chain_Append> <== NOT EXECUTED
}
}
80149dc: 2b 9d 00 04 lw ra,(sp+4)
80149e0: 2b 8b 00 0c lw r11,(sp+12)
80149e4: 2b 8c 00 08 lw r12,(sp+8)
80149e8: 37 9c 00 0c addi sp,sp,12
80149ec: c3 a0 00 00 ret
08008550 <_Timespec_Greater_than>:
bool _Timespec_Greater_than(
const struct timespec *lhs,
const struct timespec *rhs
)
{
if ( lhs->tv_sec > rhs->tv_sec )
8008550: 28 24 00 00 lw r4,(r1+0)
8008554: 28 45 00 00 lw r5,(r2+0)
bool _Timespec_Greater_than(
const struct timespec *lhs,
const struct timespec *rhs
)
{
8008558: b8 20 18 00 mv r3,r1
if ( lhs->tv_sec > rhs->tv_sec )
return true;
800855c: 34 01 00 01 mvi r1,1
bool _Timespec_Greater_than(
const struct timespec *lhs,
const struct timespec *rhs
)
{
if ( lhs->tv_sec > rhs->tv_sec )
8008560: 48 85 00 06 bg r4,r5,8008578 <_Timespec_Greater_than+0x28>
return true;
if ( lhs->tv_sec < rhs->tv_sec )
return false;
8008564: 34 01 00 00 mvi r1,0
)
{
if ( lhs->tv_sec > rhs->tv_sec )
return true;
if ( lhs->tv_sec < rhs->tv_sec )
8008568: 48 a4 00 04 bg r5,r4,8008578 <_Timespec_Greater_than+0x28> <== NEVER TAKEN
#include <rtems/system.h>
#include <rtems/score/timespec.h>
#include <rtems/score/tod.h>
bool _Timespec_Greater_than(
800856c: 28 63 00 04 lw r3,(r3+4)
8008570: 28 41 00 04 lw r1,(r2+4)
8008574: e8 61 08 00 cmpg r1,r3,r1
/* ASSERT: lhs->tv_sec == rhs->tv_sec */
if ( lhs->tv_nsec > rhs->tv_nsec )
return true;
return false;
}
8008578: c3 a0 00 00 ret
0800621c <_User_extensions_Handler_initialization>:
#include <rtems/score/userext.h>
#include <rtems/score/wkspace.h>
#include <string.h>
void _User_extensions_Handler_initialization(void)
{
800621c: 37 9c ff ec addi sp,sp,-20
8006220: 5b 8b 00 14 sw (sp+20),r11
8006224: 5b 8c 00 10 sw (sp+16),r12
8006228: 5b 8d 00 0c sw (sp+12),r13
800622c: 5b 8e 00 08 sw (sp+8),r14
8006230: 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;
8006234: 78 02 08 01 mvhi r2,0x801
8006238: 38 42 30 c4 ori r2,r2,0x30c4
800623c: 28 4e 00 3c lw r14,(r2+60)
initial_extensions = Configuration.User_extension_table;
8006240: 28 4b 00 40 lw r11,(r2+64)
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8006244: 78 03 08 01 mvhi r3,0x801
8006248: 78 02 08 01 mvhi r2,0x801
800624c: 38 42 39 a4 ori r2,r2,0x39a4
8006250: 38 63 39 a8 ori r3,r3,0x39a8
8006254: 58 43 00 00 sw (r2+0),r3
head->previous = NULL;
8006258: 58 40 00 04 sw (r2+4),r0
tail->previous = head;
800625c: 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;
8006260: 78 03 08 01 mvhi r3,0x801
8006264: 78 02 08 01 mvhi r2,0x801
8006268: 38 42 38 2c ori r2,r2,0x382c
800626c: 38 63 38 30 ori r3,r3,0x3830
8006270: 58 43 00 00 sw (r2+0),r3
head->previous = NULL;
8006274: 58 40 00 04 sw (r2+4),r0
tail->previous = head;
8006278: 58 42 00 08 sw (r2+8),r2
_Chain_Initialize_empty( &_User_extensions_List );
_Chain_Initialize_empty( &_User_extensions_Switches_list );
if ( initial_extensions ) {
800627c: 45 60 00 22 be r11,r0,8006304 <_User_extensions_Handler_initialization+0xe8><== NEVER TAKEN
extension = (User_extensions_Control *)
_Workspace_Allocate_or_fatal_error(
number_of_extensions * sizeof( User_extensions_Control )
8006280: 34 02 00 34 mvi r2,52
8006284: b9 c0 08 00 mv r1,r14
8006288: f8 00 29 d2 calli 80109d0 <__mulsi3>
800628c: 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(
8006290: f8 00 01 d4 calli 80069e0 <_Workspace_Allocate_or_fatal_error>
number_of_extensions * sizeof( User_extensions_Control )
);
memset (
8006294: b9 a0 18 00 mv r3,r13
8006298: 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(
800629c: b8 20 60 00 mv r12,r1
extension,
0,
number_of_extensions * sizeof( User_extensions_Control )
);
for ( i = 0 ; i < number_of_extensions ; i++ ) {
80062a0: 34 0d 00 00 mvi r13,0
extension = (User_extensions_Control *)
_Workspace_Allocate_or_fatal_error(
number_of_extensions * sizeof( User_extensions_Control )
);
memset (
80062a4: f8 00 17 4a calli 800bfcc <memset>
extension,
0,
number_of_extensions * sizeof( User_extensions_Control )
);
for ( i = 0 ; i < number_of_extensions ; i++ ) {
80062a8: e0 00 00 16 bi 8006300 <_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;
80062ac: 29 61 00 1c lw r1,(r11+28)
80062b0: 29 68 00 00 lw r8,(r11+0)
80062b4: 29 67 00 04 lw r7,(r11+4)
80062b8: 29 66 00 08 lw r6,(r11+8)
80062bc: 29 65 00 0c lw r5,(r11+12)
80062c0: 29 64 00 10 lw r4,(r11+16)
80062c4: 29 63 00 14 lw r3,(r11+20)
80062c8: 29 62 00 18 lw r2,(r11+24)
80062cc: 59 81 00 30 sw (r12+48),r1
80062d0: 59 88 00 14 sw (r12+20),r8
80062d4: 59 87 00 18 sw (r12+24),r7
80062d8: 59 86 00 1c sw (r12+28),r6
80062dc: 59 85 00 20 sw (r12+32),r5
80062e0: 59 84 00 24 sw (r12+36),r4
80062e4: 59 83 00 28 sw (r12+40),r3
80062e8: 59 82 00 2c sw (r12+44),r2
_User_extensions_Add_set( extension );
80062ec: b9 80 08 00 mv r1,r12
80062f0: f8 00 0d a8 calli 8009990 <_User_extensions_Add_set>
_User_extensions_Add_set_with_table (extension, &initial_extensions[i]);
extension++;
80062f4: 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++ ) {
80062f8: 35 ad 00 01 addi r13,r13,1
80062fc: 35 6b 00 20 addi r11,r11,32
8006300: 55 cd ff eb bgu r14,r13,80062ac <_User_extensions_Handler_initialization+0x90>
_User_extensions_Add_set_with_table (extension, &initial_extensions[i]);
extension++;
}
}
}
8006304: 2b 9d 00 04 lw ra,(sp+4)
8006308: 2b 8b 00 14 lw r11,(sp+20)
800630c: 2b 8c 00 10 lw r12,(sp+16)
8006310: 2b 8d 00 0c lw r13,(sp+12)
8006314: 2b 8e 00 08 lw r14,(sp+8)
8006318: 37 9c 00 14 addi sp,sp,20
800631c: c3 a0 00 00 ret
080087b0 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
80087b0: 37 9c ff e4 addi sp,sp,-28
80087b4: 5b 8b 00 1c sw (sp+28),r11
80087b8: 5b 8c 00 18 sw (sp+24),r12
80087bc: 5b 8d 00 14 sw (sp+20),r13
80087c0: 5b 8e 00 10 sw (sp+16),r14
80087c4: 5b 8f 00 0c sw (sp+12),r15
80087c8: 5b 90 00 08 sw (sp+8),r16
80087cc: 5b 9d 00 04 sw (sp+4),ra
80087d0: b8 20 60 00 mv r12,r1
80087d4: b8 60 58 00 mv r11,r3
ISR_Level level;
_ISR_Disable( level );
80087d8: 90 00 08 00 rcsr r1,IE
80087dc: 34 03 ff fe mvi r3,-2
80087e0: a0 23 18 00 and r3,r1,r3
80087e4: d0 03 00 00 wcsr IE,r3
}
}
_ISR_Enable( level );
}
80087e8: 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 );
80087ec: 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 ) ) {
80087f0: 44 6e 00 1d be r3,r14,8008864 <_Watchdog_Adjust+0xb4>
switch ( direction ) {
80087f4: 44 40 00 04 be r2,r0,8008804 <_Watchdog_Adjust+0x54>
80087f8: 34 04 00 01 mvi r4,1
80087fc: 5c 44 00 1a bne r2,r4,8008864 <_Watchdog_Adjust+0xb4> <== NEVER TAKEN
8008800: e0 00 00 04 bi 8008810 <_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;
8008804: 34 10 00 01 mvi r16,1
_ISR_Enable( level );
_Watchdog_Tickle( header );
_ISR_Disable( level );
8008808: 34 0f ff fe mvi r15,-2
800880c: e0 00 00 15 bi 8008860 <_Watchdog_Adjust+0xb0>
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
8008810: 28 62 00 10 lw r2,(r3+16)
8008814: b4 4b 58 00 add r11,r2,r11
8008818: 58 6b 00 10 sw (r3+16),r11
break;
800881c: e0 00 00 12 bi 8008864 <_Watchdog_Adjust+0xb4>
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) _Chain_First( header ) );
8008820: 29 82 00 00 lw r2,(r12+0)
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
8008824: 28 4d 00 10 lw r13,(r2+16)
8008828: 51 6d 00 04 bgeu r11,r13,8008838 <_Watchdog_Adjust+0x88>
_Watchdog_First( header )->delta_interval -= units;
800882c: c9 ab 58 00 sub r11,r13,r11
8008830: 58 4b 00 10 sw (r2+16),r11
break;
8008834: e0 00 00 0c bi 8008864 <_Watchdog_Adjust+0xb4>
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
8008838: 58 50 00 10 sw (r2+16),r16
_ISR_Enable( level );
800883c: d0 01 00 00 wcsr IE,r1
_Watchdog_Tickle( header );
8008840: b9 80 08 00 mv r1,r12
8008844: f8 00 00 9a calli 8008aac <_Watchdog_Tickle>
_ISR_Disable( level );
8008848: 90 00 08 00 rcsr r1,IE
800884c: a0 2f 10 00 and r2,r1,r15
8008850: d0 02 00 00 wcsr IE,r2
if ( _Chain_Is_empty( header ) )
8008854: 29 82 00 00 lw r2,(r12+0)
8008858: 44 4e 00 03 be r2,r14,8008864 <_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;
800885c: 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 ) {
8008860: 5d 60 ff f0 bne r11,r0,8008820 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN
}
break;
}
}
_ISR_Enable( level );
8008864: d0 01 00 00 wcsr IE,r1
}
8008868: 2b 9d 00 04 lw ra,(sp+4)
800886c: 2b 8b 00 1c lw r11,(sp+28)
8008870: 2b 8c 00 18 lw r12,(sp+24)
8008874: 2b 8d 00 14 lw r13,(sp+20)
8008878: 2b 8e 00 10 lw r14,(sp+16)
800887c: 2b 8f 00 0c lw r15,(sp+12)
8008880: 2b 90 00 08 lw r16,(sp+8)
8008884: 37 9c 00 1c addi sp,sp,28
8008888: c3 a0 00 00 ret
080067a8 <_Watchdog_Remove>:
{
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
80067a8: 90 00 28 00 rcsr r5,IE
80067ac: 34 02 ff fe mvi r2,-2
80067b0: a0 a2 10 00 and r2,r5,r2
80067b4: d0 02 00 00 wcsr IE,r2
previous_state = the_watchdog->state;
80067b8: 28 23 00 08 lw r3,(r1+8)
switch ( previous_state ) {
80067bc: 34 02 00 01 mvi r2,1
80067c0: 44 62 00 05 be r3,r2,80067d4 <_Watchdog_Remove+0x2c>
80067c4: 44 60 00 1b be r3,r0,8006830 <_Watchdog_Remove+0x88>
80067c8: 34 02 00 03 mvi r2,3
80067cc: 54 62 00 19 bgu r3,r2,8006830 <_Watchdog_Remove+0x88> <== NEVER TAKEN
80067d0: e0 00 00 03 bi 80067dc <_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;
80067d4: 58 20 00 08 sw (r1+8),r0
break;
80067d8: e0 00 00 16 bi 8006830 <_Watchdog_Remove+0x88>
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
_ISR_Enable( level );
return( previous_state );
}
80067dc: 28 22 00 00 lw r2,(r1+0)
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
80067e0: 58 20 00 08 sw (r1+8),r0
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
80067e4: 28 44 00 00 lw r4,(r2+0)
80067e8: 44 80 00 05 be r4,r0,80067fc <_Watchdog_Remove+0x54>
next_watchdog->delta_interval += the_watchdog->delta_interval;
80067ec: 28 46 00 10 lw r6,(r2+16)
80067f0: 28 24 00 10 lw r4,(r1+16)
80067f4: b4 c4 20 00 add r4,r6,r4
80067f8: 58 44 00 10 sw (r2+16),r4
if ( _Watchdog_Sync_count )
80067fc: 78 04 08 01 mvhi r4,0x801
8006800: 38 84 39 54 ori r4,r4,0x3954
8006804: 28 84 00 00 lw r4,(r4+0)
8006808: 44 80 00 07 be r4,r0,8006824 <_Watchdog_Remove+0x7c>
_Watchdog_Sync_level = _ISR_Nest_level;
800680c: 78 04 08 01 mvhi r4,0x801
8006810: 38 84 39 e8 ori r4,r4,0x39e8
8006814: 28 86 00 08 lw r6,(r4+8)
8006818: 78 04 08 01 mvhi r4,0x801
800681c: 38 84 38 ec ori r4,r4,0x38ec
8006820: 58 86 00 00 sw (r4+0),r6
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
8006824: 28 24 00 04 lw r4,(r1+4)
next->previous = previous;
8006828: 58 44 00 04 sw (r2+4),r4
previous->next = next;
800682c: 58 82 00 00 sw (r4+0),r2
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
8006830: 78 02 08 01 mvhi r2,0x801
8006834: 38 42 39 58 ori r2,r2,0x3958
8006838: 28 42 00 00 lw r2,(r2+0)
800683c: 58 22 00 18 sw (r1+24),r2
_ISR_Enable( level );
8006840: d0 05 00 00 wcsr IE,r5
return( previous_state );
}
8006844: b8 60 08 00 mv r1,r3
8006848: c3 a0 00 00 ret
080083e8 <_Watchdog_Report_chain>:
void _Watchdog_Report_chain(
const char *name,
Chain_Control *header
)
{
80083e8: 37 9c ff ec addi sp,sp,-20
80083ec: 5b 8b 00 14 sw (sp+20),r11
80083f0: 5b 8c 00 10 sw (sp+16),r12
80083f4: 5b 8d 00 0c sw (sp+12),r13
80083f8: 5b 8e 00 08 sw (sp+8),r14
80083fc: 5b 9d 00 04 sw (sp+4),ra
8008400: b8 20 70 00 mv r14,r1
8008404: b8 40 60 00 mv r12,r2
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
8008408: 90 00 68 00 rcsr r13,IE
800840c: 34 01 ff fe mvi r1,-2
8008410: a1 a1 08 00 and r1,r13,r1
8008414: d0 01 00 00 wcsr IE,r1
printk( "Watchdog Chain: %s %p\n", name, header );
8008418: 78 01 08 01 mvhi r1,0x801
800841c: b9 80 18 00 mv r3,r12
8008420: 38 21 d1 04 ori r1,r1,0xd104
8008424: b9 c0 10 00 mv r2,r14
8008428: fb ff eb e9 calli 80033cc <printk>
printk( "== end of %s \n", name );
} else {
printk( "Chain is empty\n" );
}
_ISR_Enable( level );
}
800842c: 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 );
8008430: 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 ) ) {
8008434: 45 6c 00 0b be r11,r12,8008460 <_Watchdog_Report_chain+0x78>
node != _Chain_Tail(header) ;
node = node->next )
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
8008438: b9 60 10 00 mv r2,r11
800843c: 34 01 00 00 mvi r1,0
8008440: f8 00 00 13 calli 800848c <_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 )
8008444: 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 ) ;
8008448: 5d 6c ff fc bne r11,r12,8008438 <_Watchdog_Report_chain+0x50><== NEVER TAKEN
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
800844c: 78 01 08 01 mvhi r1,0x801
8008450: 38 21 d1 1c ori r1,r1,0xd11c
8008454: b9 c0 10 00 mv r2,r14
8008458: fb ff eb dd calli 80033cc <printk>
800845c: e0 00 00 04 bi 800846c <_Watchdog_Report_chain+0x84>
} else {
printk( "Chain is empty\n" );
8008460: 78 01 08 01 mvhi r1,0x801
8008464: 38 21 d1 2c ori r1,r1,0xd12c
8008468: fb ff eb d9 calli 80033cc <printk>
}
_ISR_Enable( level );
800846c: d0 0d 00 00 wcsr IE,r13
}
8008470: 2b 9d 00 04 lw ra,(sp+4)
8008474: 2b 8b 00 14 lw r11,(sp+20)
8008478: 2b 8c 00 10 lw r12,(sp+16)
800847c: 2b 8d 00 0c lw r13,(sp+12)
8008480: 2b 8e 00 08 lw r14,(sp+8)
8008484: 37 9c 00 14 addi sp,sp,20
8008488: c3 a0 00 00 ret
0800684c <_Watchdog_Tickle>:
*/
void _Watchdog_Tickle(
Chain_Control *header
)
{
800684c: 37 9c ff e4 addi sp,sp,-28
8006850: 5b 8b 00 1c sw (sp+28),r11
8006854: 5b 8c 00 18 sw (sp+24),r12
8006858: 5b 8d 00 14 sw (sp+20),r13
800685c: 5b 8e 00 10 sw (sp+16),r14
8006860: 5b 8f 00 0c sw (sp+12),r15
8006864: 5b 90 00 08 sw (sp+8),r16
8006868: 5b 9d 00 04 sw (sp+4),ra
800686c: 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 );
8006870: 90 00 18 00 rcsr r3,IE
8006874: 34 01 ff fe mvi r1,-2
8006878: a0 61 08 00 and r1,r3,r1
800687c: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
8006880: 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 );
8006884: 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 );
8006888: b8 60 10 00 mv r2,r3
if ( _Chain_Is_empty( header ) )
800688c: 45 6e 00 1a be r11,r14,80068f4 <_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) {
8006890: 29 61 00 10 lw r1,(r11+16)
8006894: 44 20 00 04 be r1,r0,80068a4 <_Watchdog_Tickle+0x58>
the_watchdog->delta_interval--;
8006898: 34 21 ff ff addi r1,r1,-1
800689c: 59 61 00 10 sw (r11+16),r1
if ( the_watchdog->delta_interval != 0 )
80068a0: 5c 20 00 15 bne r1,r0,80068f4 <_Watchdog_Tickle+0xa8>
*/
void _Watchdog_Tickle(
Chain_Control *header
)
{
80068a4: b8 60 68 00 mv r13,r3
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
_ISR_Enable( level );
switch( watchdog_state ) {
80068a8: 34 10 00 02 mvi r16,2
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
80068ac: 34 0f ff fe mvi r15,-2
80068b0: e0 00 00 02 bi 80068b8 <_Watchdog_Tickle+0x6c>
80068b4: b8 40 68 00 mv r13,r2
if ( the_watchdog->delta_interval != 0 )
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
80068b8: b9 60 08 00 mv r1,r11
80068bc: fb ff ff bb calli 80067a8 <_Watchdog_Remove>
_ISR_Enable( level );
80068c0: d0 0d 00 00 wcsr IE,r13
switch( watchdog_state ) {
80068c4: 5c 30 00 05 bne r1,r16,80068d8 <_Watchdog_Tickle+0x8c> <== NEVER TAKEN
case WATCHDOG_ACTIVE:
(*the_watchdog->routine)(
80068c8: 29 63 00 1c lw r3,(r11+28)
80068cc: 29 61 00 20 lw r1,(r11+32)
80068d0: 29 62 00 24 lw r2,(r11+36)
80068d4: d8 60 00 00 call r3
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
80068d8: 90 00 10 00 rcsr r2,IE
80068dc: a0 4f 08 00 and r1,r2,r15
80068e0: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
80068e4: 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) );
80068e8: 45 6e 00 03 be r11,r14,80068f4 <_Watchdog_Tickle+0xa8>
}
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
80068ec: 29 61 00 10 lw r1,(r11+16)
80068f0: 44 20 ff f1 be r1,r0,80068b4 <_Watchdog_Tickle+0x68>
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
80068f4: d0 02 00 00 wcsr IE,r2
}
80068f8: 2b 9d 00 04 lw ra,(sp+4)
80068fc: 2b 8b 00 1c lw r11,(sp+28)
8006900: 2b 8c 00 18 lw r12,(sp+24)
8006904: 2b 8d 00 14 lw r13,(sp+20)
8006908: 2b 8e 00 10 lw r14,(sp+16)
800690c: 2b 8f 00 0c lw r15,(sp+12)
8006910: 2b 90 00 08 lw r16,(sp+8)
8006914: 37 9c 00 1c addi sp,sp,28
8006918: c3 a0 00 00 ret
080036d0 <rtems_chain_append_with_notification>:
rtems_chain_control *chain,
rtems_chain_node *node,
rtems_id task,
rtems_event_set events
)
{
80036d0: 37 9c ff f4 addi sp,sp,-12
80036d4: 5b 8b 00 0c sw (sp+12),r11
80036d8: 5b 8c 00 08 sw (sp+8),r12
80036dc: 5b 9d 00 04 sw (sp+4),ra
80036e0: b8 60 60 00 mv r12,r3
80036e4: b8 80 58 00 mv r11,r4
RTEMS_INLINE_ROUTINE bool rtems_chain_append_with_empty_check(
rtems_chain_control *chain,
rtems_chain_node *node
)
{
return _Chain_Append_with_empty_check( chain, node );
80036e8: f8 00 01 8f calli 8003d24 <_Chain_Append_with_empty_check>
rtems_status_code sc = RTEMS_SUCCESSFUL;
80036ec: 34 05 00 00 mvi r5,0
bool was_empty = rtems_chain_append_with_empty_check( chain, node );
if ( was_empty ) {
80036f0: 44 20 00 05 be r1,r0,8003704 <rtems_chain_append_with_notification+0x34><== NEVER TAKEN
sc = rtems_event_send( task, events );
80036f4: b9 80 08 00 mv r1,r12
80036f8: b9 60 10 00 mv r2,r11
80036fc: f8 00 15 c0 calli 8008dfc <rtems_event_send>
8003700: b8 20 28 00 mv r5,r1
}
return sc;
}
8003704: b8 a0 08 00 mv r1,r5
8003708: 2b 9d 00 04 lw ra,(sp+4)
800370c: 2b 8b 00 0c lw r11,(sp+12)
8003710: 2b 8c 00 08 lw r12,(sp+8)
8003714: 37 9c 00 0c addi sp,sp,12
8003718: c3 a0 00 00 ret
0800376c <rtems_chain_get_with_wait>:
rtems_chain_control *chain,
rtems_event_set events,
rtems_interval timeout,
rtems_chain_node **node_ptr
)
{
800376c: 37 9c ff e4 addi sp,sp,-28
8003770: 5b 8b 00 18 sw (sp+24),r11
8003774: 5b 8c 00 14 sw (sp+20),r12
8003778: 5b 8d 00 10 sw (sp+16),r13
800377c: 5b 8e 00 0c sw (sp+12),r14
8003780: 5b 8f 00 08 sw (sp+8),r15
8003784: 5b 9d 00 04 sw (sp+4),ra
8003788: b8 20 78 00 mv r15,r1
800378c: b8 40 70 00 mv r14,r2
8003790: b8 60 68 00 mv r13,r3
8003794: b8 80 60 00 mv r12,r4
8003798: e0 00 00 08 bi 80037b8 <rtems_chain_get_with_wait+0x4c>
while (
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
) {
rtems_event_set out;
sc = rtems_event_receive(
800379c: b9 c0 08 00 mv r1,r14
80037a0: 34 02 00 00 mvi r2,0
80037a4: b9 a0 18 00 mv r3,r13
80037a8: 37 84 00 1c addi r4,sp,28
80037ac: fb ff fd d2 calli 8002ef4 <rtems_event_receive>
80037b0: b8 20 28 00 mv r5,r1
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
80037b4: 5c 2b 00 06 bne r1,r11,80037cc <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 );
80037b8: b9 e0 08 00 mv r1,r15
80037bc: f8 00 01 90 calli 8003dfc <_Chain_Get>
80037c0: b8 20 58 00 mv r11,r1
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
80037c4: 44 20 ff f6 be r1,r0,800379c <rtems_chain_get_with_wait+0x30>
80037c8: 34 05 00 00 mvi r5,0
}
*node_ptr = node;
return sc;
}
80037cc: b8 a0 08 00 mv r1,r5
timeout,
&out
);
}
*node_ptr = node;
80037d0: 59 8b 00 00 sw (r12+0),r11
return sc;
}
80037d4: 2b 9d 00 04 lw ra,(sp+4)
80037d8: 2b 8b 00 18 lw r11,(sp+24)
80037dc: 2b 8c 00 14 lw r12,(sp+20)
80037e0: 2b 8d 00 10 lw r13,(sp+16)
80037e4: 2b 8e 00 0c lw r14,(sp+12)
80037e8: 2b 8f 00 08 lw r15,(sp+8)
80037ec: 37 9c 00 1c addi sp,sp,28
80037f0: c3 a0 00 00 ret
080037f4 <rtems_chain_prepend_with_notification>:
rtems_chain_control *chain,
rtems_chain_node *node,
rtems_id task,
rtems_event_set events
)
{
80037f4: 37 9c ff f4 addi sp,sp,-12
80037f8: 5b 8b 00 0c sw (sp+12),r11
80037fc: 5b 8c 00 08 sw (sp+8),r12
8003800: 5b 9d 00 04 sw (sp+4),ra
8003804: b8 60 60 00 mv r12,r3
8003808: b8 80 58 00 mv r11,r4
RTEMS_INLINE_ROUTINE bool rtems_chain_prepend_with_empty_check(
rtems_chain_control *chain,
rtems_chain_node *node
)
{
return _Chain_Prepend_with_empty_check( chain, node );
800380c: f8 00 01 96 calli 8003e64 <_Chain_Prepend_with_empty_check>
rtems_status_code sc = RTEMS_SUCCESSFUL;
8003810: 34 05 00 00 mvi r5,0
bool was_empty = rtems_chain_prepend_with_empty_check( chain, node );
if (was_empty) {
8003814: 44 20 00 05 be r1,r0,8003828 <rtems_chain_prepend_with_notification+0x34><== NEVER TAKEN
sc = rtems_event_send( task, events );
8003818: b9 80 08 00 mv r1,r12
800381c: b9 60 10 00 mv r2,r11
8003820: f8 00 15 77 calli 8008dfc <rtems_event_send>
8003824: b8 20 28 00 mv r5,r1
}
return sc;
}
8003828: b8 a0 08 00 mv r1,r5
800382c: 2b 9d 00 04 lw ra,(sp+4)
8003830: 2b 8b 00 0c lw r11,(sp+12)
8003834: 2b 8c 00 08 lw r12,(sp+8)
8003838: 37 9c 00 0c addi sp,sp,12
800383c: c3 a0 00 00 ret
08010a04 <rtems_clock_set_nanoseconds_extension>:
* error code - if unsuccessful
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
8010a04: b8 20 18 00 mv r3,r1
if ( !routine )
return RTEMS_INVALID_ADDRESS;
8010a08: 34 01 00 09 mvi r1,9
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
if ( !routine )
8010a0c: 44 60 00 05 be r3,r0,8010a20 <rtems_clock_set_nanoseconds_extension+0x1c><== ALWAYS TAKEN
return RTEMS_INVALID_ADDRESS;
_Watchdog_Nanoseconds_since_tick_handler = routine;
8010a10: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
8010a14: 38 42 a1 40 ori r2,r2,0xa140 <== NOT EXECUTED
8010a18: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED
return RTEMS_SUCCESSFUL;
8010a1c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
8010a20: c3 a0 00 00 ret
08005fd4 <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)
{
8005fd4: 37 9c ff e4 addi sp,sp,-28
8005fd8: 5b 8b 00 1c sw (sp+28),r11
8005fdc: 5b 8c 00 18 sw (sp+24),r12
8005fe0: 5b 8d 00 14 sw (sp+20),r13
8005fe4: 5b 8e 00 10 sw (sp+16),r14
8005fe8: 5b 8f 00 0c sw (sp+12),r15
8005fec: 5b 90 00 08 sw (sp+8),r16
8005ff0: 5b 9d 00 04 sw (sp+4),ra
8005ff4: b8 20 78 00 mv r15,r1
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8005ff8: 44 20 00 18 be r1,r0,8006058 <rtems_iterate_over_all_threads+0x84><== NEVER TAKEN
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8005ffc: 78 02 08 02 mvhi r2,0x802
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006000: 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)
8006004: 38 42 75 bc ori r2,r2,0x75bc
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006008: 39 6b 75 c0 ori r11,r11,0x75c0
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
800600c: 34 50 00 10 addi r16,r2,16
if ( !routine )
return;
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
8006010: 29 61 00 00 lw r1,(r11+0)
8006014: 44 20 00 0f be r1,r0,8006050 <rtems_iterate_over_all_threads+0x7c>
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
8006018: 28 2c 00 04 lw r12,(r1+4)
if ( !information )
800601c: 34 0e 00 04 mvi r14,4
8006020: 34 0d 00 01 mvi r13,1
8006024: 5d 80 00 09 bne r12,r0,8006048 <rtems_iterate_over_all_threads+0x74>
8006028: e0 00 00 0a bi 8006050 <rtems_iterate_over_all_threads+0x7c>
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
800602c: 29 81 00 1c lw r1,(r12+28)
8006030: b4 2e 08 00 add r1,r1,r14
8006034: 28 21 00 00 lw r1,(r1+0)
if ( !the_thread )
8006038: 44 20 00 02 be r1,r0,8006040 <rtems_iterate_over_all_threads+0x6c>
continue;
(*routine)(the_thread);
800603c: d9 e0 00 00 call r15
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
8006040: 35 ad 00 01 addi r13,r13,1
8006044: 35 ce 00 04 addi r14,r14,4
8006048: 2d 81 00 10 lhu r1,(r12+16)
800604c: 50 2d ff f8 bgeu r1,r13,800602c <rtems_iterate_over_all_threads+0x58>
8006050: 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++ ) {
8006054: 5d 70 ff ef bne r11,r16,8006010 <rtems_iterate_over_all_threads+0x3c>
(*routine)(the_thread);
}
}
}
8006058: 2b 9d 00 04 lw ra,(sp+4)
800605c: 2b 8b 00 1c lw r11,(sp+28)
8006060: 2b 8c 00 18 lw r12,(sp+24)
8006064: 2b 8d 00 14 lw r13,(sp+20)
8006068: 2b 8e 00 10 lw r14,(sp+16)
800606c: 2b 8f 00 0c lw r15,(sp+12)
8006070: 2b 90 00 08 lw r16,(sp+8)
8006074: 37 9c 00 1c addi sp,sp,28
8006078: c3 a0 00 00 ret
08011920 <rtems_partition_create>:
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
8011920: 37 9c ff d8 addi sp,sp,-40
8011924: 5b 8b 00 28 sw (sp+40),r11
8011928: 5b 8c 00 24 sw (sp+36),r12
801192c: 5b 8d 00 20 sw (sp+32),r13
8011930: 5b 8e 00 1c sw (sp+28),r14
8011934: 5b 8f 00 18 sw (sp+24),r15
8011938: 5b 90 00 14 sw (sp+20),r16
801193c: 5b 91 00 10 sw (sp+16),r17
8011940: 5b 92 00 0c sw (sp+12),r18
8011944: 5b 93 00 08 sw (sp+8),r19
8011948: 5b 9d 00 04 sw (sp+4),ra
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
801194c: 34 07 00 03 mvi r7,3
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
8011950: b8 20 88 00 mv r17,r1
8011954: b8 40 70 00 mv r14,r2
8011958: b8 60 78 00 mv r15,r3
801195c: b8 80 60 00 mv r12,r4
8011960: b8 a0 98 00 mv r19,r5
8011964: b8 c0 80 00 mv r16,r6
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
8011968: 44 20 00 36 be r1,r0,8011a40 <rtems_partition_create+0x120>
return RTEMS_INVALID_NAME;
if ( !starting_address )
return RTEMS_INVALID_ADDRESS;
801196c: 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 )
8011970: 44 40 00 34 be r2,r0,8011a40 <rtems_partition_create+0x120>
return RTEMS_INVALID_ADDRESS;
if ( !id )
8011974: 44 c0 00 33 be r6,r0,8011a40 <rtems_partition_create+0x120><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
8011978: 64 82 00 00 cmpei r2,r4,0
801197c: 64 61 00 00 cmpei r1,r3,0
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
8011980: 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 ||
8011984: b8 41 08 00 or r1,r2,r1
8011988: 5c 20 00 2e bne r1,r0,8011a40 <rtems_partition_create+0x120>
801198c: 54 83 00 2d bgu r4,r3,8011a40 <rtems_partition_create+0x120>
*/
RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned (
uint32_t buffer_size
)
{
return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0);
8011990: 20 81 00 07 andi r1,r4,0x7
8011994: 5c 20 00 2b bne r1,r0,8011a40 <rtems_partition_create+0x120>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
8011998: 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;
801199c: 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 ) )
80119a0: 5e 41 00 28 bne r18,r1,8011a40 <rtems_partition_create+0x120>
80119a4: 78 02 08 03 mvhi r2,0x803
80119a8: 38 42 ec 38 ori r2,r2,0xec38
80119ac: 28 41 00 00 lw r1,(r2+0)
80119b0: 34 21 00 01 addi r1,r1,1
80119b4: 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 );
80119b8: 78 0d 08 03 mvhi r13,0x803
80119bc: 39 ad ea 90 ori r13,r13,0xea90
80119c0: b9 a0 08 00 mv r1,r13
80119c4: f8 00 15 c6 calli 80170dc <_Objects_Allocate>
80119c8: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
80119cc: 5c 32 00 04 bne r1,r18,80119dc <rtems_partition_create+0xbc>
_Thread_Enable_dispatch();
80119d0: f8 00 1b 29 calli 8018674 <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
80119d4: 34 07 00 05 mvi r7,5
80119d8: e0 00 00 1a bi 8011a40 <rtems_partition_create+0x120>
}
#endif
the_partition->starting_address = starting_address;
the_partition->length = length;
the_partition->buffer_size = buffer_size;
80119dc: 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 );
80119e0: b9 80 10 00 mv r2,r12
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
80119e4: 58 2e 00 10 sw (r1+16),r14
the_partition->length = length;
80119e8: 58 2f 00 14 sw (r1+20),r15
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
80119ec: 58 33 00 1c sw (r1+28),r19
the_partition->number_of_used_blocks = 0;
80119f0: 58 20 00 20 sw (r1+32),r0
_Chain_Initialize( &the_partition->Memory, starting_address,
80119f4: 34 32 00 24 addi r18,r1,36
length / buffer_size, buffer_size );
80119f8: b9 e0 08 00 mv r1,r15
80119fc: f8 00 78 42 calli 802fb04 <__udivsi3>
8011a00: 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,
8011a04: b9 80 20 00 mv r4,r12
8011a08: ba 40 08 00 mv r1,r18
8011a0c: b9 c0 10 00 mv r2,r14
8011a10: f8 00 0e ea calli 80155b8 <_Chain_Initialize>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8011a14: 29 6c 00 08 lw r12,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8011a18: 29 ad 00 1c lw r13,(r13+28)
8011a1c: 34 02 00 02 mvi r2,2
8011a20: 21 81 ff ff andi r1,r12,0xffff
8011a24: fb ff f1 0c calli 800de54 <__ashlsi3>
8011a28: b5 a1 08 00 add r1,r13,r1
8011a2c: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8011a30: 59 71 00 0c sw (r11+12),r17
&_Partition_Information,
&the_partition->Object,
(Objects_Name) name
);
*id = the_partition->Object.id;
8011a34: 5a 0c 00 00 sw (r16+0),r12
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
8011a38: f8 00 1b 0f calli 8018674 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8011a3c: 34 07 00 00 mvi r7,0
}
8011a40: b8 e0 08 00 mv r1,r7
8011a44: 2b 9d 00 04 lw ra,(sp+4)
8011a48: 2b 8b 00 28 lw r11,(sp+40)
8011a4c: 2b 8c 00 24 lw r12,(sp+36)
8011a50: 2b 8d 00 20 lw r13,(sp+32)
8011a54: 2b 8e 00 1c lw r14,(sp+28)
8011a58: 2b 8f 00 18 lw r15,(sp+24)
8011a5c: 2b 90 00 14 lw r16,(sp+20)
8011a60: 2b 91 00 10 lw r17,(sp+16)
8011a64: 2b 92 00 0c lw r18,(sp+12)
8011a68: 2b 93 00 08 lw r19,(sp+8)
8011a6c: 37 9c 00 28 addi sp,sp,40
8011a70: c3 a0 00 00 ret
0800ac98 <rtems_rate_monotonic_get_status>:
rtems_status_code rtems_rate_monotonic_get_status(
rtems_id id,
rtems_rate_monotonic_period_status *status
)
{
800ac98: 37 9c ff e4 addi sp,sp,-28
800ac9c: 5b 8b 00 08 sw (sp+8),r11
800aca0: 5b 9d 00 04 sw (sp+4),ra
800aca4: b8 20 18 00 mv r3,r1
800aca8: b8 40 58 00 mv r11,r2
Rate_monotonic_Period_time_t since_last_period;
Rate_monotonic_Control *the_period;
bool valid_status;
if ( !status )
return RTEMS_INVALID_ADDRESS;
800acac: 34 01 00 09 mvi r1,9
Objects_Locations location;
Rate_monotonic_Period_time_t since_last_period;
Rate_monotonic_Control *the_period;
bool valid_status;
if ( !status )
800acb0: 44 40 00 26 be r2,r0,800ad48 <rtems_rate_monotonic_get_status+0xb0><== NEVER TAKEN
800acb4: 78 01 08 01 mvhi r1,0x801
800acb8: b8 60 10 00 mv r2,r3
800acbc: 38 21 f8 18 ori r1,r1,0xf818
800acc0: 37 83 00 1c addi r3,sp,28
800acc4: fb ff ef 1b calli 8006930 <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
800acc8: 2b 83 00 1c lw r3,(sp+28)
800accc: 5c 60 00 1e bne r3,r0,800ad44 <rtems_rate_monotonic_get_status+0xac><== NEVER TAKEN
case OBJECTS_LOCAL:
status->owner = the_period->owner->Object.id;
800acd0: 28 24 00 40 lw r4,(r1+64)
status->state = the_period->state;
800acd4: 28 22 00 38 lw r2,(r1+56)
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
case OBJECTS_LOCAL:
status->owner = the_period->owner->Object.id;
800acd8: 28 84 00 08 lw r4,(r4+8)
status->state = the_period->state;
800acdc: 59 62 00 04 sw (r11+4),r2
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
case OBJECTS_LOCAL:
status->owner = the_period->owner->Object.id;
800ace0: 59 64 00 00 sw (r11+0),r4
status->state = the_period->state;
/*
* If the period is inactive, there is no information.
*/
if ( status->state == RATE_MONOTONIC_INACTIVE ) {
800ace4: 5c 43 00 06 bne r2,r3,800acfc <rtems_rate_monotonic_get_status+0x64>
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timespec_Set_to_zero( &status->since_last_period );
800ace8: 59 60 00 08 sw (r11+8),r0
800acec: 59 60 00 0c sw (r11+12),r0
_Timespec_Set_to_zero( &status->executed_since_last_period );
800acf0: 59 60 00 10 sw (r11+16),r0
800acf4: 59 60 00 14 sw (r11+20),r0
800acf8: e0 00 00 10 bi 800ad38 <rtems_rate_monotonic_get_status+0xa0>
} else {
/*
* Grab the current status.
*/
valid_status =
800acfc: 37 82 00 0c addi r2,sp,12
800ad00: 37 83 00 14 addi r3,sp,20
800ad04: fb ff e4 53 calli 8003e50 <_Rate_monotonic_Get_status>
_Rate_monotonic_Get_status(
the_period, &since_last_period, &executed
);
if (!valid_status) {
800ad08: 5c 20 00 04 bne r1,r0,800ad18 <rtems_rate_monotonic_get_status+0x80>
_Thread_Enable_dispatch();
800ad0c: fb ff f2 64 calli 800769c <_Thread_Enable_dispatch>
return RTEMS_NOT_DEFINED;
800ad10: 34 01 00 0b mvi r1,11
800ad14: e0 00 00 0d bi 800ad48 <rtems_rate_monotonic_get_status+0xb0>
}
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_To_timespec(
800ad18: 2b 81 00 0c lw r1,(sp+12)
800ad1c: 59 61 00 08 sw (r11+8),r1
800ad20: 2b 81 00 10 lw r1,(sp+16)
800ad24: 59 61 00 0c sw (r11+12),r1
&since_last_period, &status->since_last_period
);
_Timestamp_To_timespec(
800ad28: 2b 81 00 14 lw r1,(sp+20)
800ad2c: 59 61 00 10 sw (r11+16),r1
800ad30: 2b 81 00 18 lw r1,(sp+24)
800ad34: 59 61 00 14 sw (r11+20),r1
status->since_last_period = since_last_period;
status->executed_since_last_period = executed;
#endif
}
_Thread_Enable_dispatch();
800ad38: fb ff f2 59 calli 800769c <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
800ad3c: 34 01 00 00 mvi r1,0
800ad40: e0 00 00 02 bi 800ad48 <rtems_rate_monotonic_get_status+0xb0>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
800ad44: 34 01 00 04 mvi r1,4
}
800ad48: 2b 9d 00 04 lw ra,(sp+4)
800ad4c: 2b 8b 00 08 lw r11,(sp+8)
800ad50: 37 9c 00 1c addi sp,sp,28
800ad54: c3 a0 00 00 ret
080040c8 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
80040c8: 37 9c ff e8 addi sp,sp,-24
80040cc: 5b 8b 00 14 sw (sp+20),r11
80040d0: 5b 8c 00 10 sw (sp+16),r12
80040d4: 5b 8d 00 0c sw (sp+12),r13
80040d8: 5b 8e 00 08 sw (sp+8),r14
80040dc: 5b 9d 00 04 sw (sp+4),ra
80040e0: b8 20 60 00 mv r12,r1
Objects_Id id,
Objects_Locations *location
)
{
return (Rate_monotonic_Control *)
_Objects_Get( &_Rate_monotonic_Information, id, location );
80040e4: 78 01 08 01 mvhi r1,0x801
80040e8: b8 40 68 00 mv r13,r2
80040ec: 38 21 f8 18 ori r1,r1,0xf818
80040f0: b9 80 10 00 mv r2,r12
80040f4: 37 83 00 18 addi r3,sp,24
80040f8: f8 00 0a 0e calli 8006930 <_Objects_Get>
80040fc: 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 ) {
8004100: 2b 81 00 18 lw r1,(sp+24)
8004104: 5c 20 00 5f bne r1,r0,8004280 <rtems_rate_monotonic_period+0x1b8>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
8004108: 78 03 08 01 mvhi r3,0x801
800410c: 38 63 fb 00 ori r3,r3,0xfb00
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
8004110: 29 62 00 40 lw r2,(r11+64)
8004114: 28 61 00 0c lw r1,(r3+12)
8004118: 44 41 00 04 be r2,r1,8004128 <rtems_rate_monotonic_period+0x60>
_Thread_Enable_dispatch();
800411c: f8 00 0d 60 calli 800769c <_Thread_Enable_dispatch>
return RTEMS_NOT_OWNER_OF_RESOURCE;
8004120: 34 0c 00 17 mvi r12,23
8004124: e0 00 00 58 bi 8004284 <rtems_rate_monotonic_period+0x1bc>
}
if ( length == RTEMS_PERIOD_STATUS ) {
8004128: 5d a0 00 0d bne r13,r0,800415c <rtems_rate_monotonic_period+0x94>
switch ( the_period->state ) {
800412c: 29 61 00 38 lw r1,(r11+56)
8004130: 34 02 00 04 mvi r2,4
8004134: 34 0c 00 00 mvi r12,0
8004138: 54 22 00 07 bgu r1,r2,8004154 <rtems_rate_monotonic_period+0x8c><== NEVER TAKEN
800413c: 78 0b 08 01 mvhi r11,0x801
8004140: 34 02 00 02 mvi r2,2
8004144: fb ff f4 52 calli 800128c <__ashlsi3>
8004148: 39 6b cc 20 ori r11,r11,0xcc20
800414c: b5 61 08 00 add r1,r11,r1
8004150: 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();
8004154: f8 00 0d 52 calli 800769c <_Thread_Enable_dispatch>
return( return_value );
8004158: e0 00 00 4b bi 8004284 <rtems_rate_monotonic_period+0x1bc>
}
_ISR_Disable( level );
800415c: 90 00 70 00 rcsr r14,IE
8004160: 34 01 ff fe mvi r1,-2
8004164: a1 c1 08 00 and r1,r14,r1
8004168: d0 01 00 00 wcsr IE,r1
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
800416c: 29 63 00 38 lw r3,(r11+56)
8004170: 5c 60 00 13 bne r3,r0,80041bc <rtems_rate_monotonic_period+0xf4>
_ISR_Enable( level );
8004174: d0 0e 00 00 wcsr IE,r14
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
8004178: b9 60 08 00 mv r1,r11
800417c: fb ff ff 6e calli 8003f34 <_Rate_monotonic_Initiate_statistics>
the_period->state = RATE_MONOTONIC_ACTIVE;
8004180: 34 01 00 02 mvi r1,2
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
8004184: 78 03 08 00 mvhi r3,0x800
8004188: 59 61 00 38 sw (r11+56),r1
800418c: 38 63 46 08 ori r3,r3,0x4608
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8004190: 78 01 08 01 mvhi r1,0x801
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8004194: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8004198: 59 63 00 2c sw (r11+44),r3
the_watchdog->id = id;
800419c: 59 6c 00 30 sw (r11+48),r12
the_watchdog->user_data = user_data;
80041a0: 59 60 00 34 sw (r11+52),r0
_Rate_monotonic_Timeout,
id,
NULL
);
the_period->next_length = length;
80041a4: 59 6d 00 3c sw (r11+60),r13
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80041a8: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80041ac: 38 21 fa 20 ori r1,r1,0xfa20
80041b0: 35 62 00 10 addi r2,r11,16
80041b4: f8 00 11 f7 calli 8008990 <_Watchdog_Insert>
80041b8: e0 00 00 1f bi 8004234 <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 ) {
80041bc: 34 01 00 02 mvi r1,2
80041c0: 5c 61 00 20 bne r3,r1,8004240 <rtems_rate_monotonic_period+0x178>
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
80041c4: b9 60 08 00 mv r1,r11
80041c8: fb ff ff 80 calli 8003fc8 <_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;
80041cc: 34 01 00 01 mvi r1,1
80041d0: 59 61 00 38 sw (r11+56),r1
the_period->next_length = length;
80041d4: 59 6d 00 3c sw (r11+60),r13
_ISR_Enable( level );
80041d8: d0 0e 00 00 wcsr IE,r14
_Thread_Executing->Wait.id = the_period->Object.id;
80041dc: 78 01 08 01 mvhi r1,0x801
80041e0: 38 21 fb 00 ori r1,r1,0xfb00
80041e4: 29 62 00 08 lw r2,(r11+8)
80041e8: 28 21 00 0c lw r1,(r1+12)
80041ec: 58 22 00 20 sw (r1+32),r2
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
80041f0: 34 02 40 00 mvi r2,16384
80041f4: f8 00 0f bc calli 80080e4 <_Thread_Set_state>
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
80041f8: 90 00 08 00 rcsr r1,IE
80041fc: 34 02 ff fe mvi r2,-2
8004200: a0 22 10 00 and r2,r1,r2
8004204: d0 02 00 00 wcsr IE,r2
local_state = the_period->state;
the_period->state = RATE_MONOTONIC_ACTIVE;
8004208: 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;
800420c: 29 62 00 38 lw r2,(r11+56)
the_period->state = RATE_MONOTONIC_ACTIVE;
8004210: 59 63 00 38 sw (r11+56),r3
_ISR_Enable( level );
8004214: 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 )
8004218: 34 01 00 03 mvi r1,3
800421c: 5c 41 00 06 bne r2,r1,8004234 <rtems_rate_monotonic_period+0x16c>
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
8004220: 78 01 08 01 mvhi r1,0x801
8004224: 38 21 fb 00 ori r1,r1,0xfb00
8004228: 28 21 00 0c lw r1,(r1+12)
800422c: 34 02 40 00 mvi r2,16384
8004230: f8 00 0c 56 calli 8007388 <_Thread_Clear_state>
_Thread_Enable_dispatch();
8004234: f8 00 0d 1a calli 800769c <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8004238: 34 0c 00 00 mvi r12,0
800423c: e0 00 00 12 bi 8004284 <rtems_rate_monotonic_period+0x1bc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8004240: 34 0c 00 04 mvi r12,4
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_EXPIRED ) {
8004244: 5c 6c 00 10 bne r3,r12,8004284 <rtems_rate_monotonic_period+0x1bc><== NEVER TAKEN
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
8004248: b9 60 08 00 mv r1,r11
800424c: fb ff ff 5f calli 8003fc8 <_Rate_monotonic_Update_statistics>
_ISR_Enable( level );
8004250: d0 0e 00 00 wcsr IE,r14
the_period->state = RATE_MONOTONIC_ACTIVE;
8004254: 34 01 00 02 mvi r1,2
8004258: 59 61 00 38 sw (r11+56),r1
800425c: 78 01 08 01 mvhi r1,0x801
8004260: 38 21 fa 20 ori r1,r1,0xfa20
8004264: 35 62 00 10 addi r2,r11,16
the_period->next_length = length;
8004268: 59 6d 00 3c sw (r11+60),r13
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
800426c: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8004270: f8 00 11 c8 calli 8008990 <_Watchdog_Insert>
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
return RTEMS_TIMEOUT;
8004274: 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();
8004278: f8 00 0d 09 calli 800769c <_Thread_Enable_dispatch>
return RTEMS_TIMEOUT;
800427c: e0 00 00 02 bi 8004284 <rtems_rate_monotonic_period+0x1bc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8004280: 34 0c 00 04 mvi r12,4
}
8004284: b9 80 08 00 mv r1,r12
8004288: 2b 9d 00 04 lw ra,(sp+4)
800428c: 2b 8b 00 14 lw r11,(sp+20)
8004290: 2b 8c 00 10 lw r12,(sp+16)
8004294: 2b 8d 00 0c lw r13,(sp+12)
8004298: 2b 8e 00 08 lw r14,(sp+8)
800429c: 37 9c 00 18 addi sp,sp,24
80042a0: c3 a0 00 00 ret
080042a4 <rtems_rate_monotonic_report_statistics_with_plugin>:
*/
void rtems_rate_monotonic_report_statistics_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
80042a4: 37 9c ff 5c addi sp,sp,-164
80042a8: 5b 8b 00 44 sw (sp+68),r11
80042ac: 5b 8c 00 40 sw (sp+64),r12
80042b0: 5b 8d 00 3c sw (sp+60),r13
80042b4: 5b 8e 00 38 sw (sp+56),r14
80042b8: 5b 8f 00 34 sw (sp+52),r15
80042bc: 5b 90 00 30 sw (sp+48),r16
80042c0: 5b 91 00 2c sw (sp+44),r17
80042c4: 5b 92 00 28 sw (sp+40),r18
80042c8: 5b 93 00 24 sw (sp+36),r19
80042cc: 5b 94 00 20 sw (sp+32),r20
80042d0: 5b 95 00 1c sw (sp+28),r21
80042d4: 5b 96 00 18 sw (sp+24),r22
80042d8: 5b 97 00 14 sw (sp+20),r23
80042dc: 5b 98 00 10 sw (sp+16),r24
80042e0: 5b 99 00 0c sw (sp+12),r25
80042e4: 5b 9b 00 08 sw (sp+8),fp
80042e8: 5b 9d 00 04 sw (sp+4),ra
80042ec: b8 20 60 00 mv r12,r1
80042f0: 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 )
80042f4: 44 40 00 72 be r2,r0,80044bc <rtems_rate_monotonic_report_statistics_with_plugin+0x218><== NEVER TAKEN
return;
(*print)( context, "Period information by period\n" );
80042f8: 78 02 08 01 mvhi r2,0x801
80042fc: 38 42 cc 34 ori r2,r2,0xcc34
8004300: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)( context, "--- CPU times are in seconds ---\n" );
8004304: 78 02 08 01 mvhi r2,0x801
8004308: 38 42 cc 54 ori r2,r2,0xcc54
800430c: b9 80 08 00 mv r1,r12
8004310: d9 60 00 00 call r11
(*print)( context, "--- Wall times are in seconds ---\n" );
8004314: 78 02 08 01 mvhi r2,0x801
8004318: 38 42 cc 78 ori r2,r2,0xcc78
800431c: b9 80 08 00 mv r1,r12
8004320: d9 60 00 00 call r11
Be sure to test the various cases.
(*print)( context,"\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
*/
(*print)( context, " ID OWNER COUNT MISSED "
8004324: 78 02 08 01 mvhi r2,0x801
8004328: 38 42 cc 9c ori r2,r2,0xcc9c
800432c: b9 80 08 00 mv r1,r12
8004330: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
" "
#endif
" WALL TIME\n"
);
(*print)( context, " "
8004334: 78 02 08 01 mvhi r2,0x801
8004338: b9 80 08 00 mv r1,r12
800433c: 38 42 cc e8 ori r2,r2,0xcce8
8004340: 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 ;
8004344: 78 01 08 01 mvhi r1,0x801
8004348: 38 21 f8 18 ori r1,r1,0xf818
rtems_object_get_name( the_status.owner, sizeof(name), name );
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
800434c: 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,
8004350: 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,
8004354: 78 0f 08 01 mvhi r15,0x801
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
8004358: 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 ;
800435c: 28 2d 00 08 lw r13,(r1+8)
id <= _Rate_monotonic_Information.maximum_id ;
8004360: b8 20 a0 00 mv r20,r1
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
8004364: 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 );
8004368: 37 98 00 80 addi r24,sp,128
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
800436c: 37 93 00 a0 addi r19,sp,160
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8004370: 3a 31 cd 34 ori r17,r17,0xcd34
{
#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;
8004374: 37 97 00 60 addi r23,sp,96
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
8004378: 37 92 00 98 addi r18,sp,152
(*print)( context,
800437c: 3a 10 cd 4c ori r16,r16,0xcd4c
{
#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;
8004380: 37 96 00 78 addi r22,sp,120
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
8004384: 39 ef cd 6c ori r15,r15,0xcd6c
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
8004388: 39 ce c2 70 ori r14,r14,0xc270
/*
* 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 ;
800438c: e0 00 00 4a bi 80044b4 <rtems_rate_monotonic_report_statistics_with_plugin+0x210>
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
8004390: b9 a0 08 00 mv r1,r13
8004394: bb 20 10 00 mv r2,r25
8004398: f8 00 1a 0e calli 800abd0 <rtems_rate_monotonic_get_statistics>
800439c: b8 20 a8 00 mv r21,r1
if ( status != RTEMS_SUCCESSFUL )
80043a0: 5c 20 00 44 bne r1,r0,80044b0 <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 );
80043a4: bb 00 10 00 mv r2,r24
80043a8: b9 a0 08 00 mv r1,r13
80043ac: f8 00 1a 3b calli 800ac98 <rtems_rate_monotonic_get_status>
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
80043b0: 2b 81 00 80 lw r1,(sp+128)
80043b4: 34 02 00 05 mvi r2,5
80043b8: ba 60 18 00 mv r3,r19
80043bc: f8 00 00 c3 calli 80046c8 <rtems_object_get_name>
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
80043c0: 2b 85 00 48 lw r5,(sp+72)
80043c4: 2b 86 00 4c lw r6,(sp+76)
80043c8: ba 20 10 00 mv r2,r17
80043cc: b9 80 08 00 mv r1,r12
80043d0: b9 a0 18 00 mv r3,r13
80043d4: ba 60 20 00 mv r4,r19
80043d8: d9 60 00 00 call r11
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
80043dc: 2b 82 00 48 lw r2,(sp+72)
80043e0: 5c 55 00 05 bne r2,r21,80043f4 <rtems_rate_monotonic_report_statistics_with_plugin+0x150>
(*print)( context, "\n" );
80043e4: b9 80 08 00 mv r1,r12
80043e8: b9 c0 10 00 mv r2,r14
80043ec: d9 60 00 00 call r11
continue;
80043f0: e0 00 00 30 bi 80044b0 <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 );
80043f4: ba 40 18 00 mv r3,r18
80043f8: ba e0 08 00 mv r1,r23
80043fc: f8 00 10 1b calli 8008468 <_Timespec_Divide_by_integer>
(*print)( context,
8004400: 2b 81 00 54 lw r1,(sp+84)
8004404: 34 02 03 e8 mvi r2,1000
8004408: f8 00 5c 02 calli 801b410 <__divsi3>
800440c: b8 20 d8 00 mv fp,r1
8004410: 2b 81 00 5c lw r1,(sp+92)
8004414: 34 02 03 e8 mvi r2,1000
8004418: f8 00 5b fe calli 801b410 <__divsi3>
800441c: b8 20 a8 00 mv r21,r1
8004420: 2b 81 00 9c lw r1,(sp+156)
8004424: 34 02 03 e8 mvi r2,1000
8004428: f8 00 5b fa calli 801b410 <__divsi3>
800442c: 2b 85 00 58 lw r5,(sp+88)
8004430: 2b 87 00 98 lw r7,(sp+152)
8004434: 2b 83 00 50 lw r3,(sp+80)
8004438: b8 20 40 00 mv r8,r1
800443c: bb 60 20 00 mv r4,fp
8004440: ba a0 30 00 mv r6,r21
8004444: ba 00 10 00 mv r2,r16
8004448: b9 80 08 00 mv r1,r12
800444c: 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);
8004450: 2b 82 00 48 lw r2,(sp+72)
8004454: ba 40 18 00 mv r3,r18
8004458: ba c0 08 00 mv r1,r22
800445c: f8 00 10 03 calli 8008468 <_Timespec_Divide_by_integer>
(*print)( context,
8004460: 2b 81 00 6c lw r1,(sp+108)
8004464: 34 02 03 e8 mvi r2,1000
8004468: f8 00 5b ea calli 801b410 <__divsi3>
800446c: b8 20 d8 00 mv fp,r1
8004470: 2b 81 00 74 lw r1,(sp+116)
8004474: 34 02 03 e8 mvi r2,1000
8004478: f8 00 5b e6 calli 801b410 <__divsi3>
800447c: b8 20 a8 00 mv r21,r1
8004480: 2b 81 00 9c lw r1,(sp+156)
8004484: 34 02 03 e8 mvi r2,1000
8004488: f8 00 5b e2 calli 801b410 <__divsi3>
800448c: 2b 83 00 68 lw r3,(sp+104)
8004490: 2b 85 00 70 lw r5,(sp+112)
8004494: 2b 87 00 98 lw r7,(sp+152)
8004498: b8 20 40 00 mv r8,r1
800449c: b9 e0 10 00 mv r2,r15
80044a0: b9 80 08 00 mv r1,r12
80044a4: bb 60 20 00 mv r4,fp
80044a8: ba a0 30 00 mv r6,r21
80044ac: 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++ ) {
80044b0: 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 ;
80044b4: 2a 81 00 0c lw r1,(r20+12)
80044b8: 50 2d ff b6 bgeu r1,r13,8004390 <rtems_rate_monotonic_report_statistics_with_plugin+0xec>
the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall
);
#endif
}
}
}
80044bc: 2b 9d 00 04 lw ra,(sp+4)
80044c0: 2b 8b 00 44 lw r11,(sp+68)
80044c4: 2b 8c 00 40 lw r12,(sp+64)
80044c8: 2b 8d 00 3c lw r13,(sp+60)
80044cc: 2b 8e 00 38 lw r14,(sp+56)
80044d0: 2b 8f 00 34 lw r15,(sp+52)
80044d4: 2b 90 00 30 lw r16,(sp+48)
80044d8: 2b 91 00 2c lw r17,(sp+44)
80044dc: 2b 92 00 28 lw r18,(sp+40)
80044e0: 2b 93 00 24 lw r19,(sp+36)
80044e4: 2b 94 00 20 lw r20,(sp+32)
80044e8: 2b 95 00 1c lw r21,(sp+28)
80044ec: 2b 96 00 18 lw r22,(sp+24)
80044f0: 2b 97 00 14 lw r23,(sp+20)
80044f4: 2b 98 00 10 lw r24,(sp+16)
80044f8: 2b 99 00 0c lw r25,(sp+12)
80044fc: 2b 9b 00 08 lw fp,(sp+8)
8004500: 37 9c 00 a4 addi sp,sp,164
8004504: c3 a0 00 00 ret
08013348 <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
8013348: 37 9c ff f4 addi sp,sp,-12
801334c: 5b 8b 00 08 sw (sp+8),r11
8013350: 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;
8013354: 34 03 00 0a mvi r3,10
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
8013358: 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 )
801335c: 44 40 00 29 be r2,r0,8013400 <rtems_signal_send+0xb8>
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
8013360: 37 82 00 0c addi r2,sp,12
8013364: f8 00 14 d1 calli 80186a8 <_Thread_Get>
switch ( location ) {
8013368: 2b 82 00 0c lw r2,(sp+12)
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
801336c: 34 03 00 04 mvi r3,4
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
switch ( location ) {
8013370: 5c 40 00 24 bne r2,r0,8013400 <rtems_signal_send+0xb8>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
8013374: 28 23 01 18 lw r3,(r1+280)
asr = &api->Signal;
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
8013378: 28 64 00 0c lw r4,(r3+12)
801337c: 44 82 00 1f be r4,r2,80133f8 <rtems_signal_send+0xb0>
if ( asr->is_enabled ) {
8013380: 40 62 00 08 lbu r2,(r3+8)
8013384: 44 40 00 12 be r2,r0,80133cc <rtems_signal_send+0x84>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
8013388: 90 00 10 00 rcsr r2,IE
801338c: 34 04 ff fe mvi r4,-2
8013390: a0 44 20 00 and r4,r2,r4
8013394: d0 04 00 00 wcsr IE,r4
*signal_set |= signals;
8013398: 28 64 00 14 lw r4,(r3+20)
801339c: b8 8b 58 00 or r11,r4,r11
80133a0: 58 6b 00 14 sw (r3+20),r11
_ISR_Enable( _level );
80133a4: 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 ) )
80133a8: 78 02 08 03 mvhi r2,0x803
80133ac: 38 42 ee 00 ori r2,r2,0xee00
80133b0: 28 43 00 08 lw r3,(r2+8)
80133b4: 44 60 00 0e be r3,r0,80133ec <rtems_signal_send+0xa4>
80133b8: 28 43 00 0c lw r3,(r2+12)
80133bc: 5c 23 00 0c bne r1,r3,80133ec <rtems_signal_send+0xa4> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
80133c0: 34 01 00 01 mvi r1,1
80133c4: 30 41 00 18 sb (r2+24),r1
80133c8: e0 00 00 09 bi 80133ec <rtems_signal_send+0xa4>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
80133cc: 90 00 08 00 rcsr r1,IE
80133d0: 34 02 ff fe mvi r2,-2
80133d4: a0 22 10 00 and r2,r1,r2
80133d8: d0 02 00 00 wcsr IE,r2
*signal_set |= signals;
80133dc: 28 62 00 18 lw r2,(r3+24)
80133e0: b8 4b 58 00 or r11,r2,r11
80133e4: 58 6b 00 18 sw (r3+24),r11
_ISR_Enable( _level );
80133e8: d0 01 00 00 wcsr IE,r1
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
80133ec: f8 00 14 a2 calli 8018674 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
80133f0: 34 03 00 00 mvi r3,0
80133f4: e0 00 00 03 bi 8013400 <rtems_signal_send+0xb8>
}
_Thread_Enable_dispatch();
80133f8: f8 00 14 9f calli 8018674 <_Thread_Enable_dispatch>
return RTEMS_NOT_DEFINED;
80133fc: 34 03 00 0b mvi r3,11
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
8013400: b8 60 08 00 mv r1,r3
8013404: 2b 9d 00 04 lw ra,(sp+4)
8013408: 2b 8b 00 08 lw r11,(sp+8)
801340c: 37 9c 00 0c addi sp,sp,12
8013410: c3 a0 00 00 ret
0800adc8 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
800adc8: 37 9c ff e0 addi sp,sp,-32
800adcc: 5b 8b 00 20 sw (sp+32),r11
800add0: 5b 8c 00 1c sw (sp+28),r12
800add4: 5b 8d 00 18 sw (sp+24),r13
800add8: 5b 8e 00 14 sw (sp+20),r14
800addc: 5b 8f 00 10 sw (sp+16),r15
800ade0: 5b 90 00 0c sw (sp+12),r16
800ade4: 5b 91 00 08 sw (sp+8),r17
800ade8: 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;
800adec: 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
)
{
800adf0: b8 20 68 00 mv r13,r1
800adf4: b8 40 70 00 mv r14,r2
800adf8: 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 )
800adfc: 44 60 00 51 be r3,r0,800af40 <rtems_task_mode+0x178>
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
800ae00: 78 01 08 01 mvhi r1,0x801
800ae04: 38 21 39 e8 ori r1,r1,0x39e8
800ae08: 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;
800ae0c: 41 8f 00 74 lbu r15,(r12+116)
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800ae10: 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 ];
800ae14: 29 8b 01 18 lw r11,(r12+280)
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
800ae18: 65 ef 00 00 cmpei r15,r15,0
800ae1c: c8 0f 78 00 sub r15,r0,r15
800ae20: 21 ef 01 00 andi r15,r15,0x100
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800ae24: 44 20 00 02 be r1,r0,800ae2c <rtems_task_mode+0x64>
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
800ae28: 39 ef 02 00 ori r15,r15,0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
800ae2c: 41 71 00 08 lbu r17,(r11+8)
old_mode |= _ISR_Get_level();
800ae30: fb ff ef 60 calli 8006bb0 <_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;
800ae34: 66 31 00 00 cmpei r17,r17,0
800ae38: c8 11 88 00 sub r17,r0,r17
800ae3c: 22 31 04 00 andi r17,r17,0x400
800ae40: ba 21 08 00 or r1,r17,r1
old_mode |= _ISR_Get_level();
800ae44: b8 2f 78 00 or r15,r1,r15
*previous_mode_set = old_mode;
800ae48: 5a 0f 00 00 sw (r16+0),r15
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
800ae4c: 21 c1 01 00 andi r1,r14,0x100
800ae50: 44 20 00 04 be r1,r0,800ae60 <rtems_task_mode+0x98>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
800ae54: 21 a1 01 00 andi r1,r13,0x100
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
800ae58: 64 21 00 00 cmpei r1,r1,0
800ae5c: 31 81 00 74 sb (r12+116),r1
if ( mask & RTEMS_TIMESLICE_MASK ) {
800ae60: 21 c1 02 00 andi r1,r14,0x200
800ae64: 44 20 00 0b be r1,r0,800ae90 <rtems_task_mode+0xc8>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
800ae68: 21 a1 02 00 andi r1,r13,0x200
if ( _Modes_Is_timeslice(mode_set) ) {
800ae6c: 44 20 00 08 be r1,r0,800ae8c <rtems_task_mode+0xc4>
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
800ae70: 34 01 00 01 mvi r1,1
800ae74: 59 81 00 7c sw (r12+124),r1
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
800ae78: 78 01 08 01 mvhi r1,0x801
800ae7c: 38 21 37 c0 ori r1,r1,0x37c0
800ae80: 28 21 00 00 lw r1,(r1+0)
800ae84: 59 81 00 78 sw (r12+120),r1
800ae88: e0 00 00 02 bi 800ae90 <rtems_task_mode+0xc8>
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
800ae8c: 59 80 00 7c sw (r12+124),r0
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
800ae90: 21 c1 00 01 andi r1,r14,0x1
800ae94: 44 20 00 04 be r1,r0,800aea4 <rtems_task_mode+0xdc>
*/
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
Modes_Control mode_set
)
{
return ( mode_set & RTEMS_INTERRUPT_MASK );
800ae98: 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 ) );
800ae9c: 64 21 00 00 cmpei r1,r1,0
800aea0: 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 ) {
800aea4: 21 ce 04 00 andi r14,r14,0x400
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800aea8: 34 03 00 00 mvi r3,0
if ( mask & RTEMS_ASR_MASK ) {
800aeac: 45 c0 00 11 be r14,r0,800aef0 <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;
800aeb0: 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 ) {
800aeb4: 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(
800aeb8: 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 ) {
800aebc: 44 2d 00 0d be r1,r13,800aef0 <rtems_task_mode+0x128>
asr->is_enabled = is_asr_enabled;
800aec0: 31 6d 00 08 sb (r11+8),r13
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
800aec4: 90 00 08 00 rcsr r1,IE
800aec8: 34 02 ff fe mvi r2,-2
800aecc: a0 22 10 00 and r2,r1,r2
800aed0: d0 02 00 00 wcsr IE,r2
_signals = information->signals_pending;
800aed4: 29 62 00 18 lw r2,(r11+24)
information->signals_pending = information->signals_posted;
800aed8: 29 63 00 14 lw r3,(r11+20)
information->signals_posted = _signals;
800aedc: 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;
800aee0: 59 63 00 18 sw (r11+24),r3
information->signals_posted = _signals;
_ISR_Enable( _level );
800aee4: d0 01 00 00 wcsr IE,r1
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
800aee8: 29 63 00 14 lw r3,(r11+20)
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800aeec: 7c 63 00 00 cmpnei r3,r3,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
800aef0: 78 01 08 01 mvhi r1,0x801
800aef4: 38 21 39 a0 ori r1,r1,0x39a0
800aef8: 28 22 00 00 lw r2,(r1+0)
800aefc: 34 01 00 03 mvi r1,3
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
800af00: 34 04 00 00 mvi r4,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
800af04: 5c 41 00 0f bne r2,r1,800af40 <rtems_task_mode+0x178> <== NEVER TAKEN
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
800af08: 78 01 08 01 mvhi r1,0x801
800af0c: 38 21 39 e8 ori r1,r1,0x39e8
800af10: 28 22 00 0c lw r2,(r1+12)
if ( are_signals_pending ||
800af14: 5c 60 00 05 bne r3,r0,800af28 <rtems_task_mode+0x160>
800af18: 28 21 00 10 lw r1,(r1+16)
800af1c: 44 41 00 09 be r2,r1,800af40 <rtems_task_mode+0x178>
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
800af20: 40 41 00 74 lbu r1,(r2+116)
800af24: 44 20 00 07 be r1,r0,800af40 <rtems_task_mode+0x178> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
800af28: 78 01 08 01 mvhi r1,0x801
800af2c: 38 21 39 e8 ori r1,r1,0x39e8
800af30: 34 02 00 01 mvi r2,1
800af34: 30 22 00 18 sb (r1+24),r2
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
800af38: fb ff e8 dd calli 80052ac <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
800af3c: 34 04 00 00 mvi r4,0
}
800af40: b8 80 08 00 mv r1,r4
800af44: 2b 9d 00 04 lw ra,(sp+4)
800af48: 2b 8b 00 20 lw r11,(sp+32)
800af4c: 2b 8c 00 1c lw r12,(sp+28)
800af50: 2b 8d 00 18 lw r13,(sp+24)
800af54: 2b 8e 00 14 lw r14,(sp+20)
800af58: 2b 8f 00 10 lw r15,(sp+16)
800af5c: 2b 90 00 0c lw r16,(sp+12)
800af60: 2b 91 00 08 lw r17,(sp+8)
800af64: 37 9c 00 20 addi sp,sp,32
800af68: c3 a0 00 00 ret
0800849c <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
800849c: 37 9c ff f0 addi sp,sp,-16
80084a0: 5b 8b 00 0c sw (sp+12),r11
80084a4: 5b 8c 00 08 sw (sp+8),r12
80084a8: 5b 9d 00 04 sw (sp+4),ra
80084ac: b8 40 58 00 mv r11,r2
80084b0: b8 60 60 00 mv r12,r3
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
80084b4: 44 40 00 06 be r2,r0,80084cc <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 ) );
80084b8: 78 02 08 01 mvhi r2,0x801
80084bc: 38 42 90 c0 ori r2,r2,0x90c0
80084c0: 40 43 00 00 lbu r3,(r2+0)
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
80084c4: 34 02 00 13 mvi r2,19
)
{
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
80084c8: 55 63 00 16 bgu r11,r3,8008520 <rtems_task_set_priority+0x84>
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
return RTEMS_INVALID_ADDRESS;
80084cc: 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 )
80084d0: 45 80 00 14 be r12,r0,8008520 <rtems_task_set_priority+0x84>
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
80084d4: 37 82 00 10 addi r2,sp,16
80084d8: f8 00 0a 66 calli 800ae70 <_Thread_Get>
switch ( location ) {
80084dc: 2b 82 00 10 lw r2,(sp+16)
80084e0: 5c 40 00 0f bne r2,r0,800851c <rtems_task_set_priority+0x80>
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
80084e4: 28 23 00 14 lw r3,(r1+20)
80084e8: 59 83 00 00 sw (r12+0),r3
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
80084ec: 45 62 00 09 be r11,r2,8008510 <rtems_task_set_priority+0x74>
the_thread->real_priority = new_priority;
if ( the_thread->resource_count == 0 ||
80084f0: 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;
80084f4: 58 2b 00 18 sw (r1+24),r11
if ( the_thread->resource_count == 0 ||
80084f8: 44 40 00 03 be r2,r0,8008504 <rtems_task_set_priority+0x68>
80084fc: 28 22 00 14 lw r2,(r1+20)
8008500: 51 62 00 04 bgeu r11,r2,8008510 <rtems_task_set_priority+0x74><== ALWAYS TAKEN
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
8008504: b9 60 10 00 mv r2,r11
8008508: 34 03 00 00 mvi r3,0
800850c: f8 00 08 fd calli 800a900 <_Thread_Change_priority>
}
_Thread_Enable_dispatch();
8008510: f8 00 0a 4b calli 800ae3c <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8008514: 34 02 00 00 mvi r2,0
8008518: e0 00 00 02 bi 8008520 <rtems_task_set_priority+0x84>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
800851c: 34 02 00 04 mvi r2,4
}
8008520: b8 40 08 00 mv r1,r2
8008524: 2b 9d 00 04 lw ra,(sp+4)
8008528: 2b 8b 00 0c lw r11,(sp+12)
800852c: 2b 8c 00 08 lw r12,(sp+8)
8008530: 37 9c 00 10 addi sp,sp,16
8008534: c3 a0 00 00 ret
08002ef0 <rtems_task_start>:
rtems_status_code rtems_task_start(
rtems_id id,
rtems_task_entry entry_point,
rtems_task_argument argument
)
{
8002ef0: 37 9c ff ec addi sp,sp,-20
8002ef4: 5b 8b 00 10 sw (sp+16),r11
8002ef8: 5b 8c 00 0c sw (sp+12),r12
8002efc: 5b 8d 00 08 sw (sp+8),r13
8002f00: 5b 9d 00 04 sw (sp+4),ra
register Thread_Control *the_thread;
Objects_Locations location;
if ( entry_point == NULL )
return RTEMS_INVALID_ADDRESS;
8002f04: 34 04 00 09 mvi r4,9
rtems_status_code rtems_task_start(
rtems_id id,
rtems_task_entry entry_point,
rtems_task_argument argument
)
{
8002f08: b8 40 60 00 mv r12,r2
8002f0c: b8 60 68 00 mv r13,r3
register Thread_Control *the_thread;
Objects_Locations location;
if ( entry_point == NULL )
8002f10: 44 40 00 11 be r2,r0,8002f54 <rtems_task_start+0x64> <== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
8002f14: 37 82 00 14 addi r2,sp,20
8002f18: f8 00 09 52 calli 8005460 <_Thread_Get>
switch ( location ) {
8002f1c: 2b 8b 00 14 lw r11,(sp+20)
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8002f20: 34 04 00 04 mvi r4,4
if ( entry_point == NULL )
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
switch ( location ) {
8002f24: 5d 60 00 0c bne r11,r0,8002f54 <rtems_task_start+0x64>
case OBJECTS_LOCAL:
if ( _Thread_Start(
8002f28: 34 02 00 00 mvi r2,0
8002f2c: b9 80 18 00 mv r3,r12
8002f30: 34 04 00 00 mvi r4,0
8002f34: b9 a0 28 00 mv r5,r13
8002f38: f8 00 0c 5a calli 80060a0 <_Thread_Start>
8002f3c: 44 2b 00 04 be r1,r11,8002f4c <rtems_task_start+0x5c>
the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) {
_Thread_Enable_dispatch();
8002f40: f8 00 09 3b calli 800542c <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8002f44: 34 04 00 00 mvi r4,0
8002f48: e0 00 00 03 bi 8002f54 <rtems_task_start+0x64>
}
_Thread_Enable_dispatch();
8002f4c: f8 00 09 38 calli 800542c <_Thread_Enable_dispatch>
return RTEMS_INCORRECT_STATE;
8002f50: 34 04 00 0e mvi r4,14
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
8002f54: b8 80 08 00 mv r1,r4
8002f58: 2b 9d 00 04 lw ra,(sp+4)
8002f5c: 2b 8b 00 10 lw r11,(sp+16)
8002f60: 2b 8c 00 0c lw r12,(sp+12)
8002f64: 2b 8d 00 08 lw r13,(sp+8)
8002f68: 37 9c 00 14 addi sp,sp,20
8002f6c: c3 a0 00 00 ret
08013e78 <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
8013e78: 37 9c ff f8 addi sp,sp,-8
8013e7c: 5b 9d 00 04 sw (sp+4),ra
8013e80: b8 20 10 00 mv r2,r1
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
_Objects_Get( &_Timer_Information, id, location );
8013e84: 78 01 08 03 mvhi r1,0x803
8013e88: 38 21 ee 94 ori r1,r1,0xee94
8013e8c: 37 83 00 08 addi r3,sp,8
8013e90: f8 00 0e 4d calli 80177c4 <_Objects_Get>
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
8013e94: 2b 82 00 08 lw r2,(sp+8)
8013e98: 5c 40 00 09 bne r2,r0,8013ebc <rtems_timer_cancel+0x44>
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
8013e9c: 28 23 00 38 lw r3,(r1+56)
8013ea0: 34 02 00 04 mvi r2,4
8013ea4: 44 62 00 03 be r3,r2,8013eb0 <rtems_timer_cancel+0x38> <== NEVER TAKEN
(void) _Watchdog_Remove( &the_timer->Ticker );
8013ea8: 34 21 00 10 addi r1,r1,16
8013eac: f8 00 17 c3 calli 8019db8 <_Watchdog_Remove>
_Thread_Enable_dispatch();
8013eb0: f8 00 11 f1 calli 8018674 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8013eb4: 34 01 00 00 mvi r1,0
8013eb8: e0 00 00 02 bi 8013ec0 <rtems_timer_cancel+0x48>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8013ebc: 34 01 00 04 mvi r1,4
}
8013ec0: 2b 9d 00 04 lw ra,(sp+4)
8013ec4: 37 9c 00 08 addi sp,sp,8
8013ec8: c3 a0 00 00 ret
08014494 <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
8014494: 37 9c ff dc addi sp,sp,-36
8014498: 5b 8b 00 20 sw (sp+32),r11
801449c: 5b 8c 00 1c sw (sp+28),r12
80144a0: 5b 8d 00 18 sw (sp+24),r13
80144a4: 5b 8e 00 14 sw (sp+20),r14
80144a8: 5b 8f 00 10 sw (sp+16),r15
80144ac: 5b 90 00 0c sw (sp+12),r16
80144b0: 5b 91 00 08 sw (sp+8),r17
80144b4: 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;
80144b8: 78 05 08 03 mvhi r5,0x803
80144bc: 38 a5 ee d4 ori r5,r5,0xeed4
80144c0: 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
)
{
80144c4: b8 20 78 00 mv r15,r1
80144c8: b8 40 60 00 mv r12,r2
80144cc: b8 60 80 00 mv r16,r3
80144d0: 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;
80144d4: 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 )
80144d8: 45 a0 00 2e be r13,r0,8014590 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
80144dc: 78 05 08 03 mvhi r5,0x803
80144e0: 38 a5 ec 48 ori r5,r5,0xec48
80144e4: 40 a1 00 00 lbu r1,(r5+0)
return RTEMS_NOT_DEFINED;
80144e8: 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 )
80144ec: 44 20 00 29 be r1,r0,8014590 <rtems_timer_server_fire_when+0xfc><== NEVER TAKEN
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
80144f0: 34 0b 00 09 mvi r11,9
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
if ( !routine )
80144f4: 44 60 00 27 be r3,r0,8014590 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
80144f8: b8 40 08 00 mv r1,r2
80144fc: fb ff f1 c1 calli 8010c00 <_TOD_Validate>
return RTEMS_INVALID_CLOCK;
8014500: 34 0b 00 14 mvi r11,20
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
8014504: 44 20 00 23 be r1,r0,8014590 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
8014508: b9 80 08 00 mv r1,r12
if ( seconds <= _TOD_Seconds_since_epoch() )
801450c: 78 0c 08 03 mvhi r12,0x803
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
8014510: fb ff f1 7c calli 8010b00 <_TOD_To_seconds>
if ( seconds <= _TOD_Seconds_since_epoch() )
8014514: 39 8c ec e0 ori r12,r12,0xece0
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
8014518: b8 20 70 00 mv r14,r1
if ( seconds <= _TOD_Seconds_since_epoch() )
801451c: 29 81 00 00 lw r1,(r12+0)
8014520: 50 2e 00 1c bgeu r1,r14,8014590 <rtems_timer_server_fire_when+0xfc>
8014524: 78 01 08 03 mvhi r1,0x803
8014528: 38 21 ee 94 ori r1,r1,0xee94
801452c: b9 e0 10 00 mv r2,r15
8014530: 37 83 00 24 addi r3,sp,36
8014534: f8 00 0c a4 calli 80177c4 <_Objects_Get>
8014538: b8 20 58 00 mv r11,r1
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
801453c: 2b 81 00 24 lw r1,(sp+36)
8014540: 5c 20 00 13 bne r1,r0,801458c <rtems_timer_server_fire_when+0xf8>
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
8014544: 35 61 00 10 addi r1,r11,16
8014548: f8 00 16 1c calli 8019db8 <_Watchdog_Remove>
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
801454c: 34 01 00 03 mvi r1,3
8014550: 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();
8014554: 29 81 00 00 lw r1,(r12+0)
(*timer_server->schedule_operation)( timer_server, the_timer );
8014558: 29 a3 00 04 lw r3,(r13+4)
801455c: 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();
8014560: c9 c1 70 00 sub r14,r14,r1
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8014564: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8014568: 59 70 00 2c sw (r11+44),r16
the_watchdog->id = id;
801456c: 59 6f 00 30 sw (r11+48),r15
the_watchdog->user_data = user_data;
8014570: 59 71 00 34 sw (r11+52),r17
8014574: 59 6e 00 1c sw (r11+28),r14
(*timer_server->schedule_operation)( timer_server, the_timer );
8014578: b9 a0 08 00 mv r1,r13
801457c: d8 60 00 00 call r3
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
8014580: 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();
8014584: f8 00 10 3c calli 8018674 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8014588: e0 00 00 02 bi 8014590 <rtems_timer_server_fire_when+0xfc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
801458c: 34 0b 00 04 mvi r11,4
}
8014590: b9 60 08 00 mv r1,r11
8014594: 2b 9d 00 04 lw ra,(sp+4)
8014598: 2b 8b 00 20 lw r11,(sp+32)
801459c: 2b 8c 00 1c lw r12,(sp+28)
80145a0: 2b 8d 00 18 lw r13,(sp+24)
80145a4: 2b 8e 00 14 lw r14,(sp+20)
80145a8: 2b 8f 00 10 lw r15,(sp+16)
80145ac: 2b 90 00 0c lw r16,(sp+12)
80145b0: 2b 91 00 08 lw r17,(sp+8)
80145b4: 37 9c 00 24 addi sp,sp,36
80145b8: c3 a0 00 00 ret