RTEMS 4.11Annotated Report
Mon Mar 21 01:57:26 2011
0800da7c <_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
)
{
800da7c: 37 9c ff e4 addi sp,sp,-28
800da80: 5b 8b 00 1c sw (sp+28),r11
800da84: 5b 8c 00 18 sw (sp+24),r12
800da88: 5b 8d 00 14 sw (sp+20),r13
800da8c: 5b 8e 00 10 sw (sp+16),r14
800da90: 5b 8f 00 0c sw (sp+12),r15
800da94: 5b 90 00 08 sw (sp+8),r16
800da98: 5b 9d 00 04 sw (sp+4),ra
800da9c: 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;
800daa0: 58 20 00 48 sw (r1+72),r0
the_message_queue->maximum_message_size = maximum_message_size;
800daa4: 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;
800daa8: 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)) {
800daac: 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
)
{
800dab0: b8 40 80 00 mv r16,r2
800dab4: 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)) {
800dab8: b8 80 60 00 mv r12,r4
800dabc: 44 20 00 06 be r1,r0,800dad4 <_CORE_message_queue_Initialize+0x58>
allocated_message_size += sizeof(uint32_t);
800dac0: 34 8c 00 04 addi r12,r4,4
allocated_message_size &= ~(sizeof(uint32_t) - 1);
800dac4: 34 01 ff fc mvi r1,-4
800dac8: a1 81 60 00 and r12,r12,r1
}
if (allocated_message_size < maximum_message_size)
return false;
800dacc: 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)
800dad0: 54 8c 00 1c bgu r4,r12,800db40 <_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));
800dad4: 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 *
800dad8: b9 e0 08 00 mv r1,r15
800dadc: b9 c0 10 00 mv r2,r14
800dae0: f8 00 59 8c calli 8024110 <__mulsi3>
(allocated_message_size + sizeof(CORE_message_queue_Buffer_control));
if (message_buffering_required < allocated_message_size)
return false;
800dae4: 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)
800dae8: 55 81 00 16 bgu r12,r1,800db40 <_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 );
800daec: f8 00 0e 8c calli 801151c <_Workspace_Allocate>
return false;
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
800daf0: 59 61 00 5c sw (r11+92),r1
_Workspace_Allocate( message_buffering_required );
800daf4: b8 20 28 00 mv r5,r1
if (the_message_queue->message_buffers == 0)
800daf8: 44 20 00 12 be r1,r0,800db40 <_CORE_message_queue_Initialize+0xc4>
/*
* Initialize the pool of inactive messages, pending messages,
* and set of waiting threads.
*/
_Chain_Initialize (
800dafc: b8 a0 10 00 mv r2,r5
800db00: 35 61 00 60 addi r1,r11,96
800db04: b9 c0 18 00 mv r3,r14
800db08: b9 e0 20 00 mv r4,r15
800db0c: f8 00 17 39 calli 80137f0 <_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 );
800db10: 35 61 00 54 addi r1,r11,84
head->next = tail;
800db14: 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 );
800db18: 35 61 00 50 addi r1,r11,80
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
800db1c: 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;
800db20: 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(
800db24: 2a 02 00 00 lw r2,(r16+0)
800db28: b9 60 08 00 mv r1,r11
800db2c: 34 03 00 80 mvi r3,128
800db30: 64 42 00 01 cmpei r2,r2,1
800db34: 34 04 00 06 mvi r4,6
800db38: f8 00 0b 6c calli 80108e8 <_Thread_queue_Initialize>
THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
STATES_WAITING_FOR_MESSAGE,
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
);
return true;
800db3c: 34 0d 00 01 mvi r13,1
}
800db40: b9 a0 08 00 mv r1,r13
800db44: 2b 9d 00 04 lw ra,(sp+4)
800db48: 2b 8b 00 1c lw r11,(sp+28)
800db4c: 2b 8c 00 18 lw r12,(sp+24)
800db50: 2b 8d 00 14 lw r13,(sp+20)
800db54: 2b 8e 00 10 lw r14,(sp+16)
800db58: 2b 8f 00 0c lw r15,(sp+12)
800db5c: 2b 90 00 08 lw r16,(sp+8)
800db60: 37 9c 00 1c addi sp,sp,28
800db64: c3 a0 00 00 ret
0800db68 <_CORE_message_queue_Seize>:
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800db68: 37 9c ff f4 addi sp,sp,-12
800db6c: 5b 8b 00 0c sw (sp+12),r11
800db70: 5b 8c 00 08 sw (sp+8),r12
800db74: 5b 9d 00 04 sw (sp+4),ra
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
800db78: 78 07 08 02 mvhi r7,0x802
800db7c: 38 e7 7b c8 ori r7,r7,0x7bc8
800db80: 28 e7 00 0c lw r7,(r7+12)
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800db84: b8 20 58 00 mv r11,r1
800db88: 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;
800db8c: 58 e0 00 34 sw (r7+52),r0
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800db90: 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 );
800db94: 90 00 40 00 rcsr r8,IE
800db98: 34 03 ff fe mvi r3,-2
800db9c: a1 03 18 00 and r3,r8,r3
800dba0: 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 );
}
800dba4: 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 );
800dba8: 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))
800dbac: 45 83 00 07 be r12,r3,800dbc8 <_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;
800dbb0: 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 );
800dbb4: 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;
800dbb8: 59 63 00 50 sw (r11+80),r3
new_first->previous = head;
800dbbc: 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 ) {
800dbc0: 5d 80 00 04 bne r12,r0,800dbd0 <_CORE_message_queue_Seize+0x68><== ALWAYS TAKEN
800dbc4: e0 00 00 13 bi 800dc10 <_CORE_message_queue_Seize+0xa8> <== NOT EXECUTED
)
{
if ( !_Chain_Is_empty(the_chain))
return _Chain_Get_first_unprotected(the_chain);
else
return NULL;
800dbc8: 34 0c 00 00 mvi r12,0
800dbcc: e0 00 00 11 bi 800dc10 <_CORE_message_queue_Seize+0xa8>
the_message_queue->number_of_pending_messages -= 1;
800dbd0: 29 62 00 48 lw r2,(r11+72)
800dbd4: 34 42 ff ff addi r2,r2,-1
800dbd8: 59 62 00 48 sw (r11+72),r2
_ISR_Enable( level );
800dbdc: d0 08 00 00 wcsr IE,r8
*size_p = the_message->Contents.size;
_Thread_Executing->Wait.count =
800dbe0: 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;
800dbe4: 29 83 00 08 lw r3,(r12+8)
_Thread_Executing->Wait.count =
800dbe8: 38 42 7b c8 ori r2,r2,0x7bc8
800dbec: 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;
800dbf0: 58 83 00 00 sw (r4+0),r3
_Thread_Executing->Wait.count =
800dbf4: 58 40 00 24 sw (r2+36),r0
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800dbf8: 35 82 00 0c addi r2,r12,12
800dbfc: f8 00 22 ad calli 80166b0 <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 );
800dc00: 35 61 00 60 addi r1,r11,96
800dc04: b9 80 10 00 mv r2,r12
800dc08: fb ff ff 6d calli 800d9bc <_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;
800dc0c: e0 00 00 12 bi 800dc54 <_CORE_message_queue_Seize+0xec>
return;
}
#endif
}
if ( !wait ) {
800dc10: 5c ac 00 05 bne r5,r12,800dc24 <_CORE_message_queue_Seize+0xbc>
_ISR_Enable( level );
800dc14: d0 08 00 00 wcsr IE,r8
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
800dc18: 34 01 00 04 mvi r1,4
800dc1c: 58 e1 00 34 sw (r7+52),r1
return;
800dc20: e0 00 00 0d bi 800dc54 <_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;
800dc24: 34 03 00 01 mvi r3,1
800dc28: 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;
800dc2c: 58 eb 00 44 sw (r7+68),r11
executing->Wait.id = id;
800dc30: 58 e2 00 20 sw (r7+32),r2
executing->Wait.return_argument_second.mutable_object = buffer;
800dc34: 58 e1 00 2c sw (r7+44),r1
executing->Wait.return_argument = size_p;
800dc38: 58 e4 00 28 sw (r7+40),r4
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
800dc3c: d0 08 00 00 wcsr IE,r8
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
800dc40: 78 03 08 01 mvhi r3,0x801
800dc44: b9 60 08 00 mv r1,r11
800dc48: b8 c0 10 00 mv r2,r6
800dc4c: 38 63 0a 28 ori r3,r3,0xa28
800dc50: f8 00 0a 3b calli 801053c <_Thread_queue_Enqueue_with_handler>
}
800dc54: 2b 9d 00 04 lw ra,(sp+4)
800dc58: 2b 8b 00 0c lw r11,(sp+12)
800dc5c: 2b 8c 00 08 lw r12,(sp+8)
800dc60: 37 9c 00 0c addi sp,sp,12
800dc64: c3 a0 00 00 ret
080036b8 <_CORE_mutex_Seize>:
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
80036b8: 37 9c ff e8 addi sp,sp,-24
80036bc: 5b 8b 00 14 sw (sp+20),r11
80036c0: 5b 8c 00 10 sw (sp+16),r12
80036c4: 5b 8d 00 0c sw (sp+12),r13
80036c8: 5b 8e 00 08 sw (sp+8),r14
80036cc: 5b 9d 00 04 sw (sp+4),ra
80036d0: b8 20 58 00 mv r11,r1
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
80036d4: 78 01 08 01 mvhi r1,0x801
80036d8: 38 21 38 88 ori r1,r1,0x3888
80036dc: 28 21 00 00 lw r1,(r1+0)
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
80036e0: 5b 85 00 18 sw (sp+24),r5
80036e4: b8 40 70 00 mv r14,r2
80036e8: b8 80 68 00 mv r13,r4
80036ec: 20 6c 00 ff andi r12,r3,0xff
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
80036f0: 44 20 00 0b be r1,r0,800371c <_CORE_mutex_Seize+0x64>
80036f4: 45 80 00 0a be r12,r0,800371c <_CORE_mutex_Seize+0x64> <== NEVER TAKEN
80036f8: 78 01 08 01 mvhi r1,0x801
80036fc: 38 21 39 e0 ori r1,r1,0x39e0
8003700: 28 21 00 00 lw r1,(r1+0)
8003704: 34 02 00 01 mvi r2,1
8003708: 50 41 00 05 bgeu r2,r1,800371c <_CORE_mutex_Seize+0x64>
800370c: 34 01 00 00 mvi r1,0
8003710: 34 02 00 00 mvi r2,0
8003714: 34 03 00 12 mvi r3,18
8003718: f8 00 02 2a calli 8003fc0 <_Internal_error_Occurred>
800371c: b9 60 08 00 mv r1,r11
8003720: 37 82 00 18 addi r2,sp,24
8003724: f8 00 15 e5 calli 8008eb8 <_CORE_mutex_Seize_interrupt_trylock>
8003728: 44 20 00 19 be r1,r0,800378c <_CORE_mutex_Seize+0xd4>
800372c: 78 01 08 01 mvhi r1,0x801
8003730: 38 21 3a 28 ori r1,r1,0x3a28
8003734: 5d 80 00 07 bne r12,r0,8003750 <_CORE_mutex_Seize+0x98>
8003738: 2b 82 00 18 lw r2,(sp+24)
800373c: d0 02 00 00 wcsr IE,r2
8003740: 28 21 00 0c lw r1,(r1+12)
8003744: 34 02 00 01 mvi r2,1
8003748: 58 22 00 34 sw (r1+52),r2
800374c: e0 00 00 10 bi 800378c <_CORE_mutex_Seize+0xd4>
8003750: 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;
8003754: 34 02 00 01 mvi r2,1
8003758: 59 62 00 30 sw (r11+48),r2
800375c: 58 2b 00 44 sw (r1+68),r11
8003760: 58 2e 00 20 sw (r1+32),r14
8003764: 78 01 08 01 mvhi r1,0x801
8003768: 38 21 38 88 ori r1,r1,0x3888
800376c: 28 22 00 00 lw r2,(r1+0)
8003770: 34 42 00 01 addi r2,r2,1
8003774: 58 22 00 00 sw (r1+0),r2
8003778: 2b 81 00 18 lw r1,(sp+24)
800377c: d0 01 00 00 wcsr IE,r1
8003780: b9 60 08 00 mv r1,r11
8003784: b9 a0 10 00 mv r2,r13
8003788: fb ff ff ab calli 8003634 <_CORE_mutex_Seize_interrupt_blocking>
}
800378c: 2b 9d 00 04 lw ra,(sp+4)
8003790: 2b 8b 00 14 lw r11,(sp+20)
8003794: 2b 8c 00 10 lw r12,(sp+16)
8003798: 2b 8d 00 0c lw r13,(sp+12)
800379c: 2b 8e 00 08 lw r14,(sp+8)
80037a0: 37 9c 00 18 addi sp,sp,24
80037a4: c3 a0 00 00 ret
08003908 <_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
)
{
8003908: 37 9c ff f8 addi sp,sp,-8
800390c: 5b 8b 00 08 sw (sp+8),r11
8003910: 5b 9d 00 04 sw (sp+4),ra
8003914: 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)) ) {
8003918: f8 00 08 1f calli 8005994 <_Thread_queue_Dequeue>
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
800391c: 34 02 00 00 mvi r2,0
if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
8003920: 5c 20 00 0d bne r1,r0,8003954 <_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 );
8003924: 90 00 08 00 rcsr r1,IE
8003928: 34 02 ff fe mvi r2,-2
800392c: a0 22 10 00 and r2,r1,r2
8003930: d0 02 00 00 wcsr IE,r2
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
8003934: 29 63 00 48 lw r3,(r11+72)
8003938: 29 64 00 40 lw r4,(r11+64)
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
800393c: 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 )
8003940: 50 64 00 04 bgeu r3,r4,8003950 <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN
the_semaphore->count += 1;
8003944: 34 63 00 01 addi r3,r3,1
8003948: 59 63 00 48 sw (r11+72),r3
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
800394c: 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 );
8003950: d0 01 00 00 wcsr IE,r1
}
return status;
}
8003954: b8 40 08 00 mv r1,r2
8003958: 2b 9d 00 04 lw ra,(sp+4)
800395c: 2b 8b 00 08 lw r11,(sp+8)
8003960: 37 9c 00 08 addi sp,sp,8
8003964: c3 a0 00 00 ret
0800cf80 <_Event_Surrender>:
*/
void _Event_Surrender(
Thread_Control *the_thread
)
{
800cf80: 37 9c ff f8 addi sp,sp,-8
800cf84: 5b 8b 00 08 sw (sp+8),r11
800cf88: 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 ];
800cf8c: 28 24 01 18 lw r4,(r1+280)
option_set = (rtems_option) the_thread->Wait.option;
800cf90: 28 28 00 30 lw r8,(r1+48)
*/
void _Event_Surrender(
Thread_Control *the_thread
)
{
800cf94: 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 );
800cf98: 90 00 08 00 rcsr r1,IE
800cf9c: 34 07 ff fe mvi r7,-2
800cfa0: a0 27 38 00 and r7,r1,r7
800cfa4: d0 07 00 00 wcsr IE,r7
pending_events = api->pending_events;
800cfa8: 28 85 00 00 lw r5,(r4+0)
event_condition = (rtems_event_set) the_thread->Wait.count;
800cfac: 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 );
800cfb0: 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 ) ) {
800cfb4: 5c 40 00 03 bne r2,r0,800cfc0 <_Event_Surrender+0x40>
_ISR_Enable( level );
800cfb8: d0 01 00 00 wcsr IE,r1
return;
800cfbc: e0 00 00 3d bi 800d0b0 <_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() &&
800cfc0: 78 03 08 01 mvhi r3,0x801
800cfc4: 38 63 8a a8 ori r3,r3,0x8aa8
800cfc8: 28 69 00 08 lw r9,(r3+8)
800cfcc: 45 20 00 1a be r9,r0,800d034 <_Event_Surrender+0xb4>
800cfd0: 28 63 00 0c lw r3,(r3+12)
800cfd4: 5d 63 00 18 bne r11,r3,800d034 <_Event_Surrender+0xb4>
_Thread_Is_executing( the_thread ) &&
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
800cfd8: 78 03 08 01 mvhi r3,0x801
800cfdc: 38 63 8c 00 ori r3,r3,0x8c00
800cfe0: 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 ) &&
800cfe4: 34 09 00 02 mvi r9,2
800cfe8: 45 49 00 04 be r10,r9,800cff8 <_Event_Surrender+0x78> <== NEVER TAKEN
((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
800cfec: 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) ||
800cff0: 34 03 00 01 mvi r3,1
800cff4: 5d 23 00 10 bne r9,r3,800d034 <_Event_Surrender+0xb4>
(_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
800cff8: 44 46 00 03 be r2,r6,800d004 <_Event_Surrender+0x84>
*/
RTEMS_INLINE_ROUTINE bool _Options_Is_any (
rtems_option option_set
)
{
return (option_set & RTEMS_EVENT_ANY) ? true : false;
800cffc: 21 08 00 02 andi r8,r8,0x2
800d000: 45 00 00 0b be r8,r0,800d02c <_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) );
800d004: a4 40 18 00 not r3,r2
800d008: 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;
800d00c: 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 );
800d010: 58 85 00 00 sw (r4+0),r5
the_thread->Wait.count = 0;
800d014: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800d018: 58 62 00 00 sw (r3+0),r2
_Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
800d01c: 78 02 08 01 mvhi r2,0x801
800d020: 38 42 8c 00 ori r2,r2,0x8c00
800d024: 34 03 00 03 mvi r3,3
800d028: 58 43 00 00 sw (r2+0),r3
}
_ISR_Enable( level );
800d02c: d0 01 00 00 wcsr IE,r1
return;
800d030: e0 00 00 20 bi 800d0b0 <_Event_Surrender+0x130>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event (
States_Control the_states
)
{
return (the_states & STATES_WAITING_FOR_EVENT);
800d034: 29 63 00 10 lw r3,(r11+16)
800d038: 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 ) ) {
800d03c: 44 60 00 1c be r3,r0,800d0ac <_Event_Surrender+0x12c>
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
800d040: 44 46 00 03 be r2,r6,800d04c <_Event_Surrender+0xcc>
800d044: 21 08 00 02 andi r8,r8,0x2
800d048: 45 00 00 19 be r8,r0,800d0ac <_Event_Surrender+0x12c> <== NEVER TAKEN
800d04c: a4 40 18 00 not r3,r2
800d050: 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;
800d054: 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 );
800d058: 58 85 00 00 sw (r4+0),r5
the_thread->Wait.count = 0;
800d05c: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800d060: 58 62 00 00 sw (r3+0),r2
_ISR_Flash( level );
800d064: d0 01 00 00 wcsr IE,r1
800d068: d0 07 00 00 wcsr IE,r7
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
800d06c: 29 63 00 50 lw r3,(r11+80)
800d070: 34 02 00 02 mvi r2,2
800d074: 44 62 00 03 be r3,r2,800d080 <_Event_Surrender+0x100>
_ISR_Enable( level );
800d078: d0 01 00 00 wcsr IE,r1
800d07c: e0 00 00 06 bi 800d094 <_Event_Surrender+0x114>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
800d080: 34 02 00 03 mvi r2,3
800d084: 59 62 00 50 sw (r11+80),r2
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
800d088: d0 01 00 00 wcsr IE,r1
(void) _Watchdog_Remove( &the_thread->Timer );
800d08c: 35 61 00 48 addi r1,r11,72
800d090: fb ff eb 0a calli 8007cb8 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800d094: 78 03 08 01 mvhi r3,0x801
800d098: 38 63 6f 60 ori r3,r3,0x6f60
800d09c: 28 62 00 00 lw r2,(r3+0)
800d0a0: b9 60 08 00 mv r1,r11
800d0a4: f8 00 04 fd calli 800e498 <_Thread_Clear_state>
800d0a8: e0 00 00 02 bi 800d0b0 <_Event_Surrender+0x130>
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
800d0ac: d0 01 00 00 wcsr IE,r1
}
800d0b0: 2b 9d 00 04 lw ra,(sp+4)
800d0b4: 2b 8b 00 08 lw r11,(sp+8)
800d0b8: 37 9c 00 08 addi sp,sp,8
800d0bc: c3 a0 00 00 ret
0800d0c0 <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *ignored
)
{
800d0c0: 37 9c ff f8 addi sp,sp,-8
800d0c4: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
ISR_Level level;
the_thread = _Thread_Get( id, &location );
800d0c8: 37 82 00 08 addi r2,sp,8
800d0cc: fb ff e6 7c calli 8006abc <_Thread_Get>
switch ( location ) {
800d0d0: 2b 82 00 08 lw r2,(sp+8)
800d0d4: 5c 40 00 1d bne r2,r0,800d148 <_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 );
800d0d8: 90 00 18 00 rcsr r3,IE
800d0dc: 34 02 ff fe mvi r2,-2
800d0e0: a0 62 10 00 and r2,r3,r2
800d0e4: d0 02 00 00 wcsr IE,r2
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
800d0e8: 78 02 08 01 mvhi r2,0x801
800d0ec: 38 42 8a a8 ori r2,r2,0x8aa8
return;
}
#endif
the_thread->Wait.count = 0;
if ( _Thread_Is_executing( the_thread ) ) {
800d0f0: 28 42 00 0c lw r2,(r2+12)
_ISR_Enable( level );
return;
}
#endif
the_thread->Wait.count = 0;
800d0f4: 58 20 00 24 sw (r1+36),r0
if ( _Thread_Is_executing( the_thread ) ) {
800d0f8: 5c 22 00 08 bne r1,r2,800d118 <_Event_Timeout+0x58>
if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
800d0fc: 78 02 08 01 mvhi r2,0x801
800d100: 38 42 8c 00 ori r2,r2,0x8c00
800d104: 28 45 00 00 lw r5,(r2+0)
800d108: 34 04 00 01 mvi r4,1
800d10c: 5c a4 00 03 bne r5,r4,800d118 <_Event_Timeout+0x58>
_Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
800d110: 34 04 00 02 mvi r4,2
800d114: 58 44 00 00 sw (r2+0),r4
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
800d118: 34 02 00 06 mvi r2,6
800d11c: 58 22 00 34 sw (r1+52),r2
_ISR_Enable( level );
800d120: d0 03 00 00 wcsr IE,r3
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800d124: 78 03 08 01 mvhi r3,0x801
800d128: 38 63 6f 60 ori r3,r3,0x6f60
800d12c: 28 62 00 00 lw r2,(r3+0)
800d130: f8 00 04 da calli 800e498 <_Thread_Clear_state>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
800d134: 78 01 08 01 mvhi r1,0x801
800d138: 38 21 89 08 ori r1,r1,0x8908
800d13c: 28 22 00 00 lw r2,(r1+0)
800d140: 34 42 ff ff addi r2,r2,-1
800d144: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
800d148: 2b 9d 00 04 lw ra,(sp+4)
800d14c: 37 9c 00 08 addi sp,sp,8
800d150: c3 a0 00 00 ret
08009438 <_Heap_Extend>:
Heap_Control *heap,
void *extend_area_begin_ptr,
uintptr_t extend_area_size,
uintptr_t *extended_size_ptr
)
{
8009438: 37 9c ff b8 addi sp,sp,-72
800943c: 5b 8b 00 40 sw (sp+64),r11
8009440: 5b 8c 00 3c sw (sp+60),r12
8009444: 5b 8d 00 38 sw (sp+56),r13
8009448: 5b 8e 00 34 sw (sp+52),r14
800944c: 5b 8f 00 30 sw (sp+48),r15
8009450: 5b 90 00 2c sw (sp+44),r16
8009454: 5b 91 00 28 sw (sp+40),r17
8009458: 5b 92 00 24 sw (sp+36),r18
800945c: 5b 93 00 20 sw (sp+32),r19
8009460: 5b 94 00 1c sw (sp+28),r20
8009464: 5b 95 00 18 sw (sp+24),r21
8009468: 5b 96 00 14 sw (sp+20),r22
800946c: 5b 97 00 10 sw (sp+16),r23
8009470: 5b 98 00 0c sw (sp+12),r24
8009474: 5b 99 00 08 sw (sp+8),r25
8009478: 5b 9d 00 04 sw (sp+4),ra
800947c: 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;
8009480: 5b 80 00 48 sw (sp+72),r0
Heap_Block *extend_last_block = NULL;
8009484: 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;
8009488: 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
)
{
800948c: b8 80 a0 00 mv r20,r4
8009490: b8 20 58 00 mv r11,r1
8009494: b8 60 10 00 mv r2,r3
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const first_block = heap->first_block;
8009498: 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;
800949c: 28 36 00 10 lw r22,(r1+16)
uintptr_t const min_block_size = heap->min_block_size;
80094a0: 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;
80094a4: 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;
80094a8: 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 ) {
80094ac: 55 cd 00 8e bgu r14,r13,80096e4 <_Heap_Extend+0x2ac>
return false;
}
extend_area_ok = _Heap_Get_first_and_last_block(
80094b0: b9 c0 08 00 mv r1,r14
80094b4: ba c0 18 00 mv r3,r22
80094b8: 37 85 00 48 addi r5,sp,72
80094bc: 37 86 00 44 addi r6,sp,68
80094c0: fb ff ea a0 calli 8003f40 <_Heap_Get_first_and_last_block>
page_size,
min_block_size,
&extend_first_block,
&extend_last_block
);
if (!extend_area_ok ) {
80094c4: 44 20 00 88 be r1,r0,80096e4 <_Heap_Extend+0x2ac>
80094c8: ba a0 78 00 mv r15,r21
80094cc: 34 11 00 00 mvi r17,0
80094d0: 34 13 00 00 mvi r19,0
80094d4: 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;
80094d8: 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;
80094dc: 34 18 ff fe mvi r24,-2
80094e0: e0 00 00 02 bi 80094e8 <_Heap_Extend+0xb0>
80094e4: b9 e0 08 00 mv r1,r15
uintptr_t const sub_area_end = start_block->prev_size;
80094e8: 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
80094ec: f5 a1 18 00 cmpgu r3,r13,r1
80094f0: 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 (
80094f4: a0 62 10 00 and r2,r3,r2
80094f8: 5c 40 00 7a bne r2,r0,80096e0 <_Heap_Extend+0x2a8>
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
}
if ( extend_area_end == sub_area_begin ) {
80094fc: 45 a1 00 03 be r13,r1,8009508 <_Heap_Extend+0xd0>
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
8009500: 56 4d 00 04 bgu r18,r13,8009510 <_Heap_Extend+0xd8>
8009504: e0 00 00 04 bi 8009514 <_Heap_Extend+0xdc>
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
}
if ( extend_area_end == sub_area_begin ) {
8009508: b9 e0 80 00 mv r16,r15
800950c: e0 00 00 02 bi 8009514 <_Heap_Extend+0xdc>
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
8009510: 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);
8009514: ba 40 08 00 mv r1,r18
8009518: ba c0 10 00 mv r2,r22
800951c: 36 59 ff f8 addi r25,r18,-8
8009520: f8 00 1e ad calli 8010fd4 <__umodsi3>
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
8009524: cb 21 08 00 sub r1,r25,r1
link_below_block = start_block;
}
if ( sub_area_end == extend_area_begin ) {
8009528: 5d d2 00 04 bne r14,r18,8009538 <_Heap_Extend+0x100>
start_block->prev_size = extend_area_end;
800952c: 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 )
8009530: b8 20 60 00 mv r12,r1
8009534: e0 00 00 04 bi 8009544 <_Heap_Extend+0x10c>
merge_above_block = end_block;
} else if ( sub_area_end < extend_area_begin ) {
8009538: 55 d2 00 02 bgu r14,r18,8009540 <_Heap_Extend+0x108>
800953c: e0 00 00 02 bi 8009544 <_Heap_Extend+0x10c>
8009540: 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;
8009544: 28 2f 00 04 lw r15,(r1+4)
8009548: 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);
800954c: 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 );
8009550: 5d f5 ff e5 bne r15,r21,80094e4 <_Heap_Extend+0xac>
if ( extend_area_begin < heap->area_begin ) {
8009554: 29 61 00 18 lw r1,(r11+24)
8009558: 51 c1 00 03 bgeu r14,r1,8009564 <_Heap_Extend+0x12c>
heap->area_begin = extend_area_begin;
800955c: 59 6e 00 18 sw (r11+24),r14
8009560: e0 00 00 04 bi 8009570 <_Heap_Extend+0x138>
} else if ( heap->area_end < extend_area_end ) {
8009564: 29 61 00 1c lw r1,(r11+28)
8009568: 50 2d 00 02 bgeu r1,r13,8009570 <_Heap_Extend+0x138>
heap->area_end = extend_area_end;
800956c: 59 6d 00 1c sw (r11+28),r13
}
extend_first_block_size =
(uintptr_t) extend_last_block - (uintptr_t) extend_first_block;
8009570: 2b 81 00 44 lw r1,(sp+68)
8009574: 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 =
8009578: 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;
800957c: 58 4d 00 00 sw (r2+0),r13
extend_first_block->size_and_flag =
extend_first_block_size | HEAP_PREV_BLOCK_USED;
8009580: 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;
8009584: 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 ) {
8009588: 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 =
800958c: 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;
8009590: 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 ) {
8009594: 50 43 00 03 bgeu r2,r3,80095a0 <_Heap_Extend+0x168>
heap->first_block = extend_first_block;
8009598: 59 62 00 20 sw (r11+32),r2
800959c: e0 00 00 04 bi 80095ac <_Heap_Extend+0x174>
} else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) {
80095a0: 29 62 00 24 lw r2,(r11+36)
80095a4: 50 41 00 02 bgeu r2,r1,80095ac <_Heap_Extend+0x174>
heap->last_block = extend_last_block;
80095a8: 59 61 00 24 sw (r11+36),r1
}
if ( merge_below_block != NULL ) {
80095ac: 46 00 00 12 be r16,r0,80095f4 <_Heap_Extend+0x1bc>
Heap_Control *heap,
uintptr_t extend_area_begin,
Heap_Block *first_block
)
{
uintptr_t const page_size = heap->page_size;
80095b0: 29 6f 00 10 lw r15,(r11+16)
uintptr_t const new_first_block_alloc_begin =
_Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size );
80095b4: 35 ce 00 08 addi r14,r14,8
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up(
uintptr_t value,
uintptr_t alignment
)
{
uintptr_t remainder = value % alignment;
80095b8: b9 c0 08 00 mv r1,r14
80095bc: b9 e0 10 00 mv r2,r15
80095c0: f8 00 1e 85 calli 8010fd4 <__umodsi3>
if ( remainder != 0 ) {
80095c4: 44 20 00 03 be r1,r0,80095d0 <_Heap_Extend+0x198> <== NEVER TAKEN
return value - remainder + alignment;
80095c8: b5 cf 70 00 add r14,r14,r15
80095cc: c9 c1 70 00 sub r14,r14,r1
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
80095d0: 2a 01 00 00 lw r1,(r16+0)
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const new_first_block_alloc_begin =
_Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size );
uintptr_t const new_first_block_begin =
80095d4: 35 c2 ff f8 addi r2,r14,-8
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
80095d8: 59 c1 ff f8 sw (r14+-8),r1
uintptr_t const new_first_block_alloc_begin =
_Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size );
uintptr_t const new_first_block_begin =
new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE;
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
80095dc: ca 02 08 00 sub r1,r16,r2
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED;
80095e0: 38 21 00 01 ori r1,r1,0x1
80095e4: 58 41 00 04 sw (r2+4),r1
_Heap_Free_block( heap, new_first_block );
80095e8: b9 60 08 00 mv r1,r11
80095ec: fb ff ff 86 calli 8009404 <_Heap_Free_block>
80095f0: e0 00 00 06 bi 8009608 <_Heap_Extend+0x1d0>
heap->last_block = extend_last_block;
}
if ( merge_below_block != NULL ) {
_Heap_Merge_below( heap, extend_area_begin, merge_below_block );
} else if ( link_below_block != NULL ) {
80095f4: 46 70 00 05 be r19,r16,8009608 <_Heap_Extend+0x1d0>
_Heap_Link_below(
80095f8: 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;
80095fc: ca 61 98 00 sub r19,r19,r1
8009600: 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 =
8009604: 58 33 00 04 sw (r1+4),r19
link_below_block,
extend_last_block
);
}
if ( merge_above_block != NULL ) {
8009608: 45 80 00 14 be r12,r0,8009658 <_Heap_Extend+0x220>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
800960c: 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,
8009610: 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(
8009614: c9 ac 68 00 sub r13,r13,r12
8009618: b9 a0 08 00 mv r1,r13
800961c: f8 00 1e 6e calli 8010fd4 <__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)
8009620: 29 83 00 04 lw r3,(r12+4)
8009624: 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 =
8009628: b4 2c 10 00 add r2,r1,r12
(last_block->size_and_flag - last_block_new_size)
800962c: c8 61 18 00 sub r3,r3,r1
| HEAP_PREV_BLOCK_USED;
8009630: 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 =
8009634: 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;
8009638: 29 82 00 04 lw r2,(r12+4)
800963c: 20 42 00 01 andi r2,r2,0x1
block->size_and_flag = size | flag;
8009640: b8 22 08 00 or r1,r1,r2
8009644: 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 );
8009648: b9 80 10 00 mv r2,r12
800964c: b9 60 08 00 mv r1,r11
8009650: fb ff ff 6d calli 8009404 <_Heap_Free_block>
8009654: e0 00 00 0c bi 8009684 <_Heap_Extend+0x24c>
);
}
if ( merge_above_block != NULL ) {
_Heap_Merge_above( heap, merge_above_block, extend_area_end );
} else if ( link_above_block != NULL ) {
8009658: 46 2c 00 0b be r17,r12,8009684 <_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;
800965c: 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 );
8009660: 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(
8009664: 2b 82 00 44 lw r2,(sp+68)
8009668: 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 );
800966c: c8 71 18 00 sub r3,r3,r17
block->size_and_flag = size | flag;
8009670: b8 61 08 00 or r1,r3,r1
8009674: 5a 21 00 04 sw (r17+4),r1
last_block->size_and_flag |= HEAP_PREV_BLOCK_USED;
8009678: 28 41 00 04 lw r1,(r2+4)
800967c: 38 21 00 01 ori r1,r1,0x1
8009680: 58 41 00 04 sw (r2+4),r1
extend_first_block,
extend_last_block
);
}
if ( merge_below_block == NULL && merge_above_block == NULL ) {
8009684: 65 8c 00 00 cmpei r12,r12,0
8009688: 66 10 00 00 cmpei r16,r16,0
800968c: a1 90 60 00 and r12,r12,r16
8009690: 45 80 00 04 be r12,r0,80096a0 <_Heap_Extend+0x268>
_Heap_Free_block( heap, extend_first_block );
8009694: 2b 82 00 48 lw r2,(sp+72)
8009698: b9 60 08 00 mv r1,r11
800969c: fb ff ff 5a calli 8009404 <_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
80096a0: 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(
80096a4: 29 63 00 20 lw r3,(r11+32)
stats->size += extended_size;
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
80096a8: 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;
80096ac: 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(
80096b0: 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;
80096b4: 20 42 00 01 andi r2,r2,0x1
block->size_and_flag = size | flag;
80096b8: b8 62 10 00 or r2,r3,r2
80096bc: 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;
80096c0: 29 61 00 30 lw r1,(r11+48)
/* Statistics */
stats->size += extended_size;
80096c4: 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;
80096c8: c8 37 08 00 sub r1,r1,r23
/* Statistics */
stats->size += extended_size;
80096cc: b4 41 10 00 add r2,r2,r1
80096d0: 59 62 00 2c sw (r11+44),r2
if ( extended_size_ptr != NULL )
80096d4: 46 80 00 04 be r20,r0,80096e4 <_Heap_Extend+0x2ac> <== NEVER TAKEN
*extended_size_ptr = extended_size;
80096d8: 5a 81 00 00 sw (r20+0),r1
80096dc: e0 00 00 02 bi 80096e4 <_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;
80096e0: 34 0c 00 00 mvi r12,0
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
}
80096e4: b9 80 08 00 mv r1,r12
80096e8: 2b 9d 00 04 lw ra,(sp+4)
80096ec: 2b 8b 00 40 lw r11,(sp+64)
80096f0: 2b 8c 00 3c lw r12,(sp+60)
80096f4: 2b 8d 00 38 lw r13,(sp+56)
80096f8: 2b 8e 00 34 lw r14,(sp+52)
80096fc: 2b 8f 00 30 lw r15,(sp+48)
8009700: 2b 90 00 2c lw r16,(sp+44)
8009704: 2b 91 00 28 lw r17,(sp+40)
8009708: 2b 92 00 24 lw r18,(sp+36)
800970c: 2b 93 00 20 lw r19,(sp+32)
8009710: 2b 94 00 1c lw r20,(sp+28)
8009714: 2b 95 00 18 lw r21,(sp+24)
8009718: 2b 96 00 14 lw r22,(sp+20)
800971c: 2b 97 00 10 lw r23,(sp+16)
8009720: 2b 98 00 0c lw r24,(sp+12)
8009724: 2b 99 00 08 lw r25,(sp+8)
8009728: 37 9c 00 48 addi sp,sp,72
800972c: c3 a0 00 00 ret
0800928c <_Heap_Free>:
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
800928c: 37 9c ff f4 addi sp,sp,-12
8009290: 5b 8b 00 0c sw (sp+12),r11
8009294: 5b 8c 00 08 sw (sp+8),r12
8009298: 5b 9d 00 04 sw (sp+4),ra
800929c: b8 20 58 00 mv r11,r1
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
return true;
80092a0: 34 01 00 01 mvi r1,1
/*
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
80092a4: 44 40 00 73 be r2,r0,8009470 <_Heap_Free+0x1e4>
80092a8: 34 4c ff f8 addi r12,r2,-8
80092ac: b8 40 08 00 mv r1,r2
80092b0: 29 62 00 10 lw r2,(r11+16)
80092b4: f8 00 1e 5f calli 8010c30 <__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
80092b8: 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);
80092bc: 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;
80092c0: 34 01 00 00 mvi r1,0
80092c4: 54 e3 00 03 bgu r7,r3,80092d0 <_Heap_Free+0x44>
80092c8: 29 61 00 24 lw r1,(r11+36)
80092cc: f0 23 08 00 cmpgeu r1,r1,r3
}
alloc_begin = (uintptr_t) alloc_begin_ptr;
block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
80092d0: b8 20 10 00 mv r2,r1
return false;
80092d4: 34 01 00 00 mvi r1,0
}
alloc_begin = (uintptr_t) alloc_begin_ptr;
block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
80092d8: 44 40 00 66 be r2,r0,8009470 <_Heap_Free+0x1e4>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
80092dc: 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;
80092e0: 34 04 ff fe mvi r4,-2
80092e4: 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);
80092e8: 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;
80092ec: 54 e2 00 03 bgu r7,r2,80092f8 <_Heap_Free+0x6c> <== NEVER TAKEN
80092f0: 29 61 00 24 lw r1,(r11+36)
80092f4: f0 22 08 00 cmpgeu r1,r1,r2
_Heap_Protection_block_check( heap, block );
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
80092f8: b8 20 28 00 mv r5,r1
return false;
80092fc: 34 01 00 00 mvi r1,0
_Heap_Protection_block_check( heap, block );
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
8009300: 44 a0 00 5c be r5,r0,8009470 <_Heap_Free+0x1e4> <== NEVER TAKEN
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
8009304: 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;
8009308: 20 a8 00 01 andi r8,r5,0x1
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
800930c: 45 00 00 59 be r8,r0,8009470 <_Heap_Free+0x1e4> <== NEVER TAKEN
if ( !_Heap_Protection_determine_block_free( heap, block ) ) {
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
8009310: 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;
8009314: 34 01 ff fe mvi r1,-2
8009318: a0 a1 28 00 and r5,r5,r1
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
800931c: 34 08 00 00 mvi r8,0
8009320: 45 22 00 05 be r9,r2,8009334 <_Heap_Free+0xa8>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
8009324: 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;
8009328: 28 28 00 04 lw r8,(r1+4)
800932c: 21 08 00 01 andi r8,r8,0x1
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
8009330: 65 08 00 00 cmpei r8,r8,0
8009334: 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
8009338: 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 ) ) {
800933c: 5c c0 00 24 bne r6,r0,80093cc <_Heap_Free+0x140>
uintptr_t const prev_size = block->prev_size;
8009340: 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;
8009344: 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);
8009348: 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;
800934c: 54 e3 00 02 bgu r7,r3,8009354 <_Heap_Free+0xc8> <== NEVER TAKEN
8009350: 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 ) ) {
8009354: b8 20 38 00 mv r7,r1
_HAssert( false );
return( false );
8009358: 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 ) ) {
800935c: 44 e0 00 45 be r7,r0,8009470 <_Heap_Free+0x1e4> <== NEVER TAKEN
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
8009360: 28 67 00 04 lw r7,(r3+4)
8009364: 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) ) {
8009368: 44 e0 00 42 be r7,r0,8009470 <_Heap_Free+0x1e4> <== NEVER TAKEN
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
800936c: 45 00 00 0f be r8,r0,80093a8 <_Heap_Free+0x11c>
return _Heap_Free_list_tail(heap)->prev;
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
8009370: 28 41 00 08 lw r1,(r2+8)
Heap_Block *prev = block->prev;
8009374: 28 42 00 0c lw r2,(r2+12)
uintptr_t const size = block_size + prev_size + next_block_size;
8009378: b4 85 28 00 add r5,r4,r5
800937c: b4 a6 30 00 add r6,r5,r6
prev->next = next;
8009380: 58 41 00 08 sw (r2+8),r1
next->prev = prev;
8009384: 58 22 00 0c sw (r1+12),r2
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
8009388: 29 61 00 38 lw r1,(r11+56)
800938c: 34 21 ff ff addi r1,r1,-1
8009390: 59 61 00 38 sw (r11+56),r1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
8009394: 38 c1 00 01 ori r1,r6,0x1
8009398: 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;
800939c: b4 66 18 00 add r3,r3,r6
80093a0: 58 66 00 00 sw (r3+0),r6
80093a4: e0 00 00 29 bi 8009448 <_Heap_Free+0x1bc>
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
80093a8: b4 86 30 00 add r6,r4,r6
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
80093ac: 38 c1 00 01 ori r1,r6,0x1
80093b0: 58 61 00 04 sw (r3+4),r1
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
80093b4: 28 43 00 04 lw r3,(r2+4)
80093b8: 34 01 ff fe mvi r1,-2
next_block->prev_size = size;
80093bc: 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;
80093c0: a0 61 08 00 and r1,r3,r1
80093c4: 58 41 00 04 sw (r2+4),r1
80093c8: e0 00 00 20 bi 8009448 <_Heap_Free+0x1bc>
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
80093cc: 45 00 00 0d be r8,r0,8009400 <_Heap_Free+0x174>
uintptr_t const size = block_size + next_block_size;
80093d0: 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;
80093d4: 28 45 00 08 lw r5,(r2+8)
Heap_Block *prev = old_block->prev;
80093d8: 28 42 00 0c lw r2,(r2+12)
new_block->next = next;
80093dc: 58 65 00 08 sw (r3+8),r5
new_block->prev = prev;
80093e0: 58 62 00 0c sw (r3+12),r2
next->prev = new_block;
prev->next = new_block;
80093e4: 58 43 00 08 sw (r2+8),r3
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
80093e8: 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;
80093ec: 58 a3 00 0c sw (r5+12),r3
80093f0: 58 62 00 04 sw (r3+4),r2
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
80093f4: b4 61 18 00 add r3,r3,r1
80093f8: 58 61 00 00 sw (r3+0),r1
80093fc: e0 00 00 13 bi 8009448 <_Heap_Free+0x1bc>
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
8009400: 29 61 00 08 lw r1,(r11+8)
new_block->next = next;
new_block->prev = block_before;
8009404: 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;
8009408: 58 44 00 00 sw (r2+0),r4
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
800940c: 58 61 00 08 sw (r3+8),r1
new_block->prev = block_before;
block_before->next = new_block;
next->prev = new_block;
8009410: 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;
8009414: 38 81 00 01 ori r1,r4,0x1
8009418: 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;
800941c: 59 63 00 08 sw (r11+8),r3
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
8009420: 28 43 00 04 lw r3,(r2+4)
8009424: 34 01 ff fe mvi r1,-2
8009428: a0 61 08 00 and r1,r3,r1
800942c: 58 41 00 04 sw (r2+4),r1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
8009430: 29 61 00 38 lw r1,(r11+56)
if ( stats->max_free_blocks < stats->free_blocks ) {
8009434: 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;
8009438: 34 21 00 01 addi r1,r1,1
800943c: 59 61 00 38 sw (r11+56),r1
if ( stats->max_free_blocks < stats->free_blocks ) {
8009440: 50 41 00 02 bgeu r2,r1,8009448 <_Heap_Free+0x1bc>
stats->max_free_blocks = stats->free_blocks;
8009444: 59 61 00 3c sw (r11+60),r1
}
}
/* Statistics */
--stats->used_blocks;
8009448: 29 61 00 40 lw r1,(r11+64)
800944c: 34 21 ff ff addi r1,r1,-1
8009450: 59 61 00 40 sw (r11+64),r1
++stats->frees;
8009454: 29 61 00 50 lw r1,(r11+80)
8009458: 34 21 00 01 addi r1,r1,1
800945c: 59 61 00 50 sw (r11+80),r1
stats->free_size += block_size;
8009460: 29 61 00 30 lw r1,(r11+48)
8009464: b4 24 20 00 add r4,r1,r4
8009468: 59 64 00 30 sw (r11+48),r4
return( true );
800946c: 34 01 00 01 mvi r1,1
}
8009470: 2b 9d 00 04 lw ra,(sp+4)
8009474: 2b 8b 00 0c lw r11,(sp+12)
8009478: 2b 8c 00 08 lw r12,(sp+8)
800947c: 37 9c 00 0c addi sp,sp,12
8009480: c3 a0 00 00 ret
08011614 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
8011614: 37 9c ff ec addi sp,sp,-20
8011618: 5b 8b 00 14 sw (sp+20),r11
801161c: 5b 8c 00 10 sw (sp+16),r12
8011620: 5b 8d 00 0c sw (sp+12),r13
8011624: 5b 8e 00 08 sw (sp+8),r14
8011628: 5b 9d 00 04 sw (sp+4),ra
801162c: 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);
8011630: 34 4e ff f8 addi r14,r2,-8
8011634: b8 40 08 00 mv r1,r2
8011638: b8 40 60 00 mv r12,r2
801163c: 29 62 00 10 lw r2,(r11+16)
8011640: b8 60 68 00 mv r13,r3
8011644: fb ff fd 7b calli 8010c30 <__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
8011648: 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);
801164c: 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;
8011650: 34 01 00 00 mvi r1,0
8011654: 54 44 00 03 bgu r2,r4,8011660 <_Heap_Size_of_alloc_area+0x4c>
8011658: 29 61 00 24 lw r1,(r11+36)
801165c: 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 ) ) {
8011660: b8 20 18 00 mv r3,r1
return false;
8011664: 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 ) ) {
8011668: 44 60 00 13 be r3,r0,80116b4 <_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;
801166c: 28 83 00 04 lw r3,(r4+4)
8011670: 34 01 ff fe mvi r1,-2
8011674: 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);
8011678: 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;
801167c: 34 01 00 00 mvi r1,0
8011680: 54 44 00 03 bgu r2,r4,801168c <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN
8011684: 29 61 00 24 lw r1,(r11+36)
8011688: f0 24 08 00 cmpgeu r1,r1,r4
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
801168c: b8 20 10 00 mv r2,r1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
8011690: 34 01 00 00 mvi r1,0
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
8011694: 44 40 00 08 be r2,r0,80116b4 <_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;
8011698: 28 82 00 04 lw r2,(r4+4)
801169c: 20 42 00 01 andi r2,r2,0x1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
80116a0: 44 40 00 05 be r2,r0,80116b4 <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
80116a4: c8 8c 20 00 sub r4,r4,r12
80116a8: 34 84 00 04 addi r4,r4,4
80116ac: 59 a4 00 00 sw (r13+0),r4
return true;
80116b0: 34 01 00 01 mvi r1,1
}
80116b4: 2b 9d 00 04 lw ra,(sp+4)
80116b8: 2b 8b 00 14 lw r11,(sp+20)
80116bc: 2b 8c 00 10 lw r12,(sp+16)
80116c0: 2b 8d 00 0c lw r13,(sp+12)
80116c4: 2b 8e 00 08 lw r14,(sp+8)
80116c8: 37 9c 00 14 addi sp,sp,20
80116cc: c3 a0 00 00 ret
08004bf4 <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
8004bf4: 37 9c ff a0 addi sp,sp,-96
8004bf8: 5b 8b 00 50 sw (sp+80),r11
8004bfc: 5b 8c 00 4c sw (sp+76),r12
8004c00: 5b 8d 00 48 sw (sp+72),r13
8004c04: 5b 8e 00 44 sw (sp+68),r14
8004c08: 5b 8f 00 40 sw (sp+64),r15
8004c0c: 5b 90 00 3c sw (sp+60),r16
8004c10: 5b 91 00 38 sw (sp+56),r17
8004c14: 5b 92 00 34 sw (sp+52),r18
8004c18: 5b 93 00 30 sw (sp+48),r19
8004c1c: 5b 94 00 2c sw (sp+44),r20
8004c20: 5b 95 00 28 sw (sp+40),r21
8004c24: 5b 96 00 24 sw (sp+36),r22
8004c28: 5b 97 00 20 sw (sp+32),r23
8004c2c: 5b 98 00 1c sw (sp+28),r24
8004c30: 5b 99 00 18 sw (sp+24),r25
8004c34: 5b 9b 00 14 sw (sp+20),fp
8004c38: 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;
8004c3c: 78 0d 08 00 mvhi r13,0x800
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
8004c40: 20 63 00 ff andi r3,r3,0xff
8004c44: b8 20 60 00 mv r12,r1
8004c48: b8 40 70 00 mv r14,r2
uintptr_t const page_size = heap->page_size;
8004c4c: 28 33 00 10 lw r19,(r1+16)
uintptr_t const min_block_size = heap->min_block_size;
8004c50: 28 35 00 14 lw r21,(r1+20)
Heap_Block *const first_block = heap->first_block;
8004c54: 28 34 00 20 lw r20,(r1+32)
Heap_Block *const last_block = heap->last_block;
8004c58: 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;
8004c5c: 39 ad 4b 5c ori r13,r13,0x4b5c
8004c60: 44 60 00 03 be r3,r0,8004c6c <_Heap_Walk+0x78>
8004c64: 78 0d 08 00 mvhi r13,0x800
8004c68: 39 ad 4b 80 ori r13,r13,0x4b80
if ( !_System_state_Is_up( _System_state_Get() ) ) {
8004c6c: 78 03 08 01 mvhi r3,0x801
8004c70: 38 63 5a 28 ori r3,r3,0x5a28
8004c74: 28 67 00 00 lw r7,(r3+0)
8004c78: 34 02 00 03 mvi r2,3
return true;
8004c7c: 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() ) ) {
8004c80: 5c e2 01 08 bne r7,r2,80050a0 <_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)(
8004c84: 29 81 00 08 lw r1,(r12+8)
8004c88: 29 86 00 18 lw r6,(r12+24)
8004c8c: 29 87 00 1c lw r7,(r12+28)
8004c90: 5b 81 00 08 sw (sp+8),r1
8004c94: 29 81 00 0c lw r1,(r12+12)
8004c98: 78 03 08 01 mvhi r3,0x801
8004c9c: 5b 96 00 04 sw (sp+4),r22
8004ca0: 5b 81 00 0c sw (sp+12),r1
8004ca4: 34 02 00 00 mvi r2,0
8004ca8: b9 c0 08 00 mv r1,r14
8004cac: 38 63 2e 10 ori r3,r3,0x2e10
8004cb0: ba 60 20 00 mv r4,r19
8004cb4: ba a0 28 00 mv r5,r21
8004cb8: ba 80 40 00 mv r8,r20
8004cbc: 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 ) {
8004cc0: 5e 60 00 06 bne r19,r0,8004cd8 <_Heap_Walk+0xe4>
(*printer)( source, true, "page size is zero\n" );
8004cc4: 78 03 08 01 mvhi r3,0x801
8004cc8: b9 c0 08 00 mv r1,r14
8004ccc: 34 02 00 01 mvi r2,1
8004cd0: 38 63 2e a4 ori r3,r3,0x2ea4
8004cd4: e0 00 00 25 bi 8004d68 <_Heap_Walk+0x174>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
8004cd8: 22 6f 00 07 andi r15,r19,0x7
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
8004cdc: 45 e0 00 07 be r15,r0,8004cf8 <_Heap_Walk+0x104>
(*printer)(
8004ce0: 78 03 08 01 mvhi r3,0x801
8004ce4: b9 c0 08 00 mv r1,r14
8004ce8: 34 02 00 01 mvi r2,1
8004cec: 38 63 2e b8 ori r3,r3,0x2eb8
8004cf0: ba 60 20 00 mv r4,r19
8004cf4: e0 00 01 04 bi 8005104 <_Heap_Walk+0x510>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004cf8: ba a0 08 00 mv r1,r21
8004cfc: ba 60 10 00 mv r2,r19
8004d00: fb ff ef aa calli 8000ba8 <__umodsi3>
8004d04: b8 20 58 00 mv r11,r1
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
8004d08: 44 2f 00 07 be r1,r15,8004d24 <_Heap_Walk+0x130>
(*printer)(
8004d0c: 78 03 08 01 mvhi r3,0x801
8004d10: b9 c0 08 00 mv r1,r14
8004d14: 34 02 00 01 mvi r2,1
8004d18: 38 63 2e d8 ori r3,r3,0x2ed8
8004d1c: ba a0 20 00 mv r4,r21
8004d20: e0 00 00 f9 bi 8005104 <_Heap_Walk+0x510>
8004d24: 36 81 00 08 addi r1,r20,8
8004d28: ba 60 10 00 mv r2,r19
8004d2c: fb ff ef 9f calli 8000ba8 <__umodsi3>
);
return false;
}
if (
8004d30: 44 2b 00 07 be r1,r11,8004d4c <_Heap_Walk+0x158>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
8004d34: 78 03 08 01 mvhi r3,0x801
8004d38: b9 c0 08 00 mv r1,r14
8004d3c: 34 02 00 01 mvi r2,1
8004d40: 38 63 2e fc ori r3,r3,0x2efc
8004d44: ba 80 20 00 mv r4,r20
8004d48: e0 00 00 ef bi 8005104 <_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;
8004d4c: 2a 82 00 04 lw r2,(r20+4)
8004d50: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
8004d54: 5c 41 00 07 bne r2,r1,8004d70 <_Heap_Walk+0x17c>
(*printer)(
8004d58: 78 03 08 01 mvhi r3,0x801
8004d5c: b9 c0 08 00 mv r1,r14
8004d60: 34 02 00 01 mvi r2,1
8004d64: 38 63 2f 30 ori r3,r3,0x2f30
8004d68: d9 a0 00 00 call r13
8004d6c: e0 00 00 40 bi 8004e6c <_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;
8004d70: 2a cf 00 04 lw r15,(r22+4)
8004d74: 34 02 ff fe mvi r2,-2
8004d78: 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);
8004d7c: 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;
8004d80: 29 e2 00 04 lw r2,(r15+4)
8004d84: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
8004d88: 5c 41 00 06 bne r2,r1,8004da0 <_Heap_Walk+0x1ac>
(*printer)(
8004d8c: 78 03 08 01 mvhi r3,0x801
8004d90: b9 c0 08 00 mv r1,r14
8004d94: 34 02 00 01 mvi r2,1
8004d98: 38 63 2f 60 ori r3,r3,0x2f60
8004d9c: e3 ff ff f3 bi 8004d68 <_Heap_Walk+0x174>
);
return false;
}
if (
8004da0: 45 f4 00 06 be r15,r20,8004db8 <_Heap_Walk+0x1c4>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
8004da4: 78 03 08 01 mvhi r3,0x801
8004da8: b9 c0 08 00 mv r1,r14
8004dac: 34 02 00 01 mvi r2,1
8004db0: 38 63 2f 78 ori r3,r3,0x2f78
8004db4: e3 ff ff ed bi 8004d68 <_Heap_Walk+0x174>
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
8004db8: 29 92 00 10 lw r18,(r12+16)
block = next_block;
} while ( block != first_block );
return true;
}
8004dbc: 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 );
8004dc0: 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;
8004dc4: 34 11 ff fe mvi r17,-2
8004dc8: e0 00 00 2d bi 8004e7c <_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;
8004dcc: 29 83 00 20 lw r3,(r12+32)
8004dd0: 34 01 00 00 mvi r1,0
8004dd4: 54 6b 00 03 bgu r3,r11,8004de0 <_Heap_Walk+0x1ec>
8004dd8: 29 81 00 24 lw r1,(r12+36)
8004ddc: 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 ) ) {
8004de0: 5c 20 00 06 bne r1,r0,8004df8 <_Heap_Walk+0x204>
(*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 a8 ori r3,r3,0x2fa8
8004df4: e0 00 00 14 bi 8004e44 <_Heap_Walk+0x250>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004df8: 35 61 00 08 addi r1,r11,8
8004dfc: ba 40 10 00 mv r2,r18
8004e00: fb ff ef 6a calli 8000ba8 <__umodsi3>
);
return false;
}
if (
8004e04: 44 20 00 06 be r1,r0,8004e1c <_Heap_Walk+0x228>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
8004e08: 78 03 08 01 mvhi r3,0x801
8004e0c: b9 c0 08 00 mv r1,r14
8004e10: 34 02 00 01 mvi r2,1
8004e14: 38 63 2f c8 ori r3,r3,0x2fc8
8004e18: e0 00 00 0b bi 8004e44 <_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;
8004e1c: 29 63 00 04 lw r3,(r11+4)
8004e20: a2 23 18 00 and r3,r17,r3
block = next_block;
} while ( block != first_block );
return true;
}
8004e24: 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;
8004e28: 28 63 00 04 lw r3,(r3+4)
8004e2c: 20 63 00 01 andi r3,r3,0x1
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
8004e30: 44 61 00 07 be r3,r1,8004e4c <_Heap_Walk+0x258>
(*printer)(
8004e34: 78 03 08 01 mvhi r3,0x801
8004e38: b9 c0 08 00 mv r1,r14
8004e3c: 34 02 00 01 mvi r2,1
8004e40: 38 63 2f f8 ori r3,r3,0x2ff8
8004e44: b9 60 20 00 mv r4,r11
8004e48: e0 00 00 af bi 8005104 <_Heap_Walk+0x510>
);
return false;
}
if ( free_block->prev != prev_block ) {
8004e4c: 29 65 00 0c lw r5,(r11+12)
8004e50: 44 b0 00 09 be r5,r16,8004e74 <_Heap_Walk+0x280>
(*printer)(
8004e54: 78 03 08 01 mvhi r3,0x801
8004e58: b9 c0 08 00 mv r1,r14
8004e5c: 34 02 00 01 mvi r2,1
8004e60: 38 63 30 14 ori r3,r3,0x3014
8004e64: b9 60 20 00 mv r4,r11
8004e68: 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;
8004e6c: 34 03 00 00 mvi r3,0
8004e70: e0 00 00 8c bi 80050a0 <_Heap_Walk+0x4ac>
return false;
}
prev_block = free_block;
free_block = free_block->next;
8004e74: b9 60 80 00 mv r16,r11
8004e78: 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 ) {
8004e7c: 5d 6c ff d4 bne r11,r12,8004dcc <_Heap_Walk+0x1d8>
8004e80: e0 00 00 03 bi 8004e8c <_Heap_Walk+0x298>
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
8004e84: ba 20 78 00 mv r15,r17
8004e88: e0 00 00 15 bi 8004edc <_Heap_Walk+0x2e8>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
8004e8c: 78 01 08 01 mvhi r1,0x801
8004e90: 38 21 31 c4 ori r1,r1,0x31c4
8004e94: 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)(
8004e98: 78 01 08 01 mvhi r1,0x801
8004e9c: 38 21 31 ac ori r1,r1,0x31ac
8004ea0: 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)(
8004ea4: 78 01 08 01 mvhi r1,0x801
8004ea8: 38 21 2d d8 ori r1,r1,0x2dd8
8004eac: 5b 81 00 5c sw (sp+92),r1
8004eb0: 78 01 08 01 mvhi r1,0x801
8004eb4: 38 21 2d f4 ori r1,r1,0x2df4
8004eb8: 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)" : "")
8004ebc: 78 17 08 01 mvhi r23,0x801
8004ec0: 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)" : ""),
8004ec4: 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)(
8004ec8: 5b 81 00 60 sw (sp+96),r1
8004ecc: 3b 7b 31 08 ori fp,fp,0x3108
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
8004ed0: 3a f7 31 78 ori r23,r23,0x3178
8004ed4: 3b 39 2e 04 ori r25,r25,0x2e04
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
8004ed8: 3b 18 2d e8 ori r24,r24,0x2de8
block = next_block;
} while ( block != first_block );
return true;
}
8004edc: 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;
8004ee0: 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;
8004ee4: 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;
8004ee8: 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);
8004eec: 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;
8004ef0: 34 06 00 00 mvi r6,0
8004ef4: 54 91 00 03 bgu r4,r17,8004f00 <_Heap_Walk+0x30c> <== NEVER TAKEN
8004ef8: 29 86 00 24 lw r6,(r12+36)
8004efc: 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 ) ) {
8004f00: 5c c0 00 06 bne r6,r0,8004f18 <_Heap_Walk+0x324>
(*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 30 48 ori r3,r3,0x3048
8004f14: e0 00 00 1f bi 8004f90 <_Heap_Walk+0x39c>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8004f18: ba 00 08 00 mv r1,r16
8004f1c: 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;
8004f20: fd f6 58 00 cmpne r11,r15,r22
8004f24: fb ff ef 21 calli 8000ba8 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
8004f28: 44 20 00 09 be r1,r0,8004f4c <_Heap_Walk+0x358>
8004f2c: 45 60 00 08 be r11,r0,8004f4c <_Heap_Walk+0x358>
(*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 78 ori r3,r3,0x3078
8004f40: b9 e0 20 00 mv r4,r15
8004f44: ba 00 28 00 mv r5,r16
8004f48: e3 ff ff c8 bi 8004e68 <_Heap_Walk+0x274>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
8004f4c: 52 15 00 0b bgeu r16,r21,8004f78 <_Heap_Walk+0x384>
8004f50: 45 60 00 0a be r11,r0,8004f78 <_Heap_Walk+0x384> <== NEVER TAKEN
(*printer)(
8004f54: 78 03 08 01 mvhi r3,0x801
8004f58: b9 c0 08 00 mv r1,r14
8004f5c: 34 02 00 01 mvi r2,1
8004f60: 38 63 30 a8 ori r3,r3,0x30a8
8004f64: b9 e0 20 00 mv r4,r15
8004f68: ba 00 28 00 mv r5,r16
8004f6c: ba a0 30 00 mv r6,r21
8004f70: d9 a0 00 00 call r13
8004f74: e3 ff ff be bi 8004e6c <_Heap_Walk+0x278>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
8004f78: 56 2f 00 09 bgu r17,r15,8004f9c <_Heap_Walk+0x3a8>
8004f7c: 45 60 00 08 be r11,r0,8004f9c <_Heap_Walk+0x3a8>
(*printer)(
8004f80: 78 03 08 01 mvhi r3,0x801
8004f84: b9 c0 08 00 mv r1,r14
8004f88: 34 02 00 01 mvi r2,1
8004f8c: 38 63 30 d4 ori r3,r3,0x30d4
8004f90: b9 e0 20 00 mv r4,r15
8004f94: ba 20 28 00 mv r5,r17
8004f98: e3 ff ff b4 bi 8004e68 <_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;
8004f9c: 2a 24 00 04 lw r4,(r17+4)
8004fa0: 22 52 00 01 andi r18,r18,0x1
8004fa4: 20 84 00 01 andi r4,r4,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
8004fa8: 5c 80 00 2d bne r4,r0,800505c <_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 ?
8004fac: 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)(
8004fb0: 29 85 00 08 lw r5,(r12+8)
block = next_block;
} while ( block != first_block );
return true;
}
8004fb4: 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)(
8004fb8: 2b 87 00 5c lw r7,(sp+92)
8004fbc: 44 c5 00 04 be r6,r5,8004fcc <_Heap_Walk+0x3d8>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
8004fc0: ba e0 38 00 mv r7,r23
8004fc4: 5c cc 00 02 bne r6,r12,8004fcc <_Heap_Walk+0x3d8>
8004fc8: bb 00 38 00 mv r7,r24
block->next,
block->next == last_free_block ?
8004fcc: 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)(
8004fd0: 2b 89 00 60 lw r9,(sp+96)
8004fd4: 45 04 00 04 be r8,r4,8004fe4 <_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)" : "")
8004fd8: ba e0 48 00 mv r9,r23
8004fdc: 5d 0c 00 02 bne r8,r12,8004fe4 <_Heap_Walk+0x3f0>
8004fe0: 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)(
8004fe4: 5b 89 00 04 sw (sp+4),r9
8004fe8: b9 c0 08 00 mv r1,r14
8004fec: 34 02 00 00 mvi r2,0
8004ff0: bb 60 18 00 mv r3,fp
8004ff4: b9 e0 20 00 mv r4,r15
8004ff8: ba 00 28 00 mv r5,r16
8004ffc: 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 ) {
8005000: 2a 26 00 00 lw r6,(r17+0)
8005004: 46 06 00 0a be r16,r6,800502c <_Heap_Walk+0x438>
(*printer)(
8005008: 78 03 08 01 mvhi r3,0x801
800500c: b9 c0 08 00 mv r1,r14
8005010: 34 02 00 01 mvi r2,1
8005014: 38 63 31 40 ori r3,r3,0x3140
8005018: b9 e0 20 00 mv r4,r15
800501c: ba 00 28 00 mv r5,r16
8005020: ba 20 38 00 mv r7,r17
8005024: d9 a0 00 00 call r13
8005028: e3 ff ff 91 bi 8004e6c <_Heap_Walk+0x278>
);
return false;
}
if ( !prev_used ) {
800502c: 5e 40 00 06 bne r18,r0,8005044 <_Heap_Walk+0x450>
(*printer)(
8005030: 78 03 08 01 mvhi r3,0x801
8005034: b9 c0 08 00 mv r1,r14
8005038: 34 02 00 01 mvi r2,1
800503c: 38 63 31 7c ori r3,r3,0x317c
8005040: e0 00 00 30 bi 8005100 <_Heap_Walk+0x50c>
block = next_block;
} while ( block != first_block );
return true;
}
8005044: 29 85 00 08 lw r5,(r12+8)
8005048: e0 00 00 03 bi 8005054 <_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 ) {
800504c: 44 af 00 13 be r5,r15,8005098 <_Heap_Walk+0x4a4>
return true;
}
free_block = free_block->next;
8005050: 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 ) {
8005054: 5c ac ff fe bne r5,r12,800504c <_Heap_Walk+0x458>
8005058: e0 00 00 26 bi 80050f0 <_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) {
800505c: 46 40 00 08 be r18,r0,800507c <_Heap_Walk+0x488>
(*printer)(
8005060: 2b 83 00 58 lw r3,(sp+88)
8005064: b9 c0 08 00 mv r1,r14
8005068: 34 02 00 00 mvi r2,0
800506c: b9 e0 20 00 mv r4,r15
8005070: ba 00 28 00 mv r5,r16
8005074: d9 a0 00 00 call r13
8005078: e0 00 00 08 bi 8005098 <_Heap_Walk+0x4a4>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
800507c: 2b 83 00 54 lw r3,(sp+84)
8005080: 29 e6 00 00 lw r6,(r15+0)
8005084: b9 c0 08 00 mv r1,r14
8005088: 34 02 00 00 mvi r2,0
800508c: b9 e0 20 00 mv r4,r15
8005090: ba 00 28 00 mv r5,r16
8005094: d9 a0 00 00 call r13
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
8005098: 5e 91 ff 7b bne r20,r17,8004e84 <_Heap_Walk+0x290>
return true;
800509c: 34 03 00 01 mvi r3,1
}
80050a0: b8 60 08 00 mv r1,r3
80050a4: 2b 9d 00 10 lw ra,(sp+16)
80050a8: 2b 8b 00 50 lw r11,(sp+80)
80050ac: 2b 8c 00 4c lw r12,(sp+76)
80050b0: 2b 8d 00 48 lw r13,(sp+72)
80050b4: 2b 8e 00 44 lw r14,(sp+68)
80050b8: 2b 8f 00 40 lw r15,(sp+64)
80050bc: 2b 90 00 3c lw r16,(sp+60)
80050c0: 2b 91 00 38 lw r17,(sp+56)
80050c4: 2b 92 00 34 lw r18,(sp+52)
80050c8: 2b 93 00 30 lw r19,(sp+48)
80050cc: 2b 94 00 2c lw r20,(sp+44)
80050d0: 2b 95 00 28 lw r21,(sp+40)
80050d4: 2b 96 00 24 lw r22,(sp+36)
80050d8: 2b 97 00 20 lw r23,(sp+32)
80050dc: 2b 98 00 1c lw r24,(sp+28)
80050e0: 2b 99 00 18 lw r25,(sp+24)
80050e4: 2b 9b 00 14 lw fp,(sp+20)
80050e8: 37 9c 00 60 addi sp,sp,96
80050ec: c3 a0 00 00 ret
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
80050f0: 78 03 08 01 mvhi r3,0x801
80050f4: b9 c0 08 00 mv r1,r14
80050f8: 34 02 00 01 mvi r2,1
80050fc: 38 63 31 ec ori r3,r3,0x31ec
8005100: b9 e0 20 00 mv r4,r15
8005104: d9 a0 00 00 call r13
8005108: e3 ff ff 59 bi 8004e6c <_Heap_Walk+0x278>
08003100 <_IO_Manager_initialization>:
* workspace.
*
*/
void _IO_Manager_initialization(void)
{
8003100: 37 9c ff e8 addi sp,sp,-24
8003104: 5b 8b 00 18 sw (sp+24),r11
8003108: 5b 8c 00 14 sw (sp+20),r12
800310c: 5b 8d 00 10 sw (sp+16),r13
8003110: 5b 8e 00 0c sw (sp+12),r14
8003114: 5b 8f 00 08 sw (sp+8),r15
8003118: 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;
800311c: 78 01 08 01 mvhi r1,0x801
8003120: 38 21 30 f4 ori r1,r1,0x30f4
drivers_in_table = Configuration.number_of_device_drivers;
8003124: 28 2d 00 30 lw r13,(r1+48)
number_of_drivers = Configuration.maximum_drivers;
8003128: 28 2b 00 2c lw r11,(r1+44)
uint32_t index;
rtems_driver_address_table *driver_table;
uint32_t drivers_in_table;
uint32_t number_of_drivers;
driver_table = Configuration.Device_driver_table;
800312c: 28 2e 00 34 lw r14,(r1+52)
/*
* If the user claims there are less drivers than are actually in
* the table, then let's just go with the table's count.
*/
if ( number_of_drivers <= drivers_in_table )
8003130: 51 ab 00 03 bgeu r13,r11,800313c <_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 ) {
8003134: 5d 6d 00 0a bne r11,r13,800315c <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN
8003138: e0 00 00 02 bi 8003140 <_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 )
800313c: 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;
8003140: 78 01 08 01 mvhi r1,0x801
8003144: 38 21 3a bc ori r1,r1,0x3abc
8003148: 58 2e 00 00 sw (r1+0),r14
_IO_Number_of_drivers = number_of_drivers;
800314c: 78 01 08 01 mvhi r1,0x801
8003150: 38 21 3a b8 ori r1,r1,0x3ab8
8003154: 58 2b 00 00 sw (r1+0),r11
return;
8003158: e0 00 00 27 bi 80031f4 <_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 )
800315c: 34 02 00 01 mvi r2,1
8003160: b9 60 08 00 mv r1,r11
8003164: f8 00 35 c9 calli 8010888 <__ashlsi3>
8003168: 34 02 00 03 mvi r2,3
800316c: b4 2b 08 00 add r1,r1,r11
8003170: f8 00 35 c6 calli 8010888 <__ashlsi3>
8003174: 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(
8003178: f8 00 0e 75 calli 8006b4c <_Workspace_Allocate_or_fatal_error>
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
800317c: 78 02 08 01 mvhi r2,0x801
8003180: 38 42 3a b8 ori r2,r2,0x3ab8
/*
* 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 *)
8003184: 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;
8003188: 58 4b 00 00 sw (r2+0),r11
memset(
800318c: 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 *)
8003190: 39 8c 3a bc ori r12,r12,0x3abc
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
memset(
8003194: 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 *)
8003198: 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(
800319c: f8 00 23 74 calli 800bf6c <memset>
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
80031a0: 34 03 00 00 mvi r3,0
80031a4: 34 04 00 00 mvi r4,0
80031a8: e0 00 00 12 bi 80031f0 <_IO_Manager_initialization+0xf0>
_IO_Driver_address_table[index] = driver_table[index];
80031ac: 29 82 00 00 lw r2,(r12+0)
* registration. The driver table is now allocated in the
* workspace.
*
*/
void _IO_Manager_initialization(void)
80031b0: 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];
80031b4: 28 29 00 00 lw r9,(r1+0)
80031b8: 28 28 00 04 lw r8,(r1+4)
80031bc: 28 27 00 08 lw r7,(r1+8)
80031c0: 28 26 00 0c lw r6,(r1+12)
80031c4: 28 25 00 10 lw r5,(r1+16)
80031c8: 28 21 00 14 lw r1,(r1+20)
80031cc: b4 43 10 00 add r2,r2,r3
80031d0: 58 49 00 00 sw (r2+0),r9
80031d4: 58 48 00 04 sw (r2+4),r8
80031d8: 58 47 00 08 sw (r2+8),r7
80031dc: 58 46 00 0c sw (r2+12),r6
80031e0: 58 45 00 10 sw (r2+16),r5
80031e4: 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++ )
80031e8: 34 84 00 01 addi r4,r4,1
80031ec: 34 63 00 18 addi r3,r3,24
80031f0: 55 a4 ff ef bgu r13,r4,80031ac <_IO_Manager_initialization+0xac>
_IO_Driver_address_table[index] = driver_table[index];
}
80031f4: 2b 9d 00 04 lw ra,(sp+4)
80031f8: 2b 8b 00 18 lw r11,(sp+24)
80031fc: 2b 8c 00 14 lw r12,(sp+20)
8003200: 2b 8d 00 10 lw r13,(sp+16)
8003204: 2b 8e 00 0c lw r14,(sp+12)
8003208: 2b 8f 00 08 lw r15,(sp+8)
800320c: 37 9c 00 18 addi sp,sp,24
8003210: c3 a0 00 00 ret
08004084 <_Objects_Allocate>:
*/
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
8004084: 37 9c ff ec addi sp,sp,-20
8004088: 5b 8b 00 14 sw (sp+20),r11
800408c: 5b 8c 00 10 sw (sp+16),r12
8004090: 5b 8d 00 0c sw (sp+12),r13
8004094: 5b 8e 00 08 sw (sp+8),r14
8004098: 5b 9d 00 04 sw (sp+4),ra
800409c: 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 )
80040a0: 28 21 00 18 lw r1,(r1+24)
return NULL;
80040a4: 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 )
80040a8: 44 20 00 1e be r1,r0,8004120 <_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 );
80040ac: 35 6d 00 20 addi r13,r11,32
80040b0: b9 a0 08 00 mv r1,r13
80040b4: fb ff fd 23 calli 8003540 <_Chain_Get>
80040b8: b8 20 60 00 mv r12,r1
80040bc: b8 20 70 00 mv r14,r1
if ( information->auto_extend ) {
80040c0: 41 61 00 12 lbu r1,(r11+18)
80040c4: 44 20 00 17 be r1,r0,8004120 <_Objects_Allocate+0x9c>
/*
* If the list is empty then we are out of objects and need to
* extend information base.
*/
if ( !the_object ) {
80040c8: 5d 80 00 07 bne r12,r0,80040e4 <_Objects_Allocate+0x60>
_Objects_Extend_information( information );
80040cc: b9 60 08 00 mv r1,r11
80040d0: f8 00 00 1c calli 8004140 <_Objects_Extend_information>
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
80040d4: b9 a0 08 00 mv r1,r13
80040d8: fb ff fd 1a calli 8003540 <_Chain_Get>
80040dc: b8 20 60 00 mv r12,r1
}
if ( the_object ) {
80040e0: 44 2e 00 10 be r1,r14,8004120 <_Objects_Allocate+0x9c>
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
80040e4: 2d 82 00 0a lhu r2,(r12+10)
80040e8: 2d 61 00 0a lhu r1,(r11+10)
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
80040ec: c8 41 08 00 sub r1,r2,r1
80040f0: 2d 62 00 14 lhu r2,(r11+20)
80040f4: f8 00 32 bf calli 8010bf0 <__udivsi3>
information->inactive_per_block[ block ]--;
80040f8: 34 02 00 02 mvi r2,2
80040fc: f8 00 31 e3 calli 8010888 <__ashlsi3>
8004100: 29 62 00 30 lw r2,(r11+48)
8004104: b4 41 08 00 add r1,r2,r1
8004108: 28 22 00 00 lw r2,(r1+0)
800410c: 34 42 ff ff addi r2,r2,-1
8004110: 58 22 00 00 sw (r1+0),r2
information->inactive--;
8004114: 2d 61 00 2c lhu r1,(r11+44)
8004118: 34 21 ff ff addi r1,r1,-1
800411c: 0d 61 00 2c sh (r11+44),r1
);
}
#endif
return the_object;
}
8004120: b9 80 08 00 mv r1,r12
8004124: 2b 9d 00 04 lw ra,(sp+4)
8004128: 2b 8b 00 14 lw r11,(sp+20)
800412c: 2b 8c 00 10 lw r12,(sp+16)
8004130: 2b 8d 00 0c lw r13,(sp+12)
8004134: 2b 8e 00 08 lw r14,(sp+8)
8004138: 37 9c 00 14 addi sp,sp,20
800413c: c3 a0 00 00 ret
08004560 <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint16_t the_class
)
{
8004560: 37 9c ff ec addi sp,sp,-20
8004564: 5b 8b 00 14 sw (sp+20),r11
8004568: 5b 8c 00 10 sw (sp+16),r12
800456c: 5b 8d 00 0c sw (sp+12),r13
8004570: 5b 8e 00 08 sw (sp+8),r14
8004574: 5b 9d 00 04 sw (sp+4),ra
8004578: 20 4c ff ff andi r12,r2,0xffff
800457c: b8 20 70 00 mv r14,r1
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
return NULL;
8004580: 34 0b 00 00 mvi r11,0
)
{
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
8004584: 45 80 00 16 be r12,r0,80045dc <_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 );
8004588: f8 00 13 bf calli 8009484 <_Objects_API_maximum_class>
if ( the_class_api_maximum == 0 )
800458c: 44 20 00 14 be r1,r0,80045dc <_Objects_Get_information+0x7c>
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
8004590: 55 81 00 13 bgu r12,r1,80045dc <_Objects_Get_information+0x7c>
return NULL;
if ( !_Objects_Information_table[ the_api ] )
8004594: 78 0d 08 01 mvhi r13,0x801
8004598: b9 c0 08 00 mv r1,r14
800459c: 34 02 00 02 mvi r2,2
80045a0: 39 ad 38 24 ori r13,r13,0x3824
80045a4: f8 00 30 b9 calli 8010888 <__ashlsi3>
80045a8: b5 a1 08 00 add r1,r13,r1
80045ac: 28 2d 00 00 lw r13,(r1+0)
80045b0: 45 a0 00 0b be r13,r0,80045dc <_Objects_Get_information+0x7c><== NEVER TAKEN
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
80045b4: b9 80 08 00 mv r1,r12
80045b8: 34 02 00 02 mvi r2,2
80045bc: f8 00 30 b3 calli 8010888 <__ashlsi3>
80045c0: b5 a1 08 00 add r1,r13,r1
80045c4: 28 2b 00 00 lw r11,(r1+0)
if ( !info )
80045c8: 45 60 00 05 be r11,r0,80045dc <_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 )
80045cc: 2d 61 00 10 lhu r1,(r11+16)
return NULL;
80045d0: 7c 21 00 00 cmpnei r1,r1,0
80045d4: c8 01 08 00 sub r1,r0,r1
80045d8: a1 61 58 00 and r11,r11,r1
#endif
return info;
}
80045dc: b9 60 08 00 mv r1,r11
80045e0: 2b 9d 00 04 lw ra,(sp+4)
80045e4: 2b 8b 00 14 lw r11,(sp+20)
80045e8: 2b 8c 00 10 lw r12,(sp+16)
80045ec: 2b 8d 00 0c lw r13,(sp+12)
80045f0: 2b 8e 00 08 lw r14,(sp+8)
80045f4: 37 9c 00 14 addi sp,sp,20
80045f8: c3 a0 00 00 ret
08017814 <_Objects_Get_no_protection>:
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
8017814: 37 9c ff f4 addi sp,sp,-12
8017818: 5b 8b 00 0c sw (sp+12),r11
801781c: 5b 8c 00 08 sw (sp+8),r12
8017820: 5b 9d 00 04 sw (sp+4),ra
8017824: 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;
8017828: 28 21 00 08 lw r1,(r1+8)
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
801782c: 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;
8017830: c8 41 08 00 sub r1,r2,r1
if ( information->maximum >= index ) {
8017834: 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;
8017838: 34 21 00 01 addi r1,r1,1
if ( information->maximum >= index ) {
801783c: 54 22 00 09 bgu r1,r2,8017860 <_Objects_Get_no_protection+0x4c>
if ( (the_object = information->local_table[ index ]) != NULL ) {
8017840: 28 8c 00 1c lw r12,(r4+28)
8017844: 34 02 00 02 mvi r2,2
8017848: fb ff d9 ab calli 800def4 <__ashlsi3>
801784c: b5 81 08 00 add r1,r12,r1
8017850: 28 21 00 00 lw r1,(r1+0)
8017854: 44 20 00 03 be r1,r0,8017860 <_Objects_Get_no_protection+0x4c><== NEVER TAKEN
*location = OBJECTS_LOCAL;
8017858: 59 60 00 00 sw (r11+0),r0
return the_object;
801785c: e0 00 00 04 bi 801786c <_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;
8017860: 34 01 00 01 mvi r1,1
8017864: 59 61 00 00 sw (r11+0),r1
return NULL;
8017868: 34 01 00 00 mvi r1,0
}
801786c: 2b 9d 00 04 lw ra,(sp+4)
8017870: 2b 8b 00 0c lw r11,(sp+12)
8017874: 2b 8c 00 08 lw r12,(sp+8)
8017878: 37 9c 00 0c addi sp,sp,12
801787c: c3 a0 00 00 ret
08006220 <_Objects_Id_to_name>:
*/
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
8006220: 37 9c ff e8 addi sp,sp,-24
8006224: 5b 8b 00 14 sw (sp+20),r11
8006228: 5b 8c 00 10 sw (sp+16),r12
800622c: 5b 8d 00 0c sw (sp+12),r13
8006230: 5b 8e 00 08 sw (sp+8),r14
8006234: 5b 9d 00 04 sw (sp+4),ra
8006238: b8 40 70 00 mv r14,r2
/*
* Caller is trusted for name != NULL.
*/
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
800623c: b8 20 58 00 mv r11,r1
8006240: 5c 20 00 05 bne r1,r0,8006254 <_Objects_Id_to_name+0x34>
8006244: 78 01 08 01 mvhi r1,0x801
8006248: 38 21 fa 88 ori r1,r1,0xfa88
800624c: 28 21 00 0c lw r1,(r1+12)
8006250: 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);
8006254: 34 02 00 18 mvi r2,24
8006258: b9 60 08 00 mv r1,r11
800625c: f8 00 53 f9 calli 801b240 <__lshrsi3>
8006260: 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 )
8006264: 34 23 ff ff addi r3,r1,-1
8006268: 34 02 00 02 mvi r2,2
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
800626c: 34 0d 00 03 mvi r13,3
8006270: 54 62 00 12 bgu r3,r2,80062b8 <_Objects_Id_to_name+0x98>
8006274: e0 00 00 19 bi 80062d8 <_Objects_Id_to_name+0xb8>
*/
RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
Objects_Id id
)
{
return (uint32_t)
8006278: 34 02 00 1b mvi r2,27
800627c: b9 60 08 00 mv r1,r11
8006280: f8 00 53 f0 calli 801b240 <__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 ];
8006284: 34 02 00 02 mvi r2,2
8006288: fb ff ec ed calli 800163c <__ashlsi3>
800628c: b5 81 08 00 add r1,r12,r1
8006290: 28 21 00 00 lw r1,(r1+0)
if ( !information )
8006294: 44 20 00 09 be r1,r0,80062b8 <_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 );
8006298: b9 60 10 00 mv r2,r11
800629c: 37 83 00 18 addi r3,sp,24
80062a0: fb ff ff ba calli 8006188 <_Objects_Get>
if ( !the_object )
80062a4: 44 20 00 05 be r1,r0,80062b8 <_Objects_Id_to_name+0x98>
return OBJECTS_INVALID_ID;
*name = the_object->name;
80062a8: 28 21 00 0c lw r1,(r1+12)
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
80062ac: 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;
80062b0: 59 c1 00 00 sw (r14+0),r1
_Thread_Enable_dispatch();
80062b4: f8 00 03 d5 calli 8007208 <_Thread_Enable_dispatch>
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
}
80062b8: b9 a0 08 00 mv r1,r13
80062bc: 2b 9d 00 04 lw ra,(sp+4)
80062c0: 2b 8b 00 14 lw r11,(sp+20)
80062c4: 2b 8c 00 10 lw r12,(sp+16)
80062c8: 2b 8d 00 0c lw r13,(sp+12)
80062cc: 2b 8e 00 08 lw r14,(sp+8)
80062d0: 37 9c 00 18 addi sp,sp,24
80062d4: 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 ] )
80062d8: 78 0c 08 01 mvhi r12,0x801
80062dc: 34 02 00 02 mvi r2,2
80062e0: 39 8c f8 84 ori r12,r12,0xf884
80062e4: fb ff ec d6 calli 800163c <__ashlsi3>
80062e8: b5 81 08 00 add r1,r12,r1
80062ec: 28 2c 00 00 lw r12,(r1+0)
80062f0: 5d 80 ff e2 bne r12,r0,8006278 <_Objects_Id_to_name+0x58>
80062f4: e3 ff ff f1 bi 80062b8 <_Objects_Id_to_name+0x98>
0800473c <_Objects_Initialize_information>:
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
800473c: 37 9c ff e4 addi sp,sp,-28
8004740: 5b 8b 00 1c sw (sp+28),r11
8004744: 5b 8c 00 18 sw (sp+24),r12
8004748: 5b 8d 00 14 sw (sp+20),r13
800474c: 5b 8e 00 10 sw (sp+16),r14
8004750: 5b 8f 00 0c sw (sp+12),r15
8004754: 5b 90 00 08 sw (sp+8),r16
8004758: 5b 9d 00 04 sw (sp+4),ra
800475c: 20 6d ff ff andi r13,r3,0xffff
8004760: b8 20 58 00 mv r11,r1
8004764: 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;
8004768: 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;
800476c: 59 62 00 00 sw (r11+0),r2
information->the_class = the_class;
8004770: 0c 2d 00 04 sh (r1+4),r13
information->size = size;
information->local_table = 0;
8004774: 58 20 00 1c sw (r1+28),r0
information->inactive_per_block = 0;
8004778: 58 20 00 30 sw (r1+48),r0
information->object_blocks = 0;
800477c: 58 20 00 34 sw (r1+52),r0
information->inactive = 0;
8004780: 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;
8004784: 0c 20 00 10 sh (r1+16),r0
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8004788: 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;
800478c: b8 40 08 00 mv r1,r2
8004790: 78 0f 08 01 mvhi r15,0x801
8004794: 34 02 00 02 mvi r2,2
,
bool supports_global,
Objects_Thread_queue_Extract_callout extract
#endif
)
{
8004798: b8 80 60 00 mv r12,r4
800479c: 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;
80047a0: 39 ef 38 24 ori r15,r15,0x3824
80047a4: f8 00 30 39 calli 8010888 <__ashlsi3>
80047a8: b5 e1 08 00 add r1,r15,r1
80047ac: 28 2f 00 00 lw r15,(r1+0)
80047b0: 34 02 00 02 mvi r2,2
80047b4: b9 a0 08 00 mv r1,r13
80047b8: f8 00 30 34 calli 8010888 <__ashlsi3>
80047bc: b5 e1 08 00 add r1,r15,r1
80047c0: 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;
80047c4: 34 02 00 1f mvi r2,31
80047c8: b9 80 08 00 mv r1,r12
80047cc: f8 00 30 7d calli 80109c0 <__lshrsi3>
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
80047d0: 78 03 08 01 mvhi r3,0x801
80047d4: 38 63 1d e8 ori r3,r3,0x1de8
/*
* Are we operating in limited or unlimited (e.g. auto-extend) mode.
*/
information->auto_extend =
(maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false;
80047d8: 20 22 00 ff andi r2,r1,0xff
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
80047dc: 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 =
80047e0: 31 62 00 12 sb (r11+18),r2
(maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false;
maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
80047e4: a1 81 60 00 and r12,r12,r1
/*
* Unlimited and maximum of zero is illogical.
*/
if ( information->auto_extend && maximum_per_allocation == 0) {
80047e8: 44 40 00 06 be r2,r0,8004800 <_Objects_Initialize_information+0xc4>
80047ec: 5d 80 00 05 bne r12,r0,8004800 <_Objects_Initialize_information+0xc4><== ALWAYS TAKEN
_Internal_error_Occurred(
80047f0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
80047f4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
80047f8: 34 03 00 13 mvi r3,19 <== NOT EXECUTED
80047fc: fb ff fd f1 calli 8003fc0 <_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;
8004800: 78 01 08 01 mvhi r1,0x801
8004804: 38 21 36 98 ori r1,r1,0x3698
8004808: 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) |
800480c: 34 02 00 18 mvi r2,24
8004810: b9 c0 08 00 mv r1,r14
}
/*
* The allocation unit is the maximum value
*/
information->allocation_size = maximum_per_allocation;
8004814: 0d 6c 00 14 sh (r11+20),r12
8004818: f8 00 30 1c calli 8010888 <__ashlsi3>
800481c: 78 0e 00 01 mvhi r14,0x1
8004820: b8 2e 70 00 or r14,r1,r14
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
8004824: 34 02 00 1b mvi r2,27
8004828: b9 a0 08 00 mv r1,r13
800482c: f8 00 30 17 calli 8010888 <__ashlsi3>
information->local_table = &null_local_table;
/*
* Calculate minimum and maximum Id's
*/
minimum_index = (maximum_per_allocation == 0) ? 0 : 1;
8004830: 7d 82 00 00 cmpnei r2,r12,0
8004834: 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) |
8004838: b8 22 08 00 or r1,r1,r2
information->minimum_id =
800483c: 59 61 00 08 sw (r11+8),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 );
8004840: 35 61 00 24 addi r1,r11,36
head->next = tail;
8004844: 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 );
8004848: 35 61 00 20 addi r1,r11,32
if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) )
name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
~(OBJECTS_NAME_ALIGNMENT-1);
#endif
information->name_length = name_length;
800484c: 0d 70 00 38 sh (r11+56),r16
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
8004850: 59 60 00 24 sw (r11+36),r0
tail->previous = head;
8004854: 59 61 00 28 sw (r11+40),r1
_Chain_Initialize_empty( &information->Inactive );
/*
* Initialize objects .. if there are any
*/
if ( maximum_per_allocation ) {
8004858: 45 80 00 03 be r12,r0,8004864 <_Objects_Initialize_information+0x128>
/*
* 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 );
800485c: b9 60 08 00 mv r1,r11
8004860: fb ff fe 38 calli 8004140 <_Objects_Extend_information>
_Chain_Initialize_empty( &information->global_table[ index ] );
}
else
information->global_table = NULL;
#endif
}
8004864: 2b 9d 00 04 lw ra,(sp+4)
8004868: 2b 8b 00 1c lw r11,(sp+28)
800486c: 2b 8c 00 18 lw r12,(sp+24)
8004870: 2b 8d 00 14 lw r13,(sp+20)
8004874: 2b 8e 00 10 lw r14,(sp+16)
8004878: 2b 8f 00 0c lw r15,(sp+12)
800487c: 2b 90 00 08 lw r16,(sp+8)
8004880: 37 9c 00 1c addi sp,sp,28
8004884: c3 a0 00 00 ret
08002e68 <_RTEMS_tasks_Initialize_user_tasks_body>:
*
* Output parameters: NONE
*/
void _RTEMS_tasks_Initialize_user_tasks_body( void )
{
8002e68: 37 9c ff e8 addi sp,sp,-24
8002e6c: 5b 8b 00 14 sw (sp+20),r11
8002e70: 5b 8c 00 10 sw (sp+16),r12
8002e74: 5b 8d 00 0c sw (sp+12),r13
8002e78: 5b 8e 00 08 sw (sp+8),r14
8002e7c: 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;
8002e80: 78 01 08 01 mvhi r1,0x801
8002e84: 38 21 30 bc ori r1,r1,0x30bc
8002e88: 28 2b 00 2c lw r11,(r1+44)
maximum = Configuration_RTEMS_API.number_of_initialization_tasks;
8002e8c: 28 2e 00 28 lw r14,(r1+40)
/*
* Verify that we have a set of user tasks to iterate
*/
if ( !user_tasks )
8002e90: 34 0d 00 00 mvi r13,0
8002e94: 5d 60 00 1a bne r11,r0,8002efc <_RTEMS_tasks_Initialize_user_tasks_body+0x94>
8002e98: e0 00 00 1a bi 8002f00 <_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(
8002e9c: 29 61 00 00 lw r1,(r11+0)
8002ea0: 29 62 00 08 lw r2,(r11+8)
8002ea4: 29 63 00 04 lw r3,(r11+4)
8002ea8: 29 64 00 14 lw r4,(r11+20)
8002eac: 29 65 00 0c lw r5,(r11+12)
8002eb0: 37 86 00 18 addi r6,sp,24
8002eb4: fb ff ff 53 calli 8002c00 <rtems_task_create>
8002eb8: 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 ) )
8002ebc: 44 20 00 05 be r1,r0,8002ed0 <_RTEMS_tasks_Initialize_user_tasks_body+0x68><== 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: b9 80 18 00 mv r3,r12 <== NOT EXECUTED
8002ecc: e0 00 00 0a bi 8002ef4 <_RTEMS_tasks_Initialize_user_tasks_body+0x8c><== NOT EXECUTED
return_value = rtems_task_start(
8002ed0: 29 63 00 18 lw r3,(r11+24)
8002ed4: 29 62 00 10 lw r2,(r11+16)
8002ed8: 2b 81 00 18 lw r1,(sp+24)
8002edc: 35 6b 00 1c addi r11,r11,28
8002ee0: f8 00 00 0f calli 8002f1c <rtems_task_start>
8002ee4: b8 20 18 00 mv r3,r1
id,
user_tasks[ index ].entry_point,
user_tasks[ index ].argument
);
if ( !rtems_is_status_successful( return_value ) )
8002ee8: 44 2c 00 04 be r1,r12,8002ef8 <_RTEMS_tasks_Initialize_user_tasks_body+0x90><== ALWAYS TAKEN
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
8002eec: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8002ef0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8002ef4: f8 00 04 33 calli 8003fc0 <_Internal_error_Occurred> <== NOT EXECUTED
return;
/*
* Now iterate over the initialization tasks and create/start them.
*/
for ( index=0 ; index < maximum ; index++ ) {
8002ef8: 35 ad 00 01 addi r13,r13,1
8002efc: 55 cd ff e8 bgu r14,r13,8002e9c <_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 );
}
}
8002f00: 2b 9d 00 04 lw ra,(sp+4)
8002f04: 2b 8b 00 14 lw r11,(sp+20)
8002f08: 2b 8c 00 10 lw r12,(sp+16)
8002f0c: 2b 8d 00 0c lw r13,(sp+12)
8002f10: 2b 8e 00 08 lw r14,(sp+8)
8002f14: 37 9c 00 18 addi sp,sp,24
8002f18: c3 a0 00 00 ret
08008b34 <_RTEMS_tasks_Post_switch_extension>:
*/
void _RTEMS_tasks_Post_switch_extension(
Thread_Control *executing
)
{
8008b34: 37 9c ff f0 addi sp,sp,-16
8008b38: 5b 8b 00 0c sw (sp+12),r11
8008b3c: 5b 8c 00 08 sw (sp+8),r12
8008b40: 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 ];
8008b44: 28 2b 01 18 lw r11,(r1+280)
if ( !api )
8008b48: 45 60 00 1a be r11,r0,8008bb0 <_RTEMS_tasks_Post_switch_extension+0x7c><== NEVER TAKEN
* Signal Processing
*/
asr = &api->Signal;
_ISR_Disable( level );
8008b4c: 90 00 08 00 rcsr r1,IE
8008b50: 34 02 ff fe mvi r2,-2
8008b54: a0 22 10 00 and r2,r1,r2
8008b58: d0 02 00 00 wcsr IE,r2
signal_set = asr->signals_posted;
8008b5c: 29 6c 00 14 lw r12,(r11+20)
asr->signals_posted = 0;
8008b60: 59 60 00 14 sw (r11+20),r0
_ISR_Enable( level );
8008b64: d0 01 00 00 wcsr IE,r1
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
8008b68: 45 80 00 12 be r12,r0,8008bb0 <_RTEMS_tasks_Post_switch_extension+0x7c>
return;
asr->nest_level += 1;
8008b6c: 29 61 00 1c lw r1,(r11+28)
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
8008b70: 37 83 00 10 addi r3,sp,16
8008b74: 38 02 ff ff mvu r2,0xffff
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
return;
asr->nest_level += 1;
8008b78: 34 21 00 01 addi r1,r1,1
8008b7c: 59 61 00 1c sw (r11+28),r1
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
8008b80: 29 61 00 10 lw r1,(r11+16)
8008b84: f8 00 08 79 calli 800ad68 <rtems_task_mode>
(*asr->handler)( signal_set );
8008b88: 29 62 00 0c lw r2,(r11+12)
8008b8c: b9 80 08 00 mv r1,r12
8008b90: d8 40 00 00 call r2
asr->nest_level -= 1;
8008b94: 29 61 00 1c lw r1,(r11+28)
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
8008b98: 38 02 ff ff mvu r2,0xffff
8008b9c: 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;
8008ba0: 34 21 ff ff addi r1,r1,-1
8008ba4: 59 61 00 1c sw (r11+28),r1
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
8008ba8: 2b 81 00 10 lw r1,(sp+16)
8008bac: f8 00 08 6f calli 800ad68 <rtems_task_mode>
}
8008bb0: 2b 9d 00 04 lw ra,(sp+4)
8008bb4: 2b 8b 00 0c lw r11,(sp+12)
8008bb8: 2b 8c 00 08 lw r12,(sp+8)
8008bbc: 37 9c 00 10 addi sp,sp,16
8008bc0: c3 a0 00 00 ret
08004634 <_Rate_monotonic_Timeout>:
void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
)
{
8004634: 37 9c ff f4 addi sp,sp,-12
8004638: 5b 8b 00 08 sw (sp+8),r11
800463c: 5b 9d 00 04 sw (sp+4),ra
8004640: b8 20 10 00 mv r2,r1
8004644: 78 01 08 01 mvhi r1,0x801
8004648: 38 21 f8 78 ori r1,r1,0xf878
800464c: 37 83 00 0c addi r3,sp,12
8004650: f8 00 08 be calli 8006948 <_Objects_Get>
/*
* When we get here, the Timer is already off the chain so we do not
* have to worry about that -- hence no _Watchdog_Remove().
*/
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
8004654: 2b 82 00 0c lw r2,(sp+12)
8004658: b8 20 58 00 mv r11,r1
800465c: 5c 40 00 22 bne r2,r0,80046e4 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN
case OBJECTS_LOCAL:
the_thread = the_period->owner;
8004660: 28 21 00 40 lw r1,(r1+64)
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period (
States_Control the_states
)
{
return (the_states & STATES_WAITING_FOR_PERIOD);
8004664: 28 23 00 10 lw r3,(r1+16)
8004668: 20 63 40 00 andi r3,r3,0x4000
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
800466c: 44 62 00 09 be r3,r2,8004690 <_Rate_monotonic_Timeout+0x5c>
8004670: 28 23 00 20 lw r3,(r1+32)
8004674: 29 62 00 08 lw r2,(r11+8)
8004678: 5c 62 00 06 bne r3,r2,8004690 <_Rate_monotonic_Timeout+0x5c>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800467c: 78 03 08 01 mvhi r3,0x801
8004680: 38 63 d2 24 ori r3,r3,0xd224
8004684: 28 62 00 00 lw r2,(r3+0)
8004688: f8 00 0b b7 calli 8007564 <_Thread_Clear_state>
800468c: e0 00 00 06 bi 80046a4 <_Rate_monotonic_Timeout+0x70>
_Thread_Unblock( the_thread );
_Rate_monotonic_Initiate_statistics( the_period );
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) {
8004690: 29 62 00 38 lw r2,(r11+56)
8004694: 34 01 00 01 mvi r1,1
8004698: 5c 41 00 0c bne r2,r1,80046c8 <_Rate_monotonic_Timeout+0x94>
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
800469c: 34 01 00 03 mvi r1,3
80046a0: 59 61 00 38 sw (r11+56),r1
_Rate_monotonic_Initiate_statistics( the_period );
80046a4: b9 60 08 00 mv r1,r11
80046a8: fb ff fe 2e calli 8003f60 <_Rate_monotonic_Initiate_statistics>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80046ac: 29 61 00 3c lw r1,(r11+60)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80046b0: 35 62 00 10 addi r2,r11,16
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80046b4: 59 61 00 1c sw (r11+28),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80046b8: 78 01 08 01 mvhi r1,0x801
80046bc: 38 21 fa 60 ori r1,r1,0xfa60
80046c0: f8 00 10 f6 calli 8008a98 <_Watchdog_Insert>
80046c4: e0 00 00 03 bi 80046d0 <_Rate_monotonic_Timeout+0x9c>
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
80046c8: 34 01 00 04 mvi r1,4
80046cc: 59 61 00 38 sw (r11+56),r1
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
80046d0: 78 01 08 01 mvhi r1,0x801
80046d4: 38 21 f9 a0 ori r1,r1,0xf9a0
80046d8: 28 22 00 00 lw r2,(r1+0)
80046dc: 34 42 ff ff addi r2,r2,-1
80046e0: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
80046e4: 2b 9d 00 04 lw ra,(sp+4)
80046e8: 2b 8b 00 08 lw r11,(sp+8)
80046ec: 37 9c 00 0c addi sp,sp,12
80046f0: c3 a0 00 00 ret
08003ff4 <_Rate_monotonic_Update_statistics>:
void _Rate_monotonic_Update_statistics(
Rate_monotonic_Control *the_period
)
{
8003ff4: 37 9c ff e4 addi sp,sp,-28
8003ff8: 5b 8b 00 0c sw (sp+12),r11
8003ffc: 5b 8c 00 08 sw (sp+8),r12
8004000: 5b 9d 00 04 sw (sp+4),ra
8004004: b8 20 58 00 mv r11,r1
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8004008: 28 21 00 54 lw r1,(r1+84)
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
800400c: 29 62 00 38 lw r2,(r11+56)
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8004010: 34 21 00 01 addi r1,r1,1
8004014: 59 61 00 54 sw (r11+84),r1
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
8004018: 34 01 00 04 mvi r1,4
800401c: 5c 41 00 04 bne r2,r1,800402c <_Rate_monotonic_Update_statistics+0x38>
stats->missed_count++;
8004020: 29 61 00 58 lw r1,(r11+88)
8004024: 34 21 00 01 addi r1,r1,1
8004028: 59 61 00 58 sw (r11+88),r1
/*
* Grab status for time statistics.
*/
valid_status =
_Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
800402c: 37 8c 00 18 addi r12,sp,24
stats->missed_count++;
/*
* Grab status for time statistics.
*/
valid_status =
8004030: b9 60 08 00 mv r1,r11
8004034: 37 82 00 10 addi r2,sp,16
8004038: b9 80 18 00 mv r3,r12
800403c: fb ff ff 90 calli 8003e7c <_Rate_monotonic_Get_status>
_Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
if (!valid_status)
8004040: 44 20 00 28 be r1,r0,80040e0 <_Rate_monotonic_Update_statistics+0xec><== NEVER TAKEN
/*
* Update CPU time
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Add_to( &stats->total_cpu_time, &executed );
8004044: b9 80 10 00 mv r2,r12
8004048: 35 61 00 6c addi r1,r11,108
800404c: f8 00 11 30 calli 800850c <_Timespec_Add_to>
if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) )
8004050: b9 80 08 00 mv r1,r12
8004054: 35 62 00 5c addi r2,r11,92
8004058: f8 00 11 8b calli 8008684 <_Timespec_Less_than>
800405c: 44 20 00 05 be r1,r0,8004070 <_Rate_monotonic_Update_statistics+0x7c>
stats->min_cpu_time = executed;
8004060: 2b 81 00 18 lw r1,(sp+24)
8004064: 59 61 00 5c sw (r11+92),r1
8004068: 2b 81 00 1c lw r1,(sp+28)
800406c: 59 61 00 60 sw (r11+96),r1
if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
8004070: 37 81 00 18 addi r1,sp,24
8004074: 35 62 00 64 addi r2,r11,100
8004078: f8 00 11 78 calli 8008658 <_Timespec_Greater_than>
800407c: 44 20 00 05 be r1,r0,8004090 <_Rate_monotonic_Update_statistics+0x9c>
stats->max_cpu_time = executed;
8004080: 2b 81 00 18 lw r1,(sp+24)
8004084: 59 61 00 64 sw (r11+100),r1
8004088: 2b 81 00 1c lw r1,(sp+28)
800408c: 59 61 00 68 sw (r11+104),r1
/*
* Update Wall time
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Add_to( &stats->total_wall_time, &since_last_period );
8004090: 37 8c 00 10 addi r12,sp,16
8004094: b9 80 10 00 mv r2,r12
8004098: 35 61 00 84 addi r1,r11,132
800409c: f8 00 11 1c calli 800850c <_Timespec_Add_to>
if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
80040a0: b9 80 08 00 mv r1,r12
80040a4: 35 62 00 74 addi r2,r11,116
80040a8: f8 00 11 77 calli 8008684 <_Timespec_Less_than>
80040ac: 44 20 00 05 be r1,r0,80040c0 <_Rate_monotonic_Update_statistics+0xcc>
stats->min_wall_time = since_last_period;
80040b0: 2b 81 00 10 lw r1,(sp+16)
80040b4: 59 61 00 74 sw (r11+116),r1
80040b8: 2b 81 00 14 lw r1,(sp+20)
80040bc: 59 61 00 78 sw (r11+120),r1
if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
80040c0: 37 81 00 10 addi r1,sp,16
80040c4: 35 62 00 7c addi r2,r11,124
80040c8: f8 00 11 64 calli 8008658 <_Timespec_Greater_than>
80040cc: 44 20 00 05 be r1,r0,80040e0 <_Rate_monotonic_Update_statistics+0xec>
stats->max_wall_time = since_last_period;
80040d0: 2b 81 00 10 lw r1,(sp+16)
80040d4: 59 61 00 7c sw (r11+124),r1
80040d8: 2b 81 00 14 lw r1,(sp+20)
80040dc: 59 61 00 80 sw (r11+128),r1
stats->min_wall_time = since_last_period;
if ( since_last_period > stats->max_wall_time )
stats->max_wall_time = since_last_period;
#endif
}
80040e0: 2b 9d 00 04 lw ra,(sp+4)
80040e4: 2b 8b 00 0c lw r11,(sp+12)
80040e8: 2b 8c 00 08 lw r12,(sp+8)
80040ec: 37 9c 00 1c addi sp,sp,28
80040f0: c3 a0 00 00 ret
08004b0c <_Scheduler_priority_Block>:
#include <rtems/score/thread.h>
void _Scheduler_priority_Block(
Thread_Control *the_thread
)
{
8004b0c: 37 9c ff ec addi sp,sp,-20
8004b10: 5b 8b 00 14 sw (sp+20),r11
8004b14: 5b 8c 00 10 sw (sp+16),r12
8004b18: 5b 8d 00 0c sw (sp+12),r13
8004b1c: 5b 8e 00 08 sw (sp+8),r14
8004b20: 5b 9d 00 04 sw (sp+4),ra
8004b24: b8 20 60 00 mv r12,r1
)
{
Scheduler_priority_Per_thread *sched_info;
Chain_Control *ready;
sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info;
8004b28: 28 21 00 8c lw r1,(r1+140)
ready = sched_info->ready_chain;
8004b2c: 28 22 00 00 lw r2,(r1+0)
if ( _Chain_Has_only_one_node( ready ) ) {
8004b30: 28 44 00 00 lw r4,(r2+0)
8004b34: 28 43 00 08 lw r3,(r2+8)
8004b38: 5c 83 00 12 bne r4,r3,8004b80 <_Scheduler_priority_Block+0x74>
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
8004b3c: 34 43 00 04 addi r3,r2,4
head->next = tail;
8004b40: 58 43 00 00 sw (r2+0),r3
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove (
Priority_bit_map_Information *the_priority_map
)
{
*the_priority_map->minor &= the_priority_map->block_minor;
8004b44: 28 23 00 04 lw r3,(r1+4)
head->previous = NULL;
8004b48: 58 40 00 04 sw (r2+4),r0
tail->previous = head;
8004b4c: 58 42 00 08 sw (r2+8),r2
8004b50: 2c 24 00 0e lhu r4,(r1+14)
8004b54: 2c 62 00 00 lhu r2,(r3+0)
8004b58: a0 44 10 00 and r2,r2,r4
8004b5c: 0c 62 00 00 sh (r3+0),r2
if ( *the_priority_map->minor == 0 )
8004b60: 5c 40 00 0c bne r2,r0,8004b90 <_Scheduler_priority_Block+0x84>
_Priority_Major_bit_map &= the_priority_map->block_major;
8004b64: 78 02 08 01 mvhi r2,0x801
8004b68: 38 42 3a 48 ori r2,r2,0x3a48
8004b6c: 2c 43 00 00 lhu r3,(r2+0)
8004b70: 2c 21 00 0c lhu r1,(r1+12)
8004b74: a0 23 08 00 and r1,r1,r3
8004b78: 0c 41 00 00 sh (r2+0),r1
8004b7c: e0 00 00 05 bi 8004b90 <_Scheduler_priority_Block+0x84>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
8004b80: 29 82 00 00 lw r2,(r12+0)
previous = the_node->previous;
8004b84: 29 81 00 04 lw r1,(r12+4)
next->previous = previous;
8004b88: 58 41 00 04 sw (r2+4),r1
previous->next = next;
8004b8c: 58 22 00 00 sw (r1+0),r2
RTEMS_INLINE_ROUTINE bool _Thread_Is_heir (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Heir );
8004b90: 78 01 08 01 mvhi r1,0x801
8004b94: 38 21 3a 28 ori r1,r1,0x3a28
_Scheduler_priority_Ready_queue_extract( the_thread );
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
8004b98: 28 21 00 10 lw r1,(r1+16)
8004b9c: 5d 81 00 3b bne r12,r1,8004c88 <_Scheduler_priority_Block+0x17c>
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
(Chain_Control *) _Scheduler.information
8004ba0: 78 01 08 01 mvhi r1,0x801
RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void )
{
Priority_bit_map_Control minor;
Priority_bit_map_Control major;
_Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
8004ba4: 78 02 08 01 mvhi r2,0x801
8004ba8: 38 21 30 1c ori r1,r1,0x301c
8004bac: 38 42 3a 48 ori r2,r2,0x3a48
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8004bb0: 28 2e 00 00 lw r14,(r1+0)
8004bb4: 2c 41 00 00 lhu r1,(r2+0)
8004bb8: 78 0b 08 01 mvhi r11,0x801
8004bbc: 34 02 00 ff mvi r2,255
8004bc0: 20 21 ff ff andi r1,r1,0xffff
8004bc4: 39 6b 1c 84 ori r11,r11,0x1c84
8004bc8: 54 22 00 05 bgu r1,r2,8004bdc <_Scheduler_priority_Block+0xd0>
8004bcc: b5 61 58 00 add r11,r11,r1
8004bd0: 41 6d 00 00 lbu r13,(r11+0)
8004bd4: 35 ad 00 08 addi r13,r13,8
8004bd8: e0 00 00 05 bi 8004bec <_Scheduler_priority_Block+0xe0>
8004bdc: 34 02 00 08 mvi r2,8
8004be0: f8 00 2f 78 calli 80109c0 <__lshrsi3>
8004be4: b5 61 58 00 add r11,r11,r1
8004be8: 41 6d 00 00 lbu r13,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
8004bec: 34 02 00 01 mvi r2,1
8004bf0: 78 0b 08 01 mvhi r11,0x801
8004bf4: b9 a0 08 00 mv r1,r13
8004bf8: f8 00 2f 24 calli 8010888 <__ashlsi3>
8004bfc: 39 6b 3a 50 ori r11,r11,0x3a50
8004c00: b5 61 58 00 add r11,r11,r1
8004c04: 2d 62 00 00 lhu r2,(r11+0)
8004c08: 34 01 00 ff mvi r1,255
8004c0c: 78 0b 08 01 mvhi r11,0x801
8004c10: 39 6b 1c 84 ori r11,r11,0x1c84
8004c14: 54 41 00 05 bgu r2,r1,8004c28 <_Scheduler_priority_Block+0x11c>
8004c18: b5 62 58 00 add r11,r11,r2
8004c1c: 41 6b 00 00 lbu r11,(r11+0)
8004c20: 35 6b 00 08 addi r11,r11,8
8004c24: e0 00 00 06 bi 8004c3c <_Scheduler_priority_Block+0x130>
8004c28: b8 40 08 00 mv r1,r2
8004c2c: 34 02 00 08 mvi r2,8
8004c30: f8 00 2f 64 calli 80109c0 <__lshrsi3>
8004c34: b5 61 58 00 add r11,r11,r1
8004c38: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
8004c3c: 34 02 00 04 mvi r2,4
8004c40: b9 a0 08 00 mv r1,r13
8004c44: f8 00 2f 11 calli 8010888 <__ashlsi3>
8004c48: 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 ] ) )
8004c4c: 34 02 00 01 mvi r2,1
8004c50: b9 60 08 00 mv r1,r11
8004c54: f8 00 2f 0d calli 8010888 <__ashlsi3>
8004c58: 34 02 00 02 mvi r2,2
8004c5c: b4 2b 08 00 add r1,r1,r11
8004c60: f8 00 2f 0a calli 8010888 <__ashlsi3>
8004c64: b5 c1 08 00 add r1,r14,r1
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
8004c68: 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 );
8004c6c: 34 21 00 04 addi r1,r1,4
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
8004c70: 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 ] ) )
8004c74: 44 61 00 02 be r3,r1,8004c7c <_Scheduler_priority_Block+0x170><== NEVER TAKEN
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
8004c78: b8 60 10 00 mv r2,r3
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8004c7c: 78 01 08 01 mvhi r1,0x801
8004c80: 38 21 3a 28 ori r1,r1,0x3a28
8004c84: 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 );
8004c88: 78 01 08 01 mvhi r1,0x801
8004c8c: 38 21 3a 28 ori r1,r1,0x3a28
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
8004c90: 28 22 00 0c lw r2,(r1+12)
8004c94: 5d 82 00 03 bne r12,r2,8004ca0 <_Scheduler_priority_Block+0x194>
_Thread_Dispatch_necessary = true;
8004c98: 34 02 00 01 mvi r2,1
8004c9c: 30 22 00 18 sb (r1+24),r2
}
8004ca0: 2b 9d 00 04 lw ra,(sp+4)
8004ca4: 2b 8b 00 14 lw r11,(sp+20)
8004ca8: 2b 8c 00 10 lw r12,(sp+16)
8004cac: 2b 8d 00 0c lw r13,(sp+12)
8004cb0: 2b 8e 00 08 lw r14,(sp+8)
8004cb4: 37 9c 00 14 addi sp,sp,20
8004cb8: c3 a0 00 00 ret
08004e90 <_Scheduler_priority_Schedule>:
#include <rtems/system.h>
#include <rtems/score/scheduler.h>
#include <rtems/score/schedulerpriority.h>
void _Scheduler_priority_Schedule(void)
{
8004e90: 37 9c ff f0 addi sp,sp,-16
8004e94: 5b 8b 00 10 sw (sp+16),r11
8004e98: 5b 8c 00 0c sw (sp+12),r12
8004e9c: 5b 8d 00 08 sw (sp+8),r13
8004ea0: 5b 9d 00 04 sw (sp+4),ra
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
(Chain_Control *) _Scheduler.information
8004ea4: 78 01 08 01 mvhi r1,0x801
RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void )
{
Priority_bit_map_Control minor;
Priority_bit_map_Control major;
_Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
8004ea8: 78 02 08 01 mvhi r2,0x801
8004eac: 38 21 30 1c ori r1,r1,0x301c
8004eb0: 38 42 3a 48 ori r2,r2,0x3a48
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8004eb4: 28 2d 00 00 lw r13,(r1+0)
8004eb8: 2c 41 00 00 lhu r1,(r2+0)
8004ebc: 78 0b 08 01 mvhi r11,0x801
8004ec0: 34 02 00 ff mvi r2,255
8004ec4: 20 21 ff ff andi r1,r1,0xffff
8004ec8: 39 6b 1c 84 ori r11,r11,0x1c84
8004ecc: 54 22 00 05 bgu r1,r2,8004ee0 <_Scheduler_priority_Schedule+0x50>
8004ed0: b5 61 58 00 add r11,r11,r1
8004ed4: 41 6c 00 00 lbu r12,(r11+0)
8004ed8: 35 8c 00 08 addi r12,r12,8
8004edc: e0 00 00 05 bi 8004ef0 <_Scheduler_priority_Schedule+0x60>
8004ee0: 34 02 00 08 mvi r2,8
8004ee4: f8 00 2e b7 calli 80109c0 <__lshrsi3>
8004ee8: b5 61 58 00 add r11,r11,r1
8004eec: 41 6c 00 00 lbu r12,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
8004ef0: 34 02 00 01 mvi r2,1
8004ef4: 78 0b 08 01 mvhi r11,0x801
8004ef8: b9 80 08 00 mv r1,r12
8004efc: f8 00 2e 63 calli 8010888 <__ashlsi3>
8004f00: 39 6b 3a 50 ori r11,r11,0x3a50
8004f04: b5 61 58 00 add r11,r11,r1
8004f08: 2d 62 00 00 lhu r2,(r11+0)
8004f0c: 34 01 00 ff mvi r1,255
8004f10: 78 0b 08 01 mvhi r11,0x801
8004f14: 39 6b 1c 84 ori r11,r11,0x1c84
8004f18: 54 41 00 05 bgu r2,r1,8004f2c <_Scheduler_priority_Schedule+0x9c>
8004f1c: b5 62 58 00 add r11,r11,r2
8004f20: 41 6b 00 00 lbu r11,(r11+0)
8004f24: 35 6b 00 08 addi r11,r11,8
8004f28: e0 00 00 06 bi 8004f40 <_Scheduler_priority_Schedule+0xb0>
8004f2c: b8 40 08 00 mv r1,r2
8004f30: 34 02 00 08 mvi r2,8
8004f34: f8 00 2e a3 calli 80109c0 <__lshrsi3>
8004f38: b5 61 58 00 add r11,r11,r1
8004f3c: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
8004f40: 34 02 00 04 mvi r2,4
8004f44: b9 80 08 00 mv r1,r12
8004f48: f8 00 2e 50 calli 8010888 <__ashlsi3>
8004f4c: 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 ] ) )
8004f50: 34 02 00 01 mvi r2,1
8004f54: b9 60 08 00 mv r1,r11
8004f58: f8 00 2e 4c calli 8010888 <__ashlsi3>
8004f5c: 34 02 00 02 mvi r2,2
8004f60: b4 2b 08 00 add r1,r1,r11
8004f64: f8 00 2e 49 calli 8010888 <__ashlsi3>
8004f68: b5 a1 08 00 add r1,r13,r1
_Scheduler_priority_Schedule_body();
}
8004f6c: 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 );
8004f70: 34 21 00 04 addi r1,r1,4
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
8004f74: 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 ] ) )
8004f78: 44 61 00 02 be r3,r1,8004f80 <_Scheduler_priority_Schedule+0xf0><== NEVER TAKEN
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
8004f7c: b8 60 10 00 mv r2,r3
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8004f80: 78 01 08 01 mvhi r1,0x801
8004f84: 38 21 3a 28 ori r1,r1,0x3a28
8004f88: 58 22 00 10 sw (r1+16),r2
8004f8c: 2b 9d 00 04 lw ra,(sp+4)
8004f90: 2b 8b 00 10 lw r11,(sp+16)
8004f94: 2b 8c 00 0c lw r12,(sp+12)
8004f98: 2b 8d 00 08 lw r13,(sp+8)
8004f9c: 37 9c 00 10 addi sp,sp,16
8004fa0: c3 a0 00 00 ret
080050f8 <_Scheduler_priority_Yield>:
Scheduler_priority_Per_thread *sched_info;
ISR_Level level;
Thread_Control *executing;
Chain_Control *ready;
executing = _Thread_Executing;
80050f8: 78 01 08 01 mvhi r1,0x801
80050fc: 38 21 3a 28 ori r1,r1,0x3a28
8005100: 28 21 00 0c lw r1,(r1+12)
sched_info = (Scheduler_priority_Per_thread *) executing->scheduler_info;
ready = sched_info->ready_chain;
8005104: 28 22 00 8c lw r2,(r1+140)
8005108: 28 42 00 00 lw r2,(r2+0)
_ISR_Disable( level );
800510c: 90 00 20 00 rcsr r4,IE
8005110: 34 05 ff fe mvi r5,-2
8005114: a0 85 28 00 and r5,r4,r5
8005118: d0 05 00 00 wcsr IE,r5
if ( !_Chain_Has_only_one_node( ready ) ) {
800511c: 28 47 00 00 lw r7,(r2+0)
8005120: 28 46 00 08 lw r6,(r2+8)
8005124: 78 03 08 01 mvhi r3,0x801
8005128: 38 63 3a 28 ori r3,r3,0x3a28
800512c: 44 e6 00 16 be r7,r6,8005184 <_Scheduler_priority_Yield+0x8c>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
8005130: 28 27 00 00 lw r7,(r1+0)
previous = the_node->previous;
8005134: 28 26 00 04 lw r6,(r1+4)
next->previous = previous;
8005138: 58 e6 00 04 sw (r7+4),r6
previous->next = next;
800513c: 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;
8005140: 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 );
8005144: 34 47 00 04 addi r7,r2,4
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
8005148: 58 41 00 08 sw (r2+8),r1
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
800514c: 58 27 00 00 sw (r1+0),r7
tail->previous = the_node;
old_last->next = the_node;
8005150: 58 c1 00 00 sw (r6+0),r1
the_node->previous = old_last;
8005154: 58 26 00 04 sw (r1+4),r6
_Chain_Extract_unprotected( &executing->Object.Node );
_Chain_Append_unprotected( ready, &executing->Object.Node );
_ISR_Flash( level );
8005158: d0 04 00 00 wcsr IE,r4
800515c: d0 05 00 00 wcsr IE,r5
if ( _Thread_Is_heir( executing ) )
8005160: 28 65 00 10 lw r5,(r3+16)
8005164: 5c 25 00 03 bne r1,r5,8005170 <_Scheduler_priority_Yield+0x78><== NEVER TAKEN
_Thread_Heir = (Thread_Control *) _Chain_First( ready );
8005168: 28 41 00 00 lw r1,(r2+0)
800516c: 58 61 00 10 sw (r3+16),r1
_Thread_Dispatch_necessary = true;
8005170: 78 01 08 01 mvhi r1,0x801
8005174: 38 21 3a 28 ori r1,r1,0x3a28
8005178: 34 02 00 01 mvi r2,1
800517c: 30 22 00 18 sb (r1+24),r2
8005180: e0 00 00 05 bi 8005194 <_Scheduler_priority_Yield+0x9c>
}
else if ( !_Thread_Is_heir( executing ) )
8005184: 28 62 00 10 lw r2,(r3+16)
8005188: 44 22 00 03 be r1,r2,8005194 <_Scheduler_priority_Yield+0x9c><== ALWAYS TAKEN
_Thread_Dispatch_necessary = true;
800518c: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8005190: 30 61 00 18 sb (r3+24),r1 <== NOT EXECUTED
_ISR_Enable( level );
8005194: d0 04 00 00 wcsr IE,r4
}
8005198: c3 a0 00 00 ret
08004290 <_TOD_Validate>:
*/
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
8004290: 37 9c ff f0 addi sp,sp,-16
8004294: 5b 8b 00 10 sw (sp+16),r11
8004298: 5b 8c 00 0c sw (sp+12),r12
800429c: 5b 8d 00 08 sw (sp+8),r13
80042a0: 5b 9d 00 04 sw (sp+4),ra
80042a4: 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();
80042a8: 78 01 08 01 mvhi r1,0x801
80042ac: 38 21 f0 f4 ori r1,r1,0xf0f4
80042b0: 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;
80042b4: 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) ||
80042b8: 45 60 00 22 be r11,r0,8004340 <_TOD_Validate+0xb0> <== NEVER TAKEN
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
80042bc: 78 03 08 01 mvhi r3,0x801
80042c0: 38 63 cf b4 ori r3,r3,0xcfb4
80042c4: 28 61 00 00 lw r1,(r3+0)
80042c8: f8 00 5f 03 calli 801bed4 <__udivsi3>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
80042cc: 29 62 00 18 lw r2,(r11+24)
80042d0: 50 41 00 1c bgeu r2,r1,8004340 <_TOD_Validate+0xb0>
(the_tod->ticks >= ticks_per_second) ||
80042d4: 29 62 00 14 lw r2,(r11+20)
80042d8: 34 01 00 3b mvi r1,59
80042dc: 54 41 00 19 bgu r2,r1,8004340 <_TOD_Validate+0xb0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
80042e0: 29 62 00 10 lw r2,(r11+16)
80042e4: 54 41 00 17 bgu r2,r1,8004340 <_TOD_Validate+0xb0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
80042e8: 29 62 00 0c lw r2,(r11+12)
80042ec: 34 01 00 17 mvi r1,23
80042f0: 54 41 00 14 bgu r2,r1,8004340 <_TOD_Validate+0xb0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
80042f4: 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) ||
80042f8: 44 20 00 12 be r1,r0,8004340 <_TOD_Validate+0xb0> <== NEVER TAKEN
(the_tod->month == 0) ||
80042fc: 34 02 00 0c mvi r2,12
8004300: 54 22 00 10 bgu r1,r2,8004340 <_TOD_Validate+0xb0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
8004304: 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) ||
8004308: 34 03 07 c3 mvi r3,1987
800430c: 50 62 00 0d bgeu r3,r2,8004340 <_TOD_Validate+0xb0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
8004310: 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) ||
8004314: 45 a0 00 0b be r13,r0,8004340 <_TOD_Validate+0xb0> <== NEVER TAKEN
8004318: 78 0b 08 01 mvhi r11,0x801
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
800431c: 20 42 00 03 andi r2,r2,0x3
8004320: 39 6b d8 6c ori r11,r11,0xd86c
8004324: 5c 40 00 02 bne r2,r0,800432c <_TOD_Validate+0x9c>
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
8004328: 34 21 00 0d addi r1,r1,13
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
800432c: 34 02 00 02 mvi r2,2
8004330: fb ff f3 dc calli 80012a0 <__ashlsi3>
8004334: b5 61 08 00 add r1,r11,r1
8004338: 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(
800433c: f1 8d 60 00 cmpgeu r12,r12,r13
if ( the_tod->day > days_in_month )
return false;
return true;
}
8004340: b9 80 08 00 mv r1,r12
8004344: 2b 9d 00 04 lw ra,(sp+4)
8004348: 2b 8b 00 10 lw r11,(sp+16)
800434c: 2b 8c 00 0c lw r12,(sp+12)
8004350: 2b 8d 00 08 lw r13,(sp+8)
8004354: 37 9c 00 10 addi sp,sp,16
8004358: c3 a0 00 00 ret
0800519c <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
800519c: 37 9c ff e8 addi sp,sp,-24
80051a0: 5b 8b 00 18 sw (sp+24),r11
80051a4: 5b 8c 00 14 sw (sp+20),r12
80051a8: 5b 8d 00 10 sw (sp+16),r13
80051ac: 5b 8e 00 0c sw (sp+12),r14
80051b0: 5b 8f 00 08 sw (sp+8),r15
80051b4: 5b 9d 00 04 sw (sp+4),ra
80051b8: b8 20 58 00 mv r11,r1
States_Control state, original_state;
/*
* Save original state
*/
original_state = the_thread->current_state;
80051bc: 28 2f 00 10 lw r15,(r1+16)
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
80051c0: b8 40 60 00 mv r12,r2
80051c4: 20 6e 00 ff andi r14,r3,0xff
/*
* Set a transient state for the thread so it is pulled off the Ready chains.
* This will prevent it from being scheduled no matter what happens in an
* ISR.
*/
_Thread_Set_transient( the_thread );
80051c8: f8 00 03 c0 calli 80060c8 <_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 )
80051cc: 29 61 00 14 lw r1,(r11+20)
80051d0: 44 2c 00 04 be r1,r12,80051e0 <_Thread_Change_priority+0x44>
_Thread_Set_priority( the_thread, new_priority );
80051d4: b9 60 08 00 mv r1,r11
80051d8: b9 80 10 00 mv r2,r12
80051dc: f8 00 03 9a calli 8006044 <_Thread_Set_priority>
_ISR_Disable( level );
80051e0: 90 00 60 00 rcsr r12,IE
80051e4: 34 0d ff fe mvi r13,-2
80051e8: a1 8d 68 00 and r13,r12,r13
80051ec: d0 0d 00 00 wcsr IE,r13
/*
* If the thread has more than STATES_TRANSIENT set, then it is blocked,
* If it is blocked on a thread queue, then we need to requeue it.
*/
state = the_thread->current_state;
80051f0: 29 61 00 10 lw r1,(r11+16)
if ( state != STATES_TRANSIENT ) {
80051f4: 34 03 00 04 mvi r3,4
80051f8: 21 e2 00 04 andi r2,r15,0x4
80051fc: 44 23 00 0f be r1,r3,8005238 <_Thread_Change_priority+0x9c>
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
8005200: 5c 40 00 04 bne r2,r0,8005210 <_Thread_Change_priority+0x74><== NEVER TAKEN
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
8005204: 34 02 ff fb mvi r2,-5
8005208: a0 22 10 00 and r2,r1,r2
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
800520c: 59 62 00 10 sw (r11+16),r2
_ISR_Enable( level );
8005210: 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);
8005214: 78 03 08 01 mvhi r3,0x801
8005218: 38 63 1d ec ori r3,r3,0x1dec
800521c: 28 62 00 00 lw r2,(r3+0)
8005220: a0 22 08 00 and r1,r1,r2
if ( _States_Is_waiting_on_thread_queue( state ) ) {
8005224: 44 20 00 1f be r1,r0,80052a0 <_Thread_Change_priority+0x104>
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
8005228: 29 61 00 44 lw r1,(r11+68)
800522c: b9 60 10 00 mv r2,r11
8005230: f8 00 03 50 calli 8005f70 <_Thread_queue_Requeue>
8005234: e0 00 00 1b bi 80052a0 <_Thread_Change_priority+0x104>
}
return;
}
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) ) {
8005238: 5c 40 00 0a bne r2,r0,8005260 <_Thread_Change_priority+0xc4><== NEVER TAKEN
800523c: 78 01 08 01 mvhi r1,0x801
* Interrupts are STILL disabled.
* We now know the thread will be in the READY state when we remove
* the TRANSIENT state. So we have to place it on the appropriate
* Ready Queue with interrupts off.
*/
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
8005240: 59 60 00 10 sw (r11+16),r0
8005244: 38 21 30 1c ori r1,r1,0x301c
if ( prepend_it )
8005248: 45 c2 00 03 be r14,r2,8005254 <_Thread_Change_priority+0xb8>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue_first( the_thread );
800524c: 28 22 00 28 lw r2,(r1+40)
8005250: e0 00 00 02 bi 8005258 <_Thread_Change_priority+0xbc>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue( the_thread );
8005254: 28 22 00 24 lw r2,(r1+36)
8005258: b9 60 08 00 mv r1,r11
800525c: d8 40 00 00 call r2
_Scheduler_Enqueue_first( the_thread );
else
_Scheduler_Enqueue( the_thread );
}
_ISR_Flash( level );
8005260: d0 0c 00 00 wcsr IE,r12
8005264: d0 0d 00 00 wcsr IE,r13
* This kernel routine implements the scheduling decision logic for
* the scheduler. It does NOT dispatch.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void )
{
_Scheduler.Operations.schedule();
8005268: 78 01 08 01 mvhi r1,0x801
800526c: 38 21 30 1c ori r1,r1,0x301c
8005270: 28 21 00 08 lw r1,(r1+8)
8005274: d8 20 00 00 call r1
* is also the heir thread, and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void )
{
return ( _Thread_Executing == _Thread_Heir );
8005278: 78 01 08 01 mvhi r1,0x801
800527c: 38 21 3a 28 ori r1,r1,0x3a28
8005280: 28 22 00 0c lw r2,(r1+12)
* We altered the set of thread priorities. So let's figure out
* who is the heir and if we need to switch to them.
*/
_Scheduler_Schedule();
if ( !_Thread_Is_executing_also_the_heir() &&
8005284: 28 23 00 10 lw r3,(r1+16)
8005288: 44 43 00 05 be r2,r3,800529c <_Thread_Change_priority+0x100>
800528c: 40 42 00 74 lbu r2,(r2+116)
8005290: 44 40 00 03 be r2,r0,800529c <_Thread_Change_priority+0x100>
_Thread_Executing->is_preemptible )
_Thread_Dispatch_necessary = true;
8005294: 34 02 00 01 mvi r2,1
8005298: 30 22 00 18 sb (r1+24),r2
_ISR_Enable( level );
800529c: d0 0c 00 00 wcsr IE,r12
}
80052a0: 2b 9d 00 04 lw ra,(sp+4)
80052a4: 2b 8b 00 18 lw r11,(sp+24)
80052a8: 2b 8c 00 14 lw r12,(sp+20)
80052ac: 2b 8d 00 10 lw r13,(sp+16)
80052b0: 2b 8e 00 0c lw r14,(sp+12)
80052b4: 2b 8f 00 08 lw r15,(sp+8)
80052b8: 37 9c 00 18 addi sp,sp,24
80052bc: c3 a0 00 00 ret
0800bf34 <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
800bf34: 37 9c ff f8 addi sp,sp,-8
800bf38: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
800bf3c: 37 82 00 08 addi r2,sp,8
800bf40: f8 00 00 7c calli 800c130 <_Thread_Get>
switch ( location ) {
800bf44: 2b 82 00 08 lw r2,(sp+8)
800bf48: 5c 40 00 0a bne r2,r0,800bf70 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
800bf4c: 78 03 08 02 mvhi r3,0x802
800bf50: 38 63 5d 40 ori r3,r3,0x5d40
800bf54: 28 62 00 00 lw r2,(r3+0)
800bf58: fb ff ff 6f calli 800bd14 <_Thread_Clear_state>
800bf5c: 78 01 08 02 mvhi r1,0x802
800bf60: 38 21 8a 08 ori r1,r1,0x8a08
800bf64: 28 22 00 00 lw r2,(r1+0)
800bf68: 34 42 ff ff addi r2,r2,-1
800bf6c: 58 22 00 00 sw (r1+0),r2
| STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Thread_Unnest_dispatch();
break;
}
}
800bf70: 2b 9d 00 04 lw ra,(sp+4)
800bf74: 37 9c 00 08 addi sp,sp,8
800bf78: c3 a0 00 00 ret
08005484 <_Thread_Dispatch>:
* dispatch thread
* no dispatch thread
*/
void _Thread_Dispatch( void )
{
8005484: 37 9c ff c0 addi sp,sp,-64
8005488: 5b 8b 00 30 sw (sp+48),r11
800548c: 5b 8c 00 2c sw (sp+44),r12
8005490: 5b 8d 00 28 sw (sp+40),r13
8005494: 5b 8e 00 24 sw (sp+36),r14
8005498: 5b 8f 00 20 sw (sp+32),r15
800549c: 5b 90 00 1c sw (sp+28),r16
80054a0: 5b 91 00 18 sw (sp+24),r17
80054a4: 5b 92 00 14 sw (sp+20),r18
80054a8: 5b 93 00 10 sw (sp+16),r19
80054ac: 5b 94 00 0c sw (sp+12),r20
80054b0: 5b 95 00 08 sw (sp+8),r21
80054b4: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *executing;
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
80054b8: 78 01 08 01 mvhi r1,0x801
80054bc: 38 21 3a 28 ori r1,r1,0x3a28
80054c0: 28 2d 00 0c lw r13,(r1+12)
_ISR_Disable( level );
80054c4: 90 00 20 00 rcsr r4,IE
80054c8: 34 01 ff fe mvi r1,-2
80054cc: a0 81 08 00 and r1,r4,r1
80054d0: d0 01 00 00 wcsr IE,r1
while ( _Thread_Dispatch_necessary == true ) {
80054d4: 78 0c 08 01 mvhi r12,0x801
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
80054d8: 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;
80054dc: 78 0f 08 01 mvhi r15,0x801
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
80054e0: 78 0e 08 01 mvhi r14,0x801
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
80054e4: 78 10 08 01 mvhi r16,0x801
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
80054e8: 39 8c 3a 28 ori r12,r12,0x3a28
heir = _Thread_Heir;
_Thread_Dispatch_disable_level = 1;
80054ec: 3a 31 38 88 ori r17,r17,0x3888
80054f0: 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;
80054f4: 39 ef 38 20 ori r15,r15,0x3820
_ISR_Enable( level );
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
80054f8: 37 93 00 3c addi r19,sp,60
_Timestamp_Subtract(
80054fc: 39 ce 39 34 ori r14,r14,0x3934
8005500: 37 92 00 34 addi r18,sp,52
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8005504: 3a 10 39 0c ori r16,r16,0x390c
#endif
#endif
executing = _Thread_Executing;
_ISR_Disable( level );
8005508: 34 15 ff fe mvi r21,-2
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
800550c: e0 00 00 28 bi 80055ac <_Thread_Dispatch+0x128>
heir = _Thread_Heir;
8005510: 29 8b 00 10 lw r11,(r12+16)
_Thread_Dispatch_disable_level = 1;
8005514: 5a 34 00 00 sw (r17+0),r20
_Thread_Dispatch_necessary = false;
8005518: 31 80 00 18 sb (r12+24),r0
_Thread_Executing = heir;
800551c: 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 )
8005520: 45 6d 00 26 be r11,r13,80055b8 <_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 )
8005524: 29 61 00 7c lw r1,(r11+124)
8005528: 5c 34 00 03 bne r1,r20,8005534 <_Thread_Dispatch+0xb0>
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
800552c: 29 e1 00 00 lw r1,(r15+0)
8005530: 59 61 00 78 sw (r11+120),r1
_ISR_Enable( level );
8005534: d0 04 00 00 wcsr IE,r4
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
8005538: ba 60 08 00 mv r1,r19
800553c: f8 00 0e ac calli 8008fec <_TOD_Get_uptime>
_Timestamp_Subtract(
8005540: b9 c0 08 00 mv r1,r14
8005544: ba 60 10 00 mv r2,r19
8005548: ba 40 18 00 mv r3,r18
800554c: f8 00 03 7d calli 8006340 <_Timespec_Subtract>
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
8005550: 35 a1 00 84 addi r1,r13,132
8005554: ba 40 10 00 mv r2,r18
8005558: f8 00 03 61 calli 80062dc <_Timespec_Add_to>
_Thread_Time_of_last_context_switch = uptime;
800555c: 2b 81 00 3c lw r1,(sp+60)
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8005560: 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;
8005564: 59 c1 00 00 sw (r14+0),r1
8005568: 2b 81 00 40 lw r1,(sp+64)
800556c: 59 c1 00 04 sw (r14+4),r1
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
8005570: 44 80 00 05 be r4,r0,8005584 <_Thread_Dispatch+0x100> <== NEVER TAKEN
executing->libc_reent = *_Thread_libc_reent;
8005574: 28 81 00 00 lw r1,(r4+0)
8005578: 59 a1 01 14 sw (r13+276),r1
*_Thread_libc_reent = heir->libc_reent;
800557c: 29 61 01 14 lw r1,(r11+276)
8005580: 58 81 00 00 sw (r4+0),r1
}
_User_extensions_Thread_switch( executing, heir );
8005584: b9 a0 08 00 mv r1,r13
8005588: b9 60 10 00 mv r2,r11
800558c: f8 00 04 68 calli 800672c <_User_extensions_Thread_switch>
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
8005590: 35 a1 00 c0 addi r1,r13,192
8005594: 35 62 00 c0 addi r2,r11,192
8005598: f8 00 05 7c calli 8006b88 <_CPU_Context_switch>
if ( executing->fp_context != NULL )
_Context_Restore_fp( &executing->fp_context );
#endif
#endif
executing = _Thread_Executing;
800559c: 29 8d 00 0c lw r13,(r12+12)
_ISR_Disable( level );
80055a0: 90 00 20 00 rcsr r4,IE
80055a4: a0 95 08 00 and r1,r4,r21
80055a8: d0 01 00 00 wcsr IE,r1
Thread_Control *heir;
ISR_Level level;
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
80055ac: 41 81 00 18 lbu r1,(r12+24)
80055b0: 20 21 00 ff andi r1,r1,0xff
80055b4: 5c 20 ff d7 bne r1,r0,8005510 <_Thread_Dispatch+0x8c>
_ISR_Disable( level );
}
post_switch:
_Thread_Dispatch_disable_level = 0;
80055b8: 78 01 08 01 mvhi r1,0x801
80055bc: 38 21 38 88 ori r1,r1,0x3888
80055c0: 58 20 00 00 sw (r1+0),r0
_ISR_Enable( level );
80055c4: d0 04 00 00 wcsr IE,r4
_API_extensions_Run_postswitch();
80055c8: fb ff f7 60 calli 8003348 <_API_extensions_Run_postswitch>
}
80055cc: 2b 9d 00 04 lw ra,(sp+4)
80055d0: 2b 8b 00 30 lw r11,(sp+48)
80055d4: 2b 8c 00 2c lw r12,(sp+44)
80055d8: 2b 8d 00 28 lw r13,(sp+40)
80055dc: 2b 8e 00 24 lw r14,(sp+36)
80055e0: 2b 8f 00 20 lw r15,(sp+32)
80055e4: 2b 90 00 1c lw r16,(sp+28)
80055e8: 2b 91 00 18 lw r17,(sp+24)
80055ec: 2b 92 00 14 lw r18,(sp+20)
80055f0: 2b 93 00 10 lw r19,(sp+16)
80055f4: 2b 94 00 0c lw r20,(sp+12)
80055f8: 2b 95 00 08 lw r21,(sp+8)
80055fc: 37 9c 00 40 addi sp,sp,64
8005600: c3 a0 00 00 ret
0800b1f0 <_Thread_Handler>:
*
* Output parameters: NONE
*/
void _Thread_Handler( void )
{
800b1f0: 37 9c ff f4 addi sp,sp,-12
800b1f4: 5b 8b 00 0c sw (sp+12),r11
800b1f8: 5b 8c 00 08 sw (sp+8),r12
800b1fc: 5b 9d 00 04 sw (sp+4),ra
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static char doneConstructors;
char doneCons;
#endif
executing = _Thread_Executing;
800b200: 78 01 08 01 mvhi r1,0x801
800b204: 38 21 3a 28 ori r1,r1,0x3a28
800b208: 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;
800b20c: 29 61 00 ac lw r1,(r11+172)
_ISR_Set_level(level);
800b210: 64 21 00 00 cmpei r1,r1,0
800b214: d0 01 00 00 wcsr IE,r1
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
doneCons = doneConstructors;
800b218: 78 01 08 01 mvhi r1,0x801
800b21c: 38 21 36 a0 ori r1,r1,0x36a0
800b220: 40 2c 00 00 lbu r12,(r1+0)
doneConstructors = 1;
800b224: 34 02 00 01 mvi r2,1
800b228: 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 );
800b22c: b9 60 08 00 mv r1,r11
800b230: fb ff ec 97 calli 800648c <_User_extensions_Thread_begin>
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
800b234: fb ff e8 f4 calli 8005604 <_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) */ {
800b238: 5d 80 00 02 bne r12,r0,800b240 <_Thread_Handler+0x50>
INIT_NAME ();
800b23c: fb ff d3 71 calli 8000000 <RamBase>
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
800b240: 29 61 00 94 lw r1,(r11+148)
800b244: 5c 20 00 05 bne r1,r0,800b258 <_Thread_Handler+0x68> <== NEVER TAKEN
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
800b248: 29 62 00 90 lw r2,(r11+144)
800b24c: 29 61 00 9c lw r1,(r11+156)
800b250: d8 40 00 00 call r2
INIT_NAME ();
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
executing->Wait.return_argument =
800b254: 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 );
800b258: b9 60 08 00 mv r1,r11
800b25c: fb ff ec a4 calli 80064ec <_User_extensions_Thread_exitted>
_Internal_error_Occurred(
800b260: 34 01 00 00 mvi r1,0
800b264: 34 02 00 01 mvi r2,1
800b268: 34 03 00 05 mvi r3,5
800b26c: fb ff e3 55 calli 8003fc0 <_Internal_error_Occurred>
080096d4 <_Thread_queue_Enqueue_fifo>:
)
{
Thread_blocking_operation_States sync_state;
ISR_Level level;
_ISR_Disable( level );
80096d4: 90 00 20 00 rcsr r4,IE
80096d8: 34 05 ff fe mvi r5,-2
80096dc: a0 85 28 00 and r5,r4,r5
80096e0: d0 05 00 00 wcsr IE,r5
sync_state = the_thread_queue->sync_state;
80096e4: 28 25 00 30 lw r5,(r1+48)
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) {
80096e8: 34 06 00 01 mvi r6,1
ISR_Level level;
_ISR_Disable( level );
sync_state = the_thread_queue->sync_state;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
80096ec: 58 20 00 30 sw (r1+48),r0
if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) {
80096f0: 5c a6 00 0a bne r5,r6,8009718 <_Thread_queue_Enqueue_fifo+0x44><== NEVER TAKEN
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
80096f4: 28 23 00 08 lw r3,(r1+8)
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
80096f8: 34 26 00 04 addi r6,r1,4
Chain_Node *old_last = tail->previous;
the_node->next = tail;
80096fc: 58 46 00 00 sw (r2+0),r6
tail->previous = the_node;
8009700: 58 22 00 08 sw (r1+8),r2
old_last->next = the_node;
8009704: 58 62 00 00 sw (r3+0),r2
the_node->previous = old_last;
8009708: 58 43 00 04 sw (r2+4),r3
_Chain_Append_unprotected(
&the_thread_queue->Queues.Fifo,
&the_thread->Object.Node
);
the_thread->Wait.queue = the_thread_queue;
800970c: 58 41 00 44 sw (r2+68),r1
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
_ISR_Enable( level );
8009710: d0 04 00 00 wcsr IE,r4
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
8009714: e0 00 00 02 bi 800971c <_Thread_queue_Enqueue_fifo+0x48>
* 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;
8009718: 58 64 00 00 sw (r3+0),r4 <== NOT EXECUTED
return sync_state;
}
800971c: b8 a0 08 00 mv r1,r5
8009720: c3 a0 00 00 ret
08005c24 <_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
)
{
8005c24: 37 9c ff cc addi sp,sp,-52
8005c28: 5b 8b 00 34 sw (sp+52),r11
8005c2c: 5b 8c 00 30 sw (sp+48),r12
8005c30: 5b 8d 00 2c sw (sp+44),r13
8005c34: 5b 8e 00 28 sw (sp+40),r14
8005c38: 5b 8f 00 24 sw (sp+36),r15
8005c3c: 5b 90 00 20 sw (sp+32),r16
8005c40: 5b 91 00 1c sw (sp+28),r17
8005c44: 5b 92 00 18 sw (sp+24),r18
8005c48: 5b 93 00 14 sw (sp+20),r19
8005c4c: 5b 94 00 10 sw (sp+16),r20
8005c50: 5b 95 00 0c sw (sp+12),r21
8005c54: 5b 96 00 08 sw (sp+8),r22
8005c58: 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;
8005c5c: 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
)
{
8005c60: 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 );
8005c64: 34 41 00 3c addi r1,r2,60
head->next = tail;
8005c68: 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 );
8005c6c: 34 41 00 38 addi r1,r2,56
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
8005c70: 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;
8005c74: 58 40 00 3c sw (r2+60),r0
8005c78: 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);
8005c7c: ba 00 08 00 mv r1,r16
8005c80: 34 02 00 06 mvi r2,6
8005c84: b8 60 a8 00 mv r21,r3
8005c88: f8 00 2b 4e calli 80109c0 <__lshrsi3>
8005c8c: 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;
8005c90: 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 );
8005c94: 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;
8005c98: 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;
8005c9c: 3a 52 30 f0 ori r18,r18,0x30f0
_ISR_Disable( level );
8005ca0: 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 ) )
8005ca4: 5c 20 00 30 bne r1,r0,8005d64 <_Thread_queue_Enqueue_priority+0x140>
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
8005ca8: 34 14 ff fe mvi r20,-2
8005cac: 90 00 78 00 rcsr r15,IE
8005cb0: a1 f4 90 00 and r18,r15,r20
8005cb4: d0 12 00 00 wcsr IE,r18
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
8005cb8: 34 02 00 01 mvi r2,1
8005cbc: b9 c0 08 00 mv r1,r14
8005cc0: f8 00 2a f2 calli 8010888 <__ashlsi3>
8005cc4: b4 2e 08 00 add r1,r1,r14
8005cc8: 34 02 00 02 mvi r2,2
8005ccc: f8 00 2a ef calli 8010888 <__ashlsi3>
8005cd0: 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 );
8005cd4: 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;
8005cd8: 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 ) ) {
8005cdc: e0 00 00 0b bi 8005d08 <_Thread_queue_Enqueue_priority+0xe4>
search_priority = search_thread->current_priority;
8005ce0: 29 71 00 14 lw r17,(r11+20)
if ( priority <= search_priority )
8005ce4: 52 30 00 12 bgeu r17,r16,8005d2c <_Thread_queue_Enqueue_priority+0x108>
break;
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
8005ce8: d0 0f 00 00 wcsr IE,r15
8005cec: 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);
8005cf0: 29 61 00 10 lw r1,(r11+16)
8005cf4: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
8005cf8: 5c 20 00 03 bne r1,r0,8005d04 <_Thread_queue_Enqueue_priority+0xe0><== ALWAYS TAKEN
_ISR_Enable( level );
8005cfc: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_forward_search;
8005d00: e3 ff ff eb bi 8005cac <_Thread_queue_Enqueue_priority+0x88><== NOT EXECUTED
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
8005d04: 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));
8005d08: 34 02 00 01 mvi r2,1
8005d0c: b9 c0 08 00 mv r1,r14
8005d10: f8 00 2a de calli 8010888 <__ashlsi3>
8005d14: b4 2e 08 00 add r1,r1,r14
8005d18: 34 02 00 02 mvi r2,2
8005d1c: f8 00 2a db calli 8010888 <__ashlsi3>
8005d20: b5 a1 08 00 add r1,r13,r1
8005d24: 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 ) ) {
8005d28: 5d 61 ff ee bne r11,r1,8005ce0 <_Thread_queue_Enqueue_priority+0xbc>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
8005d2c: 29 a3 00 30 lw r3,(r13+48)
8005d30: 34 02 00 01 mvi r2,1
8005d34: b9 e0 08 00 mv r1,r15
8005d38: 5c 62 00 43 bne r3,r2,8005e44 <_Thread_queue_Enqueue_priority+0x220>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8005d3c: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
8005d40: 46 11 00 38 be r16,r17,8005e20 <_Thread_queue_Enqueue_priority+0x1fc>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
8005d44: 29 61 00 04 lw r1,(r11+4)
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8005d48: 59 8b 00 00 sw (r12+0),r11
the_node->previous = previous_node;
8005d4c: 59 81 00 04 sw (r12+4),r1
previous_node->next = the_node;
8005d50: 58 2c 00 00 sw (r1+0),r12
search_node->previous = the_node;
8005d54: 59 6c 00 04 sw (r11+4),r12
the_thread->Wait.queue = the_thread_queue;
8005d58: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
8005d5c: d0 0f 00 00 wcsr IE,r15
8005d60: e0 00 00 2e bi 8005e18 <_Thread_queue_Enqueue_priority+0x1f4>
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
8005d64: 42 51 00 00 lbu r17,(r18+0)
8005d68: 36 31 00 01 addi r17,r17,1
_ISR_Disable( level );
8005d6c: 90 00 78 00 rcsr r15,IE
8005d70: a1 f6 a0 00 and r20,r15,r22
8005d74: d0 14 00 00 wcsr IE,r20
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
8005d78: 34 02 00 01 mvi r2,1
8005d7c: b9 c0 08 00 mv r1,r14
8005d80: f8 00 2a c2 calli 8010888 <__ashlsi3>
8005d84: b4 2e 08 00 add r1,r1,r14
8005d88: 34 02 00 02 mvi r2,2
8005d8c: f8 00 2a bf calli 8010888 <__ashlsi3>
8005d90: 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 );
8005d94: 28 2b 00 08 lw r11,(r1+8)
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
8005d98: e0 00 00 0b bi 8005dc4 <_Thread_queue_Enqueue_priority+0x1a0>
search_priority = search_thread->current_priority;
8005d9c: 29 71 00 14 lw r17,(r11+20)
if ( priority >= search_priority )
8005da0: 52 11 00 11 bgeu r16,r17,8005de4 <_Thread_queue_Enqueue_priority+0x1c0>
break;
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
8005da4: d0 0f 00 00 wcsr IE,r15
8005da8: d0 14 00 00 wcsr IE,r20
8005dac: 29 61 00 10 lw r1,(r11+16)
8005db0: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
8005db4: 5c 20 00 03 bne r1,r0,8005dc0 <_Thread_queue_Enqueue_priority+0x19c><== ALWAYS TAKEN
_ISR_Enable( level );
8005db8: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_reverse_search;
8005dbc: e3 ff ff ea bi 8005d64 <_Thread_queue_Enqueue_priority+0x140><== NOT EXECUTED
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
8005dc0: 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));
8005dc4: 34 02 00 01 mvi r2,1
8005dc8: b9 c0 08 00 mv r1,r14
8005dcc: f8 00 2a af calli 8010888 <__ashlsi3>
8005dd0: b4 2e 08 00 add r1,r1,r14
8005dd4: 34 02 00 02 mvi r2,2
8005dd8: f8 00 2a ac calli 8010888 <__ashlsi3>
8005ddc: 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 ) ) {
8005de0: 5d 61 ff ef bne r11,r1,8005d9c <_Thread_queue_Enqueue_priority+0x178>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
8005de4: 29 a3 00 30 lw r3,(r13+48)
8005de8: 34 02 00 01 mvi r2,1
8005dec: b9 e0 08 00 mv r1,r15
8005df0: 5c 62 00 15 bne r3,r2,8005e44 <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8005df4: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
8005df8: 46 11 00 0a be r16,r17,8005e20 <_Thread_queue_Enqueue_priority+0x1fc>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
8005dfc: 29 61 00 00 lw r1,(r11+0)
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
8005e00: 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;
8005e04: 59 81 00 00 sw (r12+0),r1
the_node->previous = search_node;
search_node->next = the_node;
8005e08: 59 6c 00 00 sw (r11+0),r12
next_node->previous = the_node;
8005e0c: 58 2c 00 04 sw (r1+4),r12
the_thread->Wait.queue = the_thread_queue;
8005e10: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
8005e14: d0 0f 00 00 wcsr IE,r15
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
8005e18: 34 01 00 01 mvi r1,1
8005e1c: e0 00 00 0c bi 8005e4c <_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;
8005e20: 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 );
8005e24: 35 62 00 3c addi r2,r11,60
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8005e28: 59 82 00 00 sw (r12+0),r2
the_node->previous = previous_node;
8005e2c: 59 81 00 04 sw (r12+4),r1
previous_node->next = the_node;
8005e30: 58 2c 00 00 sw (r1+0),r12
search_node->previous = the_node;
8005e34: 59 6c 00 40 sw (r11+64),r12
the_thread->Wait.queue = the_thread_queue;
8005e38: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
8005e3c: d0 0f 00 00 wcsr IE,r15
8005e40: e3 ff ff f6 bi 8005e18 <_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;
8005e44: 5a a1 00 00 sw (r21+0),r1
return the_thread_queue->sync_state;
8005e48: 29 a1 00 30 lw r1,(r13+48)
}
8005e4c: 2b 9d 00 04 lw ra,(sp+4)
8005e50: 2b 8b 00 34 lw r11,(sp+52)
8005e54: 2b 8c 00 30 lw r12,(sp+48)
8005e58: 2b 8d 00 2c lw r13,(sp+44)
8005e5c: 2b 8e 00 28 lw r14,(sp+40)
8005e60: 2b 8f 00 24 lw r15,(sp+36)
8005e64: 2b 90 00 20 lw r16,(sp+32)
8005e68: 2b 91 00 1c lw r17,(sp+28)
8005e6c: 2b 92 00 18 lw r18,(sp+24)
8005e70: 2b 93 00 14 lw r19,(sp+20)
8005e74: 2b 94 00 10 lw r20,(sp+16)
8005e78: 2b 95 00 0c lw r21,(sp+12)
8005e7c: 2b 96 00 08 lw r22,(sp+8)
8005e80: 37 9c 00 34 addi sp,sp,52
8005e84: c3 a0 00 00 ret
08009890 <_Thread_queue_Process_timeout>:
#include <rtems/score/tqdata.h>
void _Thread_queue_Process_timeout(
Thread_Control *the_thread
)
{
8009890: 37 9c ff fc addi sp,sp,-4
8009894: 5b 9d 00 04 sw (sp+4),ra
8009898: b8 20 10 00 mv r2,r1
Thread_queue_Control *the_thread_queue = the_thread->Wait.queue;
800989c: 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 &&
80098a0: 28 24 00 30 lw r4,(r1+48)
80098a4: 44 80 00 0c be r4,r0,80098d4 <_Thread_queue_Process_timeout+0x44>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
80098a8: 78 03 08 01 mvhi r3,0x801
80098ac: 38 63 3a 28 ori r3,r3,0x3a28
80098b0: 28 63 00 0c lw r3,(r3+12)
80098b4: 5c 43 00 08 bne r2,r3,80098d4 <_Thread_queue_Process_timeout+0x44>
_Thread_Is_executing( the_thread ) ) {
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
80098b8: 34 03 00 03 mvi r3,3
80098bc: 44 83 00 09 be r4,r3,80098e0 <_Thread_queue_Process_timeout+0x50><== ALWAYS TAKEN
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
80098c0: 28 23 00 3c lw r3,(r1+60) <== NOT EXECUTED
80098c4: 58 43 00 34 sw (r2+52),r3 <== NOT EXECUTED
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
80098c8: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
80098cc: 58 22 00 30 sw (r1+48),r2 <== NOT EXECUTED
80098d0: e0 00 00 04 bi 80098e0 <_Thread_queue_Process_timeout+0x50><== NOT EXECUTED
}
} else {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
80098d4: 28 23 00 3c lw r3,(r1+60)
80098d8: 58 43 00 34 sw (r2+52),r3
_Thread_queue_Extract( the_thread->Wait.queue, the_thread );
80098dc: fb ff ff 92 calli 8009724 <_Thread_queue_Extract>
}
}
80098e0: 2b 9d 00 04 lw ra,(sp+4)
80098e4: 37 9c 00 04 addi sp,sp,4
80098e8: c3 a0 00 00 ret
08005f70 <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
8005f70: 37 9c ff ec addi sp,sp,-20
8005f74: 5b 8b 00 10 sw (sp+16),r11
8005f78: 5b 8c 00 0c sw (sp+12),r12
8005f7c: 5b 8d 00 08 sw (sp+8),r13
8005f80: 5b 9d 00 04 sw (sp+4),ra
8005f84: b8 20 58 00 mv r11,r1
8005f88: 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 )
8005f8c: 44 20 00 19 be r1,r0,8005ff0 <_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 ) {
8005f90: 28 22 00 34 lw r2,(r1+52)
8005f94: 34 01 00 01 mvi r1,1
8005f98: 5c 41 00 16 bne r2,r1,8005ff0 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
8005f9c: 90 00 68 00 rcsr r13,IE
8005fa0: 34 01 ff fe mvi r1,-2
8005fa4: a1 a1 08 00 and r1,r13,r1
8005fa8: d0 01 00 00 wcsr IE,r1
8005fac: 78 03 08 01 mvhi r3,0x801
8005fb0: 38 63 1d ec ori r3,r3,0x1dec
8005fb4: 29 82 00 10 lw r2,(r12+16)
8005fb8: 28 61 00 00 lw r1,(r3+0)
8005fbc: a0 41 08 00 and r1,r2,r1
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
8005fc0: 44 20 00 0b be r1,r0,8005fec <_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;
8005fc4: 34 01 00 01 mvi r1,1
8005fc8: 59 61 00 30 sw (r11+48),r1
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
8005fcc: b9 80 10 00 mv r2,r12
8005fd0: b9 60 08 00 mv r1,r11
8005fd4: 34 03 00 01 mvi r3,1
8005fd8: f8 00 0d df calli 8009754 <_Thread_queue_Extract_priority_helper>
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
8005fdc: b9 60 08 00 mv r1,r11
8005fe0: b9 80 10 00 mv r2,r12
8005fe4: 37 83 00 14 addi r3,sp,20
8005fe8: fb ff ff 0f calli 8005c24 <_Thread_queue_Enqueue_priority>
}
_ISR_Enable( level );
8005fec: d0 0d 00 00 wcsr IE,r13
}
}
8005ff0: 2b 9d 00 04 lw ra,(sp+4)
8005ff4: 2b 8b 00 10 lw r11,(sp+16)
8005ff8: 2b 8c 00 0c lw r12,(sp+12)
8005ffc: 2b 8d 00 08 lw r13,(sp+8)
8006000: 37 9c 00 14 addi sp,sp,20
8006004: c3 a0 00 00 ret
08006008 <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
8006008: 37 9c ff f8 addi sp,sp,-8
800600c: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
8006010: 37 82 00 08 addi r2,sp,8
8006014: fb ff fd 89 calli 8005638 <_Thread_Get>
switch ( location ) {
8006018: 2b 82 00 08 lw r2,(sp+8)
800601c: 5c 40 00 07 bne r2,r0,8006038 <_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 );
8006020: f8 00 0e 1c calli 8009890 <_Thread_queue_Process_timeout>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
8006024: 78 01 08 01 mvhi r1,0x801
8006028: 38 21 38 88 ori r1,r1,0x3888
800602c: 28 22 00 00 lw r2,(r1+0)
8006030: 34 42 ff ff addi r2,r2,-1
8006034: 58 22 00 00 sw (r1+0),r2
_Thread_Unnest_dispatch();
break;
}
}
8006038: 2b 9d 00 04 lw ra,(sp+4)
800603c: 37 9c 00 08 addi sp,sp,8
8006040: c3 a0 00 00 ret
0801478c <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
801478c: 37 9c ff a8 addi sp,sp,-88
8014790: 5b 8b 00 40 sw (sp+64),r11
8014794: 5b 8c 00 3c sw (sp+60),r12
8014798: 5b 8d 00 38 sw (sp+56),r13
801479c: 5b 8e 00 34 sw (sp+52),r14
80147a0: 5b 8f 00 30 sw (sp+48),r15
80147a4: 5b 90 00 2c sw (sp+44),r16
80147a8: 5b 91 00 28 sw (sp+40),r17
80147ac: 5b 92 00 24 sw (sp+36),r18
80147b0: 5b 93 00 20 sw (sp+32),r19
80147b4: 5b 94 00 1c sw (sp+28),r20
80147b8: 5b 95 00 18 sw (sp+24),r21
80147bc: 5b 96 00 14 sw (sp+20),r22
80147c0: 5b 97 00 10 sw (sp+16),r23
80147c4: 5b 98 00 0c sw (sp+12),r24
80147c8: 5b 99 00 08 sw (sp+8),r25
80147cc: 5b 9d 00 04 sw (sp+4),ra
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
80147d0: 78 10 08 03 mvhi r16,0x803
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
80147d4: b8 20 58 00 mv r11,r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80147d8: 37 82 00 54 addi r2,sp,84
80147dc: 37 81 00 50 addi r1,sp,80
80147e0: 37 8f 00 44 addi r15,sp,68
80147e4: 37 91 00 48 addi r17,sp,72
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
80147e8: 78 0e 08 03 mvhi r14,0x803
80147ec: 5b 82 00 50 sw (sp+80),r2
head->previous = NULL;
80147f0: 5b 80 00 54 sw (sp+84),r0
tail->previous = head;
80147f4: 5b 81 00 58 sw (sp+88),r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80147f8: 5b 91 00 44 sw (sp+68),r17
head->previous = NULL;
80147fc: 5b 80 00 48 sw (sp+72),r0
tail->previous = head;
8014800: 5b 8f 00 4c sw (sp+76),r15
{
/*
* Afterwards all timer inserts are directed to this chain and the interval
* and TOD chains will be no more modified by other parties.
*/
ts->insert_chain = insert_chain;
8014804: b8 20 c8 00 mv r25,r1
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
8014808: 3a 10 ed a8 ori r16,r16,0xeda8
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
801480c: 35 73 00 30 addi r19,r11,48
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
8014810: 39 ce ed 20 ori r14,r14,0xed20
/*
* The current TOD is before the last TOD which indicates that
* TOD has been set backwards.
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
8014814: 35 6d 00 68 addi r13,r11,104
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
8014818: 34 18 00 03 mvi r24,3
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
801481c: 34 12 ff fe mvi r18,-2
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
8014820: b8 40 b8 00 mv r23,r2
_Thread_Set_state( ts->thread, STATES_DELAYING );
_Timer_server_Reset_interval_system_watchdog( ts );
_Timer_server_Reset_tod_system_watchdog( ts );
_Thread_Enable_dispatch();
ts->active = true;
8014824: 34 16 00 01 mvi r22,1
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
8014828: 35 75 00 08 addi r21,r11,8
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
801482c: 35 74 00 40 addi r20,r11,64
{
/*
* Afterwards all timer inserts are directed to this chain and the interval
* and TOD chains will be no more modified by other parties.
*/
ts->insert_chain = insert_chain;
8014830: 59 79 00 78 sw (r11+120),r25
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
8014834: 2a 02 00 00 lw r2,(r16+0)
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
8014838: 29 63 00 3c lw r3,(r11+60)
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
801483c: ba 60 08 00 mv r1,r19
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
8014840: 59 62 00 3c sw (r11+60),r2
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
8014844: c8 43 10 00 sub r2,r2,r3
8014848: b9 e0 18 00 mv r3,r15
801484c: f8 00 15 29 calli 8019cf0 <_Watchdog_Adjust_to_chain>
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
8014850: 29 64 00 74 lw r4,(r11+116)
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
8014854: 29 cc 00 00 lw r12,(r14+0)
/*
* Process the seconds chain. Start by checking that the Time
* of Day (TOD) has not been set backwards. If it has then
* we want to adjust the watchdogs->Chain to indicate this.
*/
if ( snapshot > last_snapshot ) {
8014858: 50 8c 00 06 bgeu r4,r12,8014870 <_Timer_server_Body+0xe4>
/*
* This path is for normal forward movement and cases where the
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
801485c: b9 a0 08 00 mv r1,r13
8014860: c9 84 10 00 sub r2,r12,r4
8014864: b9 e0 18 00 mv r3,r15
8014868: f8 00 15 22 calli 8019cf0 <_Watchdog_Adjust_to_chain>
801486c: e0 00 00 06 bi 8014884 <_Timer_server_Body+0xf8>
} else if ( snapshot < last_snapshot ) {
8014870: 51 84 00 05 bgeu r12,r4,8014884 <_Timer_server_Body+0xf8>
/*
* The current TOD is before the last TOD which indicates that
* TOD has been set backwards.
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
8014874: b9 a0 08 00 mv r1,r13
8014878: 34 02 00 01 mvi r2,1
801487c: c8 8c 18 00 sub r3,r4,r12
8014880: f8 00 14 e5 calli 8019c14 <_Watchdog_Adjust>
}
watchdogs->last_snapshot = snapshot;
8014884: 59 6c 00 74 sw (r11+116),r12
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8014888: 34 0c 00 01 mvi r12,1
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
801488c: 29 63 00 78 lw r3,(r11+120)
8014890: b8 60 08 00 mv r1,r3
8014894: f8 00 03 68 calli 8015634 <_Chain_Get>
8014898: b8 20 10 00 mv r2,r1
if ( timer == NULL ) {
801489c: 44 20 00 09 be r1,r0,80148c0 <_Timer_server_Body+0x134> <== ALWAYS TAKEN
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
80148a0: 28 23 00 38 lw r3,(r1+56) <== NOT EXECUTED
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
80148a4: ba 60 08 00 mv r1,r19 <== NOT EXECUTED
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
80148a8: 44 6c 00 03 be r3,r12,80148b4 <_Timer_server_Body+0x128> <== NOT EXECUTED
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
80148ac: 5c 78 ff f8 bne r3,r24,801488c <_Timer_server_Body+0x100> <== NOT EXECUTED
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
80148b0: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
80148b4: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED
80148b8: f8 00 15 33 calli 8019d84 <_Watchdog_Insert> <== NOT EXECUTED
80148bc: e3 ff ff f4 bi 801488c <_Timer_server_Body+0x100> <== NOT EXECUTED
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
80148c0: 90 00 10 00 rcsr r2,IE
80148c4: a0 52 08 00 and r1,r2,r18
80148c8: d0 01 00 00 wcsr IE,r1
if ( _Chain_Is_empty( insert_chain ) ) {
80148cc: 2b 81 00 50 lw r1,(sp+80)
80148d0: 5c 37 00 06 bne r1,r23,80148e8 <_Timer_server_Body+0x15c> <== NEVER TAKEN
ts->insert_chain = NULL;
80148d4: 59 60 00 78 sw (r11+120),r0
_ISR_Enable( level );
80148d8: d0 02 00 00 wcsr IE,r2
_Chain_Initialize_empty( &fire_chain );
while ( true ) {
_Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain );
if ( !_Chain_Is_empty( &fire_chain ) ) {
80148dc: 2b 81 00 44 lw r1,(sp+68)
80148e0: 5c 31 00 04 bne r1,r17,80148f0 <_Timer_server_Body+0x164>
80148e4: e0 00 00 15 bi 8014938 <_Timer_server_Body+0x1ac>
ts->insert_chain = NULL;
_ISR_Enable( level );
break;
} else {
_ISR_Enable( level );
80148e8: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
80148ec: e3 ff ff d2 bi 8014834 <_Timer_server_Body+0xa8> <== NOT EXECUTED
/*
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
80148f0: 90 00 18 00 rcsr r3,IE
80148f4: a0 72 08 00 and r1,r3,r18
80148f8: d0 01 00 00 wcsr IE,r1
initialized = false;
}
#endif
return status;
}
80148fc: 2b 82 00 44 lw r2,(sp+68)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
8014900: 44 51 00 0c be r2,r17,8014930 <_Timer_server_Body+0x1a4>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
8014904: 28 44 00 00 lw r4,(r2+0)
head->next = new_first;
8014908: 5b 84 00 44 sw (sp+68),r4
new_first->previous = head;
801490c: 58 8f 00 04 sw (r4+4),r15
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
8014910: 44 40 00 08 be r2,r0,8014930 <_Timer_server_Body+0x1a4> <== NEVER TAKEN
watchdog->state = WATCHDOG_INACTIVE;
8014914: 58 40 00 08 sw (r2+8),r0
_ISR_Enable( level );
8014918: d0 03 00 00 wcsr IE,r3
/*
* The timer server may block here and wait for resources or time.
* The system watchdogs are inactive and will remain inactive since
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
801491c: 28 43 00 1c lw r3,(r2+28)
8014920: 28 41 00 20 lw r1,(r2+32)
8014924: 28 42 00 24 lw r2,(r2+36)
8014928: d8 60 00 00 call r3
}
801492c: e3 ff ff f1 bi 80148f0 <_Timer_server_Body+0x164>
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
_ISR_Enable( level );
} else {
_ISR_Enable( level );
8014930: d0 03 00 00 wcsr IE,r3
8014934: e3 ff ff bf bi 8014830 <_Timer_server_Body+0xa4>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
8014938: 31 60 00 7c sb (r11+124),r0
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
801493c: fb ff ff 54 calli 801468c <_Thread_Disable_dispatch>
_Thread_Set_state( ts->thread, STATES_DELAYING );
8014940: 29 61 00 00 lw r1,(r11+0)
8014944: 34 02 00 08 mvi r2,8
8014948: f8 00 12 b5 calli 801941c <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
801494c: b9 60 08 00 mv r1,r11
8014950: fb ff ff 55 calli 80146a4 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
8014954: b9 60 08 00 mv r1,r11
8014958: fb ff ff 70 calli 8014718 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
801495c: f8 00 0f e4 calli 80188ec <_Thread_Enable_dispatch>
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
8014960: ba a0 08 00 mv r1,r21
_Thread_Set_state( ts->thread, STATES_DELAYING );
_Timer_server_Reset_interval_system_watchdog( ts );
_Timer_server_Reset_tod_system_watchdog( ts );
_Thread_Enable_dispatch();
ts->active = true;
8014964: 31 76 00 7c sb (r11+124),r22
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
8014968: f8 00 15 66 calli 8019f00 <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
801496c: ba 80 08 00 mv r1,r20
8014970: f8 00 15 64 calli 8019f00 <_Watchdog_Remove>
8014974: e3 ff ff af bi 8014830 <_Timer_server_Body+0xa4>
08014978 <_Timer_server_Schedule_operation_method>:
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
8014978: 37 9c ff f4 addi sp,sp,-12
801497c: 5b 8b 00 0c sw (sp+12),r11
8014980: 5b 8c 00 08 sw (sp+8),r12
8014984: 5b 9d 00 04 sw (sp+4),ra
8014988: b8 20 58 00 mv r11,r1
if ( ts->insert_chain == NULL ) {
801498c: 28 21 00 78 lw r1,(r1+120)
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
8014990: b8 40 60 00 mv r12,r2
if ( ts->insert_chain == NULL ) {
8014994: 5c 20 00 43 bne r1,r0,8014aa0 <_Timer_server_Schedule_operation_method+0x128><== NEVER TAKEN
* is the reference point for the delta chain. Thus if we do not update the
* reference point we have to add DT to the initial delta of the watchdog
* being inserted. This could result in an integer overflow.
*/
_Thread_Disable_dispatch();
8014998: fb ff ff 3d calli 801468c <_Thread_Disable_dispatch>
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
801499c: 29 81 00 38 lw r1,(r12+56)
80149a0: 34 02 00 01 mvi r2,1
80149a4: 5c 22 00 1d bne r1,r2,8014a18 <_Timer_server_Schedule_operation_method+0xa0>
/*
* We have to advance the last known ticks value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
80149a8: 90 00 10 00 rcsr r2,IE
80149ac: 34 01 ff fe mvi r1,-2
80149b0: a0 41 08 00 and r1,r2,r1
80149b4: d0 01 00 00 wcsr IE,r1
snapshot = _Watchdog_Ticks_since_boot;
80149b8: 78 01 08 03 mvhi r1,0x803
80149bc: 38 21 ed a8 ori r1,r1,0xeda8
80149c0: 28 23 00 00 lw r3,(r1+0)
initialized = false;
}
#endif
return status;
}
80149c4: 29 61 00 30 lw r1,(r11+48)
* We have to advance the last known ticks value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
snapshot = _Watchdog_Ticks_since_boot;
last_snapshot = ts->Interval_watchdogs.last_snapshot;
80149c8: 29 65 00 3c lw r5,(r11+60)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
80149cc: 35 64 00 34 addi r4,r11,52
if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) {
80149d0: 44 24 00 07 be r1,r4,80149ec <_Timer_server_Schedule_operation_method+0x74>
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
80149d4: 28 26 00 10 lw r6,(r1+16)
first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain );
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
80149d8: c8 65 28 00 sub r5,r3,r5
delta_interval = first_watchdog->delta_interval;
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
80149dc: 34 04 00 00 mvi r4,0
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
if (delta_interval > delta) {
80149e0: 50 a6 00 02 bgeu r5,r6,80149e8 <_Timer_server_Schedule_operation_method+0x70>
delta_interval -= delta;
80149e4: c8 c5 20 00 sub r4,r6,r5
} else {
delta_interval = 0;
}
first_watchdog->delta_interval = delta_interval;
80149e8: 58 24 00 10 sw (r1+16),r4
}
ts->Interval_watchdogs.last_snapshot = snapshot;
80149ec: 59 63 00 3c sw (r11+60),r3
_ISR_Enable( level );
80149f0: d0 02 00 00 wcsr IE,r2
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
80149f4: 35 61 00 30 addi r1,r11,48
80149f8: 35 82 00 10 addi r2,r12,16
80149fc: f8 00 14 e2 calli 8019d84 <_Watchdog_Insert>
if ( !ts->active ) {
8014a00: 41 61 00 7c lbu r1,(r11+124)
8014a04: 20 21 00 ff andi r1,r1,0xff
8014a08: 5c 20 00 24 bne r1,r0,8014a98 <_Timer_server_Schedule_operation_method+0x120>
_Timer_server_Reset_interval_system_watchdog( ts );
8014a0c: b9 60 08 00 mv r1,r11
8014a10: fb ff ff 25 calli 80146a4 <_Timer_server_Reset_interval_system_watchdog>
8014a14: e0 00 00 21 bi 8014a98 <_Timer_server_Schedule_operation_method+0x120>
}
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
8014a18: 34 02 00 03 mvi r2,3
8014a1c: 5c 22 00 1f bne r1,r2,8014a98 <_Timer_server_Schedule_operation_method+0x120>
/*
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
8014a20: 90 00 30 00 rcsr r6,IE
8014a24: 34 01 ff fe mvi r1,-2
8014a28: a0 c1 08 00 and r1,r6,r1
8014a2c: d0 01 00 00 wcsr IE,r1
initialized = false;
}
#endif
return status;
}
8014a30: 29 62 00 68 lw r2,(r11+104)
/*
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
8014a34: 78 01 08 03 mvhi r1,0x803
last_snapshot = ts->TOD_watchdogs.last_snapshot;
8014a38: 29 65 00 74 lw r5,(r11+116)
/*
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
8014a3c: 38 21 ed 20 ori r1,r1,0xed20
8014a40: 35 63 00 6c addi r3,r11,108
8014a44: 28 21 00 00 lw r1,(r1+0)
last_snapshot = ts->TOD_watchdogs.last_snapshot;
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
8014a48: 44 43 00 0a be r2,r3,8014a70 <_Timer_server_Schedule_operation_method+0xf8>
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
8014a4c: 28 44 00 10 lw r4,(r2+16)
}
} else {
/*
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
8014a50: b4 85 18 00 add r3,r4,r5
delta_interval += delta;
8014a54: c8 61 18 00 sub r3,r3,r1
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
last_snapshot = ts->TOD_watchdogs.last_snapshot;
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
if ( snapshot > last_snapshot ) {
8014a58: 50 a1 00 05 bgeu r5,r1,8014a6c <_Timer_server_Schedule_operation_method+0xf4>
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
8014a5c: c8 25 28 00 sub r5,r1,r5
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
8014a60: 34 03 00 00 mvi r3,0
if ( snapshot > last_snapshot ) {
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
if (delta_interval > delta) {
8014a64: 50 a4 00 02 bgeu r5,r4,8014a6c <_Timer_server_Schedule_operation_method+0xf4><== NEVER TAKEN
delta_interval -= delta;
8014a68: c8 85 18 00 sub r3,r4,r5
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
delta_interval += delta;
}
first_watchdog->delta_interval = delta_interval;
8014a6c: 58 43 00 10 sw (r2+16),r3
}
ts->TOD_watchdogs.last_snapshot = snapshot;
8014a70: 59 61 00 74 sw (r11+116),r1
_ISR_Enable( level );
8014a74: d0 06 00 00 wcsr IE,r6
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
8014a78: 35 61 00 68 addi r1,r11,104
8014a7c: 35 82 00 10 addi r2,r12,16
8014a80: f8 00 14 c1 calli 8019d84 <_Watchdog_Insert>
if ( !ts->active ) {
8014a84: 41 61 00 7c lbu r1,(r11+124)
8014a88: 20 21 00 ff andi r1,r1,0xff
8014a8c: 5c 20 00 03 bne r1,r0,8014a98 <_Timer_server_Schedule_operation_method+0x120><== NEVER TAKEN
_Timer_server_Reset_tod_system_watchdog( ts );
8014a90: b9 60 08 00 mv r1,r11
8014a94: fb ff ff 21 calli 8014718 <_Timer_server_Reset_tod_system_watchdog>
}
}
_Thread_Enable_dispatch();
8014a98: f8 00 0f 95 calli 80188ec <_Thread_Enable_dispatch>
8014a9c: e0 00 00 03 bi 8014aa8 <_Timer_server_Schedule_operation_method+0x130>
* server is not preemptible, so we must be in interrupt context here. No
* thread dispatch will happen until the timer server finishes its
* critical section. We have to use the protected chain methods because
* we may be interrupted by a higher priority interrupt.
*/
_Chain_Append( ts->insert_chain, &timer->Object.Node );
8014aa0: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED
8014aa4: f8 00 02 ce calli 80155dc <_Chain_Append> <== NOT EXECUTED
}
}
8014aa8: 2b 9d 00 04 lw ra,(sp+4)
8014aac: 2b 8b 00 0c lw r11,(sp+12)
8014ab0: 2b 8c 00 08 lw r12,(sp+8)
8014ab4: 37 9c 00 0c addi sp,sp,12
8014ab8: c3 a0 00 00 ret
08006388 <_User_extensions_Handler_initialization>:
#include <rtems/score/userext.h>
#include <rtems/score/wkspace.h>
#include <string.h>
void _User_extensions_Handler_initialization(void)
{
8006388: 37 9c ff ec addi sp,sp,-20
800638c: 5b 8b 00 14 sw (sp+20),r11
8006390: 5b 8c 00 10 sw (sp+16),r12
8006394: 5b 8d 00 0c sw (sp+12),r13
8006398: 5b 8e 00 08 sw (sp+8),r14
800639c: 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;
80063a0: 78 02 08 01 mvhi r2,0x801
80063a4: 38 42 30 f4 ori r2,r2,0x30f4
80063a8: 28 4e 00 38 lw r14,(r2+56)
initial_extensions = Configuration.User_extension_table;
80063ac: 28 4b 00 3c lw r11,(r2+60)
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80063b0: 78 03 08 01 mvhi r3,0x801
80063b4: 78 02 08 01 mvhi r2,0x801
80063b8: 38 42 39 e4 ori r2,r2,0x39e4
80063bc: 38 63 39 e8 ori r3,r3,0x39e8
80063c0: 58 43 00 00 sw (r2+0),r3
head->previous = NULL;
80063c4: 58 40 00 04 sw (r2+4),r0
tail->previous = head;
80063c8: 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;
80063cc: 78 03 08 01 mvhi r3,0x801
80063d0: 78 02 08 01 mvhi r2,0x801
80063d4: 38 42 38 8c ori r2,r2,0x388c
80063d8: 38 63 38 90 ori r3,r3,0x3890
80063dc: 58 43 00 00 sw (r2+0),r3
head->previous = NULL;
80063e0: 58 40 00 04 sw (r2+4),r0
tail->previous = head;
80063e4: 58 42 00 08 sw (r2+8),r2
_Chain_Initialize_empty( &_User_extensions_List );
_Chain_Initialize_empty( &_User_extensions_Switches_list );
if ( initial_extensions ) {
80063e8: 45 60 00 22 be r11,r0,8006470 <_User_extensions_Handler_initialization+0xe8><== NEVER TAKEN
extension = (User_extensions_Control *)
_Workspace_Allocate_or_fatal_error(
number_of_extensions * sizeof( User_extensions_Control )
80063ec: 34 02 00 34 mvi r2,52
80063f0: b9 c0 08 00 mv r1,r14
80063f4: f8 00 29 9a calli 8010a5c <__mulsi3>
80063f8: 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(
80063fc: f8 00 01 d4 calli 8006b4c <_Workspace_Allocate_or_fatal_error>
number_of_extensions * sizeof( User_extensions_Control )
);
memset (
8006400: b9 a0 18 00 mv r3,r13
8006404: 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(
8006408: b8 20 60 00 mv r12,r1
extension,
0,
number_of_extensions * sizeof( User_extensions_Control )
);
for ( i = 0 ; i < number_of_extensions ; i++ ) {
800640c: 34 0d 00 00 mvi r13,0
extension = (User_extensions_Control *)
_Workspace_Allocate_or_fatal_error(
number_of_extensions * sizeof( User_extensions_Control )
);
memset (
8006410: f8 00 16 d7 calli 800bf6c <memset>
extension,
0,
number_of_extensions * sizeof( User_extensions_Control )
);
for ( i = 0 ; i < number_of_extensions ; i++ ) {
8006414: e0 00 00 16 bi 800646c <_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;
8006418: 29 61 00 1c lw r1,(r11+28)
800641c: 29 68 00 00 lw r8,(r11+0)
8006420: 29 67 00 04 lw r7,(r11+4)
8006424: 29 66 00 08 lw r6,(r11+8)
8006428: 29 65 00 0c lw r5,(r11+12)
800642c: 29 64 00 10 lw r4,(r11+16)
8006430: 29 63 00 14 lw r3,(r11+20)
8006434: 29 62 00 18 lw r2,(r11+24)
8006438: 59 81 00 30 sw (r12+48),r1
800643c: 59 88 00 14 sw (r12+20),r8
8006440: 59 87 00 18 sw (r12+24),r7
8006444: 59 86 00 1c sw (r12+28),r6
8006448: 59 85 00 20 sw (r12+32),r5
800644c: 59 84 00 24 sw (r12+36),r4
8006450: 59 83 00 28 sw (r12+40),r3
8006454: 59 82 00 2c sw (r12+44),r2
_User_extensions_Add_set( extension );
8006458: b9 80 08 00 mv r1,r12
800645c: f8 00 0d 35 calli 8009930 <_User_extensions_Add_set>
_User_extensions_Add_set_with_table (extension, &initial_extensions[i]);
extension++;
8006460: 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++ ) {
8006464: 35 ad 00 01 addi r13,r13,1
8006468: 35 6b 00 20 addi r11,r11,32
800646c: 55 cd ff eb bgu r14,r13,8006418 <_User_extensions_Handler_initialization+0x90>
_User_extensions_Add_set_with_table (extension, &initial_extensions[i]);
extension++;
}
}
}
8006470: 2b 9d 00 04 lw ra,(sp+4)
8006474: 2b 8b 00 14 lw r11,(sp+20)
8006478: 2b 8c 00 10 lw r12,(sp+16)
800647c: 2b 8d 00 0c lw r13,(sp+12)
8006480: 2b 8e 00 08 lw r14,(sp+8)
8006484: 37 9c 00 14 addi sp,sp,20
8006488: c3 a0 00 00 ret
080088d4 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
80088d4: 37 9c ff e4 addi sp,sp,-28
80088d8: 5b 8b 00 1c sw (sp+28),r11
80088dc: 5b 8c 00 18 sw (sp+24),r12
80088e0: 5b 8d 00 14 sw (sp+20),r13
80088e4: 5b 8e 00 10 sw (sp+16),r14
80088e8: 5b 8f 00 0c sw (sp+12),r15
80088ec: 5b 90 00 08 sw (sp+8),r16
80088f0: 5b 9d 00 04 sw (sp+4),ra
80088f4: b8 20 60 00 mv r12,r1
80088f8: b8 60 58 00 mv r11,r3
ISR_Level level;
_ISR_Disable( level );
80088fc: 90 00 08 00 rcsr r1,IE
8008900: 34 03 ff fe mvi r3,-2
8008904: a0 23 18 00 and r3,r1,r3
8008908: d0 03 00 00 wcsr IE,r3
}
}
_ISR_Enable( level );
}
800890c: 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 );
8008910: 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 ) ) {
8008914: 44 6e 00 1d be r3,r14,8008988 <_Watchdog_Adjust+0xb4>
switch ( direction ) {
8008918: 44 40 00 04 be r2,r0,8008928 <_Watchdog_Adjust+0x54>
800891c: 34 04 00 01 mvi r4,1
8008920: 5c 44 00 1a bne r2,r4,8008988 <_Watchdog_Adjust+0xb4> <== NEVER TAKEN
8008924: e0 00 00 04 bi 8008934 <_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;
8008928: 34 10 00 01 mvi r16,1
_ISR_Enable( level );
_Watchdog_Tickle( header );
_ISR_Disable( level );
800892c: 34 0f ff fe mvi r15,-2
8008930: e0 00 00 15 bi 8008984 <_Watchdog_Adjust+0xb0>
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
8008934: 28 62 00 10 lw r2,(r3+16)
8008938: b4 4b 58 00 add r11,r2,r11
800893c: 58 6b 00 10 sw (r3+16),r11
break;
8008940: e0 00 00 12 bi 8008988 <_Watchdog_Adjust+0xb4>
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) _Chain_First( header ) );
8008944: 29 82 00 00 lw r2,(r12+0)
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
8008948: 28 4d 00 10 lw r13,(r2+16)
800894c: 51 6d 00 04 bgeu r11,r13,800895c <_Watchdog_Adjust+0x88>
_Watchdog_First( header )->delta_interval -= units;
8008950: c9 ab 58 00 sub r11,r13,r11
8008954: 58 4b 00 10 sw (r2+16),r11
break;
8008958: e0 00 00 0c bi 8008988 <_Watchdog_Adjust+0xb4>
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
800895c: 58 50 00 10 sw (r2+16),r16
_ISR_Enable( level );
8008960: d0 01 00 00 wcsr IE,r1
_Watchdog_Tickle( header );
8008964: b9 80 08 00 mv r1,r12
8008968: f8 00 00 9a calli 8008bd0 <_Watchdog_Tickle>
_ISR_Disable( level );
800896c: 90 00 08 00 rcsr r1,IE
8008970: a0 2f 10 00 and r2,r1,r15
8008974: d0 02 00 00 wcsr IE,r2
if ( _Chain_Is_empty( header ) )
8008978: 29 82 00 00 lw r2,(r12+0)
800897c: 44 4e 00 03 be r2,r14,8008988 <_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;
8008980: 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 ) {
8008984: 5d 60 ff f0 bne r11,r0,8008944 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN
}
break;
}
}
_ISR_Enable( level );
8008988: d0 01 00 00 wcsr IE,r1
}
800898c: 2b 9d 00 04 lw ra,(sp+4)
8008990: 2b 8b 00 1c lw r11,(sp+28)
8008994: 2b 8c 00 18 lw r12,(sp+24)
8008998: 2b 8d 00 14 lw r13,(sp+20)
800899c: 2b 8e 00 10 lw r14,(sp+16)
80089a0: 2b 8f 00 0c lw r15,(sp+12)
80089a4: 2b 90 00 08 lw r16,(sp+8)
80089a8: 37 9c 00 1c addi sp,sp,28
80089ac: c3 a0 00 00 ret
08006914 <_Watchdog_Remove>:
{
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
8006914: 90 00 28 00 rcsr r5,IE
8006918: 34 02 ff fe mvi r2,-2
800691c: a0 a2 10 00 and r2,r5,r2
8006920: d0 02 00 00 wcsr IE,r2
previous_state = the_watchdog->state;
8006924: 28 23 00 08 lw r3,(r1+8)
switch ( previous_state ) {
8006928: 34 02 00 01 mvi r2,1
800692c: 44 62 00 05 be r3,r2,8006940 <_Watchdog_Remove+0x2c>
8006930: 44 60 00 1b be r3,r0,800699c <_Watchdog_Remove+0x88>
8006934: 34 02 00 03 mvi r2,3
8006938: 54 62 00 19 bgu r3,r2,800699c <_Watchdog_Remove+0x88> <== NEVER TAKEN
800693c: e0 00 00 03 bi 8006948 <_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;
8006940: 58 20 00 08 sw (r1+8),r0
break;
8006944: e0 00 00 16 bi 800699c <_Watchdog_Remove+0x88>
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
_ISR_Enable( level );
return( previous_state );
}
8006948: 28 22 00 00 lw r2,(r1+0)
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
800694c: 58 20 00 08 sw (r1+8),r0
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
8006950: 28 44 00 00 lw r4,(r2+0)
8006954: 44 80 00 05 be r4,r0,8006968 <_Watchdog_Remove+0x54>
next_watchdog->delta_interval += the_watchdog->delta_interval;
8006958: 28 46 00 10 lw r6,(r2+16)
800695c: 28 24 00 10 lw r4,(r1+16)
8006960: b4 c4 20 00 add r4,r6,r4
8006964: 58 44 00 10 sw (r2+16),r4
if ( _Watchdog_Sync_count )
8006968: 78 04 08 01 mvhi r4,0x801
800696c: 38 84 39 94 ori r4,r4,0x3994
8006970: 28 84 00 00 lw r4,(r4+0)
8006974: 44 80 00 07 be r4,r0,8006990 <_Watchdog_Remove+0x7c>
_Watchdog_Sync_level = _ISR_Nest_level;
8006978: 78 04 08 01 mvhi r4,0x801
800697c: 38 84 3a 28 ori r4,r4,0x3a28
8006980: 28 86 00 08 lw r6,(r4+8)
8006984: 78 04 08 01 mvhi r4,0x801
8006988: 38 84 39 2c ori r4,r4,0x392c
800698c: 58 86 00 00 sw (r4+0),r6
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
8006990: 28 24 00 04 lw r4,(r1+4)
next->previous = previous;
8006994: 58 44 00 04 sw (r2+4),r4
previous->next = next;
8006998: 58 82 00 00 sw (r4+0),r2
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
800699c: 78 02 08 01 mvhi r2,0x801
80069a0: 38 42 39 98 ori r2,r2,0x3998
80069a4: 28 42 00 00 lw r2,(r2+0)
80069a8: 58 22 00 18 sw (r1+24),r2
_ISR_Enable( level );
80069ac: d0 05 00 00 wcsr IE,r5
return( previous_state );
}
80069b0: b8 60 08 00 mv r1,r3
80069b4: c3 a0 00 00 ret
080084f0 <_Watchdog_Report_chain>:
void _Watchdog_Report_chain(
const char *name,
Chain_Control *header
)
{
80084f0: 37 9c ff ec addi sp,sp,-20
80084f4: 5b 8b 00 14 sw (sp+20),r11
80084f8: 5b 8c 00 10 sw (sp+16),r12
80084fc: 5b 8d 00 0c sw (sp+12),r13
8008500: 5b 8e 00 08 sw (sp+8),r14
8008504: 5b 9d 00 04 sw (sp+4),ra
8008508: b8 20 70 00 mv r14,r1
800850c: b8 40 60 00 mv r12,r2
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
8008510: 90 00 68 00 rcsr r13,IE
8008514: 34 01 ff fe mvi r1,-2
8008518: a1 a1 08 00 and r1,r13,r1
800851c: d0 01 00 00 wcsr IE,r1
printk( "Watchdog Chain: %s %p\n", name, header );
8008520: 78 01 08 01 mvhi r1,0x801
8008524: b9 80 18 00 mv r3,r12
8008528: 38 21 d5 28 ori r1,r1,0xd528
800852c: b9 c0 10 00 mv r2,r14
8008530: fb ff eb b2 calli 80033f8 <printk>
printk( "== end of %s \n", name );
} else {
printk( "Chain is empty\n" );
}
_ISR_Enable( level );
}
8008534: 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 );
8008538: 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 ) ) {
800853c: 45 6c 00 0b be r11,r12,8008568 <_Watchdog_Report_chain+0x78>
node != _Chain_Tail(header) ;
node = node->next )
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
8008540: b9 60 10 00 mv r2,r11
8008544: 34 01 00 00 mvi r1,0
8008548: f8 00 00 13 calli 8008594 <_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 )
800854c: 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 ) ;
8008550: 5d 6c ff fc bne r11,r12,8008540 <_Watchdog_Report_chain+0x50><== NEVER TAKEN
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
8008554: 78 01 08 01 mvhi r1,0x801
8008558: 38 21 d5 40 ori r1,r1,0xd540
800855c: b9 c0 10 00 mv r2,r14
8008560: fb ff eb a6 calli 80033f8 <printk>
8008564: e0 00 00 04 bi 8008574 <_Watchdog_Report_chain+0x84>
} else {
printk( "Chain is empty\n" );
8008568: 78 01 08 01 mvhi r1,0x801
800856c: 38 21 d5 50 ori r1,r1,0xd550
8008570: fb ff eb a2 calli 80033f8 <printk>
}
_ISR_Enable( level );
8008574: d0 0d 00 00 wcsr IE,r13
}
8008578: 2b 9d 00 04 lw ra,(sp+4)
800857c: 2b 8b 00 14 lw r11,(sp+20)
8008580: 2b 8c 00 10 lw r12,(sp+16)
8008584: 2b 8d 00 0c lw r13,(sp+12)
8008588: 2b 8e 00 08 lw r14,(sp+8)
800858c: 37 9c 00 14 addi sp,sp,20
8008590: c3 a0 00 00 ret
080069b8 <_Watchdog_Tickle>:
*/
void _Watchdog_Tickle(
Chain_Control *header
)
{
80069b8: 37 9c ff e4 addi sp,sp,-28
80069bc: 5b 8b 00 1c sw (sp+28),r11
80069c0: 5b 8c 00 18 sw (sp+24),r12
80069c4: 5b 8d 00 14 sw (sp+20),r13
80069c8: 5b 8e 00 10 sw (sp+16),r14
80069cc: 5b 8f 00 0c sw (sp+12),r15
80069d0: 5b 90 00 08 sw (sp+8),r16
80069d4: 5b 9d 00 04 sw (sp+4),ra
80069d8: 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 );
80069dc: 90 00 18 00 rcsr r3,IE
80069e0: 34 01 ff fe mvi r1,-2
80069e4: a0 61 08 00 and r1,r3,r1
80069e8: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
80069ec: 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 );
80069f0: 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 );
80069f4: b8 60 10 00 mv r2,r3
if ( _Chain_Is_empty( header ) )
80069f8: 45 6e 00 1a be r11,r14,8006a60 <_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) {
80069fc: 29 61 00 10 lw r1,(r11+16)
8006a00: 44 20 00 04 be r1,r0,8006a10 <_Watchdog_Tickle+0x58>
the_watchdog->delta_interval--;
8006a04: 34 21 ff ff addi r1,r1,-1
8006a08: 59 61 00 10 sw (r11+16),r1
if ( the_watchdog->delta_interval != 0 )
8006a0c: 5c 20 00 15 bne r1,r0,8006a60 <_Watchdog_Tickle+0xa8>
*/
void _Watchdog_Tickle(
Chain_Control *header
)
{
8006a10: b8 60 68 00 mv r13,r3
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
_ISR_Enable( level );
switch( watchdog_state ) {
8006a14: 34 10 00 02 mvi r16,2
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
8006a18: 34 0f ff fe mvi r15,-2
8006a1c: e0 00 00 02 bi 8006a24 <_Watchdog_Tickle+0x6c>
8006a20: b8 40 68 00 mv r13,r2
if ( the_watchdog->delta_interval != 0 )
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
8006a24: b9 60 08 00 mv r1,r11
8006a28: fb ff ff bb calli 8006914 <_Watchdog_Remove>
_ISR_Enable( level );
8006a2c: d0 0d 00 00 wcsr IE,r13
switch( watchdog_state ) {
8006a30: 5c 30 00 05 bne r1,r16,8006a44 <_Watchdog_Tickle+0x8c> <== NEVER TAKEN
case WATCHDOG_ACTIVE:
(*the_watchdog->routine)(
8006a34: 29 63 00 1c lw r3,(r11+28)
8006a38: 29 61 00 20 lw r1,(r11+32)
8006a3c: 29 62 00 24 lw r2,(r11+36)
8006a40: d8 60 00 00 call r3
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
8006a44: 90 00 10 00 rcsr r2,IE
8006a48: a0 4f 08 00 and r1,r2,r15
8006a4c: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
8006a50: 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) );
8006a54: 45 6e 00 03 be r11,r14,8006a60 <_Watchdog_Tickle+0xa8>
}
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
8006a58: 29 61 00 10 lw r1,(r11+16)
8006a5c: 44 20 ff f1 be r1,r0,8006a20 <_Watchdog_Tickle+0x68>
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
8006a60: d0 02 00 00 wcsr IE,r2
}
8006a64: 2b 9d 00 04 lw ra,(sp+4)
8006a68: 2b 8b 00 1c lw r11,(sp+28)
8006a6c: 2b 8c 00 18 lw r12,(sp+24)
8006a70: 2b 8d 00 14 lw r13,(sp+20)
8006a74: 2b 8e 00 10 lw r14,(sp+16)
8006a78: 2b 8f 00 0c lw r15,(sp+12)
8006a7c: 2b 90 00 08 lw r16,(sp+8)
8006a80: 37 9c 00 1c addi sp,sp,28
8006a84: c3 a0 00 00 ret
08003898 <rtems_chain_get_with_wait>:
rtems_chain_control *chain,
rtems_event_set events,
rtems_interval timeout,
rtems_chain_node **node_ptr
)
{
8003898: 37 9c ff e4 addi sp,sp,-28
800389c: 5b 8b 00 18 sw (sp+24),r11
80038a0: 5b 8c 00 14 sw (sp+20),r12
80038a4: 5b 8d 00 10 sw (sp+16),r13
80038a8: 5b 8e 00 0c sw (sp+12),r14
80038ac: 5b 8f 00 08 sw (sp+8),r15
80038b0: 5b 9d 00 04 sw (sp+4),ra
80038b4: b8 20 78 00 mv r15,r1
80038b8: b8 40 70 00 mv r14,r2
80038bc: b8 60 68 00 mv r13,r3
80038c0: b8 80 60 00 mv r12,r4
80038c4: e0 00 00 08 bi 80038e4 <rtems_chain_get_with_wait+0x4c>
while (
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
) {
rtems_event_set out;
sc = rtems_event_receive(
80038c8: b9 c0 08 00 mv r1,r14
80038cc: 34 02 00 00 mvi r2,0
80038d0: b9 a0 18 00 mv r3,r13
80038d4: 37 84 00 1c addi r4,sp,28
80038d8: fb ff fd d2 calli 8003020 <rtems_event_receive>
80038dc: b8 20 28 00 mv r5,r1
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
80038e0: 5c 2b 00 06 bne r1,r11,80038f8 <rtems_chain_get_with_wait+0x60><== ALWAYS TAKEN
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
80038e4: b9 e0 08 00 mv r1,r15
80038e8: f8 00 01 8b calli 8003f14 <_Chain_Get>
80038ec: b8 20 58 00 mv r11,r1
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
80038f0: 44 20 ff f6 be r1,r0,80038c8 <rtems_chain_get_with_wait+0x30>
80038f4: 34 05 00 00 mvi r5,0
}
*node_ptr = node;
return sc;
}
80038f8: b8 a0 08 00 mv r1,r5
timeout,
&out
);
}
*node_ptr = node;
80038fc: 59 8b 00 00 sw (r12+0),r11
return sc;
}
8003900: 2b 9d 00 04 lw ra,(sp+4)
8003904: 2b 8b 00 18 lw r11,(sp+24)
8003908: 2b 8c 00 14 lw r12,(sp+20)
800390c: 2b 8d 00 10 lw r13,(sp+16)
8003910: 2b 8e 00 0c lw r14,(sp+12)
8003914: 2b 8f 00 08 lw r15,(sp+8)
8003918: 37 9c 00 1c addi sp,sp,28
800391c: c3 a0 00 00 ret
08010ad0 <rtems_clock_set_nanoseconds_extension>:
* error code - if unsuccessful
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
8010ad0: b8 20 18 00 mv r3,r1
if ( !routine )
return RTEMS_INVALID_ADDRESS;
8010ad4: 34 01 00 09 mvi r1,9
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
if ( !routine )
8010ad8: 44 60 00 05 be r3,r0,8010aec <rtems_clock_set_nanoseconds_extension+0x1c><== ALWAYS TAKEN
return RTEMS_INVALID_ADDRESS;
_Watchdog_Nanoseconds_since_tick_handler = routine;
8010adc: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
8010ae0: 38 42 a1 6c ori r2,r2,0xa16c <== NOT EXECUTED
8010ae4: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED
return RTEMS_SUCCESSFUL;
8010ae8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
8010aec: c3 a0 00 00 ret
08006008 <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)
{
8006008: 37 9c ff e4 addi sp,sp,-28
800600c: 5b 8b 00 1c sw (sp+28),r11
8006010: 5b 8c 00 18 sw (sp+24),r12
8006014: 5b 8d 00 14 sw (sp+20),r13
8006018: 5b 8e 00 10 sw (sp+16),r14
800601c: 5b 8f 00 0c sw (sp+12),r15
8006020: 5b 90 00 08 sw (sp+8),r16
8006024: 5b 9d 00 04 sw (sp+4),ra
8006028: b8 20 78 00 mv r15,r1
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
800602c: 44 20 00 18 be r1,r0,800608c <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)
8006030: 78 02 08 01 mvhi r2,0x801
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006034: 78 0b 08 01 mvhi r11,0x801
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8006038: 38 42 fc 3c ori r2,r2,0xfc3c
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
800603c: 39 6b fc 40 ori r11,r11,0xfc40
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8006040: 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 ] )
8006044: 29 61 00 00 lw r1,(r11+0)
8006048: 44 20 00 0f be r1,r0,8006084 <rtems_iterate_over_all_threads+0x7c>
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
800604c: 28 2c 00 04 lw r12,(r1+4)
if ( !information )
8006050: 34 0e 00 04 mvi r14,4
8006054: 34 0d 00 01 mvi r13,1
8006058: 5d 80 00 09 bne r12,r0,800607c <rtems_iterate_over_all_threads+0x74>
800605c: e0 00 00 0a bi 8006084 <rtems_iterate_over_all_threads+0x7c>
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
8006060: 29 81 00 1c lw r1,(r12+28)
8006064: b4 2e 08 00 add r1,r1,r14
8006068: 28 21 00 00 lw r1,(r1+0)
if ( !the_thread )
800606c: 44 20 00 02 be r1,r0,8006074 <rtems_iterate_over_all_threads+0x6c>
continue;
(*routine)(the_thread);
8006070: d9 e0 00 00 call r15
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
8006074: 35 ad 00 01 addi r13,r13,1
8006078: 35 ce 00 04 addi r14,r14,4
800607c: 2d 81 00 10 lhu r1,(r12+16)
8006080: 50 2d ff f8 bgeu r1,r13,8006060 <rtems_iterate_over_all_threads+0x58>
8006084: 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++ ) {
8006088: 5d 70 ff ef bne r11,r16,8006044 <rtems_iterate_over_all_threads+0x3c>
(*routine)(the_thread);
}
}
}
800608c: 2b 9d 00 04 lw ra,(sp+4)
8006090: 2b 8b 00 1c lw r11,(sp+28)
8006094: 2b 8c 00 18 lw r12,(sp+24)
8006098: 2b 8d 00 14 lw r13,(sp+20)
800609c: 2b 8e 00 10 lw r14,(sp+16)
80060a0: 2b 8f 00 0c lw r15,(sp+12)
80060a4: 2b 90 00 08 lw r16,(sp+8)
80060a8: 37 9c 00 1c addi sp,sp,28
80060ac: c3 a0 00 00 ret
080119ec <rtems_partition_create>:
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
80119ec: 37 9c ff d8 addi sp,sp,-40
80119f0: 5b 8b 00 28 sw (sp+40),r11
80119f4: 5b 8c 00 24 sw (sp+36),r12
80119f8: 5b 8d 00 20 sw (sp+32),r13
80119fc: 5b 8e 00 1c sw (sp+28),r14
8011a00: 5b 8f 00 18 sw (sp+24),r15
8011a04: 5b 90 00 14 sw (sp+20),r16
8011a08: 5b 91 00 10 sw (sp+16),r17
8011a0c: 5b 92 00 0c sw (sp+12),r18
8011a10: 5b 93 00 08 sw (sp+8),r19
8011a14: 5b 9d 00 04 sw (sp+4),ra
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
8011a18: 34 07 00 03 mvi r7,3
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
8011a1c: b8 20 88 00 mv r17,r1
8011a20: b8 40 70 00 mv r14,r2
8011a24: b8 60 78 00 mv r15,r3
8011a28: b8 80 60 00 mv r12,r4
8011a2c: b8 a0 98 00 mv r19,r5
8011a30: b8 c0 80 00 mv r16,r6
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
8011a34: 44 20 00 36 be r1,r0,8011b0c <rtems_partition_create+0x120>
return RTEMS_INVALID_NAME;
if ( !starting_address )
return RTEMS_INVALID_ADDRESS;
8011a38: 34 07 00 09 mvi r7,9
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !starting_address )
8011a3c: 44 40 00 34 be r2,r0,8011b0c <rtems_partition_create+0x120>
return RTEMS_INVALID_ADDRESS;
if ( !id )
8011a40: 44 c0 00 33 be r6,r0,8011b0c <rtems_partition_create+0x120><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
8011a44: 64 82 00 00 cmpei r2,r4,0
8011a48: 64 61 00 00 cmpei r1,r3,0
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
8011a4c: 34 07 00 08 mvi r7,8
return RTEMS_INVALID_ADDRESS;
if ( !id )
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
8011a50: b8 41 08 00 or r1,r2,r1
8011a54: 5c 20 00 2e bne r1,r0,8011b0c <rtems_partition_create+0x120>
8011a58: 54 83 00 2d bgu r4,r3,8011b0c <rtems_partition_create+0x120>
*/
RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned (
uint32_t buffer_size
)
{
return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0);
8011a5c: 20 81 00 07 andi r1,r4,0x7
8011a60: 5c 20 00 2b bne r1,r0,8011b0c <rtems_partition_create+0x120>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
8011a64: 21 d2 00 07 andi r18,r14,0x7
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
return RTEMS_INVALID_ADDRESS;
8011a68: 34 07 00 09 mvi r7,9
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
8011a6c: 5e 41 00 28 bne r18,r1,8011b0c <rtems_partition_create+0x120>
8011a70: 78 02 08 03 mvhi r2,0x803
8011a74: 38 42 ec 98 ori r2,r2,0xec98
8011a78: 28 41 00 00 lw r1,(r2+0)
8011a7c: 34 21 00 01 addi r1,r1,1
8011a80: 58 41 00 00 sw (r2+0),r1
* This function allocates a partition control block from
* the inactive chain of free partition control blocks.
*/
RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void )
{
return (Partition_Control *) _Objects_Allocate( &_Partition_Information );
8011a84: 78 0d 08 03 mvhi r13,0x803
8011a88: 39 ad ea f0 ori r13,r13,0xeaf0
8011a8c: b9 a0 08 00 mv r1,r13
8011a90: f8 00 15 c3 calli 801719c <_Objects_Allocate>
8011a94: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
8011a98: 5c 32 00 04 bne r1,r18,8011aa8 <rtems_partition_create+0xbc>
_Thread_Enable_dispatch();
8011a9c: f8 00 1b 94 calli 80188ec <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
8011aa0: 34 07 00 05 mvi r7,5
8011aa4: e0 00 00 1a bi 8011b0c <rtems_partition_create+0x120>
}
#endif
the_partition->starting_address = starting_address;
the_partition->length = length;
the_partition->buffer_size = buffer_size;
8011aa8: 58 2c 00 18 sw (r1+24),r12
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
_Chain_Initialize( &the_partition->Memory, starting_address,
length / buffer_size, buffer_size );
8011aac: b9 80 10 00 mv r2,r12
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
8011ab0: 58 2e 00 10 sw (r1+16),r14
the_partition->length = length;
8011ab4: 58 2f 00 14 sw (r1+20),r15
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
8011ab8: 58 33 00 1c sw (r1+28),r19
the_partition->number_of_used_blocks = 0;
8011abc: 58 20 00 20 sw (r1+32),r0
_Chain_Initialize( &the_partition->Memory, starting_address,
8011ac0: 34 32 00 24 addi r18,r1,36
length / buffer_size, buffer_size );
8011ac4: b9 e0 08 00 mv r1,r15
8011ac8: f8 00 7a 8f calli 8030504 <__udivsi3>
8011acc: b8 20 18 00 mv r3,r1
the_partition->length = length;
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
_Chain_Initialize( &the_partition->Memory, starting_address,
8011ad0: b9 80 20 00 mv r4,r12
8011ad4: ba 40 08 00 mv r1,r18
8011ad8: b9 c0 10 00 mv r2,r14
8011adc: f8 00 0e e5 calli 8015670 <_Chain_Initialize>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8011ae0: 29 6c 00 08 lw r12,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8011ae4: 29 ad 00 1c lw r13,(r13+28)
8011ae8: 34 02 00 02 mvi r2,2
8011aec: 21 81 ff ff andi r1,r12,0xffff
8011af0: fb ff f1 01 calli 800def4 <__ashlsi3>
8011af4: b5 a1 08 00 add r1,r13,r1
8011af8: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8011afc: 59 71 00 0c sw (r11+12),r17
&_Partition_Information,
&the_partition->Object,
(Objects_Name) name
);
*id = the_partition->Object.id;
8011b00: 5a 0c 00 00 sw (r16+0),r12
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
8011b04: f8 00 1b 7a calli 80188ec <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8011b08: 34 07 00 00 mvi r7,0
}
8011b0c: b8 e0 08 00 mv r1,r7
8011b10: 2b 9d 00 04 lw ra,(sp+4)
8011b14: 2b 8b 00 28 lw r11,(sp+40)
8011b18: 2b 8c 00 24 lw r12,(sp+36)
8011b1c: 2b 8d 00 20 lw r13,(sp+32)
8011b20: 2b 8e 00 1c lw r14,(sp+28)
8011b24: 2b 8f 00 18 lw r15,(sp+24)
8011b28: 2b 90 00 14 lw r16,(sp+20)
8011b2c: 2b 91 00 10 lw r17,(sp+16)
8011b30: 2b 92 00 0c lw r18,(sp+12)
8011b34: 2b 93 00 08 lw r19,(sp+8)
8011b38: 37 9c 00 28 addi sp,sp,40
8011b3c: c3 a0 00 00 ret
08010fd8 <rtems_port_internal_to_external>:
rtems_status_code rtems_port_internal_to_external(
rtems_id id,
void *internal,
void **external
)
{
8010fd8: 37 9c ff f0 addi sp,sp,-16
8010fdc: 5b 8b 00 0c sw (sp+12),r11
8010fe0: 5b 8c 00 08 sw (sp+8),r12
8010fe4: 5b 9d 00 04 sw (sp+4),ra
8010fe8: b8 20 20 00 mv r4,r1
8010fec: b8 40 60 00 mv r12,r2
8010ff0: b8 60 58 00 mv r11,r3
register Dual_ported_memory_Control *the_port;
Objects_Locations location;
uint32_t ending;
if ( !external )
return RTEMS_INVALID_ADDRESS;
8010ff4: 34 01 00 09 mvi r1,9
{
register Dual_ported_memory_Control *the_port;
Objects_Locations location;
uint32_t ending;
if ( !external )
8010ff8: 44 60 00 15 be r3,r0,801104c <rtems_port_internal_to_external+0x74><== NEVER TAKEN
8010ffc: 78 01 08 03 mvhi r1,0x803
8011000: b8 80 10 00 mv r2,r4
8011004: 38 21 ea b0 ori r1,r1,0xeab0
8011008: 37 83 00 10 addi r3,sp,16
801100c: f8 00 1a 1d calli 8017880 <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_port = _Dual_ported_memory_Get( id, &location );
switch ( location ) {
8011010: 2b 82 00 10 lw r2,(sp+16)
8011014: 5c 40 00 0d bne r2,r0,8011048 <rtems_port_internal_to_external+0x70>
RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract (
const void *left,
const void *right
)
{
return (int32_t) ((const char *) left - (const char *) right);
8011018: 28 23 00 10 lw r3,(r1+16)
case OBJECTS_LOCAL:
ending = _Addresses_Subtract( internal, the_port->internal_base );
if ( ending > the_port->length )
801101c: 28 22 00 18 lw r2,(r1+24)
8011020: c9 83 18 00 sub r3,r12,r3
8011024: 50 43 00 03 bgeu r2,r3,8011030 <rtems_port_internal_to_external+0x58>
*external = internal;
8011028: 59 6c 00 00 sw (r11+0),r12
801102c: e0 00 00 04 bi 801103c <rtems_port_internal_to_external+0x64>
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
8011030: 28 21 00 14 lw r1,(r1+20)
8011034: b4 23 18 00 add r3,r1,r3
else
*external = _Addresses_Add_offset( the_port->external_base,
8011038: 59 63 00 00 sw (r11+0),r3
ending );
_Thread_Enable_dispatch();
801103c: f8 00 1e 2c calli 80188ec <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8011040: 34 01 00 00 mvi r1,0
8011044: e0 00 00 02 bi 801104c <rtems_port_internal_to_external+0x74>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8011048: 34 01 00 04 mvi r1,4
}
801104c: 2b 9d 00 04 lw ra,(sp+4)
8011050: 2b 8b 00 0c lw r11,(sp+12)
8011054: 2b 8c 00 08 lw r12,(sp+8)
8011058: 37 9c 00 10 addi sp,sp,16
801105c: c3 a0 00 00 ret
0800acd8 <rtems_rate_monotonic_get_statistics>:
rtems_status_code rtems_rate_monotonic_get_statistics(
rtems_id id,
rtems_rate_monotonic_period_statistics *statistics
)
{
800acd8: 37 9c ff f4 addi sp,sp,-12
800acdc: 5b 8b 00 08 sw (sp+8),r11
800ace0: 5b 9d 00 04 sw (sp+4),ra
800ace4: b8 20 18 00 mv r3,r1
800ace8: b8 40 58 00 mv r11,r2
Rate_monotonic_Control *the_period;
rtems_rate_monotonic_period_statistics *dst;
Rate_monotonic_Statistics *src;
if ( !statistics )
return RTEMS_INVALID_ADDRESS;
800acec: 34 01 00 09 mvi r1,9
Objects_Locations location;
Rate_monotonic_Control *the_period;
rtems_rate_monotonic_period_statistics *dst;
Rate_monotonic_Statistics *src;
if ( !statistics )
800acf0: 44 40 00 28 be r2,r0,800ad90 <rtems_rate_monotonic_get_statistics+0xb8><== NEVER TAKEN
800acf4: 78 01 08 01 mvhi r1,0x801
800acf8: b8 60 10 00 mv r2,r3
800acfc: 38 21 f8 78 ori r1,r1,0xf878
800ad00: 37 83 00 0c addi r3,sp,12
800ad04: fb ff ef 11 calli 8006948 <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
800ad08: 2b 82 00 0c lw r2,(sp+12)
800ad0c: 5c 40 00 20 bne r2,r0,800ad8c <rtems_rate_monotonic_get_statistics+0xb4>
case OBJECTS_LOCAL:
dst = statistics;
src = &the_period->Statistics;
dst->count = src->count;
800ad10: 28 22 00 54 lw r2,(r1+84)
800ad14: 59 62 00 00 sw (r11+0),r2
dst->missed_count = src->missed_count;
800ad18: 28 22 00 58 lw r2,(r1+88)
800ad1c: 59 62 00 04 sw (r11+4),r2
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_To_timespec( &src->min_cpu_time, &dst->min_cpu_time );
800ad20: 28 22 00 5c lw r2,(r1+92)
800ad24: 59 62 00 08 sw (r11+8),r2
800ad28: 28 22 00 60 lw r2,(r1+96)
800ad2c: 59 62 00 0c sw (r11+12),r2
_Timestamp_To_timespec( &src->max_cpu_time, &dst->max_cpu_time );
800ad30: 28 22 00 64 lw r2,(r1+100)
800ad34: 59 62 00 10 sw (r11+16),r2
800ad38: 28 22 00 68 lw r2,(r1+104)
800ad3c: 59 62 00 14 sw (r11+20),r2
_Timestamp_To_timespec( &src->total_cpu_time, &dst->total_cpu_time );
800ad40: 28 22 00 6c lw r2,(r1+108)
800ad44: 59 62 00 18 sw (r11+24),r2
800ad48: 28 22 00 70 lw r2,(r1+112)
800ad4c: 59 62 00 1c sw (r11+28),r2
_Timestamp_To_timespec( &src->min_wall_time, &dst->min_wall_time );
800ad50: 28 22 00 74 lw r2,(r1+116)
800ad54: 59 62 00 20 sw (r11+32),r2
800ad58: 28 22 00 78 lw r2,(r1+120)
800ad5c: 59 62 00 24 sw (r11+36),r2
_Timestamp_To_timespec( &src->max_wall_time, &dst->max_wall_time );
800ad60: 28 22 00 7c lw r2,(r1+124)
800ad64: 59 62 00 28 sw (r11+40),r2
800ad68: 28 22 00 80 lw r2,(r1+128)
800ad6c: 59 62 00 2c sw (r11+44),r2
_Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time );
800ad70: 28 22 00 84 lw r2,(r1+132)
800ad74: 28 21 00 88 lw r1,(r1+136)
800ad78: 59 62 00 30 sw (r11+48),r2
800ad7c: 59 61 00 34 sw (r11+52),r1
dst->min_wall_time = src->min_wall_time;
dst->max_wall_time = src->max_wall_time;
dst->total_wall_time = src->total_wall_time;
#endif
_Thread_Enable_dispatch();
800ad80: fb ff f2 bd calli 8007874 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
800ad84: 34 01 00 00 mvi r1,0
800ad88: e0 00 00 02 bi 800ad90 <rtems_rate_monotonic_get_statistics+0xb8>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
800ad8c: 34 01 00 04 mvi r1,4
}
800ad90: 2b 9d 00 04 lw ra,(sp+4)
800ad94: 2b 8b 00 08 lw r11,(sp+8)
800ad98: 37 9c 00 0c addi sp,sp,12
800ad9c: c3 a0 00 00 ret
080040f4 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
80040f4: 37 9c ff e8 addi sp,sp,-24
80040f8: 5b 8b 00 14 sw (sp+20),r11
80040fc: 5b 8c 00 10 sw (sp+16),r12
8004100: 5b 8d 00 0c sw (sp+12),r13
8004104: 5b 8e 00 08 sw (sp+8),r14
8004108: 5b 9d 00 04 sw (sp+4),ra
800410c: b8 20 60 00 mv r12,r1
Objects_Id id,
Objects_Locations *location
)
{
return (Rate_monotonic_Control *)
_Objects_Get( &_Rate_monotonic_Information, id, location );
8004110: 78 01 08 01 mvhi r1,0x801
8004114: b8 40 68 00 mv r13,r2
8004118: 38 21 f8 78 ori r1,r1,0xf878
800411c: b9 80 10 00 mv r2,r12
8004120: 37 83 00 18 addi r3,sp,24
8004124: f8 00 0a 09 calli 8006948 <_Objects_Get>
8004128: b8 20 58 00 mv r11,r1
rtems_rate_monotonic_period_states local_state;
ISR_Level level;
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
800412c: 2b 81 00 18 lw r1,(sp+24)
8004130: 5c 20 00 5f bne r1,r0,80042ac <rtems_rate_monotonic_period+0x1b8>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
8004134: 78 03 08 01 mvhi r3,0x801
8004138: 38 63 fb 40 ori r3,r3,0xfb40
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
800413c: 29 62 00 40 lw r2,(r11+64)
8004140: 28 61 00 0c lw r1,(r3+12)
8004144: 44 41 00 04 be r2,r1,8004154 <rtems_rate_monotonic_period+0x60>
_Thread_Enable_dispatch();
8004148: f8 00 0d cb calli 8007874 <_Thread_Enable_dispatch>
return RTEMS_NOT_OWNER_OF_RESOURCE;
800414c: 34 0c 00 17 mvi r12,23
8004150: e0 00 00 58 bi 80042b0 <rtems_rate_monotonic_period+0x1bc>
}
if ( length == RTEMS_PERIOD_STATUS ) {
8004154: 5d a0 00 0d bne r13,r0,8004188 <rtems_rate_monotonic_period+0x94>
switch ( the_period->state ) {
8004158: 29 61 00 38 lw r1,(r11+56)
800415c: 34 02 00 04 mvi r2,4
8004160: 34 0c 00 00 mvi r12,0
8004164: 54 22 00 07 bgu r1,r2,8004180 <rtems_rate_monotonic_period+0x8c><== NEVER TAKEN
8004168: 78 0b 08 01 mvhi r11,0x801
800416c: 34 02 00 02 mvi r2,2
8004170: fb ff f4 47 calli 800128c <__ashlsi3>
8004174: 39 6b d0 b8 ori r11,r11,0xd0b8
8004178: b5 61 08 00 add r1,r11,r1
800417c: 28 2c 00 00 lw r12,(r1+0)
case RATE_MONOTONIC_ACTIVE:
default: /* unreached -- only to remove warnings */
return_value = RTEMS_SUCCESSFUL;
break;
}
_Thread_Enable_dispatch();
8004180: f8 00 0d bd calli 8007874 <_Thread_Enable_dispatch>
return( return_value );
8004184: e0 00 00 4b bi 80042b0 <rtems_rate_monotonic_period+0x1bc>
}
_ISR_Disable( level );
8004188: 90 00 70 00 rcsr r14,IE
800418c: 34 01 ff fe mvi r1,-2
8004190: a1 c1 08 00 and r1,r14,r1
8004194: d0 01 00 00 wcsr IE,r1
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
8004198: 29 63 00 38 lw r3,(r11+56)
800419c: 5c 60 00 13 bne r3,r0,80041e8 <rtems_rate_monotonic_period+0xf4>
_ISR_Enable( level );
80041a0: d0 0e 00 00 wcsr IE,r14
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
80041a4: b9 60 08 00 mv r1,r11
80041a8: fb ff ff 6e calli 8003f60 <_Rate_monotonic_Initiate_statistics>
the_period->state = RATE_MONOTONIC_ACTIVE;
80041ac: 34 01 00 02 mvi r1,2
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
80041b0: 78 03 08 00 mvhi r3,0x800
80041b4: 59 61 00 38 sw (r11+56),r1
80041b8: 38 63 46 34 ori r3,r3,0x4634
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80041bc: 78 01 08 01 mvhi r1,0x801
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
80041c0: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
80041c4: 59 63 00 2c sw (r11+44),r3
the_watchdog->id = id;
80041c8: 59 6c 00 30 sw (r11+48),r12
the_watchdog->user_data = user_data;
80041cc: 59 60 00 34 sw (r11+52),r0
_Rate_monotonic_Timeout,
id,
NULL
);
the_period->next_length = length;
80041d0: 59 6d 00 3c sw (r11+60),r13
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80041d4: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80041d8: 38 21 fa 60 ori r1,r1,0xfa60
80041dc: 35 62 00 10 addi r2,r11,16
80041e0: f8 00 12 2e calli 8008a98 <_Watchdog_Insert>
80041e4: e0 00 00 1f bi 8004260 <rtems_rate_monotonic_period+0x16c>
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_ACTIVE ) {
80041e8: 34 01 00 02 mvi r1,2
80041ec: 5c 61 00 20 bne r3,r1,800426c <rtems_rate_monotonic_period+0x178>
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
80041f0: b9 60 08 00 mv r1,r11
80041f4: fb ff ff 80 calli 8003ff4 <_Rate_monotonic_Update_statistics>
/*
* This tells the _Rate_monotonic_Timeout that this task is
* in the process of blocking on the period and that we
* may be changing the length of the next period.
*/
the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING;
80041f8: 34 01 00 01 mvi r1,1
80041fc: 59 61 00 38 sw (r11+56),r1
the_period->next_length = length;
8004200: 59 6d 00 3c sw (r11+60),r13
_ISR_Enable( level );
8004204: d0 0e 00 00 wcsr IE,r14
_Thread_Executing->Wait.id = the_period->Object.id;
8004208: 78 01 08 01 mvhi r1,0x801
800420c: 38 21 fb 40 ori r1,r1,0xfb40
8004210: 29 62 00 08 lw r2,(r11+8)
8004214: 28 21 00 0c lw r1,(r1+12)
8004218: 58 22 00 20 sw (r1+32),r2
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
800421c: 34 02 40 00 mvi r2,16384
8004220: f8 00 10 1f calli 800829c <_Thread_Set_state>
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
8004224: 90 00 08 00 rcsr r1,IE
8004228: 34 02 ff fe mvi r2,-2
800422c: a0 22 10 00 and r2,r1,r2
8004230: d0 02 00 00 wcsr IE,r2
local_state = the_period->state;
the_period->state = RATE_MONOTONIC_ACTIVE;
8004234: 34 03 00 02 mvi r3,2
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
local_state = the_period->state;
8004238: 29 62 00 38 lw r2,(r11+56)
the_period->state = RATE_MONOTONIC_ACTIVE;
800423c: 59 63 00 38 sw (r11+56),r3
_ISR_Enable( level );
8004240: d0 01 00 00 wcsr IE,r1
/*
* If it did, then we want to unblock ourself and continue as
* if nothing happen. The period was reset in the timeout routine.
*/
if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING )
8004244: 34 01 00 03 mvi r1,3
8004248: 5c 41 00 06 bne r2,r1,8004260 <rtems_rate_monotonic_period+0x16c>
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
800424c: 78 01 08 01 mvhi r1,0x801
8004250: 38 21 fb 40 ori r1,r1,0xfb40
8004254: 28 21 00 0c lw r1,(r1+12)
8004258: 34 02 40 00 mvi r2,16384
800425c: f8 00 0c c2 calli 8007564 <_Thread_Clear_state>
_Thread_Enable_dispatch();
8004260: f8 00 0d 85 calli 8007874 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8004264: 34 0c 00 00 mvi r12,0
8004268: e0 00 00 12 bi 80042b0 <rtems_rate_monotonic_period+0x1bc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
800426c: 34 0c 00 04 mvi r12,4
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_EXPIRED ) {
8004270: 5c 6c 00 10 bne r3,r12,80042b0 <rtems_rate_monotonic_period+0x1bc><== NEVER TAKEN
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
8004274: b9 60 08 00 mv r1,r11
8004278: fb ff ff 5f calli 8003ff4 <_Rate_monotonic_Update_statistics>
_ISR_Enable( level );
800427c: d0 0e 00 00 wcsr IE,r14
the_period->state = RATE_MONOTONIC_ACTIVE;
8004280: 34 01 00 02 mvi r1,2
8004284: 59 61 00 38 sw (r11+56),r1
8004288: 78 01 08 01 mvhi r1,0x801
800428c: 38 21 fa 60 ori r1,r1,0xfa60
8004290: 35 62 00 10 addi r2,r11,16
the_period->next_length = length;
8004294: 59 6d 00 3c sw (r11+60),r13
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8004298: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800429c: f8 00 11 ff calli 8008a98 <_Watchdog_Insert>
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
return RTEMS_TIMEOUT;
80042a0: 34 0c 00 06 mvi r12,6
the_period->state = RATE_MONOTONIC_ACTIVE;
the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
80042a4: f8 00 0d 74 calli 8007874 <_Thread_Enable_dispatch>
return RTEMS_TIMEOUT;
80042a8: e0 00 00 02 bi 80042b0 <rtems_rate_monotonic_period+0x1bc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
80042ac: 34 0c 00 04 mvi r12,4
}
80042b0: b9 80 08 00 mv r1,r12
80042b4: 2b 9d 00 04 lw ra,(sp+4)
80042b8: 2b 8b 00 14 lw r11,(sp+20)
80042bc: 2b 8c 00 10 lw r12,(sp+16)
80042c0: 2b 8d 00 0c lw r13,(sp+12)
80042c4: 2b 8e 00 08 lw r14,(sp+8)
80042c8: 37 9c 00 18 addi sp,sp,24
80042cc: c3 a0 00 00 ret
080042d0 <rtems_rate_monotonic_report_statistics_with_plugin>:
*/
void rtems_rate_monotonic_report_statistics_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
80042d0: 37 9c ff 5c addi sp,sp,-164
80042d4: 5b 8b 00 44 sw (sp+68),r11
80042d8: 5b 8c 00 40 sw (sp+64),r12
80042dc: 5b 8d 00 3c sw (sp+60),r13
80042e0: 5b 8e 00 38 sw (sp+56),r14
80042e4: 5b 8f 00 34 sw (sp+52),r15
80042e8: 5b 90 00 30 sw (sp+48),r16
80042ec: 5b 91 00 2c sw (sp+44),r17
80042f0: 5b 92 00 28 sw (sp+40),r18
80042f4: 5b 93 00 24 sw (sp+36),r19
80042f8: 5b 94 00 20 sw (sp+32),r20
80042fc: 5b 95 00 1c sw (sp+28),r21
8004300: 5b 96 00 18 sw (sp+24),r22
8004304: 5b 97 00 14 sw (sp+20),r23
8004308: 5b 98 00 10 sw (sp+16),r24
800430c: 5b 99 00 0c sw (sp+12),r25
8004310: 5b 9b 00 08 sw (sp+8),fp
8004314: 5b 9d 00 04 sw (sp+4),ra
8004318: b8 20 60 00 mv r12,r1
800431c: b8 40 58 00 mv r11,r2
rtems_id id;
rtems_rate_monotonic_period_statistics the_stats;
rtems_rate_monotonic_period_status the_status;
char name[5];
if ( !print )
8004320: 44 40 00 72 be r2,r0,80044e8 <rtems_rate_monotonic_report_statistics_with_plugin+0x218><== NEVER TAKEN
return;
(*print)( context, "Period information by period\n" );
8004324: 78 02 08 01 mvhi r2,0x801
8004328: 38 42 d0 cc ori r2,r2,0xd0cc
800432c: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)( context, "--- CPU times are in seconds ---\n" );
8004330: 78 02 08 01 mvhi r2,0x801
8004334: 38 42 d0 ec ori r2,r2,0xd0ec
8004338: b9 80 08 00 mv r1,r12
800433c: d9 60 00 00 call r11
(*print)( context, "--- Wall times are in seconds ---\n" );
8004340: 78 02 08 01 mvhi r2,0x801
8004344: 38 42 d1 10 ori r2,r2,0xd110
8004348: b9 80 08 00 mv r1,r12
800434c: d9 60 00 00 call r11
Be sure to test the various cases.
(*print)( context,"\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
*/
(*print)( context, " ID OWNER COUNT MISSED "
8004350: 78 02 08 01 mvhi r2,0x801
8004354: 38 42 d1 34 ori r2,r2,0xd134
8004358: b9 80 08 00 mv r1,r12
800435c: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
" "
#endif
" WALL TIME\n"
);
(*print)( context, " "
8004360: 78 02 08 01 mvhi r2,0x801
8004364: b9 80 08 00 mv r1,r12
8004368: 38 42 d1 80 ori r2,r2,0xd180
800436c: d9 60 00 00 call r11
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
8004370: 78 01 08 01 mvhi r1,0x801
8004374: 38 21 f8 78 ori r1,r1,0xf878
rtems_object_get_name( the_status.owner, sizeof(name), name );
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8004378: 78 11 08 01 mvhi r17,0x801
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
(*print)( context,
800437c: 78 10 08 01 mvhi r16,0x801
struct timespec *min_wall = &the_stats.min_wall_time;
struct timespec *max_wall = &the_stats.max_wall_time;
struct timespec *total_wall = &the_stats.total_wall_time;
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
8004380: 78 0f 08 01 mvhi r15,0x801
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
8004384: 78 0e 08 01 mvhi r14,0x801
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
8004388: 28 2d 00 08 lw r13,(r1+8)
id <= _Rate_monotonic_Information.maximum_id ;
800438c: b8 20 a0 00 mv r20,r1
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
8004390: 37 99 00 48 addi r25,sp,72
#if defined(RTEMS_DEBUG)
status = rtems_rate_monotonic_get_status( id, &the_status );
if ( status != RTEMS_SUCCESSFUL )
continue;
#else
(void) rtems_rate_monotonic_get_status( id, &the_status );
8004394: 37 98 00 80 addi r24,sp,128
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
8004398: 37 93 00 a0 addi r19,sp,160
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
800439c: 3a 31 d1 cc ori r17,r17,0xd1cc
{
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
struct timespec cpu_average;
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
80043a0: 37 97 00 60 addi r23,sp,96
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
80043a4: 37 92 00 98 addi r18,sp,152
(*print)( context,
80043a8: 3a 10 d1 e4 ori r16,r16,0xd1e4
{
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
struct timespec wall_average;
struct timespec *min_wall = &the_stats.min_wall_time;
struct timespec *max_wall = &the_stats.max_wall_time;
struct timespec *total_wall = &the_stats.total_wall_time;
80043ac: 37 96 00 78 addi r22,sp,120
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
80043b0: 39 ef d2 04 ori r15,r15,0xd204
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
80043b4: 39 ce c7 10 ori r14,r14,0xc710
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
80043b8: e0 00 00 4a bi 80044e0 <rtems_rate_monotonic_report_statistics_with_plugin+0x210>
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
80043bc: b9 a0 08 00 mv r1,r13
80043c0: bb 20 10 00 mv r2,r25
80043c4: f8 00 1a 45 calli 800acd8 <rtems_rate_monotonic_get_statistics>
80043c8: b8 20 a8 00 mv r21,r1
if ( status != RTEMS_SUCCESSFUL )
80043cc: 5c 20 00 44 bne r1,r0,80044dc <rtems_rate_monotonic_report_statistics_with_plugin+0x20c>
#if defined(RTEMS_DEBUG)
status = rtems_rate_monotonic_get_status( id, &the_status );
if ( status != RTEMS_SUCCESSFUL )
continue;
#else
(void) rtems_rate_monotonic_get_status( id, &the_status );
80043d0: bb 00 10 00 mv r2,r24
80043d4: b9 a0 08 00 mv r1,r13
80043d8: f8 00 1a 72 calli 800ada0 <rtems_rate_monotonic_get_status>
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
80043dc: 2b 81 00 80 lw r1,(sp+128)
80043e0: 34 02 00 05 mvi r2,5
80043e4: ba 60 18 00 mv r3,r19
80043e8: f8 00 00 c3 calli 80046f4 <rtems_object_get_name>
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
80043ec: 2b 85 00 48 lw r5,(sp+72)
80043f0: 2b 86 00 4c lw r6,(sp+76)
80043f4: ba 20 10 00 mv r2,r17
80043f8: b9 80 08 00 mv r1,r12
80043fc: b9 a0 18 00 mv r3,r13
8004400: ba 60 20 00 mv r4,r19
8004404: d9 60 00 00 call r11
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
8004408: 2b 82 00 48 lw r2,(sp+72)
800440c: 5c 55 00 05 bne r2,r21,8004420 <rtems_rate_monotonic_report_statistics_with_plugin+0x150>
(*print)( context, "\n" );
8004410: b9 80 08 00 mv r1,r12
8004414: b9 c0 10 00 mv r2,r14
8004418: d9 60 00 00 call r11
continue;
800441c: e0 00 00 30 bi 80044dc <rtems_rate_monotonic_report_statistics_with_plugin+0x20c>
struct timespec cpu_average;
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
8004420: ba 40 18 00 mv r3,r18
8004424: ba e0 08 00 mv r1,r23
8004428: f8 00 10 52 calli 8008570 <_Timespec_Divide_by_integer>
(*print)( context,
800442c: 2b 81 00 54 lw r1,(sp+84)
8004430: 34 02 03 e8 mvi r2,1000
8004434: f8 00 5d 1e calli 801b8ac <__divsi3>
8004438: b8 20 d8 00 mv fp,r1
800443c: 2b 81 00 5c lw r1,(sp+92)
8004440: 34 02 03 e8 mvi r2,1000
8004444: f8 00 5d 1a calli 801b8ac <__divsi3>
8004448: b8 20 a8 00 mv r21,r1
800444c: 2b 81 00 9c lw r1,(sp+156)
8004450: 34 02 03 e8 mvi r2,1000
8004454: f8 00 5d 16 calli 801b8ac <__divsi3>
8004458: 2b 85 00 58 lw r5,(sp+88)
800445c: 2b 87 00 98 lw r7,(sp+152)
8004460: 2b 83 00 50 lw r3,(sp+80)
8004464: b8 20 40 00 mv r8,r1
8004468: bb 60 20 00 mv r4,fp
800446c: ba a0 30 00 mv r6,r21
8004470: ba 00 10 00 mv r2,r16
8004474: b9 80 08 00 mv r1,r12
8004478: d9 60 00 00 call r11
struct timespec wall_average;
struct timespec *min_wall = &the_stats.min_wall_time;
struct timespec *max_wall = &the_stats.max_wall_time;
struct timespec *total_wall = &the_stats.total_wall_time;
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
800447c: 2b 82 00 48 lw r2,(sp+72)
8004480: ba 40 18 00 mv r3,r18
8004484: ba c0 08 00 mv r1,r22
8004488: f8 00 10 3a calli 8008570 <_Timespec_Divide_by_integer>
(*print)( context,
800448c: 2b 81 00 6c lw r1,(sp+108)
8004490: 34 02 03 e8 mvi r2,1000
8004494: f8 00 5d 06 calli 801b8ac <__divsi3>
8004498: b8 20 d8 00 mv fp,r1
800449c: 2b 81 00 74 lw r1,(sp+116)
80044a0: 34 02 03 e8 mvi r2,1000
80044a4: f8 00 5d 02 calli 801b8ac <__divsi3>
80044a8: b8 20 a8 00 mv r21,r1
80044ac: 2b 81 00 9c lw r1,(sp+156)
80044b0: 34 02 03 e8 mvi r2,1000
80044b4: f8 00 5c fe calli 801b8ac <__divsi3>
80044b8: 2b 83 00 68 lw r3,(sp+104)
80044bc: 2b 85 00 70 lw r5,(sp+112)
80044c0: 2b 87 00 98 lw r7,(sp+152)
80044c4: b8 20 40 00 mv r8,r1
80044c8: b9 e0 10 00 mv r2,r15
80044cc: b9 80 08 00 mv r1,r12
80044d0: bb 60 20 00 mv r4,fp
80044d4: ba a0 30 00 mv r6,r21
80044d8: d9 60 00 00 call r11
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
80044dc: 35 ad 00 01 addi r13,r13,1
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
80044e0: 2a 81 00 0c lw r1,(r20+12)
80044e4: 50 2d ff b6 bgeu r1,r13,80043bc <rtems_rate_monotonic_report_statistics_with_plugin+0xec>
the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall
);
#endif
}
}
}
80044e8: 2b 9d 00 04 lw ra,(sp+4)
80044ec: 2b 8b 00 44 lw r11,(sp+68)
80044f0: 2b 8c 00 40 lw r12,(sp+64)
80044f4: 2b 8d 00 3c lw r13,(sp+60)
80044f8: 2b 8e 00 38 lw r14,(sp+56)
80044fc: 2b 8f 00 34 lw r15,(sp+52)
8004500: 2b 90 00 30 lw r16,(sp+48)
8004504: 2b 91 00 2c lw r17,(sp+44)
8004508: 2b 92 00 28 lw r18,(sp+40)
800450c: 2b 93 00 24 lw r19,(sp+36)
8004510: 2b 94 00 20 lw r20,(sp+32)
8004514: 2b 95 00 1c lw r21,(sp+28)
8004518: 2b 96 00 18 lw r22,(sp+24)
800451c: 2b 97 00 14 lw r23,(sp+20)
8004520: 2b 98 00 10 lw r24,(sp+16)
8004524: 2b 99 00 0c lw r25,(sp+12)
8004528: 2b 9b 00 08 lw fp,(sp+8)
800452c: 37 9c 00 a4 addi sp,sp,164
8004530: c3 a0 00 00 ret
080027d4 <rtems_semaphore_create>:
uint32_t count,
rtems_attribute attribute_set,
rtems_task_priority priority_ceiling,
rtems_id *id
)
{
80027d4: 37 9c ff c8 addi sp,sp,-56
80027d8: 5b 8b 00 20 sw (sp+32),r11
80027dc: 5b 8c 00 1c sw (sp+28),r12
80027e0: 5b 8d 00 18 sw (sp+24),r13
80027e4: 5b 8e 00 14 sw (sp+20),r14
80027e8: 5b 8f 00 10 sw (sp+16),r15
80027ec: 5b 90 00 0c sw (sp+12),r16
80027f0: 5b 91 00 08 sw (sp+8),r17
80027f4: 5b 9d 00 04 sw (sp+4),ra
80027f8: b8 20 80 00 mv r16,r1
80027fc: b8 40 70 00 mv r14,r2
8002800: b8 60 60 00 mv r12,r3
8002804: b8 80 88 00 mv r17,r4
8002808: b8 a0 78 00 mv r15,r5
CORE_mutex_Attributes the_mutex_attr;
CORE_semaphore_Attributes the_semaphore_attr;
CORE_mutex_Status mutex_status;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
800280c: 34 01 00 03 mvi r1,3
register Semaphore_Control *the_semaphore;
CORE_mutex_Attributes the_mutex_attr;
CORE_semaphore_Attributes the_semaphore_attr;
CORE_mutex_Status mutex_status;
if ( !rtems_is_name_valid( name ) )
8002810: 46 00 00 64 be r16,r0,80029a0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
return RTEMS_INVALID_NAME;
if ( !id )
return RTEMS_INVALID_ADDRESS;
8002814: 34 01 00 09 mvi r1,9
CORE_mutex_Status mutex_status;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !id )
8002818: 44 a0 00 62 be r5,r0,80029a0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
* id - semaphore id
* RTEMS_SUCCESSFUL - if successful
* error code - if unsuccessful
*/
rtems_status_code rtems_semaphore_create(
800281c: 20 62 00 c0 andi r2,r3,0xc0
return RTEMS_NOT_DEFINED;
} else
#endif
if ( _Attributes_Is_inherit_priority( attribute_set ) ||
8002820: 44 40 00 09 be r2,r0,8002844 <rtems_semaphore_create+0x70>
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore(
rtems_attribute attribute_set
)
{
return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE);
8002824: 20 64 00 30 andi r4,r3,0x30
_Attributes_Is_priority_ceiling( attribute_set ) ) {
if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) &&
8002828: 34 03 00 10 mvi r3,16
_Attributes_Is_priority( attribute_set ) ) )
return RTEMS_NOT_DEFINED;
800282c: 34 01 00 0b mvi r1,11
#endif
if ( _Attributes_Is_inherit_priority( attribute_set ) ||
_Attributes_Is_priority_ceiling( attribute_set ) ) {
if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) &&
8002830: 5c 83 00 5c bne r4,r3,80029a0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_PRIORITY ) ? true : false;
8002834: 21 83 00 04 andi r3,r12,0x4
8002838: 44 60 00 5a be r3,r0,80029a0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
_Attributes_Is_priority( attribute_set ) ) )
return RTEMS_NOT_DEFINED;
}
if ( _Attributes_Is_inherit_priority( attribute_set ) &&
800283c: 34 03 00 c0 mvi r3,192
8002840: 44 43 00 58 be r2,r3,80029a0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore(
rtems_attribute attribute_set
)
{
return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE);
8002844: 21 8d 00 30 andi r13,r12,0x30
_Attributes_Is_priority_ceiling( attribute_set ) )
return RTEMS_NOT_DEFINED;
if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) )
8002848: 45 a0 00 04 be r13,r0,8002858 <rtems_semaphore_create+0x84>
800284c: 34 02 00 01 mvi r2,1
return RTEMS_INVALID_NUMBER;
8002850: 34 01 00 0a mvi r1,10
if ( _Attributes_Is_inherit_priority( attribute_set ) &&
_Attributes_Is_priority_ceiling( attribute_set ) )
return RTEMS_NOT_DEFINED;
if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) )
8002854: 55 c2 00 53 bgu r14,r2,80029a0 <rtems_semaphore_create+0x1cc><== NEVER TAKEN
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
8002858: 78 06 08 01 mvhi r6,0x801
800285c: 38 c6 38 88 ori r6,r6,0x3888
8002860: 28 c1 00 00 lw r1,(r6+0)
8002864: 34 21 00 01 addi r1,r1,1
8002868: 58 c1 00 00 sw (r6+0),r1
* This function allocates a semaphore control block from
* the inactive chain of free semaphore control blocks.
*/
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )
{
return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information );
800286c: 78 01 08 01 mvhi r1,0x801
8002870: 38 21 37 a0 ori r1,r1,0x37a0
8002874: f8 00 06 04 calli 8004084 <_Objects_Allocate>
8002878: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* prevents deletion */
the_semaphore = _Semaphore_Allocate();
if ( !the_semaphore ) {
800287c: 5c 20 00 04 bne r1,r0,800288c <rtems_semaphore_create+0xb8>
_Thread_Enable_dispatch();
8002880: f8 00 0b 61 calli 8005604 <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
8002884: 34 01 00 05 mvi r1,5
8002888: e0 00 00 46 bi 80029a0 <rtems_semaphore_create+0x1cc>
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_semaphore->attribute_set = attribute_set;
800288c: 58 2c 00 10 sw (r1+16),r12
8002890: 21 81 00 04 andi r1,r12,0x4
/*
* Initialize it as a counting semaphore.
*/
if ( _Attributes_Is_counting_semaphore( attribute_set ) ) {
8002894: 5d a0 00 0f bne r13,r0,80028d0 <rtems_semaphore_create+0xfc>
/*
* This effectively disables limit checking.
*/
the_semaphore_attr.maximum_count = 0xFFFFFFFF;
8002898: 34 02 ff ff mvi r2,-1
800289c: 5b 82 00 34 sw (sp+52),r2
if ( _Attributes_Is_priority( attribute_set ) )
80028a0: 44 2d 00 04 be r1,r13,80028b0 <rtems_semaphore_create+0xdc>
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY;
80028a4: 34 01 00 01 mvi r1,1
80028a8: 5b 81 00 38 sw (sp+56),r1
80028ac: e0 00 00 02 bi 80028b4 <rtems_semaphore_create+0xe0>
else
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
80028b0: 5b 80 00 38 sw (sp+56),r0
* The following are just to make Purify happy.
*/
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM;
_CORE_semaphore_Initialize(
80028b4: 35 61 00 14 addi r1,r11,20
80028b8: 37 82 00 34 addi r2,sp,52
80028bc: b9 c0 18 00 mv r3,r14
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* The following are just to make Purify happy.
*/
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
80028c0: 5b 80 00 24 sw (sp+36),r0
the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM;
80028c4: 5b 80 00 30 sw (sp+48),r0
_CORE_semaphore_Initialize(
80028c8: f8 00 04 01 calli 80038cc <_CORE_semaphore_Initialize>
80028cc: e0 00 00 28 bi 800296c <rtems_semaphore_create+0x198>
} else {
/*
* It is either simple binary semaphore or a more powerful mutex
* style binary semaphore. This is the mutex style.
*/
if ( _Attributes_Is_priority( attribute_set ) )
80028d0: 44 20 00 04 be r1,r0,80028e0 <rtems_semaphore_create+0x10c>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY;
80028d4: 34 01 00 01 mvi r1,1
80028d8: 5b 81 00 2c sw (sp+44),r1
80028dc: e0 00 00 02 bi 80028e4 <rtems_semaphore_create+0x110>
else
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
80028e0: 5b 80 00 2c sw (sp+44),r0
if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
80028e4: 34 01 00 10 mvi r1,16
80028e8: 5d a1 00 11 bne r13,r1,800292c <rtems_semaphore_create+0x158>
the_mutex_attr.priority_ceiling = priority_ceiling;
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
the_mutex_attr.only_owner_release = false;
if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) {
80028ec: 2b 82 00 2c lw r2,(sp+44)
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY;
else
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
the_mutex_attr.priority_ceiling = priority_ceiling;
80028f0: 5b 91 00 30 sw (sp+48),r17
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
80028f4: 5b 80 00 24 sw (sp+36),r0
the_mutex_attr.only_owner_release = false;
80028f8: 33 80 00 28 sb (sp+40),r0
if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) {
80028fc: 34 01 00 01 mvi r1,1
8002900: 5c 41 00 0e bne r2,r1,8002938 <rtems_semaphore_create+0x164>
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_inherit_priority(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_INHERIT_PRIORITY ) ? true : false;
8002904: 21 81 00 40 andi r1,r12,0x40
if ( _Attributes_Is_inherit_priority( attribute_set ) ) {
8002908: 44 20 00 03 be r1,r0,8002914 <rtems_semaphore_create+0x140>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
800290c: 34 01 00 02 mvi r1,2
8002910: e0 00 00 04 bi 8002920 <rtems_semaphore_create+0x14c>
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_PRIORITY_CEILING ) ? true : false;
8002914: 21 8c 00 80 andi r12,r12,0x80
the_mutex_attr.only_owner_release = true;
} else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) {
8002918: 45 81 00 08 be r12,r1,8002938 <rtems_semaphore_create+0x164>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
800291c: 34 01 00 03 mvi r1,3
8002920: 5b 81 00 2c sw (sp+44),r1
the_mutex_attr.only_owner_release = true;
8002924: 33 82 00 28 sb (sp+40),r2
8002928: e0 00 00 04 bi 8002938 <rtems_semaphore_create+0x164>
}
}
} else /* must be simple binary semaphore */ {
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS;
800292c: 34 01 00 01 mvi r1,1
8002930: 5b 81 00 24 sw (sp+36),r1
the_mutex_attr.only_owner_release = false;
8002934: 33 80 00 28 sb (sp+40),r0
}
mutex_status = _CORE_mutex_Initialize(
8002938: 65 c3 00 01 cmpei r3,r14,1
800293c: 37 82 00 24 addi r2,sp,36
8002940: 35 61 00 14 addi r1,r11,20
8002944: f8 00 03 0e calli 800357c <_CORE_mutex_Initialize>
&the_semaphore->Core_control.mutex,
&the_mutex_attr,
(count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED
);
if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) {
8002948: 34 02 00 05 mvi r2,5
800294c: 5c 22 00 08 bne r1,r2,800296c <rtems_semaphore_create+0x198>
*/
RTEMS_INLINE_ROUTINE void _Semaphore_Free (
Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
8002950: 78 01 08 01 mvhi r1,0x801
8002954: 38 21 37 a0 ori r1,r1,0x37a0
8002958: b9 60 10 00 mv r2,r11
800295c: f8 00 06 c5 calli 8004470 <_Objects_Free>
_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
8002960: f8 00 0b 29 calli 8005604 <_Thread_Enable_dispatch>
return RTEMS_INVALID_PRIORITY;
8002964: 34 01 00 13 mvi r1,19
8002968: e0 00 00 0e bi 80029a0 <rtems_semaphore_create+0x1cc>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
800296c: 29 6c 00 08 lw r12,(r11+8)
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
8002970: 78 02 08 01 mvhi r2,0x801
8002974: 38 42 37 a0 ori r2,r2,0x37a0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8002978: 28 4d 00 1c lw r13,(r2+28)
800297c: 21 81 ff ff andi r1,r12,0xffff
8002980: 34 02 00 02 mvi r2,2
8002984: f8 00 37 c1 calli 8010888 <__ashlsi3>
8002988: b5 a1 08 00 add r1,r13,r1
800298c: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8002990: 59 70 00 0c sw (r11+12),r16
&_Semaphore_Information,
&the_semaphore->Object,
(Objects_Name) name
);
*id = the_semaphore->Object.id;
8002994: 59 ec 00 00 sw (r15+0),r12
the_semaphore->Object.id,
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
8002998: f8 00 0b 1b calli 8005604 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
800299c: 34 01 00 00 mvi r1,0
}
80029a0: 2b 9d 00 04 lw ra,(sp+4)
80029a4: 2b 8b 00 20 lw r11,(sp+32)
80029a8: 2b 8c 00 1c lw r12,(sp+28)
80029ac: 2b 8d 00 18 lw r13,(sp+24)
80029b0: 2b 8e 00 14 lw r14,(sp+20)
80029b4: 2b 8f 00 10 lw r15,(sp+16)
80029b8: 2b 90 00 0c lw r16,(sp+12)
80029bc: 2b 91 00 08 lw r17,(sp+8)
80029c0: 37 9c 00 38 addi sp,sp,56
80029c4: c3 a0 00 00 ret
08013414 <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
8013414: 37 9c ff f4 addi sp,sp,-12
8013418: 5b 8b 00 08 sw (sp+8),r11
801341c: 5b 9d 00 04 sw (sp+4),ra
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
8013420: 34 03 00 0a mvi r3,10
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
8013424: b8 40 58 00 mv r11,r2
register Thread_Control *the_thread;
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
8013428: 44 40 00 29 be r2,r0,80134cc <rtems_signal_send+0xb8>
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
801342c: 37 82 00 0c addi r2,sp,12
8013430: f8 00 15 3c calli 8018920 <_Thread_Get>
switch ( location ) {
8013434: 2b 82 00 0c lw r2,(sp+12)
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8013438: 34 03 00 04 mvi r3,4
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
switch ( location ) {
801343c: 5c 40 00 24 bne r2,r0,80134cc <rtems_signal_send+0xb8>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
8013440: 28 23 01 18 lw r3,(r1+280)
asr = &api->Signal;
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
8013444: 28 64 00 0c lw r4,(r3+12)
8013448: 44 82 00 1f be r4,r2,80134c4 <rtems_signal_send+0xb0>
if ( asr->is_enabled ) {
801344c: 40 62 00 08 lbu r2,(r3+8)
8013450: 44 40 00 12 be r2,r0,8013498 <rtems_signal_send+0x84>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
8013454: 90 00 10 00 rcsr r2,IE
8013458: 34 04 ff fe mvi r4,-2
801345c: a0 44 20 00 and r4,r2,r4
8013460: d0 04 00 00 wcsr IE,r4
*signal_set |= signals;
8013464: 28 64 00 14 lw r4,(r3+20)
8013468: b8 8b 58 00 or r11,r4,r11
801346c: 58 6b 00 14 sw (r3+20),r11
_ISR_Enable( _level );
8013470: d0 02 00 00 wcsr IE,r2
_ASR_Post_signals( signal_set, &asr->signals_posted );
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
8013474: 78 02 08 03 mvhi r2,0x803
8013478: 38 42 ee 40 ori r2,r2,0xee40
801347c: 28 43 00 08 lw r3,(r2+8)
8013480: 44 60 00 0e be r3,r0,80134b8 <rtems_signal_send+0xa4>
8013484: 28 43 00 0c lw r3,(r2+12)
8013488: 5c 23 00 0c bne r1,r3,80134b8 <rtems_signal_send+0xa4> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
801348c: 34 01 00 01 mvi r1,1
8013490: 30 41 00 18 sb (r2+24),r1
8013494: e0 00 00 09 bi 80134b8 <rtems_signal_send+0xa4>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
8013498: 90 00 08 00 rcsr r1,IE
801349c: 34 02 ff fe mvi r2,-2
80134a0: a0 22 10 00 and r2,r1,r2
80134a4: d0 02 00 00 wcsr IE,r2
*signal_set |= signals;
80134a8: 28 62 00 18 lw r2,(r3+24)
80134ac: b8 4b 58 00 or r11,r2,r11
80134b0: 58 6b 00 18 sw (r3+24),r11
_ISR_Enable( _level );
80134b4: d0 01 00 00 wcsr IE,r1
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
80134b8: f8 00 15 0d calli 80188ec <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
80134bc: 34 03 00 00 mvi r3,0
80134c0: e0 00 00 03 bi 80134cc <rtems_signal_send+0xb8>
}
_Thread_Enable_dispatch();
80134c4: f8 00 15 0a calli 80188ec <_Thread_Enable_dispatch>
return RTEMS_NOT_DEFINED;
80134c8: 34 03 00 0b mvi r3,11
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
80134cc: b8 60 08 00 mv r1,r3
80134d0: 2b 9d 00 04 lw ra,(sp+4)
80134d4: 2b 8b 00 08 lw r11,(sp+8)
80134d8: 37 9c 00 0c addi sp,sp,12
80134dc: c3 a0 00 00 ret
0800ad68 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
800ad68: 37 9c ff e0 addi sp,sp,-32
800ad6c: 5b 8b 00 20 sw (sp+32),r11
800ad70: 5b 8c 00 1c sw (sp+28),r12
800ad74: 5b 8d 00 18 sw (sp+24),r13
800ad78: 5b 8e 00 14 sw (sp+20),r14
800ad7c: 5b 8f 00 10 sw (sp+16),r15
800ad80: 5b 90 00 0c sw (sp+12),r16
800ad84: 5b 91 00 08 sw (sp+8),r17
800ad88: 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;
800ad8c: 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
)
{
800ad90: b8 20 68 00 mv r13,r1
800ad94: b8 40 70 00 mv r14,r2
800ad98: 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 )
800ad9c: 44 60 00 51 be r3,r0,800aee0 <rtems_task_mode+0x178>
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
800ada0: 78 01 08 01 mvhi r1,0x801
800ada4: 38 21 3a 28 ori r1,r1,0x3a28
800ada8: 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;
800adac: 41 8f 00 74 lbu r15,(r12+116)
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800adb0: 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 ];
800adb4: 29 8b 01 18 lw r11,(r12+280)
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
800adb8: 65 ef 00 00 cmpei r15,r15,0
800adbc: c8 0f 78 00 sub r15,r0,r15
800adc0: 21 ef 01 00 andi r15,r15,0x100
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800adc4: 44 20 00 02 be r1,r0,800adcc <rtems_task_mode+0x64>
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
800adc8: 39 ef 02 00 ori r15,r15,0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
800adcc: 41 71 00 08 lbu r17,(r11+8)
old_mode |= _ISR_Get_level();
800add0: fb ff ef d3 calli 8006d1c <_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;
800add4: 66 31 00 00 cmpei r17,r17,0
800add8: c8 11 88 00 sub r17,r0,r17
800addc: 22 31 04 00 andi r17,r17,0x400
800ade0: ba 21 08 00 or r1,r17,r1
old_mode |= _ISR_Get_level();
800ade4: b8 2f 78 00 or r15,r1,r15
*previous_mode_set = old_mode;
800ade8: 5a 0f 00 00 sw (r16+0),r15
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
800adec: 21 c1 01 00 andi r1,r14,0x100
800adf0: 44 20 00 04 be r1,r0,800ae00 <rtems_task_mode+0x98>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
800adf4: 21 a1 01 00 andi r1,r13,0x100
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
800adf8: 64 21 00 00 cmpei r1,r1,0
800adfc: 31 81 00 74 sb (r12+116),r1
if ( mask & RTEMS_TIMESLICE_MASK ) {
800ae00: 21 c1 02 00 andi r1,r14,0x200
800ae04: 44 20 00 0b be r1,r0,800ae30 <rtems_task_mode+0xc8>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
800ae08: 21 a1 02 00 andi r1,r13,0x200
if ( _Modes_Is_timeslice(mode_set) ) {
800ae0c: 44 20 00 08 be r1,r0,800ae2c <rtems_task_mode+0xc4>
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
800ae10: 34 01 00 01 mvi r1,1
800ae14: 59 81 00 7c sw (r12+124),r1
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
800ae18: 78 01 08 01 mvhi r1,0x801
800ae1c: 38 21 38 20 ori r1,r1,0x3820
800ae20: 28 21 00 00 lw r1,(r1+0)
800ae24: 59 81 00 78 sw (r12+120),r1
800ae28: e0 00 00 02 bi 800ae30 <rtems_task_mode+0xc8>
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
800ae2c: 59 80 00 7c sw (r12+124),r0
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
800ae30: 21 c1 00 01 andi r1,r14,0x1
800ae34: 44 20 00 04 be r1,r0,800ae44 <rtems_task_mode+0xdc>
*/
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
Modes_Control mode_set
)
{
return ( mode_set & RTEMS_INTERRUPT_MASK );
800ae38: 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 ) );
800ae3c: 64 21 00 00 cmpei r1,r1,0
800ae40: 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 ) {
800ae44: 21 ce 04 00 andi r14,r14,0x400
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800ae48: 34 03 00 00 mvi r3,0
if ( mask & RTEMS_ASR_MASK ) {
800ae4c: 45 c0 00 11 be r14,r0,800ae90 <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;
800ae50: 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 ) {
800ae54: 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(
800ae58: 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 ) {
800ae5c: 44 2d 00 0d be r1,r13,800ae90 <rtems_task_mode+0x128>
asr->is_enabled = is_asr_enabled;
800ae60: 31 6d 00 08 sb (r11+8),r13
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
800ae64: 90 00 08 00 rcsr r1,IE
800ae68: 34 02 ff fe mvi r2,-2
800ae6c: a0 22 10 00 and r2,r1,r2
800ae70: d0 02 00 00 wcsr IE,r2
_signals = information->signals_pending;
800ae74: 29 62 00 18 lw r2,(r11+24)
information->signals_pending = information->signals_posted;
800ae78: 29 63 00 14 lw r3,(r11+20)
information->signals_posted = _signals;
800ae7c: 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;
800ae80: 59 63 00 18 sw (r11+24),r3
information->signals_posted = _signals;
_ISR_Enable( _level );
800ae84: d0 01 00 00 wcsr IE,r1
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
800ae88: 29 63 00 14 lw r3,(r11+20)
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800ae8c: 7c 63 00 00 cmpnei r3,r3,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
800ae90: 78 01 08 01 mvhi r1,0x801
800ae94: 38 21 39 e0 ori r1,r1,0x39e0
800ae98: 28 22 00 00 lw r2,(r1+0)
800ae9c: 34 01 00 03 mvi r1,3
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
800aea0: 34 04 00 00 mvi r4,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
800aea4: 5c 41 00 0f bne r2,r1,800aee0 <rtems_task_mode+0x178>
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
800aea8: 78 01 08 01 mvhi r1,0x801
800aeac: 38 21 3a 28 ori r1,r1,0x3a28
800aeb0: 28 22 00 0c lw r2,(r1+12)
if ( are_signals_pending ||
800aeb4: 5c 60 00 05 bne r3,r0,800aec8 <rtems_task_mode+0x160>
800aeb8: 28 21 00 10 lw r1,(r1+16)
800aebc: 44 41 00 09 be r2,r1,800aee0 <rtems_task_mode+0x178>
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
800aec0: 40 41 00 74 lbu r1,(r2+116)
800aec4: 44 20 00 07 be r1,r0,800aee0 <rtems_task_mode+0x178> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
800aec8: 78 01 08 01 mvhi r1,0x801
800aecc: 38 21 3a 28 ori r1,r1,0x3a28
800aed0: 34 02 00 01 mvi r2,1
800aed4: 30 22 00 18 sb (r1+24),r2
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
800aed8: fb ff e9 6b calli 8005484 <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
800aedc: 34 04 00 00 mvi r4,0
}
800aee0: b8 80 08 00 mv r1,r4
800aee4: 2b 9d 00 04 lw ra,(sp+4)
800aee8: 2b 8b 00 20 lw r11,(sp+32)
800aeec: 2b 8c 00 1c lw r12,(sp+28)
800aef0: 2b 8d 00 18 lw r13,(sp+24)
800aef4: 2b 8e 00 14 lw r14,(sp+20)
800aef8: 2b 8f 00 10 lw r15,(sp+16)
800aefc: 2b 90 00 0c lw r16,(sp+12)
800af00: 2b 91 00 08 lw r17,(sp+8)
800af04: 37 9c 00 20 addi sp,sp,32
800af08: c3 a0 00 00 ret
080084c8 <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
80084c8: 37 9c ff f0 addi sp,sp,-16
80084cc: 5b 8b 00 0c sw (sp+12),r11
80084d0: 5b 8c 00 08 sw (sp+8),r12
80084d4: 5b 9d 00 04 sw (sp+4),ra
80084d8: b8 40 58 00 mv r11,r2
80084dc: b8 60 60 00 mv r12,r3
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
80084e0: 44 40 00 06 be r2,r0,80084f8 <rtems_task_set_priority+0x30>
RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid (
rtems_task_priority the_priority
)
{
return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) &&
( the_priority <= RTEMS_MAXIMUM_PRIORITY ) );
80084e4: 78 02 08 01 mvhi r2,0x801
80084e8: 38 42 90 f0 ori r2,r2,0x90f0
80084ec: 40 43 00 00 lbu r3,(r2+0)
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
80084f0: 34 02 00 13 mvi r2,19
)
{
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
80084f4: 55 63 00 16 bgu r11,r3,800854c <rtems_task_set_priority+0x84>
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
return RTEMS_INVALID_ADDRESS;
80084f8: 34 02 00 09 mvi r2,9
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
80084fc: 45 80 00 14 be r12,r0,800854c <rtems_task_set_priority+0x84>
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
8008500: 37 82 00 10 addi r2,sp,16
8008504: f8 00 0a d0 calli 800b044 <_Thread_Get>
switch ( location ) {
8008508: 2b 82 00 10 lw r2,(sp+16)
800850c: 5c 40 00 0f bne r2,r0,8008548 <rtems_task_set_priority+0x80>
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
8008510: 28 23 00 14 lw r3,(r1+20)
8008514: 59 83 00 00 sw (r12+0),r3
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
8008518: 45 62 00 09 be r11,r2,800853c <rtems_task_set_priority+0x74>
the_thread->real_priority = new_priority;
if ( the_thread->resource_count == 0 ||
800851c: 28 22 00 1c lw r2,(r1+28)
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
the_thread->real_priority = new_priority;
8008520: 58 2b 00 18 sw (r1+24),r11
if ( the_thread->resource_count == 0 ||
8008524: 44 40 00 03 be r2,r0,8008530 <rtems_task_set_priority+0x68>
8008528: 28 22 00 14 lw r2,(r1+20)
800852c: 51 62 00 04 bgeu r11,r2,800853c <rtems_task_set_priority+0x74><== ALWAYS TAKEN
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
8008530: b9 60 10 00 mv r2,r11
8008534: 34 03 00 00 mvi r3,0
8008538: f8 00 09 85 calli 800ab4c <_Thread_Change_priority>
}
_Thread_Enable_dispatch();
800853c: f8 00 0a b5 calli 800b010 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8008540: 34 02 00 00 mvi r2,0
8008544: e0 00 00 02 bi 800854c <rtems_task_set_priority+0x84>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8008548: 34 02 00 04 mvi r2,4
}
800854c: b8 40 08 00 mv r1,r2
8008550: 2b 9d 00 04 lw ra,(sp+4)
8008554: 2b 8b 00 0c lw r11,(sp+12)
8008558: 2b 8c 00 08 lw r12,(sp+8)
800855c: 37 9c 00 10 addi sp,sp,16
8008560: c3 a0 00 00 ret
08002f1c <rtems_task_start>:
rtems_status_code rtems_task_start(
rtems_id id,
rtems_task_entry entry_point,
rtems_task_argument argument
)
{
8002f1c: 37 9c ff ec addi sp,sp,-20
8002f20: 5b 8b 00 10 sw (sp+16),r11
8002f24: 5b 8c 00 0c sw (sp+12),r12
8002f28: 5b 8d 00 08 sw (sp+8),r13
8002f2c: 5b 9d 00 04 sw (sp+4),ra
register Thread_Control *the_thread;
Objects_Locations location;
if ( entry_point == NULL )
return RTEMS_INVALID_ADDRESS;
8002f30: 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
)
{
8002f34: b8 40 60 00 mv r12,r2
8002f38: b8 60 68 00 mv r13,r3
register Thread_Control *the_thread;
Objects_Locations location;
if ( entry_point == NULL )
8002f3c: 44 40 00 11 be r2,r0,8002f80 <rtems_task_start+0x64> <== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
8002f40: 37 82 00 14 addi r2,sp,20
8002f44: f8 00 09 bd calli 8005638 <_Thread_Get>
switch ( location ) {
8002f48: 2b 8b 00 14 lw r11,(sp+20)
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8002f4c: 34 04 00 04 mvi r4,4
if ( entry_point == NULL )
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
switch ( location ) {
8002f50: 5d 60 00 0c bne r11,r0,8002f80 <rtems_task_start+0x64>
case OBJECTS_LOCAL:
if ( _Thread_Start(
8002f54: 34 02 00 00 mvi r2,0
8002f58: b9 80 18 00 mv r3,r12
8002f5c: 34 04 00 00 mvi r4,0
8002f60: b9 a0 28 00 mv r5,r13
8002f64: f8 00 0c aa calli 800620c <_Thread_Start>
8002f68: 44 2b 00 04 be r1,r11,8002f78 <rtems_task_start+0x5c>
the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) {
_Thread_Enable_dispatch();
8002f6c: f8 00 09 a6 calli 8005604 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8002f70: 34 04 00 00 mvi r4,0
8002f74: e0 00 00 03 bi 8002f80 <rtems_task_start+0x64>
}
_Thread_Enable_dispatch();
8002f78: f8 00 09 a3 calli 8005604 <_Thread_Enable_dispatch>
return RTEMS_INCORRECT_STATE;
8002f7c: 34 04 00 0e mvi r4,14
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
8002f80: b8 80 08 00 mv r1,r4
8002f84: 2b 9d 00 04 lw ra,(sp+4)
8002f88: 2b 8b 00 10 lw r11,(sp+16)
8002f8c: 2b 8c 00 0c lw r12,(sp+12)
8002f90: 2b 8d 00 08 lw r13,(sp+8)
8002f94: 37 9c 00 14 addi sp,sp,20
8002f98: c3 a0 00 00 ret
08013f48 <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
8013f48: 37 9c ff f8 addi sp,sp,-8
8013f4c: 5b 9d 00 04 sw (sp+4),ra
8013f50: b8 20 10 00 mv r2,r1
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
_Objects_Get( &_Timer_Information, id, location );
8013f54: 78 01 08 03 mvhi r1,0x803
8013f58: 38 21 ee d4 ori r1,r1,0xeed4
8013f5c: 37 83 00 08 addi r3,sp,8
8013f60: f8 00 0e 48 calli 8017880 <_Objects_Get>
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
8013f64: 2b 82 00 08 lw r2,(sp+8)
8013f68: 5c 40 00 09 bne r2,r0,8013f8c <rtems_timer_cancel+0x44>
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
8013f6c: 28 23 00 38 lw r3,(r1+56)
8013f70: 34 02 00 04 mvi r2,4
8013f74: 44 62 00 03 be r3,r2,8013f80 <rtems_timer_cancel+0x38> <== NEVER TAKEN
(void) _Watchdog_Remove( &the_timer->Ticker );
8013f78: 34 21 00 10 addi r1,r1,16
8013f7c: f8 00 17 e1 calli 8019f00 <_Watchdog_Remove>
_Thread_Enable_dispatch();
8013f80: f8 00 12 5b calli 80188ec <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8013f84: 34 01 00 00 mvi r1,0
8013f88: e0 00 00 02 bi 8013f90 <rtems_timer_cancel+0x48>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8013f8c: 34 01 00 04 mvi r1,4
}
8013f90: 2b 9d 00 04 lw ra,(sp+4)
8013f94: 37 9c 00 08 addi sp,sp,8
8013f98: c3 a0 00 00 ret
08003388 <rtems_timer_create>:
rtems_status_code rtems_timer_create(
rtems_name name,
rtems_id *id
)
{
8003388: 37 9c ff e8 addi sp,sp,-24
800338c: 5b 8b 00 18 sw (sp+24),r11
8003390: 5b 8c 00 14 sw (sp+20),r12
8003394: 5b 8d 00 10 sw (sp+16),r13
8003398: 5b 8e 00 0c sw (sp+12),r14
800339c: 5b 8f 00 08 sw (sp+8),r15
80033a0: 5b 9d 00 04 sw (sp+4),ra
80033a4: b8 20 78 00 mv r15,r1
80033a8: b8 40 68 00 mv r13,r2
Timer_Control *the_timer;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
80033ac: 34 01 00 03 mvi r1,3
rtems_id *id
)
{
Timer_Control *the_timer;
if ( !rtems_is_name_valid( name ) )
80033b0: 45 e0 00 22 be r15,r0,8003438 <rtems_timer_create+0xb0> <== NEVER TAKEN
return RTEMS_INVALID_NAME;
if ( !id )
return RTEMS_INVALID_ADDRESS;
80033b4: 34 01 00 09 mvi r1,9
Timer_Control *the_timer;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !id )
80033b8: 44 40 00 20 be r2,r0,8003438 <rtems_timer_create+0xb0> <== NEVER TAKEN
80033bc: 78 03 08 01 mvhi r3,0x801
80033c0: 38 63 d8 80 ori r3,r3,0xd880
80033c4: 28 61 00 00 lw r1,(r3+0)
80033c8: 34 21 00 01 addi r1,r1,1
80033cc: 58 61 00 00 sw (r3+0),r1
* This function allocates a timer control block from
* the inactive chain of free timer control blocks.
*/
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
{
return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
80033d0: 78 0c 08 01 mvhi r12,0x801
80033d4: 39 8c da 70 ori r12,r12,0xda70
80033d8: b9 80 08 00 mv r1,r12
80033dc: f8 00 04 85 calli 80045f0 <_Objects_Allocate>
80033e0: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* to prevent deletion */
the_timer = _Timer_Allocate();
if ( !the_timer ) {
80033e4: 5c 20 00 04 bne r1,r0,80033f4 <rtems_timer_create+0x6c>
_Thread_Enable_dispatch();
80033e8: f8 00 09 63 calli 8005974 <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
80033ec: 34 01 00 05 mvi r1,5
80033f0: e0 00 00 12 bi 8003438 <rtems_timer_create+0xb0>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
80033f4: 29 6e 00 08 lw r14,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
80033f8: 29 8c 00 1c lw r12,(r12+28)
}
the_timer->the_class = TIMER_DORMANT;
80033fc: 34 01 00 04 mvi r1,4
8003400: 59 61 00 38 sw (r11+56),r1
8003404: 34 02 00 02 mvi r2,2
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8003408: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
800340c: 59 60 00 2c sw (r11+44),r0
the_watchdog->id = id;
8003410: 59 60 00 30 sw (r11+48),r0
the_watchdog->user_data = user_data;
8003414: 59 60 00 34 sw (r11+52),r0
8003418: 21 c1 ff ff andi r1,r14,0xffff
800341c: f8 00 59 c1 calli 8019b20 <__ashlsi3>
8003420: b5 81 08 00 add r1,r12,r1
8003424: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8003428: 59 6f 00 0c sw (r11+12),r15
&_Timer_Information,
&the_timer->Object,
(Objects_Name) name
);
*id = the_timer->Object.id;
800342c: 59 ae 00 00 sw (r13+0),r14
_Thread_Enable_dispatch();
8003430: f8 00 09 51 calli 8005974 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8003434: 34 01 00 00 mvi r1,0
}
8003438: 2b 9d 00 04 lw ra,(sp+4)
800343c: 2b 8b 00 18 lw r11,(sp+24)
8003440: 2b 8c 00 14 lw r12,(sp+20)
8003444: 2b 8d 00 10 lw r13,(sp+16)
8003448: 2b 8e 00 0c lw r14,(sp+12)
800344c: 2b 8f 00 08 lw r15,(sp+8)
8003450: 37 9c 00 18 addi sp,sp,24
8003454: c3 a0 00 00 ret
08014564 <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
8014564: 37 9c ff dc addi sp,sp,-36
8014568: 5b 8b 00 20 sw (sp+32),r11
801456c: 5b 8c 00 1c sw (sp+28),r12
8014570: 5b 8d 00 18 sw (sp+24),r13
8014574: 5b 8e 00 14 sw (sp+20),r14
8014578: 5b 8f 00 10 sw (sp+16),r15
801457c: 5b 90 00 0c sw (sp+12),r16
8014580: 5b 91 00 08 sw (sp+8),r17
8014584: 5b 9d 00 04 sw (sp+4),ra
Timer_Control *the_timer;
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
8014588: 78 05 08 03 mvhi r5,0x803
801458c: 38 a5 ef 14 ori r5,r5,0xef14
8014590: 28 ad 00 00 lw r13,(r5+0)
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
8014594: b8 20 78 00 mv r15,r1
8014598: b8 40 60 00 mv r12,r2
801459c: b8 60 80 00 mv r16,r3
80145a0: b8 80 88 00 mv r17,r4
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
return RTEMS_INCORRECT_STATE;
80145a4: 34 0b 00 0e mvi r11,14
Timer_Control *the_timer;
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
80145a8: 45 a0 00 2e be r13,r0,8014660 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
80145ac: 78 05 08 03 mvhi r5,0x803
80145b0: 38 a5 ec a8 ori r5,r5,0xeca8
80145b4: 40 a1 00 00 lbu r1,(r5+0)
return RTEMS_NOT_DEFINED;
80145b8: 34 0b 00 0b mvi r11,11
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
80145bc: 44 20 00 29 be r1,r0,8014660 <rtems_timer_server_fire_when+0xfc><== NEVER TAKEN
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
80145c0: 34 0b 00 09 mvi r11,9
return RTEMS_INCORRECT_STATE;
if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
if ( !routine )
80145c4: 44 60 00 27 be r3,r0,8014660 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
80145c8: b8 40 08 00 mv r1,r2
80145cc: fb ff f1 c0 calli 8010ccc <_TOD_Validate>
return RTEMS_INVALID_CLOCK;
80145d0: 34 0b 00 14 mvi r11,20
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
80145d4: 44 20 00 23 be r1,r0,8014660 <rtems_timer_server_fire_when+0xfc>
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
80145d8: b9 80 08 00 mv r1,r12
if ( seconds <= _TOD_Seconds_since_epoch() )
80145dc: 78 0c 08 03 mvhi r12,0x803
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
80145e0: fb ff f1 7b calli 8010bcc <_TOD_To_seconds>
if ( seconds <= _TOD_Seconds_since_epoch() )
80145e4: 39 8c ed 20 ori r12,r12,0xed20
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
80145e8: b8 20 70 00 mv r14,r1
if ( seconds <= _TOD_Seconds_since_epoch() )
80145ec: 29 81 00 00 lw r1,(r12+0)
80145f0: 50 2e 00 1c bgeu r1,r14,8014660 <rtems_timer_server_fire_when+0xfc>
80145f4: 78 01 08 03 mvhi r1,0x803
80145f8: 38 21 ee d4 ori r1,r1,0xeed4
80145fc: b9 e0 10 00 mv r2,r15
8014600: 37 83 00 24 addi r3,sp,36
8014604: f8 00 0c 9f calli 8017880 <_Objects_Get>
8014608: b8 20 58 00 mv r11,r1
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
801460c: 2b 81 00 24 lw r1,(sp+36)
8014610: 5c 20 00 13 bne r1,r0,801465c <rtems_timer_server_fire_when+0xf8>
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
8014614: 35 61 00 10 addi r1,r11,16
8014618: f8 00 16 3a calli 8019f00 <_Watchdog_Remove>
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
801461c: 34 01 00 03 mvi r1,3
8014620: 59 61 00 38 sw (r11+56),r1
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
8014624: 29 81 00 00 lw r1,(r12+0)
(*timer_server->schedule_operation)( timer_server, the_timer );
8014628: 29 a3 00 04 lw r3,(r13+4)
801462c: b9 60 10 00 mv r2,r11
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
8014630: c9 c1 70 00 sub r14,r14,r1
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8014634: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8014638: 59 70 00 2c sw (r11+44),r16
the_watchdog->id = id;
801463c: 59 6f 00 30 sw (r11+48),r15
the_watchdog->user_data = user_data;
8014640: 59 71 00 34 sw (r11+52),r17
8014644: 59 6e 00 1c sw (r11+28),r14
(*timer_server->schedule_operation)( timer_server, the_timer );
8014648: b9 a0 08 00 mv r1,r13
801464c: d8 60 00 00 call r3
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
8014650: 34 0b 00 00 mvi r11,0
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
(*timer_server->schedule_operation)( timer_server, the_timer );
_Thread_Enable_dispatch();
8014654: f8 00 10 a6 calli 80188ec <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8014658: e0 00 00 02 bi 8014660 <rtems_timer_server_fire_when+0xfc>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
801465c: 34 0b 00 04 mvi r11,4
}
8014660: b9 60 08 00 mv r1,r11
8014664: 2b 9d 00 04 lw ra,(sp+4)
8014668: 2b 8b 00 20 lw r11,(sp+32)
801466c: 2b 8c 00 1c lw r12,(sp+28)
8014670: 2b 8d 00 18 lw r13,(sp+24)
8014674: 2b 8e 00 14 lw r14,(sp+20)
8014678: 2b 8f 00 10 lw r15,(sp+16)
801467c: 2b 90 00 0c lw r16,(sp+12)
8014680: 2b 91 00 08 lw r17,(sp+8)
8014684: 37 9c 00 24 addi sp,sp,36
8014688: c3 a0 00 00 ret