RTEMS 4.11Annotated Report
Sun Dec 23 02:09:07 2012
08005938 <_API_extensions_Add_post_switch>:
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
8005938: 28 22 00 00 lw r2,(r1+0)
800593c: 5c 40 00 0c bne r2,r0,800596c <_API_extensions_Add_post_switch+0x34>
8005940: 28 23 00 04 lw r3,(r1+4)
8005944: 5c 62 00 0a bne r3,r2,800596c <_API_extensions_Add_post_switch+0x34><== NEVER TAKEN
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
8005948: 78 02 08 01 mvhi r2,0x801
800594c: 38 42 a9 e8 ori r2,r2,0xa9e8
8005950: 28 44 00 08 lw r4,(r2+8)
the_node->next = tail;
8005954: 78 03 08 01 mvhi r3,0x801
8005958: 38 63 a9 ec ori r3,r3,0xa9ec
800595c: 58 23 00 00 sw (r1+0),r3
tail->previous = the_node;
8005960: 58 41 00 08 sw (r2+8),r1
old_last->next = the_node;
8005964: 58 81 00 00 sw (r4+0),r1
the_node->previous = old_last;
8005968: 58 24 00 04 sw (r1+4),r4
800596c: c3 a0 00 00 ret
0800699c <_CORE_RWLock_Release>:
#include <rtems/score/watchdog.h>
CORE_RWLock_Status _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock
)
{
800699c: 37 9c ff f4 addi sp,sp,-12
80069a0: 5b 8b 00 0c sw (sp+12),r11
80069a4: 5b 8c 00 08 sw (sp+8),r12
80069a8: 5b 9d 00 04 sw (sp+4),ra
80069ac: b8 20 58 00 mv r11,r1
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
80069b0: 78 01 08 01 mvhi r1,0x801
80069b4: 38 21 9d a0 ori r1,r1,0x9da0
80069b8: 28 22 00 10 lw r2,(r1+16)
* Otherwise, we have to block.
* If locked for reading and no waiters, then OK to read.
* If any thread is waiting, then we wait.
*/
_ISR_Disable( level );
80069bc: 90 00 08 00 rcsr r1,IE
80069c0: 34 03 ff fe mvi r3,-2
80069c4: a0 23 18 00 and r3,r1,r3
80069c8: d0 03 00 00 wcsr IE,r3
if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){
80069cc: 29 63 00 44 lw r3,(r11+68)
80069d0: 5c 60 00 05 bne r3,r0,80069e4 <_CORE_RWLock_Release+0x48>
_ISR_Enable( level );
80069d4: d0 01 00 00 wcsr IE,r1
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
80069d8: 34 01 00 02 mvi r1,2
80069dc: 58 41 00 34 sw (r2+52),r1
return CORE_RWLOCK_SUCCESSFUL;
80069e0: e0 00 00 26 bi 8006a78 <_CORE_RWLock_Release+0xdc>
}
if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) {
80069e4: 34 04 00 01 mvi r4,1
80069e8: 5c 64 00 07 bne r3,r4,8006a04 <_CORE_RWLock_Release+0x68>
the_rwlock->number_of_readers -= 1;
80069ec: 29 63 00 48 lw r3,(r11+72)
80069f0: 34 63 ff ff addi r3,r3,-1
80069f4: 59 63 00 48 sw (r11+72),r3
if ( the_rwlock->number_of_readers != 0 ) {
80069f8: 44 60 00 03 be r3,r0,8006a04 <_CORE_RWLock_Release+0x68>
/* must be unlocked again */
_ISR_Enable( level );
80069fc: d0 01 00 00 wcsr IE,r1
return CORE_RWLOCK_SUCCESSFUL;
8006a00: e0 00 00 1e bi 8006a78 <_CORE_RWLock_Release+0xdc>
}
}
/* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
8006a04: 58 40 00 34 sw (r2+52),r0
/*
* Implicitly transition to "unlocked" and find another thread interested
* in obtaining this rwlock.
*/
the_rwlock->current_state = CORE_RWLOCK_UNLOCKED;
8006a08: 59 60 00 44 sw (r11+68),r0
_ISR_Enable( level );
8006a0c: d0 01 00 00 wcsr IE,r1
next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue );
8006a10: b9 60 08 00 mv r1,r11
8006a14: f8 00 08 86 calli 8008c2c <_Thread_queue_Dequeue>
if ( next ) {
8006a18: 44 20 00 18 be r1,r0,8006a78 <_CORE_RWLock_Release+0xdc>
if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
8006a1c: 28 22 00 30 lw r2,(r1+48)
8006a20: 34 01 00 01 mvi r1,1
8006a24: 5c 41 00 04 bne r2,r1,8006a34 <_CORE_RWLock_Release+0x98>
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
8006a28: 34 01 00 02 mvi r1,2
8006a2c: 59 61 00 44 sw (r11+68),r1
return CORE_RWLOCK_SUCCESSFUL;
8006a30: e0 00 00 12 bi 8006a78 <_CORE_RWLock_Release+0xdc>
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
8006a34: 29 62 00 48 lw r2,(r11+72)
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
8006a38: 59 61 00 44 sw (r11+68),r1
/*
* Now see if more readers can be let go.
*/
while ( 1 ) {
next = _Thread_queue_First( &the_rwlock->Wait_queue );
if ( !next ||
8006a3c: 34 0c 00 01 mvi r12,1
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
8006a40: 34 42 00 01 addi r2,r2,1
8006a44: 59 62 00 48 sw (r11+72),r2
/*
* Now see if more readers can be let go.
*/
while ( 1 ) {
next = _Thread_queue_First( &the_rwlock->Wait_queue );
8006a48: b9 60 08 00 mv r1,r11
8006a4c: f8 00 09 f9 calli 8009230 <_Thread_queue_First>
8006a50: b8 20 10 00 mv r2,r1
if ( !next ||
8006a54: 44 20 00 09 be r1,r0,8006a78 <_CORE_RWLock_Release+0xdc>
8006a58: 28 21 00 30 lw r1,(r1+48)
8006a5c: 44 2c 00 07 be r1,r12,8006a78 <_CORE_RWLock_Release+0xdc> <== NEVER TAKEN
next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE )
return CORE_RWLOCK_SUCCESSFUL;
the_rwlock->number_of_readers += 1;
8006a60: 29 61 00 48 lw r1,(r11+72)
8006a64: 34 21 00 01 addi r1,r1,1
8006a68: 59 61 00 48 sw (r11+72),r1
_Thread_queue_Extract( &the_rwlock->Wait_queue, next );
8006a6c: b9 60 08 00 mv r1,r11
8006a70: f8 00 09 a8 calli 8009110 <_Thread_queue_Extract>
}
8006a74: e3 ff ff f5 bi 8006a48 <_CORE_RWLock_Release+0xac>
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
8006a78: 34 01 00 00 mvi r1,0
8006a7c: 2b 9d 00 04 lw ra,(sp+4)
8006a80: 2b 8b 00 0c lw r11,(sp+12)
8006a84: 2b 8c 00 08 lw r12,(sp+8)
8006a88: 37 9c 00 0c addi sp,sp,12
8006a8c: c3 a0 00 00 ret
08006a90 <_CORE_RWLock_Timeout>:
void _CORE_RWLock_Timeout(
Objects_Id id,
void *ignored
)
{
8006a90: 37 9c ff f8 addi sp,sp,-8
8006a94: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
8006a98: 37 82 00 08 addi r2,sp,8
8006a9c: f8 00 07 70 calli 800885c <_Thread_Get>
switch ( location ) {
8006aa0: 2b 82 00 08 lw r2,(sp+8)
8006aa4: 5c 40 00 07 bne r2,r0,8006ac0 <_CORE_RWLock_Timeout+0x30> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
8006aa8: f8 00 0a 3c calli 8009398 <_Thread_queue_Process_timeout>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8006aac: 78 01 08 01 mvhi r1,0x801
8006ab0: 38 21 99 08 ori r1,r1,0x9908
8006ab4: 28 22 00 00 lw r2,(r1+0)
--level;
8006ab8: 34 42 ff ff addi r2,r2,-1
_Thread_Dispatch_disable_level = level;
8006abc: 58 22 00 00 sw (r1+0),r2
_Thread_Unnest_dispatch();
break;
}
}
8006ac0: 2b 9d 00 04 lw ra,(sp+4)
8006ac4: 37 9c 00 08 addi sp,sp,8
8006ac8: c3 a0 00 00 ret
0800e320 <_CORE_message_queue_Seize>:
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800e320: 37 9c ff f0 addi sp,sp,-16
800e324: 5b 8b 00 10 sw (sp+16),r11
800e328: 5b 8c 00 0c sw (sp+12),r12
800e32c: 5b 8d 00 08 sw (sp+8),r13
800e330: 5b 9d 00 04 sw (sp+4),ra
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
800e334: 78 07 08 02 mvhi r7,0x802
800e338: 38 e7 8f 20 ori r7,r7,0x8f20
800e33c: 28 e7 00 10 lw r7,(r7+16)
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800e340: b8 20 58 00 mv r11,r1
800e344: 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;
800e348: 58 e0 00 34 sw (r7+52),r0
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800e34c: 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 );
800e350: 90 00 40 00 rcsr r8,IE
800e354: 34 03 ff fe mvi r3,-2
800e358: a1 03 18 00 and r3,r8,r3
800e35c: 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 );
}
800e360: 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 );
800e364: 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))
800e368: 45 83 00 07 be r12,r3,800e384 <_CORE_message_queue_Seize+0x64>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
800e36c: 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 );
800e370: 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;
800e374: 59 63 00 50 sw (r11+80),r3
new_first->previous = head;
800e378: 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 ) {
800e37c: 5d 80 00 04 bne r12,r0,800e38c <_CORE_message_queue_Seize+0x6c><== ALWAYS TAKEN
800e380: e0 00 00 25 bi 800e414 <_CORE_message_queue_Seize+0xf4> <== NOT EXECUTED
)
{
if ( !_Chain_Is_empty(the_chain))
return _Chain_Get_first_unprotected(the_chain);
else
return NULL;
800e384: 34 0c 00 00 mvi r12,0
800e388: e0 00 00 23 bi 800e414 <_CORE_message_queue_Seize+0xf4>
the_message_queue->number_of_pending_messages -= 1;
800e38c: 29 62 00 48 lw r2,(r11+72)
800e390: 34 42 ff ff addi r2,r2,-1
800e394: 59 62 00 48 sw (r11+72),r2
_ISR_Enable( level );
800e398: d0 08 00 00 wcsr IE,r8
*size_p = the_message->Contents.size;
800e39c: 29 83 00 0c lw r3,(r12+12)
_Thread_Executing->Wait.count =
800e3a0: 78 02 08 02 mvhi r2,0x802
800e3a4: 38 42 8f 20 ori r2,r2,0x8f20
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;
800e3a8: 58 83 00 00 sw (r4+0),r3
_Thread_Executing->Wait.count =
800e3ac: 29 84 00 08 lw r4,(r12+8)
800e3b0: 28 42 00 10 lw r2,(r2+16)
_CORE_message_queue_Get_message_priority( the_message );
_CORE_message_queue_Copy_buffer(
the_message->Contents.buffer,
800e3b4: 35 8d 00 10 addi r13,r12,16
if ( the_message != NULL ) {
the_message_queue->number_of_pending_messages -= 1;
_ISR_Enable( level );
*size_p = the_message->Contents.size;
_Thread_Executing->Wait.count =
800e3b8: 58 44 00 24 sw (r2+36),r4
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800e3bc: b9 a0 10 00 mv r2,r13
800e3c0: f8 00 25 ac calli 8017a70 <memcpy>
* is not, then we can go ahead and free the buffer.
*
* NOTE: If we note that the queue was not full before this receive,
* then we can avoid this dequeue.
*/
the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
800e3c4: b9 60 08 00 mv r1,r11
800e3c8: f8 00 0a 97 calli 8010e24 <_Thread_queue_Dequeue>
800e3cc: b8 20 20 00 mv r4,r1
if ( !the_thread ) {
800e3d0: 5c 20 00 05 bne r1,r0,800e3e4 <_CORE_message_queue_Seize+0xc4>
RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Buffer_control *the_message
)
{
_Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
800e3d4: 35 61 00 68 addi r1,r11,104
800e3d8: b9 80 10 00 mv r2,r12
800e3dc: fb ff ff 6b calli 800e188 <_Chain_Append>
_CORE_message_queue_Free_message_buffer(
the_message_queue,
the_message
);
return;
800e3e0: e0 00 00 1e bi 800e458 <_CORE_message_queue_Seize+0x138>
CORE_message_queue_Buffer_control *the_message,
int priority
)
{
#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
the_message->priority = priority;
800e3e4: 28 21 00 24 lw r1,(r1+36)
*/
_CORE_message_queue_Set_message_priority(
the_message,
the_thread->Wait.count
);
the_message->Contents.size = (size_t) the_thread->Wait.option;
800e3e8: 28 83 00 30 lw r3,(r4+48)
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800e3ec: 28 82 00 2c lw r2,(r4+44)
CORE_message_queue_Buffer_control *the_message,
int priority
)
{
#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
the_message->priority = priority;
800e3f0: 59 81 00 08 sw (r12+8),r1
800e3f4: 59 83 00 0c sw (r12+12),r3
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800e3f8: b9 a0 08 00 mv r1,r13
800e3fc: f8 00 25 9d calli 8017a70 <memcpy>
the_thread->Wait.return_argument_second.immutable_object,
the_message->Contents.buffer,
the_message->Contents.size
);
_CORE_message_queue_Insert_message(
800e400: 29 83 00 08 lw r3,(r12+8)
800e404: b9 60 08 00 mv r1,r11
800e408: b9 80 10 00 mv r2,r12
800e40c: f8 00 18 8c calli 801463c <_CORE_message_queue_Insert_message>
the_message_queue,
the_message,
_CORE_message_queue_Get_message_priority( the_message )
);
return;
800e410: e0 00 00 12 bi 800e458 <_CORE_message_queue_Seize+0x138>
}
#endif
}
if ( !wait ) {
800e414: 5c ac 00 05 bne r5,r12,800e428 <_CORE_message_queue_Seize+0x108>
_ISR_Enable( level );
800e418: d0 08 00 00 wcsr IE,r8
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
800e41c: 34 01 00 04 mvi r1,4
800e420: 58 e1 00 34 sw (r7+52),r1
return;
800e424: e0 00 00 0d bi 800e458 <_CORE_message_queue_Seize+0x138>
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
800e428: 34 03 00 01 mvi r3,1
800e42c: 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;
800e430: 58 eb 00 44 sw (r7+68),r11
executing->Wait.id = id;
800e434: 58 e2 00 20 sw (r7+32),r2
executing->Wait.return_argument_second.mutable_object = buffer;
800e438: 58 e1 00 2c sw (r7+44),r1
executing->Wait.return_argument = size_p;
800e43c: 58 e4 00 28 sw (r7+40),r4
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
800e440: d0 08 00 00 wcsr IE,r8
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
800e444: 78 03 08 01 mvhi r3,0x801
800e448: b9 60 08 00 mv r1,r11
800e44c: b8 c0 10 00 mv r2,r6
800e450: 38 63 14 cc ori r3,r3,0x14cc
800e454: f8 00 0a e7 calli 8010ff0 <_Thread_queue_Enqueue_with_handler>
}
800e458: 2b 9d 00 04 lw ra,(sp+4)
800e45c: 2b 8b 00 10 lw r11,(sp+16)
800e460: 2b 8c 00 0c lw r12,(sp+12)
800e464: 2b 8d 00 08 lw r13,(sp+8)
800e468: 37 9c 00 10 addi sp,sp,16
800e46c: c3 a0 00 00 ret
08005b38 <_CORE_mutex_Initialize>:
CORE_mutex_Status _CORE_mutex_Initialize(
CORE_mutex_Control *the_mutex,
CORE_mutex_Attributes *the_mutex_attributes,
uint32_t initial_lock
)
{
8005b38: 37 9c ff fc addi sp,sp,-4
8005b3c: 5b 9d 00 04 sw (sp+4),ra
/* Add this to the RTEMS environment later ?????????
rtems_assert( initial_lock == CORE_MUTEX_LOCKED ||
initial_lock == CORE_MUTEX_UNLOCKED );
*/
the_mutex->Attributes = *the_mutex_attributes;
8005b40: 28 47 00 00 lw r7,(r2+0)
8005b44: 28 46 00 04 lw r6,(r2+4)
8005b48: 28 44 00 08 lw r4,(r2+8)
8005b4c: 28 45 00 0c lw r5,(r2+12)
8005b50: 58 27 00 40 sw (r1+64),r7
8005b54: 58 26 00 44 sw (r1+68),r6
8005b58: 58 24 00 48 sw (r1+72),r4
8005b5c: 58 25 00 4c sw (r1+76),r5
the_mutex->lock = initial_lock;
8005b60: 58 23 00 50 sw (r1+80),r3
the_mutex->blocked_count = 0;
8005b64: 58 20 00 58 sw (r1+88),r0
if ( initial_lock == CORE_MUTEX_LOCKED ) {
8005b68: 5c 60 00 15 bne r3,r0,8005bbc <_CORE_mutex_Initialize+0x84>
the_mutex->nest_count = 1;
8005b6c: 34 03 00 01 mvi r3,1
8005b70: 58 23 00 54 sw (r1+84),r3
the_mutex->holder = _Thread_Executing;
8005b74: 78 03 08 01 mvhi r3,0x801
8005b78: 38 63 ae 00 ori r3,r3,0xae00
8005b7c: 28 63 00 10 lw r3,(r3+16)
the_mutex->holder_id = _Thread_Executing->Object.id;
8005b80: 28 65 00 08 lw r5,(r3+8)
the_mutex->lock = initial_lock;
the_mutex->blocked_count = 0;
if ( initial_lock == CORE_MUTEX_LOCKED ) {
the_mutex->nest_count = 1;
the_mutex->holder = _Thread_Executing;
8005b84: 58 23 00 5c sw (r1+92),r3
the_mutex->holder_id = _Thread_Executing->Object.id;
8005b88: 58 25 00 60 sw (r1+96),r5
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
8005b8c: 34 05 00 02 mvi r5,2
8005b90: 44 85 00 03 be r4,r5,8005b9c <_CORE_mutex_Initialize+0x64>
8005b94: 34 05 00 03 mvi r5,3
8005b98: 5c 85 00 0c bne r4,r5,8005bc8 <_CORE_mutex_Initialize+0x90>
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
if ( _Thread_Executing->current_priority <
8005b9c: 28 65 00 14 lw r5,(r3+20)
8005ba0: 28 26 00 4c lw r6,(r1+76)
the_mutex->Attributes.priority_ceiling )
return CORE_MUTEX_STATUS_CEILING_VIOLATED;
8005ba4: 34 04 00 06 mvi r4,6
the_mutex->holder = _Thread_Executing;
the_mutex->holder_id = _Thread_Executing->Object.id;
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
if ( _Thread_Executing->current_priority <
8005ba8: 54 c5 00 0e bgu r6,r5,8005be0 <_CORE_mutex_Initialize+0xa8><== NEVER TAKEN
_Chain_Prepend_unprotected( &_Thread_Executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = _Thread_Executing->current_priority;
#endif
_Thread_Executing->resource_count++;
8005bac: 28 64 00 1c lw r4,(r3+28)
8005bb0: 34 84 00 01 addi r4,r4,1
8005bb4: 58 64 00 1c sw (r3+28),r4
8005bb8: e0 00 00 04 bi 8005bc8 <_CORE_mutex_Initialize+0x90>
}
} else {
the_mutex->nest_count = 0;
8005bbc: 58 20 00 54 sw (r1+84),r0
the_mutex->holder = NULL;
8005bc0: 58 20 00 5c sw (r1+92),r0
the_mutex->holder_id = 0;
8005bc4: 58 20 00 60 sw (r1+96),r0
}
_Thread_queue_Initialize(
8005bc8: 28 42 00 08 lw r2,(r2+8)
8005bcc: 34 04 00 05 mvi r4,5
8005bd0: 34 03 04 00 mvi r3,1024
8005bd4: 7c 42 00 00 cmpnei r2,r2,0
8005bd8: f8 00 09 c4 calli 80082e8 <_Thread_queue_Initialize>
THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY,
STATES_WAITING_FOR_MUTEX,
CORE_MUTEX_TIMEOUT
);
return CORE_MUTEX_STATUS_SUCCESSFUL;
8005bdc: 34 04 00 00 mvi r4,0
}
8005be0: b8 80 08 00 mv r1,r4
8005be4: 2b 9d 00 04 lw ra,(sp+4)
8005be8: 37 9c 00 04 addi sp,sp,4
8005bec: c3 a0 00 00 ret
08005f04 <_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
)
{
8005f04: 37 9c ff f8 addi sp,sp,-8
8005f08: 5b 8b 00 08 sw (sp+8),r11
8005f0c: 5b 9d 00 04 sw (sp+4),ra
8005f10: 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)) ) {
8005f14: f8 00 07 ab calli 8007dc0 <_Thread_queue_Dequeue>
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
8005f18: 34 02 00 00 mvi r2,0
if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
8005f1c: 5c 20 00 0d bne r1,r0,8005f50 <_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 );
8005f20: 90 00 08 00 rcsr r1,IE
8005f24: 34 02 ff fe mvi r2,-2
8005f28: a0 22 10 00 and r2,r1,r2
8005f2c: d0 02 00 00 wcsr IE,r2
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
8005f30: 29 63 00 48 lw r3,(r11+72)
8005f34: 29 64 00 40 lw r4,(r11+64)
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
8005f38: 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 )
8005f3c: 50 64 00 04 bgeu r3,r4,8005f4c <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN
the_semaphore->count += 1;
8005f40: 34 63 00 01 addi r3,r3,1
8005f44: 59 63 00 48 sw (r11+72),r3
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
8005f48: 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 );
8005f4c: d0 01 00 00 wcsr IE,r1
}
return status;
}
8005f50: b8 40 08 00 mv r1,r2
8005f54: 2b 9d 00 04 lw ra,(sp+4)
8005f58: 2b 8b 00 08 lw r11,(sp+8)
8005f5c: 37 9c 00 08 addi sp,sp,8
8005f60: c3 a0 00 00 ret
0800e56c <_Event_Surrender>:
rtems_event_set event_in,
Event_Control *event,
Thread_blocking_operation_States *sync_state,
States_Control wait_state
)
{
800e56c: 37 9c ff f4 addi sp,sp,-12
800e570: 5b 8b 00 0c sw (sp+12),r11
800e574: 5b 8c 00 08 sw (sp+8),r12
800e578: 5b 9d 00 04 sw (sp+4),ra
rtems_event_set pending_events;
rtems_event_set event_condition;
rtems_event_set seized_events;
rtems_option option_set;
option_set = the_thread->Wait.option;
800e57c: 28 2a 00 30 lw r10,(r1+48)
rtems_event_set event_in,
Event_Control *event,
Thread_blocking_operation_States *sync_state,
States_Control wait_state
)
{
800e580: b8 20 58 00 mv r11,r1
rtems_event_set seized_events;
rtems_option option_set;
option_set = the_thread->Wait.option;
_ISR_Disable( level );
800e584: 90 00 08 00 rcsr r1,IE
800e588: 34 09 ff fe mvi r9,-2
800e58c: a0 29 48 00 and r9,r1,r9
800e590: d0 09 00 00 wcsr IE,r9
RTEMS_INLINE_ROUTINE void _Event_sets_Post(
rtems_event_set the_new_events,
rtems_event_set *the_event_set
)
{
*the_event_set |= the_new_events;
800e594: 28 66 00 00 lw r6,(r3+0)
_Event_sets_Post( event_in, &event->pending_events );
pending_events = event->pending_events;
event_condition = the_thread->Wait.count;
800e598: 29 68 00 24 lw r8,(r11+36)
800e59c: b8 46 10 00 or r2,r2,r6
800e5a0: 58 62 00 00 sw (r3+0),r2
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 );
800e5a4: a0 48 30 00 and r6,r2,r8
seized_events = _Event_sets_Get( pending_events, event_condition );
/*
* No events were seized in this operation
*/
if ( _Event_sets_Is_empty( seized_events ) ) {
800e5a8: 44 c0 00 35 be r6,r0,800e67c <_Event_Surrender+0x110>
/*
* 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() &&
800e5ac: 78 07 08 01 mvhi r7,0x801
800e5b0: 38 e7 ae 00 ori r7,r7,0xae00
800e5b4: 28 ec 00 08 lw r12,(r7+8)
800e5b8: 45 80 00 13 be r12,r0,800e604 <_Event_Surrender+0x98>
800e5bc: 28 e7 00 10 lw r7,(r7+16)
800e5c0: 5d 67 00 11 bne r11,r7,800e604 <_Event_Surrender+0x98>
_Thread_Is_executing( the_thread ) &&
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
800e5c4: 28 8c 00 00 lw r12,(r4+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 ) &&
800e5c8: 34 07 00 01 mvi r7,1
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
800e5cc: 35 8c ff ff addi r12,r12,-1
/*
* 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 ) &&
800e5d0: 55 87 00 0d bgu r12,r7,800e604 <_Event_Surrender+0x98>
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
800e5d4: 44 c8 00 03 be r6,r8,800e5e0 <_Event_Surrender+0x74>
*/
RTEMS_INLINE_ROUTINE bool _Options_Is_any (
rtems_option option_set
)
{
return (option_set & RTEMS_EVENT_ANY) ? true : false;
800e5d8: 21 4a 00 02 andi r10,r10,0x2
800e5dc: 45 40 00 28 be r10,r0,800e67c <_Event_Surrender+0x110> <== 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) );
800e5e0: a4 c0 28 00 not r5,r6
800e5e4: a0 a2 10 00 and r2,r5,r2
event->pending_events = _Event_sets_Clear(
800e5e8: 58 62 00 00 sw (r3+0),r2
pending_events,
seized_events
);
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800e5ec: 29 62 00 28 lw r2,(r11+40)
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
event->pending_events = _Event_sets_Clear(
pending_events,
seized_events
);
the_thread->Wait.count = 0;
800e5f0: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800e5f4: 58 46 00 00 sw (r2+0),r6
*sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
800e5f8: 34 02 00 03 mvi r2,3
800e5fc: 58 82 00 00 sw (r4+0),r2
800e600: e0 00 00 1f bi 800e67c <_Event_Surrender+0x110>
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
800e604: 29 64 00 10 lw r4,(r11+16)
800e608: a0 a4 28 00 and r5,r5,r4
}
/*
* Otherwise, this is a normal send to another thread
*/
if ( _States_Are_set( the_thread->current_state, wait_state ) ) {
800e60c: 44 a0 00 1c be r5,r0,800e67c <_Event_Surrender+0x110>
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
800e610: 44 c8 00 03 be r6,r8,800e61c <_Event_Surrender+0xb0>
800e614: 21 4a 00 02 andi r10,r10,0x2
800e618: 45 40 00 19 be r10,r0,800e67c <_Event_Surrender+0x110> <== NEVER TAKEN
800e61c: a4 c0 20 00 not r4,r6
800e620: a0 82 10 00 and r2,r4,r2
event->pending_events = _Event_sets_Clear(
800e624: 58 62 00 00 sw (r3+0),r2
pending_events,
seized_events
);
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800e628: 29 62 00 28 lw r2,(r11+40)
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
event->pending_events = _Event_sets_Clear(
pending_events,
seized_events
);
the_thread->Wait.count = 0;
800e62c: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800e630: 58 46 00 00 sw (r2+0),r6
_ISR_Flash( level );
800e634: d0 01 00 00 wcsr IE,r1
800e638: d0 09 00 00 wcsr IE,r9
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
800e63c: 29 63 00 50 lw r3,(r11+80)
800e640: 34 02 00 02 mvi r2,2
800e644: 44 62 00 03 be r3,r2,800e650 <_Event_Surrender+0xe4>
_ISR_Enable( level );
800e648: d0 01 00 00 wcsr IE,r1
800e64c: e0 00 00 06 bi 800e664 <_Event_Surrender+0xf8>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
800e650: 34 02 00 03 mvi r2,3
800e654: 59 62 00 50 sw (r11+80),r2
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
800e658: d0 01 00 00 wcsr IE,r1
(void) _Watchdog_Remove( &the_thread->Timer );
800e65c: 35 61 00 48 addi r1,r11,72
800e660: fb ff e8 fc calli 8008a50 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800e664: 78 03 08 01 mvhi r3,0x801
800e668: 38 63 8c 94 ori r3,r3,0x8c94
800e66c: 28 62 00 00 lw r2,(r3+0)
800e670: b9 60 08 00 mv r1,r11
800e674: f8 00 04 c9 calli 800f998 <_Thread_Clear_state>
800e678: e0 00 00 02 bi 800e680 <_Event_Surrender+0x114>
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
800e67c: d0 01 00 00 wcsr IE,r1
}
800e680: 2b 9d 00 04 lw ra,(sp+4)
800e684: 2b 8b 00 0c lw r11,(sp+12)
800e688: 2b 8c 00 08 lw r12,(sp+8)
800e68c: 37 9c 00 0c addi sp,sp,12
800e690: c3 a0 00 00 ret
0800e694 <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *arg
)
{
800e694: 37 9c ff f4 addi sp,sp,-12
800e698: 5b 8b 00 08 sw (sp+8),r11
800e69c: 5b 9d 00 04 sw (sp+4),ra
800e6a0: b8 40 58 00 mv r11,r2
ISR_Level level;
Thread_blocking_operation_States *sync_state;
sync_state = arg;
the_thread = _Thread_Get( id, &location );
800e6a4: 37 82 00 0c addi r2,sp,12
800e6a8: fb ff e4 d2 calli 80079f0 <_Thread_Get>
switch ( location ) {
800e6ac: 2b 82 00 0c lw r2,(sp+12)
800e6b0: 5c 40 00 1b bne r2,r0,800e71c <_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 );
800e6b4: 90 00 10 00 rcsr r2,IE
800e6b8: 34 03 ff fe mvi r3,-2
800e6bc: a0 43 18 00 and r3,r2,r3
800e6c0: d0 03 00 00 wcsr IE,r3
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
800e6c4: 78 03 08 01 mvhi r3,0x801
800e6c8: 38 63 ae 00 ori r3,r3,0xae00
return;
}
#endif
the_thread->Wait.count = 0;
if ( _Thread_Is_executing( the_thread ) ) {
800e6cc: 28 63 00 10 lw r3,(r3+16)
_ISR_Enable( level );
return;
}
#endif
the_thread->Wait.count = 0;
800e6d0: 58 20 00 24 sw (r1+36),r0
if ( _Thread_Is_executing( the_thread ) ) {
800e6d4: 5c 23 00 06 bne r1,r3,800e6ec <_Event_Timeout+0x58>
if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
800e6d8: 29 64 00 00 lw r4,(r11+0)
800e6dc: 34 03 00 01 mvi r3,1
800e6e0: 5c 83 00 03 bne r4,r3,800e6ec <_Event_Timeout+0x58>
*sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
800e6e4: 34 03 00 02 mvi r3,2
800e6e8: 59 63 00 00 sw (r11+0),r3
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
800e6ec: 34 03 00 06 mvi r3,6
800e6f0: 58 23 00 34 sw (r1+52),r3
_ISR_Enable( level );
800e6f4: d0 02 00 00 wcsr IE,r2
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800e6f8: 78 03 08 01 mvhi r3,0x801
800e6fc: 38 63 8c 94 ori r3,r3,0x8c94
800e700: 28 62 00 00 lw r2,(r3+0)
800e704: f8 00 04 a5 calli 800f998 <_Thread_Clear_state>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
800e708: 78 01 08 01 mvhi r1,0x801
800e70c: 38 21 a9 78 ori r1,r1,0xa978
800e710: 28 22 00 00 lw r2,(r1+0)
--level;
800e714: 34 42 ff ff addi r2,r2,-1
_Thread_Dispatch_disable_level = level;
800e718: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
800e71c: 2b 9d 00 04 lw ra,(sp+4)
800e720: 2b 8b 00 08 lw r11,(sp+8)
800e724: 37 9c 00 0c addi sp,sp,12
800e728: c3 a0 00 00 ret
0800f440 <_Heap_Free>:
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
800f440: 37 9c ff f4 addi sp,sp,-12
800f444: 5b 8b 00 0c sw (sp+12),r11
800f448: 5b 8c 00 08 sw (sp+8),r12
800f44c: 5b 9d 00 04 sw (sp+4),ra
800f450: 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;
800f454: 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 ) {
800f458: 44 40 00 73 be r2,r0,800f624 <_Heap_Free+0x1e4>
800f45c: 34 4c ff f8 addi r12,r2,-8
800f460: b8 40 08 00 mv r1,r2
800f464: 29 62 00 10 lw r2,(r11+16)
800f468: f8 00 22 20 calli 8017ce8 <__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
800f46c: 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);
800f470: 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;
800f474: 34 01 00 00 mvi r1,0
800f478: 54 e3 00 03 bgu r7,r3,800f484 <_Heap_Free+0x44>
800f47c: 29 61 00 24 lw r1,(r11+36)
800f480: 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 ) ) {
800f484: b8 20 10 00 mv r2,r1
return false;
800f488: 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 ) ) {
800f48c: 44 40 00 66 be r2,r0,800f624 <_Heap_Free+0x1e4>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800f490: 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;
800f494: 34 04 ff fe mvi r4,-2
800f498: 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);
800f49c: 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;
800f4a0: 54 e2 00 03 bgu r7,r2,800f4ac <_Heap_Free+0x6c> <== NEVER TAKEN
800f4a4: 29 61 00 24 lw r1,(r11+36)
800f4a8: 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 ) ) {
800f4ac: b8 20 28 00 mv r5,r1
return false;
800f4b0: 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 ) ) {
800f4b4: 44 a0 00 5c be r5,r0,800f624 <_Heap_Free+0x1e4> <== NEVER TAKEN
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800f4b8: 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;
800f4bc: 20 a8 00 01 andi r8,r5,0x1
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
800f4c0: 45 00 00 59 be r8,r0,800f624 <_Heap_Free+0x1e4>
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
800f4c4: 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;
800f4c8: 34 01 ff fe mvi r1,-2
800f4cc: a0 a1 28 00 and r5,r5,r1
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
800f4d0: 34 08 00 00 mvi r8,0
800f4d4: 45 22 00 05 be r9,r2,800f4e8 <_Heap_Free+0xa8>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800f4d8: 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;
800f4dc: 28 28 00 04 lw r8,(r1+4)
800f4e0: 21 08 00 01 andi r8,r8,0x1
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
800f4e4: 65 08 00 00 cmpei r8,r8,0
800f4e8: 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
800f4ec: 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 ) ) {
800f4f0: 5c c0 00 24 bne r6,r0,800f580 <_Heap_Free+0x140>
uintptr_t const prev_size = block->prev_size;
800f4f4: 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;
800f4f8: 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);
800f4fc: 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;
800f500: 54 e3 00 02 bgu r7,r3,800f508 <_Heap_Free+0xc8> <== NEVER TAKEN
800f504: 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 ) ) {
800f508: b8 20 38 00 mv r7,r1
_HAssert( false );
return( false );
800f50c: 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 ) ) {
800f510: 44 e0 00 45 be r7,r0,800f624 <_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;
800f514: 28 67 00 04 lw r7,(r3+4)
800f518: 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) ) {
800f51c: 44 e0 00 42 be r7,r0,800f624 <_Heap_Free+0x1e4> <== NEVER TAKEN
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
800f520: 45 00 00 0f be r8,r0,800f55c <_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;
800f524: 28 41 00 08 lw r1,(r2+8)
Heap_Block *prev = block->prev;
800f528: 28 42 00 0c lw r2,(r2+12)
uintptr_t const size = block_size + prev_size + next_block_size;
800f52c: b4 85 28 00 add r5,r4,r5
800f530: b4 a6 30 00 add r6,r5,r6
prev->next = next;
800f534: 58 41 00 08 sw (r2+8),r1
next->prev = prev;
800f538: 58 22 00 0c sw (r1+12),r2
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
800f53c: 29 61 00 38 lw r1,(r11+56)
800f540: 34 21 ff ff addi r1,r1,-1
800f544: 59 61 00 38 sw (r11+56),r1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800f548: 38 c1 00 01 ori r1,r6,0x1
800f54c: 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;
800f550: b4 66 18 00 add r3,r3,r6
800f554: 58 66 00 00 sw (r3+0),r6
800f558: e0 00 00 29 bi 800f5fc <_Heap_Free+0x1bc>
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
800f55c: b4 86 30 00 add r6,r4,r6
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800f560: 38 c1 00 01 ori r1,r6,0x1
800f564: 58 61 00 04 sw (r3+4),r1
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
800f568: 28 43 00 04 lw r3,(r2+4)
800f56c: 34 01 ff fe mvi r1,-2
next_block->prev_size = size;
800f570: 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;
800f574: a0 61 08 00 and r1,r3,r1
800f578: 58 41 00 04 sw (r2+4),r1
800f57c: e0 00 00 20 bi 800f5fc <_Heap_Free+0x1bc>
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
800f580: 45 00 00 0d be r8,r0,800f5b4 <_Heap_Free+0x174>
uintptr_t const size = block_size + next_block_size;
800f584: 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;
800f588: 28 45 00 08 lw r5,(r2+8)
Heap_Block *prev = old_block->prev;
800f58c: 28 42 00 0c lw r2,(r2+12)
new_block->next = next;
800f590: 58 65 00 08 sw (r3+8),r5
new_block->prev = prev;
800f594: 58 62 00 0c sw (r3+12),r2
next->prev = new_block;
prev->next = new_block;
800f598: 58 43 00 08 sw (r2+8),r3
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800f59c: 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;
800f5a0: 58 a3 00 0c sw (r5+12),r3
800f5a4: 58 62 00 04 sw (r3+4),r2
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
800f5a8: b4 61 18 00 add r3,r3,r1
800f5ac: 58 61 00 00 sw (r3+0),r1
800f5b0: e0 00 00 13 bi 800f5fc <_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;
800f5b4: 29 61 00 08 lw r1,(r11+8)
new_block->next = next;
new_block->prev = block_before;
800f5b8: 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;
800f5bc: 58 44 00 00 sw (r2+0),r4
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
800f5c0: 58 61 00 08 sw (r3+8),r1
new_block->prev = block_before;
block_before->next = new_block;
next->prev = new_block;
800f5c4: 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;
800f5c8: 38 81 00 01 ori r1,r4,0x1
800f5cc: 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;
800f5d0: 59 63 00 08 sw (r11+8),r3
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
800f5d4: 28 43 00 04 lw r3,(r2+4)
800f5d8: 34 01 ff fe mvi r1,-2
800f5dc: a0 61 08 00 and r1,r3,r1
800f5e0: 58 41 00 04 sw (r2+4),r1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
800f5e4: 29 61 00 38 lw r1,(r11+56)
if ( stats->max_free_blocks < stats->free_blocks ) {
800f5e8: 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;
800f5ec: 34 21 00 01 addi r1,r1,1
800f5f0: 59 61 00 38 sw (r11+56),r1
if ( stats->max_free_blocks < stats->free_blocks ) {
800f5f4: 50 41 00 02 bgeu r2,r1,800f5fc <_Heap_Free+0x1bc>
stats->max_free_blocks = stats->free_blocks;
800f5f8: 59 61 00 3c sw (r11+60),r1
}
}
/* Statistics */
--stats->used_blocks;
800f5fc: 29 61 00 40 lw r1,(r11+64)
800f600: 34 21 ff ff addi r1,r1,-1
800f604: 59 61 00 40 sw (r11+64),r1
++stats->frees;
800f608: 29 61 00 50 lw r1,(r11+80)
800f60c: 34 21 00 01 addi r1,r1,1
800f610: 59 61 00 50 sw (r11+80),r1
stats->free_size += block_size;
800f614: 29 61 00 30 lw r1,(r11+48)
800f618: b4 24 20 00 add r4,r1,r4
800f61c: 59 64 00 30 sw (r11+48),r4
return( true );
800f620: 34 01 00 01 mvi r1,1
}
800f624: 2b 9d 00 04 lw ra,(sp+4)
800f628: 2b 8b 00 0c lw r11,(sp+12)
800f62c: 2b 8c 00 08 lw r12,(sp+8)
800f630: 37 9c 00 0c addi sp,sp,12
800f634: c3 a0 00 00 ret
08006ddc <_Heap_Greedy_allocate>:
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
8006ddc: 37 9c ff e4 addi sp,sp,-28
8006de0: 5b 8b 00 1c sw (sp+28),r11
8006de4: 5b 8c 00 18 sw (sp+24),r12
8006de8: 5b 8d 00 14 sw (sp+20),r13
8006dec: 5b 8e 00 10 sw (sp+16),r14
8006df0: 5b 8f 00 0c sw (sp+12),r15
8006df4: 5b 90 00 08 sw (sp+8),r16
8006df8: 5b 9d 00 04 sw (sp+4),ra
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
8006dfc: 34 0b 00 00 mvi r11,0
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
8006e00: b8 20 68 00 mv r13,r1
8006e04: b8 60 78 00 mv r15,r3
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
8006e08: b8 40 70 00 mv r14,r2
Heap_Block *allocated_blocks = NULL;
8006e0c: 34 0c 00 00 mvi r12,0
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
8006e10: e0 00 00 0f bi 8006e4c <_Heap_Greedy_allocate+0x70>
* @brief See _Heap_Allocate_aligned_with_boundary() with alignment and
* boundary equals zero.
*/
RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size )
{
return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
8006e14: 29 c2 00 00 lw r2,(r14+0)
8006e18: b9 a0 08 00 mv r1,r13
8006e1c: 34 03 00 00 mvi r3,0
8006e20: 34 04 00 00 mvi r4,0
8006e24: f8 00 23 2f calli 800fae0 <_Heap_Allocate_aligned_with_boundary>
void *next = _Heap_Allocate( heap, block_sizes [i] );
if ( next != NULL ) {
8006e28: 44 20 00 07 be r1,r0,8006e44 <_Heap_Greedy_allocate+0x68> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
8006e2c: 29 a2 00 10 lw r2,(r13+16)
8006e30: 34 30 ff f8 addi r16,r1,-8
8006e34: f8 00 45 f5 calli 8018608 <__umodsi3>
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
8006e38: ca 01 08 00 sub r1,r16,r1
Heap_Block *next_block = _Heap_Block_of_alloc_area(
(uintptr_t) next,
heap->page_size
);
next_block->next = allocated_blocks;
8006e3c: 58 2c 00 08 sw (r1+8),r12
8006e40: b8 20 60 00 mv r12,r1
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
8006e44: 35 6b 00 01 addi r11,r11,1
8006e48: 35 ce 00 04 addi r14,r14,4
8006e4c: 55 eb ff f2 bgu r15,r11,8006e14 <_Heap_Greedy_allocate+0x38>
8006e50: 34 0e 00 00 mvi r14,0
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
8006e54: 34 0f ff fe mvi r15,-2
8006e58: e0 00 00 0a bi 8006e80 <_Heap_Greedy_allocate+0xa4>
8006e5c: 29 64 00 04 lw r4,(r11+4)
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
_Heap_Block_allocate(
8006e60: b9 a0 08 00 mv r1,r13
8006e64: b9 60 10 00 mv r2,r11
8006e68: a1 e4 20 00 and r4,r15,r4
8006e6c: 35 63 00 08 addi r3,r11,8
8006e70: 34 84 ff f8 addi r4,r4,-8
8006e74: f8 00 01 09 calli 8007298 <_Heap_Block_allocate>
current,
_Heap_Alloc_area_of_block( current ),
_Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE
);
current->next = blocks;
8006e78: 59 6e 00 08 sw (r11+8),r14
8006e7c: b9 60 70 00 mv r14,r11
Heap_Block *current = blocks;
blocks = blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
}
}
8006e80: 29 ab 00 08 lw r11,(r13+8)
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
8006e84: 5d 6d ff f6 bne r11,r13,8006e5c <_Heap_Greedy_allocate+0x80>
8006e88: e0 00 00 06 bi 8006ea0 <_Heap_Greedy_allocate+0xc4>
blocks = current;
}
while ( allocated_blocks != NULL ) {
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
8006e8c: 29 8b 00 08 lw r11,(r12+8)
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
8006e90: 35 82 00 08 addi r2,r12,8
8006e94: b9 a0 08 00 mv r1,r13
8006e98: f8 00 23 98 calli 800fcf8 <_Heap_Free>
blocks = current;
}
while ( allocated_blocks != NULL ) {
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
8006e9c: b9 60 60 00 mv r12,r11
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
8006ea0: 5d 80 ff fb bne r12,r0,8006e8c <_Heap_Greedy_allocate+0xb0>
allocated_blocks = allocated_blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
}
return blocks;
}
8006ea4: b9 c0 08 00 mv r1,r14
8006ea8: 2b 9d 00 04 lw ra,(sp+4)
8006eac: 2b 8b 00 1c lw r11,(sp+28)
8006eb0: 2b 8c 00 18 lw r12,(sp+24)
8006eb4: 2b 8d 00 14 lw r13,(sp+20)
8006eb8: 2b 8e 00 10 lw r14,(sp+16)
8006ebc: 2b 8f 00 0c lw r15,(sp+12)
8006ec0: 2b 90 00 08 lw r16,(sp+8)
8006ec4: 37 9c 00 1c addi sp,sp,28
8006ec8: c3 a0 00 00 ret
080104c4 <_Heap_Iterate>:
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
80104c4: 37 9c ff e8 addi sp,sp,-24
80104c8: 5b 8b 00 18 sw (sp+24),r11
80104cc: 5b 8c 00 14 sw (sp+20),r12
80104d0: 5b 8d 00 10 sw (sp+16),r13
80104d4: 5b 8e 00 0c sw (sp+12),r14
80104d8: 5b 8f 00 08 sw (sp+8),r15
80104dc: 5b 9d 00 04 sw (sp+4),ra
80104e0: b8 20 28 00 mv r5,r1
80104e4: b8 40 78 00 mv r15,r2
80104e8: b8 60 70 00 mv r14,r3
Heap_Block *current = heap->first_block;
80104ec: 28 21 00 20 lw r1,(r1+32)
Heap_Block *end = heap->last_block;
80104f0: 28 ad 00 24 lw r13,(r5+36)
80104f4: 34 0c ff fe mvi r12,-2
80104f8: e0 00 00 0a bi 8010520 <_Heap_Iterate+0x5c>
80104fc: 28 22 00 04 lw r2,(r1+4)
while ( !stop && current != end ) {
uintptr_t size = _Heap_Block_size( current );
Heap_Block *next = _Heap_Block_at( current, size );
bool used = _Heap_Is_prev_used( next );
stop = (*visitor)( current, size, used, visitor_arg );
8010500: b9 c0 20 00 mv r4,r14
8010504: a1 82 10 00 and r2,r12,r2
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
8010508: b4 22 58 00 add r11,r1,r2
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;
801050c: 29 63 00 04 lw r3,(r11+4)
8010510: 20 63 00 01 andi r3,r3,0x1
8010514: d9 e0 00 00 call r15
{
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
bool stop = false;
while ( !stop && current != end ) {
8010518: 5c 20 00 03 bne r1,r0,8010524 <_Heap_Iterate+0x60> <== NEVER TAKEN
801051c: b9 60 08 00 mv r1,r11
8010520: 5c 2d ff f7 bne r1,r13,80104fc <_Heap_Iterate+0x38>
stop = (*visitor)( current, size, used, visitor_arg );
current = next;
}
}
8010524: 2b 9d 00 04 lw ra,(sp+4)
8010528: 2b 8b 00 18 lw r11,(sp+24)
801052c: 2b 8c 00 14 lw r12,(sp+20)
8010530: 2b 8d 00 10 lw r13,(sp+16)
8010534: 2b 8e 00 0c lw r14,(sp+12)
8010538: 2b 8f 00 08 lw r15,(sp+8)
801053c: 37 9c 00 18 addi sp,sp,24
8010540: c3 a0 00 00 ret
0800f794 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
800f794: 37 9c ff ec addi sp,sp,-20
800f798: 5b 8b 00 14 sw (sp+20),r11
800f79c: 5b 8c 00 10 sw (sp+16),r12
800f7a0: 5b 8d 00 0c sw (sp+12),r13
800f7a4: 5b 8e 00 08 sw (sp+8),r14
800f7a8: 5b 9d 00 04 sw (sp+4),ra
800f7ac: 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);
800f7b0: 34 4e ff f8 addi r14,r2,-8
800f7b4: b8 40 08 00 mv r1,r2
800f7b8: b8 40 60 00 mv r12,r2
800f7bc: 29 62 00 10 lw r2,(r11+16)
800f7c0: b8 60 68 00 mv r13,r3
800f7c4: f8 00 21 49 calli 8017ce8 <__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
800f7c8: 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);
800f7cc: 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;
800f7d0: 34 01 00 00 mvi r1,0
800f7d4: 54 44 00 03 bgu r2,r4,800f7e0 <_Heap_Size_of_alloc_area+0x4c>
800f7d8: 29 61 00 24 lw r1,(r11+36)
800f7dc: 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 ) ) {
800f7e0: b8 20 18 00 mv r3,r1
return false;
800f7e4: 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 ) ) {
800f7e8: 44 60 00 13 be r3,r0,800f834 <_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;
800f7ec: 28 83 00 04 lw r3,(r4+4)
800f7f0: 34 01 ff fe mvi r1,-2
800f7f4: 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);
800f7f8: 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;
800f7fc: 34 01 00 00 mvi r1,0
800f800: 54 44 00 03 bgu r2,r4,800f80c <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN
800f804: 29 61 00 24 lw r1,(r11+36)
800f808: f0 24 08 00 cmpgeu r1,r1,r4
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
800f80c: b8 20 10 00 mv r2,r1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
800f810: 34 01 00 00 mvi r1,0
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
800f814: 44 40 00 08 be r2,r0,800f834 <_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;
800f818: 28 82 00 04 lw r2,(r4+4)
800f81c: 20 42 00 01 andi r2,r2,0x1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
800f820: 44 40 00 05 be r2,r0,800f834 <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
800f824: c8 8c 20 00 sub r4,r4,r12
800f828: 34 84 00 04 addi r4,r4,4
800f82c: 59 a4 00 00 sw (r13+0),r4
return true;
800f830: 34 01 00 01 mvi r1,1
}
800f834: 2b 9d 00 04 lw ra,(sp+4)
800f838: 2b 8b 00 14 lw r11,(sp+20)
800f83c: 2b 8c 00 10 lw r12,(sp+16)
800f840: 2b 8d 00 0c lw r13,(sp+12)
800f844: 2b 8e 00 08 lw r14,(sp+8)
800f848: 37 9c 00 14 addi sp,sp,20
800f84c: c3 a0 00 00 ret
080054dc <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
80054dc: 37 9c ff a0 addi sp,sp,-96
80054e0: 5b 8b 00 50 sw (sp+80),r11
80054e4: 5b 8c 00 4c sw (sp+76),r12
80054e8: 5b 8d 00 48 sw (sp+72),r13
80054ec: 5b 8e 00 44 sw (sp+68),r14
80054f0: 5b 8f 00 40 sw (sp+64),r15
80054f4: 5b 90 00 3c sw (sp+60),r16
80054f8: 5b 91 00 38 sw (sp+56),r17
80054fc: 5b 92 00 34 sw (sp+52),r18
8005500: 5b 93 00 30 sw (sp+48),r19
8005504: 5b 94 00 2c sw (sp+44),r20
8005508: 5b 95 00 28 sw (sp+40),r21
800550c: 5b 96 00 24 sw (sp+36),r22
8005510: 5b 97 00 20 sw (sp+32),r23
8005514: 5b 98 00 1c sw (sp+28),r24
8005518: 5b 99 00 18 sw (sp+24),r25
800551c: 5b 9b 00 14 sw (sp+20),fp
8005520: 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;
8005524: 78 0d 08 00 mvhi r13,0x800
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
8005528: 20 63 00 ff andi r3,r3,0xff
800552c: b8 20 60 00 mv r12,r1
8005530: b8 40 70 00 mv r14,r2
uintptr_t const page_size = heap->page_size;
8005534: 28 33 00 10 lw r19,(r1+16)
uintptr_t const min_block_size = heap->min_block_size;
8005538: 28 35 00 14 lw r21,(r1+20)
Heap_Block *const first_block = heap->first_block;
800553c: 28 34 00 20 lw r20,(r1+32)
Heap_Block *const last_block = heap->last_block;
8005540: 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;
8005544: 39 ad 54 44 ori r13,r13,0x5444
8005548: 44 60 00 03 be r3,r0,8005554 <_Heap_Walk+0x78>
800554c: 78 0d 08 00 mvhi r13,0x800
8005550: 39 ad 54 68 ori r13,r13,0x5468
if ( !_System_state_Is_up( _System_state_Get() ) ) {
8005554: 78 03 08 01 mvhi r3,0x801
8005558: 38 63 7e 00 ori r3,r3,0x7e00
800555c: 28 67 00 00 lw r7,(r3+0)
8005560: 34 02 00 03 mvi r2,3
return true;
8005564: 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() ) ) {
8005568: 5c e2 01 08 bne r7,r2,8005988 <_Heap_Walk+0x4ac>
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)(
800556c: 29 81 00 08 lw r1,(r12+8)
8005570: 29 86 00 18 lw r6,(r12+24)
8005574: 29 87 00 1c lw r7,(r12+28)
8005578: 5b 81 00 08 sw (sp+8),r1
800557c: 29 81 00 0c lw r1,(r12+12)
8005580: 78 03 08 01 mvhi r3,0x801
8005584: 5b 96 00 04 sw (sp+4),r22
8005588: 5b 81 00 0c sw (sp+12),r1
800558c: 34 02 00 00 mvi r2,0
8005590: b9 c0 08 00 mv r1,r14
8005594: 38 63 48 4c ori r3,r3,0x484c
8005598: ba 60 20 00 mv r4,r19
800559c: ba a0 28 00 mv r5,r21
80055a0: ba 80 40 00 mv r8,r20
80055a4: 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 ) {
80055a8: 5e 60 00 06 bne r19,r0,80055c0 <_Heap_Walk+0xe4>
(*printer)( source, true, "page size is zero\n" );
80055ac: 78 03 08 01 mvhi r3,0x801
80055b0: b9 c0 08 00 mv r1,r14
80055b4: 34 02 00 01 mvi r2,1
80055b8: 38 63 48 e0 ori r3,r3,0x48e0
80055bc: e0 00 00 25 bi 8005650 <_Heap_Walk+0x174>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
80055c0: 22 6f 00 03 andi r15,r19,0x3
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
80055c4: 45 e0 00 07 be r15,r0,80055e0 <_Heap_Walk+0x104>
(*printer)(
80055c8: 78 03 08 01 mvhi r3,0x801
80055cc: b9 c0 08 00 mv r1,r14
80055d0: 34 02 00 01 mvi r2,1
80055d4: 38 63 48 f4 ori r3,r3,0x48f4
80055d8: ba 60 20 00 mv r4,r19
80055dc: e0 00 01 04 bi 80059ec <_Heap_Walk+0x510>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
80055e0: ba a0 08 00 mv r1,r21
80055e4: ba 60 10 00 mv r2,r19
80055e8: fb ff ed 70 calli 8000ba8 <__umodsi3>
80055ec: b8 20 58 00 mv r11,r1
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
80055f0: 44 2f 00 07 be r1,r15,800560c <_Heap_Walk+0x130>
(*printer)(
80055f4: 78 03 08 01 mvhi r3,0x801
80055f8: b9 c0 08 00 mv r1,r14
80055fc: 34 02 00 01 mvi r2,1
8005600: 38 63 49 14 ori r3,r3,0x4914
8005604: ba a0 20 00 mv r4,r21
8005608: e0 00 00 f9 bi 80059ec <_Heap_Walk+0x510>
800560c: 36 81 00 08 addi r1,r20,8
8005610: ba 60 10 00 mv r2,r19
8005614: fb ff ed 65 calli 8000ba8 <__umodsi3>
);
return false;
}
if (
8005618: 44 2b 00 07 be r1,r11,8005634 <_Heap_Walk+0x158>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
800561c: 78 03 08 01 mvhi r3,0x801
8005620: b9 c0 08 00 mv r1,r14
8005624: 34 02 00 01 mvi r2,1
8005628: 38 63 49 38 ori r3,r3,0x4938
800562c: ba 80 20 00 mv r4,r20
8005630: e0 00 00 ef bi 80059ec <_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;
8005634: 2a 82 00 04 lw r2,(r20+4)
8005638: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
800563c: 5c 41 00 07 bne r2,r1,8005658 <_Heap_Walk+0x17c>
(*printer)(
8005640: 78 03 08 01 mvhi r3,0x801
8005644: b9 c0 08 00 mv r1,r14
8005648: 34 02 00 01 mvi r2,1
800564c: 38 63 49 6c ori r3,r3,0x496c
8005650: d9 a0 00 00 call r13
8005654: e0 00 00 40 bi 8005754 <_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;
8005658: 2a cf 00 04 lw r15,(r22+4)
800565c: 34 02 ff fe mvi r2,-2
8005660: 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);
8005664: 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;
8005668: 29 e2 00 04 lw r2,(r15+4)
800566c: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
8005670: 5c 41 00 06 bne r2,r1,8005688 <_Heap_Walk+0x1ac>
(*printer)(
8005674: 78 03 08 01 mvhi r3,0x801
8005678: b9 c0 08 00 mv r1,r14
800567c: 34 02 00 01 mvi r2,1
8005680: 38 63 49 9c ori r3,r3,0x499c
8005684: e3 ff ff f3 bi 8005650 <_Heap_Walk+0x174>
);
return false;
}
if (
8005688: 45 f4 00 06 be r15,r20,80056a0 <_Heap_Walk+0x1c4>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
800568c: 78 03 08 01 mvhi r3,0x801
8005690: b9 c0 08 00 mv r1,r14
8005694: 34 02 00 01 mvi r2,1
8005698: 38 63 49 b4 ori r3,r3,0x49b4
800569c: e3 ff ff ed bi 8005650 <_Heap_Walk+0x174>
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
80056a0: 29 92 00 10 lw r18,(r12+16)
block = next_block;
} while ( block != first_block );
return true;
}
80056a4: 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 );
80056a8: 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;
80056ac: 34 11 ff fe mvi r17,-2
80056b0: e0 00 00 2d bi 8005764 <_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;
80056b4: 29 83 00 20 lw r3,(r12+32)
80056b8: 34 01 00 00 mvi r1,0
80056bc: 54 6b 00 03 bgu r3,r11,80056c8 <_Heap_Walk+0x1ec>
80056c0: 29 81 00 24 lw r1,(r12+36)
80056c4: 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 ) ) {
80056c8: 5c 20 00 06 bne r1,r0,80056e0 <_Heap_Walk+0x204>
(*printer)(
80056cc: 78 03 08 01 mvhi r3,0x801
80056d0: b9 c0 08 00 mv r1,r14
80056d4: 34 02 00 01 mvi r2,1
80056d8: 38 63 49 e4 ori r3,r3,0x49e4
80056dc: e0 00 00 14 bi 800572c <_Heap_Walk+0x250>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
80056e0: 35 61 00 08 addi r1,r11,8
80056e4: ba 40 10 00 mv r2,r18
80056e8: fb ff ed 30 calli 8000ba8 <__umodsi3>
);
return false;
}
if (
80056ec: 44 20 00 06 be r1,r0,8005704 <_Heap_Walk+0x228>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
80056f0: 78 03 08 01 mvhi r3,0x801
80056f4: b9 c0 08 00 mv r1,r14
80056f8: 34 02 00 01 mvi r2,1
80056fc: 38 63 4a 04 ori r3,r3,0x4a04
8005700: e0 00 00 0b bi 800572c <_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;
8005704: 29 63 00 04 lw r3,(r11+4)
8005708: a2 23 18 00 and r3,r17,r3
block = next_block;
} while ( block != first_block );
return true;
}
800570c: 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;
8005710: 28 63 00 04 lw r3,(r3+4)
8005714: 20 63 00 01 andi r3,r3,0x1
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
8005718: 44 61 00 07 be r3,r1,8005734 <_Heap_Walk+0x258>
(*printer)(
800571c: 78 03 08 01 mvhi r3,0x801
8005720: b9 c0 08 00 mv r1,r14
8005724: 34 02 00 01 mvi r2,1
8005728: 38 63 4a 34 ori r3,r3,0x4a34
800572c: b9 60 20 00 mv r4,r11
8005730: e0 00 00 af bi 80059ec <_Heap_Walk+0x510>
);
return false;
}
if ( free_block->prev != prev_block ) {
8005734: 29 65 00 0c lw r5,(r11+12)
8005738: 44 b0 00 09 be r5,r16,800575c <_Heap_Walk+0x280>
(*printer)(
800573c: 78 03 08 01 mvhi r3,0x801
8005740: b9 c0 08 00 mv r1,r14
8005744: 34 02 00 01 mvi r2,1
8005748: 38 63 4a 50 ori r3,r3,0x4a50
800574c: b9 60 20 00 mv r4,r11
8005750: 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;
8005754: 34 03 00 00 mvi r3,0
8005758: e0 00 00 8c bi 8005988 <_Heap_Walk+0x4ac>
return false;
}
prev_block = free_block;
free_block = free_block->next;
800575c: b9 60 80 00 mv r16,r11
8005760: 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 ) {
8005764: 5d 6c ff d4 bne r11,r12,80056b4 <_Heap_Walk+0x1d8>
8005768: e0 00 00 03 bi 8005774 <_Heap_Walk+0x298>
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
800576c: ba 20 78 00 mv r15,r17
8005770: e0 00 00 15 bi 80057c4 <_Heap_Walk+0x2e8>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
8005774: 78 01 08 01 mvhi r1,0x801
8005778: 38 21 4c 00 ori r1,r1,0x4c00
800577c: 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)(
8005780: 78 01 08 01 mvhi r1,0x801
8005784: 38 21 4b e8 ori r1,r1,0x4be8
8005788: 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)(
800578c: 78 01 08 01 mvhi r1,0x801
8005790: 38 21 48 14 ori r1,r1,0x4814
8005794: 5b 81 00 5c sw (sp+92),r1
8005798: 78 01 08 01 mvhi r1,0x801
800579c: 38 21 48 30 ori r1,r1,0x4830
80057a0: 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)" : "")
80057a4: 78 17 08 01 mvhi r23,0x801
80057a8: 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)" : ""),
80057ac: 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)(
80057b0: 5b 81 00 60 sw (sp+96),r1
80057b4: 3b 7b 4b 44 ori fp,fp,0x4b44
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
80057b8: 3a f7 4b b4 ori r23,r23,0x4bb4
80057bc: 3b 39 48 40 ori r25,r25,0x4840
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
80057c0: 3b 18 48 24 ori r24,r24,0x4824
block = next_block;
} while ( block != first_block );
return true;
}
80057c4: 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;
80057c8: 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;
80057cc: 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;
80057d0: 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);
80057d4: 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;
80057d8: 34 06 00 00 mvi r6,0
80057dc: 54 91 00 03 bgu r4,r17,80057e8 <_Heap_Walk+0x30c> <== NEVER TAKEN
80057e0: 29 86 00 24 lw r6,(r12+36)
80057e4: 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 ) ) {
80057e8: 5c c0 00 06 bne r6,r0,8005800 <_Heap_Walk+0x324>
(*printer)(
80057ec: 78 03 08 01 mvhi r3,0x801
80057f0: b9 c0 08 00 mv r1,r14
80057f4: 34 02 00 01 mvi r2,1
80057f8: 38 63 4a 84 ori r3,r3,0x4a84
80057fc: e0 00 00 1f bi 8005878 <_Heap_Walk+0x39c>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8005800: ba 00 08 00 mv r1,r16
8005804: 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;
8005808: fd f6 58 00 cmpne r11,r15,r22
800580c: fb ff ec e7 calli 8000ba8 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
8005810: 44 20 00 09 be r1,r0,8005834 <_Heap_Walk+0x358>
8005814: 45 60 00 08 be r11,r0,8005834 <_Heap_Walk+0x358>
(*printer)(
8005818: 78 03 08 01 mvhi r3,0x801
800581c: b9 c0 08 00 mv r1,r14
8005820: 34 02 00 01 mvi r2,1
8005824: 38 63 4a b4 ori r3,r3,0x4ab4
8005828: b9 e0 20 00 mv r4,r15
800582c: ba 00 28 00 mv r5,r16
8005830: e3 ff ff c8 bi 8005750 <_Heap_Walk+0x274>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
8005834: 52 15 00 0b bgeu r16,r21,8005860 <_Heap_Walk+0x384>
8005838: 45 60 00 0a be r11,r0,8005860 <_Heap_Walk+0x384> <== NEVER TAKEN
(*printer)(
800583c: 78 03 08 01 mvhi r3,0x801
8005840: b9 c0 08 00 mv r1,r14
8005844: 34 02 00 01 mvi r2,1
8005848: 38 63 4a e4 ori r3,r3,0x4ae4
800584c: b9 e0 20 00 mv r4,r15
8005850: ba 00 28 00 mv r5,r16
8005854: ba a0 30 00 mv r6,r21
8005858: d9 a0 00 00 call r13
800585c: e3 ff ff be bi 8005754 <_Heap_Walk+0x278>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
8005860: 56 2f 00 09 bgu r17,r15,8005884 <_Heap_Walk+0x3a8>
8005864: 45 60 00 08 be r11,r0,8005884 <_Heap_Walk+0x3a8>
(*printer)(
8005868: 78 03 08 01 mvhi r3,0x801
800586c: b9 c0 08 00 mv r1,r14
8005870: 34 02 00 01 mvi r2,1
8005874: 38 63 4b 10 ori r3,r3,0x4b10
8005878: b9 e0 20 00 mv r4,r15
800587c: ba 20 28 00 mv r5,r17
8005880: e3 ff ff b4 bi 8005750 <_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;
8005884: 2a 24 00 04 lw r4,(r17+4)
8005888: 22 52 00 01 andi r18,r18,0x1
800588c: 20 84 00 01 andi r4,r4,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
8005890: 5c 80 00 2d bne r4,r0,8005944 <_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 ?
8005894: 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)(
8005898: 29 85 00 08 lw r5,(r12+8)
block = next_block;
} while ( block != first_block );
return true;
}
800589c: 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)(
80058a0: 2b 87 00 5c lw r7,(sp+92)
80058a4: 44 c5 00 04 be r6,r5,80058b4 <_Heap_Walk+0x3d8>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
80058a8: ba e0 38 00 mv r7,r23
80058ac: 5c cc 00 02 bne r6,r12,80058b4 <_Heap_Walk+0x3d8>
80058b0: bb 00 38 00 mv r7,r24
block->next,
block->next == last_free_block ?
80058b4: 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)(
80058b8: 2b 89 00 60 lw r9,(sp+96)
80058bc: 45 04 00 04 be r8,r4,80058cc <_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)" : "")
80058c0: ba e0 48 00 mv r9,r23
80058c4: 5d 0c 00 02 bne r8,r12,80058cc <_Heap_Walk+0x3f0>
80058c8: 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)(
80058cc: 5b 89 00 04 sw (sp+4),r9
80058d0: b9 c0 08 00 mv r1,r14
80058d4: 34 02 00 00 mvi r2,0
80058d8: bb 60 18 00 mv r3,fp
80058dc: b9 e0 20 00 mv r4,r15
80058e0: ba 00 28 00 mv r5,r16
80058e4: 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 ) {
80058e8: 2a 26 00 00 lw r6,(r17+0)
80058ec: 46 06 00 0a be r16,r6,8005914 <_Heap_Walk+0x438>
(*printer)(
80058f0: 78 03 08 01 mvhi r3,0x801
80058f4: b9 c0 08 00 mv r1,r14
80058f8: 34 02 00 01 mvi r2,1
80058fc: 38 63 4b 7c ori r3,r3,0x4b7c
8005900: b9 e0 20 00 mv r4,r15
8005904: ba 00 28 00 mv r5,r16
8005908: ba 20 38 00 mv r7,r17
800590c: d9 a0 00 00 call r13
8005910: e3 ff ff 91 bi 8005754 <_Heap_Walk+0x278>
);
return false;
}
if ( !prev_used ) {
8005914: 5e 40 00 06 bne r18,r0,800592c <_Heap_Walk+0x450>
(*printer)(
8005918: 78 03 08 01 mvhi r3,0x801
800591c: b9 c0 08 00 mv r1,r14
8005920: 34 02 00 01 mvi r2,1
8005924: 38 63 4b b8 ori r3,r3,0x4bb8
8005928: e0 00 00 30 bi 80059e8 <_Heap_Walk+0x50c>
block = next_block;
} while ( block != first_block );
return true;
}
800592c: 29 85 00 08 lw r5,(r12+8)
8005930: e0 00 00 03 bi 800593c <_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 ) {
8005934: 44 af 00 13 be r5,r15,8005980 <_Heap_Walk+0x4a4>
return true;
}
free_block = free_block->next;
8005938: 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 ) {
800593c: 5c ac ff fe bne r5,r12,8005934 <_Heap_Walk+0x458>
8005940: e0 00 00 26 bi 80059d8 <_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) {
8005944: 46 40 00 08 be r18,r0,8005964 <_Heap_Walk+0x488>
(*printer)(
8005948: 2b 83 00 58 lw r3,(sp+88)
800594c: b9 c0 08 00 mv r1,r14
8005950: 34 02 00 00 mvi r2,0
8005954: b9 e0 20 00 mv r4,r15
8005958: ba 00 28 00 mv r5,r16
800595c: d9 a0 00 00 call r13
8005960: e0 00 00 08 bi 8005980 <_Heap_Walk+0x4a4>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
8005964: 2b 83 00 54 lw r3,(sp+84)
8005968: 29 e6 00 00 lw r6,(r15+0)
800596c: b9 c0 08 00 mv r1,r14
8005970: 34 02 00 00 mvi r2,0
8005974: b9 e0 20 00 mv r4,r15
8005978: ba 00 28 00 mv r5,r16
800597c: d9 a0 00 00 call r13
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
8005980: 5e 91 ff 7b bne r20,r17,800576c <_Heap_Walk+0x290>
return true;
8005984: 34 03 00 01 mvi r3,1
}
8005988: b8 60 08 00 mv r1,r3
800598c: 2b 9d 00 10 lw ra,(sp+16)
8005990: 2b 8b 00 50 lw r11,(sp+80)
8005994: 2b 8c 00 4c lw r12,(sp+76)
8005998: 2b 8d 00 48 lw r13,(sp+72)
800599c: 2b 8e 00 44 lw r14,(sp+68)
80059a0: 2b 8f 00 40 lw r15,(sp+64)
80059a4: 2b 90 00 3c lw r16,(sp+60)
80059a8: 2b 91 00 38 lw r17,(sp+56)
80059ac: 2b 92 00 34 lw r18,(sp+52)
80059b0: 2b 93 00 30 lw r19,(sp+48)
80059b4: 2b 94 00 2c lw r20,(sp+44)
80059b8: 2b 95 00 28 lw r21,(sp+40)
80059bc: 2b 96 00 24 lw r22,(sp+36)
80059c0: 2b 97 00 20 lw r23,(sp+32)
80059c4: 2b 98 00 1c lw r24,(sp+28)
80059c8: 2b 99 00 18 lw r25,(sp+24)
80059cc: 2b 9b 00 14 lw fp,(sp+20)
80059d0: 37 9c 00 60 addi sp,sp,96
80059d4: c3 a0 00 00 ret
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
80059d8: 78 03 08 01 mvhi r3,0x801
80059dc: b9 c0 08 00 mv r1,r14
80059e0: 34 02 00 01 mvi r2,1
80059e4: 38 63 4c 28 ori r3,r3,0x4c28
80059e8: b9 e0 20 00 mv r4,r15
80059ec: d9 a0 00 00 call r13
80059f0: e3 ff ff 59 bi 8005754 <_Heap_Walk+0x278>
08005478 <_IO_Manager_initialization>:
#include <rtems/score/wkspace.h>
#include <string.h>
void _IO_Manager_initialization(void)
{
8005478: 37 9c ff e8 addi sp,sp,-24
800547c: 5b 8b 00 18 sw (sp+24),r11
8005480: 5b 8c 00 14 sw (sp+20),r12
8005484: 5b 8d 00 10 sw (sp+16),r13
8005488: 5b 8e 00 0c sw (sp+12),r14
800548c: 5b 8f 00 08 sw (sp+8),r15
8005490: 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 = rtems_configuration_get_device_driver_table();
8005494: 78 01 08 01 mvhi r1,0x801
8005498: 38 21 87 ec ori r1,r1,0x87ec
drivers_in_table = rtems_configuration_get_number_of_device_drivers();
800549c: 28 2d 00 38 lw r13,(r1+56)
number_of_drivers = rtems_configuration_get_maximum_drivers();
80054a0: 28 2b 00 34 lw r11,(r1+52)
uint32_t index;
rtems_driver_address_table *driver_table;
uint32_t drivers_in_table;
uint32_t number_of_drivers;
driver_table = rtems_configuration_get_device_driver_table();
80054a4: 28 2e 00 3c lw r14,(r1+60)
/*
* 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 )
80054a8: 51 ab 00 03 bgeu r13,r11,80054b4 <_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 ) {
80054ac: 5d 6d 00 0a bne r11,r13,80054d4 <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN
80054b0: e0 00 00 02 bi 80054b8 <_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 )
80054b4: 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;
80054b8: 78 01 08 01 mvhi r1,0x801
80054bc: 38 21 b2 b4 ori r1,r1,0xb2b4
80054c0: 58 2e 00 00 sw (r1+0),r14
_IO_Number_of_drivers = number_of_drivers;
80054c4: 78 01 08 01 mvhi r1,0x801
80054c8: 38 21 b2 b0 ori r1,r1,0xb2b0
80054cc: 58 2b 00 00 sw (r1+0),r11
return;
80054d0: e0 00 00 27 bi 800556c <_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 )
80054d4: 34 02 00 01 mvi r2,1
80054d8: b9 60 08 00 mv r1,r11
80054dc: f8 00 49 19 calli 8017940 <__ashlsi3>
80054e0: 34 02 00 03 mvi r2,3
80054e4: b4 2b 08 00 add r1,r1,r11
80054e8: f8 00 49 16 calli 8017940 <__ashlsi3>
80054ec: 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(
80054f0: f8 00 0d ed calli 8008ca4 <_Workspace_Allocate_or_fatal_error>
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
80054f4: 78 02 08 01 mvhi r2,0x801
80054f8: 38 42 b2 b0 ori r2,r2,0xb2b0
/*
* 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 *)
80054fc: 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;
8005500: 58 4b 00 00 sw (r2+0),r11
memset(
8005504: 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 *)
8005508: 39 8c b2 b4 ori r12,r12,0xb2b4
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
memset(
800550c: 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 *)
8005510: 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(
8005514: f8 00 35 07 calli 8012930 <memset>
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
8005518: 34 03 00 00 mvi r3,0
800551c: 34 04 00 00 mvi r4,0
8005520: e0 00 00 12 bi 8005568 <_IO_Manager_initialization+0xf0>
_IO_Driver_address_table[index] = driver_table[index];
8005524: 29 82 00 00 lw r2,(r12+0)
#include <rtems/score/thread.h>
#include <rtems/score/wkspace.h>
#include <string.h>
void _IO_Manager_initialization(void)
8005528: 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];
800552c: 28 29 00 00 lw r9,(r1+0)
8005530: 28 28 00 04 lw r8,(r1+4)
8005534: 28 27 00 08 lw r7,(r1+8)
8005538: 28 26 00 0c lw r6,(r1+12)
800553c: 28 25 00 10 lw r5,(r1+16)
8005540: 28 21 00 14 lw r1,(r1+20)
8005544: b4 43 10 00 add r2,r2,r3
8005548: 58 49 00 00 sw (r2+0),r9
800554c: 58 48 00 04 sw (r2+4),r8
8005550: 58 47 00 08 sw (r2+8),r7
8005554: 58 46 00 0c sw (r2+12),r6
8005558: 58 45 00 10 sw (r2+16),r5
800555c: 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++ )
8005560: 34 84 00 01 addi r4,r4,1
8005564: 34 63 00 18 addi r3,r3,24
8005568: 55 a4 ff ef bgu r13,r4,8005524 <_IO_Manager_initialization+0xac>
_IO_Driver_address_table[index] = driver_table[index];
}
800556c: 2b 9d 00 04 lw ra,(sp+4)
8005570: 2b 8b 00 18 lw r11,(sp+24)
8005574: 2b 8c 00 14 lw r12,(sp+20)
8005578: 2b 8d 00 10 lw r13,(sp+16)
800557c: 2b 8e 00 0c lw r14,(sp+12)
8005580: 2b 8f 00 08 lw r15,(sp+8)
8005584: 37 9c 00 18 addi sp,sp,24
8005588: c3 a0 00 00 ret
080065f4 <_Objects_Allocate>:
#endif
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
80065f4: 37 9c ff ec addi sp,sp,-20
80065f8: 5b 8b 00 14 sw (sp+20),r11
80065fc: 5b 8c 00 10 sw (sp+16),r12
8006600: 5b 8d 00 0c sw (sp+12),r13
8006604: 5b 8e 00 08 sw (sp+8),r14
8006608: 5b 9d 00 04 sw (sp+4),ra
800660c: 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 )
8006610: 28 21 00 18 lw r1,(r1+24)
return NULL;
8006614: 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 )
8006618: 44 20 00 1e be r1,r0,8006690 <_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 );
800661c: 35 6d 00 20 addi r13,r11,32
8006620: b9 a0 08 00 mv r1,r13
8006624: fb ff fd 23 calli 8005ab0 <_Chain_Get>
8006628: b8 20 60 00 mv r12,r1
800662c: b8 20 70 00 mv r14,r1
if ( information->auto_extend ) {
8006630: 41 61 00 12 lbu r1,(r11+18)
8006634: 44 20 00 17 be r1,r0,8006690 <_Objects_Allocate+0x9c>
/*
* If the list is empty then we are out of objects and need to
* extend information base.
*/
if ( !the_object ) {
8006638: 5d 80 00 07 bne r12,r0,8006654 <_Objects_Allocate+0x60>
_Objects_Extend_information( information );
800663c: b9 60 08 00 mv r1,r11
8006640: f8 00 00 32 calli 8006708 <_Objects_Extend_information>
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
8006644: b9 a0 08 00 mv r1,r13
8006648: fb ff fd 1a calli 8005ab0 <_Chain_Get>
800664c: b8 20 60 00 mv r12,r1
}
if ( the_object ) {
8006650: 44 2e 00 10 be r1,r14,8006690 <_Objects_Allocate+0x9c>
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
8006654: 2d 82 00 0a lhu r2,(r12+10)
8006658: 2d 61 00 0a lhu r1,(r11+10)
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
800665c: c8 41 08 00 sub r1,r2,r1
8006660: 2d 62 00 14 lhu r2,(r11+20)
8006664: f8 00 45 91 calli 8017ca8 <__udivsi3>
information->inactive_per_block[ block ]--;
8006668: 34 02 00 02 mvi r2,2
800666c: f8 00 44 b5 calli 8017940 <__ashlsi3>
8006670: 29 62 00 30 lw r2,(r11+48)
8006674: b4 41 08 00 add r1,r2,r1
8006678: 28 22 00 00 lw r2,(r1+0)
800667c: 34 42 ff ff addi r2,r2,-1
8006680: 58 22 00 00 sw (r1+0),r2
information->inactive--;
8006684: 2d 61 00 2c lhu r1,(r11+44)
8006688: 34 21 ff ff addi r1,r1,-1
800668c: 0d 61 00 2c sh (r11+44),r1
);
}
#endif
return the_object;
}
8006690: b9 80 08 00 mv r1,r12
8006694: 2b 9d 00 04 lw ra,(sp+4)
8006698: 2b 8b 00 14 lw r11,(sp+20)
800669c: 2b 8c 00 10 lw r12,(sp+16)
80066a0: 2b 8d 00 0c lw r13,(sp+12)
80066a4: 2b 8e 00 08 lw r14,(sp+8)
80066a8: 37 9c 00 14 addi sp,sp,20
80066ac: c3 a0 00 00 ret
0800f89c <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint16_t the_class
)
{
800f89c: 37 9c ff ec addi sp,sp,-20
800f8a0: 5b 8b 00 14 sw (sp+20),r11
800f8a4: 5b 8c 00 10 sw (sp+16),r12
800f8a8: 5b 8d 00 0c sw (sp+12),r13
800f8ac: 5b 8e 00 08 sw (sp+8),r14
800f8b0: 5b 9d 00 04 sw (sp+4),ra
800f8b4: 20 4c ff ff andi r12,r2,0xffff
800f8b8: b8 20 70 00 mv r14,r1
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
return NULL;
800f8bc: 34 0b 00 00 mvi r11,0
)
{
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
800f8c0: 45 80 00 16 be r12,r0,800f918 <_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 );
800f8c4: f8 00 08 4b calli 80119f0 <_Objects_API_maximum_class>
if ( the_class_api_maximum == 0 )
800f8c8: 44 20 00 14 be r1,r0,800f918 <_Objects_Get_information+0x7c>
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
800f8cc: 55 81 00 13 bgu r12,r1,800f918 <_Objects_Get_information+0x7c>
return NULL;
if ( !_Objects_Information_table[ the_api ] )
800f8d0: 78 0d 08 01 mvhi r13,0x801
800f8d4: b9 c0 08 00 mv r1,r14
800f8d8: 34 02 00 02 mvi r2,2
800f8dc: 39 ad a9 14 ori r13,r13,0xa914
800f8e0: f8 00 20 18 calli 8017940 <__ashlsi3>
800f8e4: b5 a1 08 00 add r1,r13,r1
800f8e8: 28 2d 00 00 lw r13,(r1+0)
800f8ec: 45 a0 00 0b be r13,r0,800f918 <_Objects_Get_information+0x7c><== NEVER TAKEN
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
800f8f0: b9 80 08 00 mv r1,r12
800f8f4: 34 02 00 02 mvi r2,2
800f8f8: f8 00 20 12 calli 8017940 <__ashlsi3>
800f8fc: b5 a1 08 00 add r1,r13,r1
800f900: 28 2b 00 00 lw r11,(r1+0)
if ( !info )
800f904: 45 60 00 05 be r11,r0,800f918 <_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 )
800f908: 2d 61 00 10 lhu r1,(r11+16)
return NULL;
800f90c: 7c 21 00 00 cmpnei r1,r1,0
800f910: c8 01 08 00 sub r1,r0,r1
800f914: a1 61 58 00 and r11,r11,r1
#endif
return info;
}
800f918: b9 60 08 00 mv r1,r11
800f91c: 2b 9d 00 04 lw ra,(sp+4)
800f920: 2b 8b 00 14 lw r11,(sp+20)
800f924: 2b 8c 00 10 lw r12,(sp+16)
800f928: 2b 8d 00 0c lw r13,(sp+12)
800f92c: 2b 8e 00 08 lw r14,(sp+8)
800f930: 37 9c 00 14 addi sp,sp,20
800f934: c3 a0 00 00 ret
08018980 <_Objects_Get_no_protection>:
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
8018980: 37 9c ff f4 addi sp,sp,-12
8018984: 5b 8b 00 0c sw (sp+12),r11
8018988: 5b 8c 00 08 sw (sp+8),r12
801898c: 5b 9d 00 04 sw (sp+4),ra
8018990: 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;
8018994: 28 21 00 08 lw r1,(r1+8)
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
8018998: 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;
801899c: c8 41 08 00 sub r1,r2,r1
if ( information->maximum >= index ) {
80189a0: 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;
80189a4: 34 21 00 01 addi r1,r1,1
if ( information->maximum >= index ) {
80189a8: 54 22 00 09 bgu r1,r2,80189cc <_Objects_Get_no_protection+0x4c>
if ( (the_object = information->local_table[ index ]) != NULL ) {
80189ac: 28 8c 00 1c lw r12,(r4+28)
80189b0: 34 02 00 02 mvi r2,2
80189b4: fb ff d5 e3 calli 800e140 <__ashlsi3>
80189b8: b5 81 08 00 add r1,r12,r1
80189bc: 28 21 00 00 lw r1,(r1+0)
80189c0: 44 20 00 03 be r1,r0,80189cc <_Objects_Get_no_protection+0x4c><== NEVER TAKEN
*location = OBJECTS_LOCAL;
80189c4: 59 60 00 00 sw (r11+0),r0
return the_object;
80189c8: e0 00 00 04 bi 80189d8 <_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;
80189cc: 34 01 00 01 mvi r1,1
80189d0: 59 61 00 00 sw (r11+0),r1
return NULL;
80189d4: 34 01 00 00 mvi r1,0
}
80189d8: 2b 9d 00 04 lw ra,(sp+4)
80189dc: 2b 8b 00 0c lw r11,(sp+12)
80189e0: 2b 8c 00 08 lw r12,(sp+8)
80189e4: 37 9c 00 0c addi sp,sp,12
80189e8: c3 a0 00 00 ret
0800a45c <_Objects_Id_to_name>:
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
800a45c: 37 9c ff e8 addi sp,sp,-24
800a460: 5b 8b 00 14 sw (sp+20),r11
800a464: 5b 8c 00 10 sw (sp+16),r12
800a468: 5b 8d 00 0c sw (sp+12),r13
800a46c: 5b 8e 00 08 sw (sp+8),r14
800a470: 5b 9d 00 04 sw (sp+4),ra
800a474: b8 40 70 00 mv r14,r2
/*
* Caller is trusted for name != NULL.
*/
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
800a478: b8 20 58 00 mv r11,r1
800a47c: 5c 20 00 05 bne r1,r0,800a490 <_Objects_Id_to_name+0x34>
800a480: 78 01 08 03 mvhi r1,0x803
800a484: 38 21 17 00 ori r1,r1,0x1700
800a488: 28 21 00 10 lw r1,(r1+16)
800a48c: 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);
800a490: 34 02 00 18 mvi r2,24
800a494: b9 60 08 00 mv r1,r11
800a498: f8 00 80 d9 calli 802a7fc <__lshrsi3>
800a49c: 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 )
800a4a0: 34 23 ff ff addi r3,r1,-1
800a4a4: 34 02 00 02 mvi r2,2
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
800a4a8: 34 0d 00 03 mvi r13,3
800a4ac: 54 62 00 14 bgu r3,r2,800a4fc <_Objects_Id_to_name+0xa0>
800a4b0: e0 00 00 1b bi 800a51c <_Objects_Id_to_name+0xc0>
*/
RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
Objects_Id id
)
{
return (uint32_t)
800a4b4: 34 02 00 1b mvi r2,27
800a4b8: b9 60 08 00 mv r1,r11
800a4bc: f8 00 80 d0 calli 802a7fc <__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 ];
800a4c0: 34 02 00 02 mvi r2,2
800a4c4: f8 00 80 80 calli 802a6c4 <__ashlsi3>
800a4c8: b5 81 08 00 add r1,r12,r1
800a4cc: 28 21 00 00 lw r1,(r1+0)
if ( !information )
800a4d0: 44 20 00 0b be r1,r0,800a4fc <_Objects_Id_to_name+0xa0> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
800a4d4: 40 2c 00 38 lbu r12,(r1+56)
800a4d8: 5d 80 00 09 bne r12,r0,800a4fc <_Objects_Id_to_name+0xa0> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#endif
the_object = _Objects_Get( information, tmpId, &ignored_location );
800a4dc: b9 60 10 00 mv r2,r11
800a4e0: 37 83 00 18 addi r3,sp,24
800a4e4: fb ff ff b8 calli 800a3c4 <_Objects_Get>
if ( !the_object )
800a4e8: 44 2c 00 05 be r1,r12,800a4fc <_Objects_Id_to_name+0xa0>
return OBJECTS_INVALID_ID;
*name = the_object->name;
800a4ec: 28 21 00 0c lw r1,(r1+12)
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
800a4f0: 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;
800a4f4: 59 c1 00 00 sw (r14+0),r1
_Thread_Enable_dispatch();
800a4f8: f8 00 04 5b calli 800b664 <_Thread_Enable_dispatch>
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
}
800a4fc: b9 a0 08 00 mv r1,r13
800a500: 2b 9d 00 04 lw ra,(sp+4)
800a504: 2b 8b 00 14 lw r11,(sp+20)
800a508: 2b 8c 00 10 lw r12,(sp+16)
800a50c: 2b 8d 00 0c lw r13,(sp+12)
800a510: 2b 8e 00 08 lw r14,(sp+8)
800a514: 37 9c 00 18 addi sp,sp,24
800a518: 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 ] )
800a51c: 78 0c 08 03 mvhi r12,0x803
800a520: 34 02 00 02 mvi r2,2
800a524: 39 8c 11 d4 ori r12,r12,0x11d4
800a528: f8 00 80 67 calli 802a6c4 <__ashlsi3>
800a52c: b5 81 08 00 add r1,r12,r1
800a530: 28 2c 00 00 lw r12,(r1+0)
800a534: 5d 80 ff e0 bne r12,r0,800a4b4 <_Objects_Id_to_name+0x58>
800a538: e3 ff ff f1 bi 800a4fc <_Objects_Id_to_name+0xa0>
0801120c <_POSIX_Keys_Run_destructors>:
*/
void _POSIX_Keys_Run_destructors(
Thread_Control *thread
)
{
801120c: 37 9c ff dc addi sp,sp,-36
8011210: 5b 8b 00 24 sw (sp+36),r11
8011214: 5b 8c 00 20 sw (sp+32),r12
8011218: 5b 8d 00 1c sw (sp+28),r13
801121c: 5b 8e 00 18 sw (sp+24),r14
8011220: 5b 8f 00 14 sw (sp+20),r15
8011224: 5b 90 00 10 sw (sp+16),r16
8011228: 5b 91 00 0c sw (sp+12),r17
801122c: 5b 92 00 08 sw (sp+8),r18
8011230: 5b 9d 00 04 sw (sp+4),ra
Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id );
8011234: 28 2b 00 08 lw r11,(r1+8)
8011238: 34 02 00 18 mvi r2,24
801123c: b9 60 08 00 mv r1,r11
8011240: f8 00 1a 0e calli 8017a78 <__lshrsi3>
8011244: 20 30 00 07 andi r16,r1,0x7
for ( index = 1 ; index <= max ; ++index ) {
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
void *value = key->Values [ thread_api ][ thread_index ];
8011248: 34 02 00 02 mvi r2,2
801124c: 21 61 ff ff andi r1,r11,0xffff
8011250: f8 00 19 bc calli 8017940 <__ashlsi3>
*
* Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
*/
while ( !done ) {
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
8011254: 78 0b 08 01 mvhi r11,0x801
for ( index = 1 ; index <= max ; ++index ) {
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
void *value = key->Values [ thread_api ][ thread_index ];
8011258: b8 20 88 00 mv r17,r1
*
* Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
*/
while ( !done ) {
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
801125c: 39 6b ac cc ori r11,r11,0xaccc
for ( index = 1 ; index <= max ; ++index ) {
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
void *value = key->Values [ thread_api ][ thread_index ];
8011260: 36 10 00 04 addi r16,r16,4
*
* Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
*/
while ( !done ) {
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
8011264: 2d 72 00 10 lhu r18,(r11+16)
done = true;
for ( index = 1 ; index <= max ; ++index ) {
8011268: 34 0c 00 01 mvi r12,1
*/
while ( !done ) {
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
801126c: 34 0e 00 01 mvi r14,1
for ( index = 1 ; index <= max ; ++index ) {
8011270: e0 00 00 18 bi 80112d0 <_POSIX_Keys_Run_destructors+0xc4>
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
_POSIX_Keys_Information.local_table [ index ];
8011274: 29 6d 00 1c lw r13,(r11+28)
8011278: 34 02 00 02 mvi r2,2
801127c: b9 80 08 00 mv r1,r12
8011280: f8 00 19 b0 calli 8017940 <__ashlsi3>
8011284: b5 a1 10 00 add r2,r13,r1
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
8011288: 28 4d 00 00 lw r13,(r2+0)
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
801128c: 45 a0 00 0f be r13,r0,80112c8 <_POSIX_Keys_Run_destructors+0xbc>
8011290: 29 af 00 10 lw r15,(r13+16)
8011294: 45 e0 00 0d be r15,r0,80112c8 <_POSIX_Keys_Run_destructors+0xbc>
void *value = key->Values [ thread_api ][ thread_index ];
8011298: 34 02 00 02 mvi r2,2
801129c: ba 00 08 00 mv r1,r16
80112a0: f8 00 19 a8 calli 8017940 <__ashlsi3>
80112a4: b5 a1 68 00 add r13,r13,r1
80112a8: 29 a3 00 04 lw r3,(r13+4)
80112ac: b4 71 18 00 add r3,r3,r17
80112b0: 28 62 00 00 lw r2,(r3+0)
if ( value != NULL ) {
80112b4: 44 40 00 05 be r2,r0,80112c8 <_POSIX_Keys_Run_destructors+0xbc><== ALWAYS TAKEN
key->Values [ thread_api ][ thread_index ] = NULL;
80112b8: 58 60 00 00 sw (r3+0),r0 <== NOT EXECUTED
(*key->destructor)( value );
80112bc: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
80112c0: d9 e0 00 00 call r15 <== NOT EXECUTED
done = false;
80112c4: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
80112c8: 35 8c 00 01 addi r12,r12,1
80112cc: 21 8c ff ff andi r12,r12,0xffff
80112d0: 52 4c ff e9 bgeu r18,r12,8011274 <_POSIX_Keys_Run_destructors+0x68>
* number of iterations. An infinite loop may happen if destructors set
* thread specific data. This can be considered dubious.
*
* Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
*/
while ( !done ) {
80112d4: 45 c0 ff e4 be r14,r0,8011264 <_POSIX_Keys_Run_destructors+0x58><== NEVER TAKEN
done = false;
}
}
}
}
}
80112d8: 2b 9d 00 04 lw ra,(sp+4)
80112dc: 2b 8b 00 24 lw r11,(sp+36)
80112e0: 2b 8c 00 20 lw r12,(sp+32)
80112e4: 2b 8d 00 1c lw r13,(sp+28)
80112e8: 2b 8e 00 18 lw r14,(sp+24)
80112ec: 2b 8f 00 14 lw r15,(sp+20)
80112f0: 2b 90 00 10 lw r16,(sp+16)
80112f4: 2b 91 00 0c lw r17,(sp+12)
80112f8: 2b 92 00 08 lw r18,(sp+8)
80112fc: 37 9c 00 24 addi sp,sp,36
8011300: c3 a0 00 00 ret
08009320 <_POSIX_Message_queue_Receive_support>:
size_t msg_len,
unsigned int *msg_prio,
bool wait,
Watchdog_Interval timeout
)
{
8009320: 37 9c ff dc addi sp,sp,-36
8009324: 5b 8b 00 18 sw (sp+24),r11
8009328: 5b 8c 00 14 sw (sp+20),r12
800932c: 5b 8d 00 10 sw (sp+16),r13
8009330: 5b 8e 00 0c sw (sp+12),r14
8009334: 5b 8f 00 08 sw (sp+8),r15
8009338: 5b 9d 00 04 sw (sp+4),ra
800933c: b8 20 60 00 mv r12,r1
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd (
mqd_t id,
Objects_Locations *location
)
{
return (POSIX_Message_queue_Control_fd *) _Objects_Get(
8009340: 78 01 08 02 mvhi r1,0x802
8009344: b8 40 68 00 mv r13,r2
8009348: b8 60 78 00 mv r15,r3
800934c: b9 80 10 00 mv r2,r12
8009350: 38 21 a2 40 ori r1,r1,0xa240
8009354: 37 83 00 24 addi r3,sp,36
8009358: 5b 86 00 1c sw (sp+28),r6
800935c: b8 80 58 00 mv r11,r4
8009360: 20 ae 00 ff andi r14,r5,0xff
8009364: f8 00 0d 3e calli 800c85c <_Objects_Get>
Objects_Locations location;
size_t length_out;
bool do_wait;
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
8009368: 2b 82 00 24 lw r2,(sp+36)
800936c: 2b 86 00 1c lw r6,(sp+28)
8009370: 5c 40 00 33 bne r2,r0,800943c <_POSIX_Message_queue_Receive_support+0x11c>
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
8009374: 28 24 00 14 lw r4,(r1+20)
8009378: 34 02 00 01 mvi r2,1
800937c: 20 83 00 03 andi r3,r4,0x3
8009380: 5c 62 00 03 bne r3,r2,800938c <_POSIX_Message_queue_Receive_support+0x6c>
_Thread_Enable_dispatch();
8009384: f8 00 11 76 calli 800d95c <_Thread_Enable_dispatch>
8009388: e0 00 00 2d bi 800943c <_POSIX_Message_queue_Receive_support+0x11c>
rtems_set_errno_and_return_minus_one( EBADF );
}
the_mq = the_mq_fd->Queue;
800938c: 28 27 00 10 lw r7,(r1+16)
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
8009390: 28 e1 00 68 lw r1,(r7+104)
8009394: 51 e1 00 05 bgeu r15,r1,80093a8 <_POSIX_Message_queue_Receive_support+0x88>
_Thread_Enable_dispatch();
8009398: f8 00 11 71 calli 800d95c <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EMSGSIZE );
800939c: f8 00 2c 04 calli 80143ac <__errno>
80093a0: 34 02 00 7a mvi r2,122
80093a4: e0 00 00 28 bi 8009444 <_POSIX_Message_queue_Receive_support+0x124>
/*
* Now if something goes wrong, we return a "length" of -1
* to indicate an error.
*/
length_out = -1;
80093a8: 34 01 ff ff mvi r1,-1
80093ac: 5b 81 00 20 sw (sp+32),r1
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
80093b0: 34 05 00 00 mvi r5,0
80093b4: 45 c0 00 03 be r14,r0,80093c0 <_POSIX_Message_queue_Receive_support+0xa0>
do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true;
80093b8: 20 85 40 00 andi r5,r4,0x4000
80093bc: 64 a5 00 00 cmpei r5,r5,0
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
80093c0: 34 e1 00 1c addi r1,r7,28
80093c4: b9 80 10 00 mv r2,r12
80093c8: b9 a0 18 00 mv r3,r13
80093cc: 37 84 00 20 addi r4,sp,32
80093d0: f8 00 07 dc calli 800b340 <_CORE_message_queue_Seize>
&length_out,
do_wait,
timeout
);
_Thread_Enable_dispatch();
80093d4: f8 00 11 62 calli 800d95c <_Thread_Enable_dispatch>
if (msg_prio) {
80093d8: 45 60 00 0b be r11,r0,8009404 <_POSIX_Message_queue_Receive_support+0xe4><== NEVER TAKEN
*msg_prio = _POSIX_Message_queue_Priority_from_core(
_Thread_Executing->Wait.count
80093dc: 78 01 08 02 mvhi r1,0x802
80093e0: 38 21 a2 c0 ori r1,r1,0xa2c0
80093e4: 28 2c 00 10 lw r12,(r1+16)
RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
CORE_message_queue_Submit_types priority
)
{
/* absolute value without a library dependency */
return (unsigned int) ((priority >= 0) ? priority : -priority);
80093e8: 34 02 00 1f mvi r2,31
80093ec: 29 81 00 24 lw r1,(r12+36)
80093f0: f8 00 6d d3 calli 8024b3c <__ashrsi3>
80093f4: 29 82 00 24 lw r2,(r12+36)
80093f8: 98 22 10 00 xor r2,r1,r2
80093fc: c8 41 08 00 sub r1,r2,r1
timeout
);
_Thread_Enable_dispatch();
if (msg_prio) {
*msg_prio = _POSIX_Message_queue_Priority_from_core(
8009400: 59 61 00 00 sw (r11+0),r1
_Thread_Executing->Wait.count
);
}
if ( !_Thread_Executing->Wait.return_code )
8009404: 78 0b 08 02 mvhi r11,0x802
8009408: 39 6b a2 c0 ori r11,r11,0xa2c0
800940c: 29 61 00 10 lw r1,(r11+16)
8009410: 28 21 00 34 lw r1,(r1+52)
8009414: 5c 20 00 03 bne r1,r0,8009420 <_POSIX_Message_queue_Receive_support+0x100>
return length_out;
8009418: 2b 81 00 20 lw r1,(sp+32)
800941c: e0 00 00 0c bi 800944c <_POSIX_Message_queue_Receive_support+0x12c>
rtems_set_errno_and_return_minus_one(
8009420: f8 00 2b e3 calli 80143ac <__errno>
8009424: b8 20 60 00 mv r12,r1
8009428: 29 61 00 10 lw r1,(r11+16)
800942c: 28 21 00 34 lw r1,(r1+52)
8009430: f8 00 00 b9 calli 8009714 <_POSIX_Message_queue_Translate_core_message_queue_return_code>
8009434: 59 81 00 00 sw (r12+0),r1
8009438: e0 00 00 04 bi 8009448 <_POSIX_Message_queue_Receive_support+0x128>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
800943c: f8 00 2b dc calli 80143ac <__errno>
8009440: 34 02 00 09 mvi r2,9
8009444: 58 22 00 00 sw (r1+0),r2
8009448: 34 01 ff ff mvi r1,-1
}
800944c: 2b 9d 00 04 lw ra,(sp+4)
8009450: 2b 8b 00 18 lw r11,(sp+24)
8009454: 2b 8c 00 14 lw r12,(sp+20)
8009458: 2b 8d 00 10 lw r13,(sp+16)
800945c: 2b 8e 00 0c lw r14,(sp+12)
8009460: 2b 8f 00 08 lw r15,(sp+8)
8009464: 37 9c 00 24 addi sp,sp,36
8009468: c3 a0 00 00 ret
0800beec <_POSIX_Semaphore_Create_support>:
size_t name_len,
int pshared,
unsigned int value,
POSIX_Semaphore_Control **the_sem
)
{
800beec: 37 9c ff e0 addi sp,sp,-32
800bef0: 5b 8b 00 1c sw (sp+28),r11
800bef4: 5b 8c 00 18 sw (sp+24),r12
800bef8: 5b 8d 00 14 sw (sp+20),r13
800befc: 5b 8e 00 10 sw (sp+16),r14
800bf00: 5b 8f 00 0c sw (sp+12),r15
800bf04: 5b 90 00 08 sw (sp+8),r16
800bf08: 5b 9d 00 04 sw (sp+4),ra
800bf0c: b8 20 60 00 mv r12,r1
800bf10: b8 60 70 00 mv r14,r3
800bf14: b8 80 80 00 mv r16,r4
800bf18: b8 a0 78 00 mv r15,r5
POSIX_Semaphore_Control *the_semaphore;
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
800bf1c: 44 60 00 04 be r3,r0,800bf2c <_POSIX_Semaphore_Create_support+0x40>
rtems_set_errno_and_return_minus_one( ENOSYS );
800bf20: f8 00 0b f0 calli 800eee0 <__errno>
800bf24: 34 02 00 58 mvi r2,88
800bf28: e0 00 00 11 bi 800bf6c <_POSIX_Semaphore_Create_support+0x80>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
800bf2c: 78 06 08 02 mvhi r6,0x802
800bf30: 38 c6 43 28 ori r6,r6,0x4328
800bf34: 28 c1 00 00 lw r1,(r6+0)
++level;
800bf38: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
800bf3c: 58 c1 00 00 sw (r6+0),r1
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
_Objects_Allocate( &_POSIX_Semaphore_Information );
800bf40: 78 0d 08 02 mvhi r13,0x802
800bf44: 39 ad 45 64 ori r13,r13,0x4564
800bf48: b9 a0 08 00 mv r1,r13
800bf4c: 5b 82 00 20 sw (sp+32),r2
800bf50: fb ff ec 60 calli 80070d0 <_Objects_Allocate>
800bf54: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
800bf58: 2b 82 00 20 lw r2,(sp+32)
800bf5c: 5c 2e 00 07 bne r1,r14,800bf78 <_POSIX_Semaphore_Create_support+0x8c>
_Thread_Enable_dispatch();
800bf60: fb ff f1 fd calli 8008754 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSPC );
800bf64: f8 00 0b df calli 800eee0 <__errno>
800bf68: 34 02 00 1c mvi r2,28
800bf6c: 58 22 00 00 sw (r1+0),r2
800bf70: 34 01 ff ff mvi r1,-1
800bf74: e0 00 00 2c bi 800c024 <_POSIX_Semaphore_Create_support+0x138>
/*
* Make a copy of the user's string for name just in case it was
* dynamically constructed.
*/
if ( name_arg != NULL ) {
800bf78: 45 80 00 0c be r12,r0,800bfa8 <_POSIX_Semaphore_Create_support+0xbc>
name = _Workspace_String_duplicate( name_arg, name_len );
800bf7c: b9 80 08 00 mv r1,r12
800bf80: f8 00 05 09 calli 800d3a4 <_Workspace_String_duplicate>
800bf84: b8 20 60 00 mv r12,r1
if ( !name ) {
800bf88: 5c 20 00 09 bne r1,r0,800bfac <_POSIX_Semaphore_Create_support+0xc0><== ALWAYS TAKEN
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
800bf8c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800bf90: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800bf94: fb ff ed 4f calli 80074d0 <_Objects_Free> <== NOT EXECUTED
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
800bf98: fb ff f1 ef calli 8008754 <_Thread_Enable_dispatch> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
800bf9c: f8 00 0b d1 calli 800eee0 <__errno> <== NOT EXECUTED
800bfa0: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
800bfa4: e3 ff ff f2 bi 800bf6c <_POSIX_Semaphore_Create_support+0x80><== NOT EXECUTED
}
} else {
name = NULL;
800bfa8: 34 0c 00 00 mvi r12,0
}
the_semaphore->process_shared = pshared;
800bfac: 59 60 00 10 sw (r11+16),r0
if ( name ) {
800bfb0: 45 80 00 07 be r12,r0,800bfcc <_POSIX_Semaphore_Create_support+0xe0>
the_semaphore->named = true;
800bfb4: 34 01 00 01 mvi r1,1
800bfb8: 31 61 00 14 sb (r11+20),r1
the_semaphore->open_count = 1;
800bfbc: 34 01 00 01 mvi r1,1
800bfc0: 59 61 00 18 sw (r11+24),r1
the_semaphore->linked = true;
800bfc4: 31 61 00 15 sb (r11+21),r1
800bfc8: e0 00 00 04 bi 800bfd8 <_POSIX_Semaphore_Create_support+0xec>
} else {
the_semaphore->named = false;
800bfcc: 31 60 00 14 sb (r11+20),r0
the_semaphore->open_count = 0;
800bfd0: 59 60 00 18 sw (r11+24),r0
the_semaphore->linked = false;
800bfd4: 31 60 00 15 sb (r11+21),r0
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
800bfd8: 34 01 ff ff mvi r1,-1
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
800bfdc: ba 00 18 00 mv r3,r16
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
800bfe0: 59 61 00 5c sw (r11+92),r1
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
800bfe4: 35 62 00 5c addi r2,r11,92
800bfe8: 35 61 00 1c addi r1,r11,28
* blocking tasks on this semaphore should be. It could somehow
* be derived from the current scheduling policy. One
* thing is certain, no matter what we decide, it won't be
* the same as all other POSIX implementations. :)
*/
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
800bfec: 59 60 00 60 sw (r11+96),r0
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
800bff0: fb ff ea 3b calli 80068dc <_CORE_semaphore_Initialize>
*the_sem = the_semaphore;
_Thread_Enable_dispatch();
return 0;
}
800bff4: 78 01 08 02 mvhi r1,0x802
800bff8: 38 21 45 64 ori r1,r1,0x4564
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
800bffc: 28 2d 00 1c lw r13,(r1+28)
800c000: 2d 61 00 0a lhu r1,(r11+10)
800c004: 34 02 00 02 mvi r2,2
800c008: fb ff d3 05 calli 8000c1c <__ashlsi3>
800c00c: b5 a1 08 00 add r1,r13,r1
800c010: 58 2b 00 00 sw (r1+0),r11
the_object
);
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
/* ASSERT: information->is_string */
the_object->name.name_p = name;
800c014: 59 6c 00 0c sw (r11+12),r12
&_POSIX_Semaphore_Information,
&the_semaphore->Object,
name
);
*the_sem = the_semaphore;
800c018: 59 eb 00 00 sw (r15+0),r11
_Thread_Enable_dispatch();
800c01c: fb ff f1 ce calli 8008754 <_Thread_Enable_dispatch>
return 0;
800c020: 34 01 00 00 mvi r1,0
}
800c024: 2b 9d 00 04 lw ra,(sp+4)
800c028: 2b 8b 00 1c lw r11,(sp+28)
800c02c: 2b 8c 00 18 lw r12,(sp+24)
800c030: 2b 8d 00 14 lw r13,(sp+20)
800c034: 2b 8e 00 10 lw r14,(sp+16)
800c038: 2b 8f 00 0c lw r15,(sp+12)
800c03c: 2b 90 00 08 lw r16,(sp+8)
800c040: 37 9c 00 20 addi sp,sp,32
800c044: c3 a0 00 00 ret
08008aa8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>:
#include <rtems/posix/pthread.h>
void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(
Thread_Control *the_thread
)
{
8008aa8: 37 9c ff fc addi sp,sp,-4
8008aac: 5b 9d 00 04 sw (sp+4),ra
POSIX_API_Control *thread_support;
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
8008ab0: 28 22 01 1c lw r2,(r1+284)
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
8008ab4: 28 43 00 d8 lw r3,(r2+216)
8008ab8: 5c 60 00 0e bne r3,r0,8008af0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48><== NEVER TAKEN
8008abc: 28 44 00 dc lw r4,(r2+220)
8008ac0: 34 03 00 01 mvi r3,1
8008ac4: 5c 83 00 0b bne r4,r3,8008af0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48>
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
8008ac8: 28 42 00 e0 lw r2,(r2+224)
8008acc: 44 40 00 09 be r2,r0,8008af0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8008ad0: 78 02 08 01 mvhi r2,0x801
8008ad4: 38 42 68 e8 ori r2,r2,0x68e8
8008ad8: 28 43 00 00 lw r3,(r2+0)
--level;
8008adc: 34 63 ff ff addi r3,r3,-1
_Thread_Dispatch_disable_level = level;
8008ae0: 58 43 00 00 sw (r2+0),r3
thread_support->cancelation_requested ) {
_Thread_Unnest_dispatch();
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
8008ae4: 34 02 ff ff mvi r2,-1
8008ae8: f8 00 02 72 calli 80094b0 <_POSIX_Thread_Exit>
8008aec: e0 00 00 02 bi 8008af4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x4c>
} else
_Thread_Enable_dispatch();
8008af0: fb ff f5 42 calli 8005ff8 <_Thread_Enable_dispatch>
}
8008af4: 2b 9d 00 04 lw ra,(sp+4)
8008af8: 37 9c 00 04 addi sp,sp,4
8008afc: c3 a0 00 00 ret
0800a55c <_POSIX_Thread_Translate_sched_param>:
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
800a55c: 37 9c ff e8 addi sp,sp,-24
800a560: 5b 8b 00 18 sw (sp+24),r11
800a564: 5b 8c 00 14 sw (sp+20),r12
800a568: 5b 8d 00 10 sw (sp+16),r13
800a56c: 5b 8e 00 0c sw (sp+12),r14
800a570: 5b 8f 00 08 sw (sp+8),r15
800a574: 5b 9d 00 04 sw (sp+4),ra
800a578: b8 20 68 00 mv r13,r1
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a57c: 28 41 00 00 lw r1,(r2+0)
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
800a580: b8 40 58 00 mv r11,r2
800a584: b8 60 70 00 mv r14,r3
800a588: b8 80 78 00 mv r15,r4
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a58c: fb ff ff ec calli 800a53c <_POSIX_Priority_Is_valid>
return EINVAL;
800a590: 34 0c 00 16 mvi r12,22
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a594: 44 20 00 2a be r1,r0,800a63c <_POSIX_Thread_Translate_sched_param+0xe0><== NEVER TAKEN
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
800a598: 59 c0 00 00 sw (r14+0),r0
*budget_callout = NULL;
800a59c: 59 e0 00 00 sw (r15+0),r0
if ( policy == SCHED_OTHER ) {
800a5a0: 5d a0 00 04 bne r13,r0,800a5b0 <_POSIX_Thread_Translate_sched_param+0x54>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
800a5a4: 34 01 00 01 mvi r1,1
800a5a8: 59 c1 00 00 sw (r14+0),r1
800a5ac: e0 00 00 23 bi 800a638 <_POSIX_Thread_Translate_sched_param+0xdc>
return 0;
}
if ( policy == SCHED_FIFO ) {
800a5b0: 34 01 00 01 mvi r1,1
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
800a5b4: 34 0c 00 00 mvi r12,0
if ( policy == SCHED_OTHER ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
return 0;
}
if ( policy == SCHED_FIFO ) {
800a5b8: 45 a1 00 21 be r13,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
}
if ( policy == SCHED_RR ) {
800a5bc: 34 01 00 02 mvi r1,2
800a5c0: 5d a1 00 03 bne r13,r1,800a5cc <_POSIX_Thread_Translate_sched_param+0x70>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
800a5c4: 59 cd 00 00 sw (r14+0),r13
return 0;
800a5c8: e0 00 00 1d bi 800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
}
if ( policy == SCHED_SPORADIC ) {
800a5cc: 34 01 00 04 mvi r1,4
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
return 0;
}
return EINVAL;
800a5d0: 34 0c 00 16 mvi r12,22
if ( policy == SCHED_RR ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
return 0;
}
if ( policy == SCHED_SPORADIC ) {
800a5d4: 5d a1 00 1a bne r13,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
800a5d8: 29 61 00 08 lw r1,(r11+8)
800a5dc: 5c 20 00 03 bne r1,r0,800a5e8 <_POSIX_Thread_Translate_sched_param+0x8c>
800a5e0: 29 62 00 0c lw r2,(r11+12)
800a5e4: 44 41 00 16 be r2,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
(param->sched_ss_repl_period.tv_nsec == 0) )
return EINVAL;
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
800a5e8: 29 61 00 10 lw r1,(r11+16)
800a5ec: 5c 20 00 04 bne r1,r0,800a5fc <_POSIX_Thread_Translate_sched_param+0xa0>
800a5f0: 29 62 00 14 lw r2,(r11+20)
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
800a5f4: 34 0c 00 16 mvi r12,22
if ( policy == SCHED_SPORADIC ) {
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
(param->sched_ss_repl_period.tv_nsec == 0) )
return EINVAL;
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
800a5f8: 44 41 00 11 be r2,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
800a5fc: 35 61 00 08 addi r1,r11,8
800a600: fb ff f6 39 calli 8007ee4 <_Timespec_To_ticks>
800a604: b8 20 68 00 mv r13,r1
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
800a608: 35 61 00 10 addi r1,r11,16
800a60c: fb ff f6 36 calli 8007ee4 <_Timespec_To_ticks>
return EINVAL;
800a610: 34 0c 00 16 mvi r12,22
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
800a614: 54 2d 00 0a bgu r1,r13,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
return EINVAL;
if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) )
800a618: 29 61 00 04 lw r1,(r11+4)
800a61c: fb ff ff c8 calli 800a53c <_POSIX_Priority_Is_valid>
800a620: 44 20 00 07 be r1,r0,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
800a624: 34 01 00 03 mvi r1,3
800a628: 59 c1 00 00 sw (r14+0),r1
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
800a62c: 78 01 08 00 mvhi r1,0x800
800a630: 38 21 40 90 ori r1,r1,0x4090
800a634: 59 e1 00 00 sw (r15+0),r1
return 0;
800a638: 34 0c 00 00 mvi r12,0
}
return EINVAL;
}
800a63c: b9 80 08 00 mv r1,r12
800a640: 2b 9d 00 04 lw ra,(sp+4)
800a644: 2b 8b 00 18 lw r11,(sp+24)
800a648: 2b 8c 00 14 lw r12,(sp+20)
800a64c: 2b 8d 00 10 lw r13,(sp+16)
800a650: 2b 8e 00 0c lw r14,(sp+12)
800a654: 2b 8f 00 08 lw r15,(sp+8)
800a658: 37 9c 00 18 addi sp,sp,24
800a65c: c3 a0 00 00 ret
0800df24 <_POSIX_Threads_Delete_extension>:
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
800df24: 37 9c ff ec addi sp,sp,-20
800df28: 5b 8b 00 14 sw (sp+20),r11
800df2c: 5b 8c 00 10 sw (sp+16),r12
800df30: 5b 8d 00 0c sw (sp+12),r13
800df34: 5b 8e 00 08 sw (sp+8),r14
800df38: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
POSIX_API_Control *api;
void **value_ptr;
api = deleted->API_Extensions[ THREAD_API_POSIX ];
800df3c: 28 4b 01 1c lw r11,(r2+284)
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
800df40: b8 40 08 00 mv r1,r2
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
800df44: b8 40 60 00 mv r12,r2
api = deleted->API_Extensions[ THREAD_API_POSIX ];
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
800df48: f8 00 0c 8e calli 8011180 <_POSIX_Threads_cancel_run>
/*
* Run all the key destructors
*/
_POSIX_Keys_Run_destructors( deleted );
800df4c: b9 80 08 00 mv r1,r12
800df50: f8 00 0c af calli 801120c <_POSIX_Keys_Run_destructors>
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
800df54: 35 6d 00 44 addi r13,r11,68
_POSIX_Keys_Run_destructors( deleted );
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
800df58: 29 8e 00 28 lw r14,(r12+40)
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
800df5c: e0 00 00 03 bi 800df68 <_POSIX_Threads_Delete_extension+0x44>
*(void **)the_thread->Wait.return_argument = value_ptr;
800df60: 28 21 00 28 lw r1,(r1+40) <== NOT EXECUTED
800df64: 58 2e 00 00 sw (r1+0),r14 <== NOT EXECUTED
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
800df68: b9 a0 08 00 mv r1,r13
800df6c: fb ff e7 95 calli 8007dc0 <_Thread_queue_Dequeue>
800df70: 5c 20 ff fc bne r1,r0,800df60 <_POSIX_Threads_Delete_extension+0x3c><== NEVER TAKEN
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
800df74: 29 62 00 84 lw r2,(r11+132)
800df78: 34 01 00 04 mvi r1,4
800df7c: 5c 41 00 03 bne r2,r1,800df88 <_POSIX_Threads_Delete_extension+0x64>
(void) _Watchdog_Remove( &api->Sporadic_timer );
800df80: 35 61 00 a8 addi r1,r11,168
800df84: fb ff ea b3 calli 8008a50 <_Watchdog_Remove>
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
800df88: 59 80 01 1c sw (r12+284),r0
_Workspace_Free( api );
800df8c: b9 60 08 00 mv r1,r11
800df90: fb ff eb 3c calli 8008c80 <_Workspace_Free>
}
800df94: 2b 9d 00 04 lw ra,(sp+4)
800df98: 2b 8b 00 14 lw r11,(sp+20)
800df9c: 2b 8c 00 10 lw r12,(sp+16)
800dfa0: 2b 8d 00 0c lw r13,(sp+12)
800dfa4: 2b 8e 00 08 lw r14,(sp+8)
800dfa8: 37 9c 00 14 addi sp,sp,20
800dfac: c3 a0 00 00 ret
08003d14 <_POSIX_Threads_Initialize_user_threads_body>:
#include <rtems/posix/config.h>
#include <rtems/posix/key.h>
#include <rtems/posix/time.h>
void _POSIX_Threads_Initialize_user_threads_body(void)
{
8003d14: 37 9c ff a8 addi sp,sp,-88
8003d18: 5b 8b 00 14 sw (sp+20),r11
8003d1c: 5b 8c 00 10 sw (sp+16),r12
8003d20: 5b 8d 00 0c sw (sp+12),r13
8003d24: 5b 8e 00 08 sw (sp+8),r14
8003d28: 5b 9d 00 04 sw (sp+4),ra
uint32_t maximum;
posix_initialization_threads_table *user_threads;
pthread_t thread_id;
pthread_attr_t attr;
user_threads = Configuration_POSIX_API.User_initialization_threads_table;
8003d2c: 78 01 08 02 mvhi r1,0x802
8003d30: 38 21 00 c0 ori r1,r1,0xc0
maximum = Configuration_POSIX_API.number_of_initialization_threads;
8003d34: 28 2e 00 30 lw r14,(r1+48)
uint32_t maximum;
posix_initialization_threads_table *user_threads;
pthread_t thread_id;
pthread_attr_t attr;
user_threads = Configuration_POSIX_API.User_initialization_threads_table;
8003d38: 28 2c 00 34 lw r12,(r1+52)
maximum = Configuration_POSIX_API.number_of_initialization_threads;
if ( !user_threads || maximum == 0 )
8003d3c: 34 0d 00 00 mvi r13,0
8003d40: 65 c2 00 00 cmpei r2,r14,0
8003d44: 65 81 00 00 cmpei r1,r12,0
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
8003d48: 37 8b 00 18 addi r11,sp,24
pthread_attr_t attr;
user_threads = Configuration_POSIX_API.User_initialization_threads_table;
maximum = Configuration_POSIX_API.number_of_initialization_threads;
if ( !user_threads || maximum == 0 )
8003d4c: b8 41 08 00 or r1,r2,r1
8003d50: 44 20 00 16 be r1,r0,8003da8 <_POSIX_Threads_Initialize_user_threads_body+0x94><== ALWAYS TAKEN
8003d54: e0 00 00 16 bi 8003dac <_POSIX_Threads_Initialize_user_threads_body+0x98><== NOT EXECUTED
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
8003d58: b9 60 08 00 mv r1,r11
8003d5c: f8 00 1a 41 calli 800a660 <pthread_attr_init>
(void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
8003d60: 34 02 00 02 mvi r2,2
8003d64: b9 60 08 00 mv r1,r11
8003d68: f8 00 1a 4b calli 800a694 <pthread_attr_setinheritsched>
(void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
8003d6c: 29 82 00 04 lw r2,(r12+4)
8003d70: b9 60 08 00 mv r1,r11
8003d74: f8 00 1a 54 calli 800a6c4 <pthread_attr_setstacksize>
status = pthread_create(
8003d78: 29 83 00 00 lw r3,(r12+0)
8003d7c: 37 81 00 58 addi r1,sp,88
8003d80: b9 60 10 00 mv r2,r11
8003d84: 34 04 00 00 mvi r4,0
8003d88: fb ff fe cd calli 80038bc <pthread_create>
8003d8c: b8 20 18 00 mv r3,r1
8003d90: 35 8c 00 08 addi r12,r12,8
&thread_id,
&attr,
user_threads[ index ].thread_entry,
NULL
);
if ( status )
8003d94: 44 20 00 04 be r1,r0,8003da4 <_POSIX_Threads_Initialize_user_threads_body+0x90>
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
8003d98: 34 01 00 02 mvi r1,2
8003d9c: 34 02 00 01 mvi r2,1
8003da0: f8 00 07 3f calli 8005a9c <_Internal_error_Occurred>
*
* Setting the attributes explicitly is critical, since we don't want
* to inherit the idle tasks attributes.
*/
for ( index=0 ; index < maximum ; index++ ) {
8003da4: 35 ad 00 01 addi r13,r13,1
8003da8: 55 cd ff ec bgu r14,r13,8003d58 <_POSIX_Threads_Initialize_user_threads_body+0x44>
NULL
);
if ( status )
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
}
}
8003dac: 2b 9d 00 04 lw ra,(sp+4)
8003db0: 2b 8b 00 14 lw r11,(sp+20)
8003db4: 2b 8c 00 10 lw r12,(sp+16)
8003db8: 2b 8d 00 0c lw r13,(sp+12)
8003dbc: 2b 8e 00 08 lw r14,(sp+8)
8003dc0: 37 9c 00 58 addi sp,sp,88
8003dc4: c3 a0 00 00 ret
0800e0fc <_POSIX_Threads_Sporadic_budget_TSR>:
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
800e0fc: 37 9c ff f4 addi sp,sp,-12
800e100: 5b 8b 00 0c sw (sp+12),r11
800e104: 5b 8c 00 08 sw (sp+8),r12
800e108: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
POSIX_API_Control *api;
the_thread = argument;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
800e10c: 28 4c 01 1c lw r12,(r2+284)
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
800e110: b8 40 58 00 mv r11,r2
the_thread = argument;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
800e114: 35 81 00 98 addi r1,r12,152
800e118: f8 00 07 b0 calli 800ffd8 <_Timespec_To_ticks>
the_thread->cpu_time_budget = ticks;
800e11c: 59 61 00 74 sw (r11+116),r1
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
800e120: 78 01 08 01 mvhi r1,0x801
800e124: 38 21 a0 c0 ori r1,r1,0xa0c0
800e128: 40 21 00 00 lbu r1,(r1+0)
800e12c: 29 82 00 88 lw r2,(r12+136)
800e130: c8 22 10 00 sub r2,r1,r2
*/
#if 0
printk( "TSR %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
800e134: 29 61 00 1c lw r1,(r11+28)
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
the_thread->cpu_time_budget = ticks;
new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority );
the_thread->real_priority = new_priority;
800e138: 59 62 00 18 sw (r11+24),r2
*/
#if 0
printk( "TSR %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
800e13c: 5c 20 00 06 bne r1,r0,800e154 <_POSIX_Threads_Sporadic_budget_TSR+0x58><== NEVER TAKEN
/*
* If this would make them less important, then do not change it.
*/
if ( the_thread->current_priority > new_priority ) {
800e140: 29 61 00 14 lw r1,(r11+20)
800e144: 50 41 00 04 bgeu r2,r1,800e154 <_POSIX_Threads_Sporadic_budget_TSR+0x58>
_Thread_Change_priority( the_thread, new_priority, true );
800e148: b9 60 08 00 mv r1,r11
800e14c: 34 03 00 01 mvi r3,1
800e150: fb ff e5 98 calli 80077b0 <_Thread_Change_priority>
#endif
}
}
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period );
800e154: 35 81 00 90 addi r1,r12,144
800e158: f8 00 07 a0 calli 800ffd8 <_Timespec_To_ticks>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
800e15c: 59 81 00 b4 sw (r12+180),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800e160: 78 01 08 01 mvhi r1,0x801
800e164: 38 21 aa 10 ori r1,r1,0xaa10
800e168: 35 82 00 a8 addi r2,r12,168
800e16c: fb ff e9 dc calli 80088dc <_Watchdog_Insert>
_Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
}
800e170: 2b 9d 00 04 lw ra,(sp+4)
800e174: 2b 8b 00 0c lw r11,(sp+12)
800e178: 2b 8c 00 08 lw r12,(sp+8)
800e17c: 37 9c 00 0c addi sp,sp,12
800e180: c3 a0 00 00 ret
0800e184 <_POSIX_Threads_Sporadic_budget_callout>:
* _POSIX_Threads_Sporadic_budget_callout
*/
void _POSIX_Threads_Sporadic_budget_callout(
Thread_Control *the_thread
)
{
800e184: 37 9c ff fc addi sp,sp,-4
800e188: 5b 9d 00 04 sw (sp+4),ra
/*
* This will prevent the thread from consuming its entire "budget"
* while at low priority.
*/
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
800e18c: 34 02 ff ff mvi r2,-1
)
{
POSIX_API_Control *api;
uint32_t new_priority;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
800e190: 28 25 01 1c lw r5,(r1+284)
/*
* This will prevent the thread from consuming its entire "budget"
* while at low priority.
*/
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
800e194: 58 22 00 74 sw (r1+116),r2
800e198: 78 02 08 01 mvhi r2,0x801
800e19c: 38 42 a0 c0 ori r2,r2,0xa0c0
800e1a0: 40 44 00 00 lbu r4,(r2+0)
800e1a4: 28 a2 00 8c lw r2,(r5+140)
800e1a8: c8 82 10 00 sub r2,r4,r2
*/
#if 0
printk( "callout %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
800e1ac: 28 24 00 1c lw r4,(r1+28)
* while at low priority.
*/
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority);
the_thread->real_priority = new_priority;
800e1b0: 58 22 00 18 sw (r1+24),r2
*/
#if 0
printk( "callout %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
800e1b4: 5c 80 00 05 bne r4,r0,800e1c8 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN
/*
* Make sure we are actually lowering it. If they have lowered it
* to logically lower than sched_ss_low_priority, then we do not want to
* change it.
*/
if ( the_thread->current_priority < new_priority ) {
800e1b8: 28 23 00 14 lw r3,(r1+20)
800e1bc: 50 62 00 03 bgeu r3,r2,800e1c8 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN
_Thread_Change_priority( the_thread, new_priority, true );
800e1c0: 34 03 00 01 mvi r3,1
800e1c4: fb ff e5 7b calli 80077b0 <_Thread_Change_priority>
#if 0
printk( "lower priority\n" );
#endif
}
}
}
800e1c8: 2b 9d 00 04 lw ra,(sp+4)
800e1cc: 37 9c 00 04 addi sp,sp,4
800e1d0: c3 a0 00 00 ret
08003a24 <_POSIX_Timer_TSR>:
* This is the operation that is run when a timer expires
*/
void _POSIX_Timer_TSR(
Objects_Id timer __attribute__((unused)),
void *data)
{
8003a24: 37 9c ff e8 addi sp,sp,-24
8003a28: 5b 8b 00 10 sw (sp+16),r11
8003a2c: 5b 8c 00 0c sw (sp+12),r12
8003a30: 5b 8d 00 08 sw (sp+8),r13
8003a34: 5b 9d 00 04 sw (sp+4),ra
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
8003a38: 28 41 00 68 lw r1,(r2+104)
* This is the operation that is run when a timer expires
*/
void _POSIX_Timer_TSR(
Objects_Id timer __attribute__((unused)),
void *data)
{
8003a3c: b8 40 58 00 mv r11,r2
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
8003a40: 34 21 00 01 addi r1,r1,1
8003a44: 58 41 00 68 sw (r2+104),r1
/* The timer must be reprogrammed */
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
8003a48: 28 41 00 54 lw r1,(r2+84)
8003a4c: 5c 20 00 03 bne r1,r0,8003a58 <_POSIX_Timer_TSR+0x34>
8003a50: 28 42 00 58 lw r2,(r2+88)
8003a54: 44 41 00 21 be r2,r1,8003ad8 <_POSIX_Timer_TSR+0xb4> <== NEVER TAKEN
( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) {
activated = _POSIX_Timer_Insert_helper(
8003a58: 29 62 00 64 lw r2,(r11+100)
8003a5c: 29 63 00 08 lw r3,(r11+8)
8003a60: 78 04 08 00 mvhi r4,0x800
8003a64: 35 61 00 10 addi r1,r11,16
8003a68: 38 84 3a 24 ori r4,r4,0x3a24
8003a6c: b9 60 28 00 mv r5,r11
8003a70: f8 00 19 91 calli 800a0b4 <_POSIX_Timer_Insert_helper>
ptimer->ticks,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated )
8003a74: 44 20 00 1f be r1,r0,8003af0 <_POSIX_Timer_TSR+0xcc> <== NEVER TAKEN
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
8003a78: 78 02 08 02 mvhi r2,0x802
8003a7c: 38 42 08 c8 ori r2,r2,0x8c8
8003a80: 37 81 00 14 addi r1,sp,20
8003a84: f8 00 04 c0 calli 8004d84 <_TOD_Get_with_nanoseconds>
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
8003a88: 78 05 08 01 mvhi r5,0x801
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
}
8003a8c: 28 2c 00 04 lw r12,(r1+4)
8003a90: 28 2d 00 00 lw r13,(r1+0)
8003a94: 38 a5 dd 38 ori r5,r5,0xdd38
8003a98: 28 a4 00 00 lw r4,(r5+0)
8003a9c: 34 03 00 00 mvi r3,0
8003aa0: b9 a0 08 00 mv r1,r13
8003aa4: b9 80 10 00 mv r2,r12
8003aa8: f8 00 4d 3b calli 8016f94 <__divdi3>
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
8003aac: 78 05 08 01 mvhi r5,0x801
8003ab0: 38 a5 dd 38 ori r5,r5,0xdd38
8003ab4: 28 a4 00 00 lw r4,(r5+0)
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
8003ab8: 59 62 00 6c sw (r11+108),r2
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
8003abc: b9 a0 08 00 mv r1,r13
8003ac0: b9 80 10 00 mv r2,r12
8003ac4: 34 03 00 00 mvi r3,0
8003ac8: f8 00 4f 35 calli 801779c <__moddi3>
8003acc: 59 62 00 70 sw (r11+112),r2
/* Store the time when the timer was started again */
_TOD_Get( &ptimer->time );
/* The state really did not change but just to be safe */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
8003ad0: 34 01 00 03 mvi r1,3
8003ad4: e0 00 00 02 bi 8003adc <_POSIX_Timer_TSR+0xb8>
} else {
/* Indicates that the timer is stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
8003ad8: 34 01 00 04 mvi r1,4 <== NOT EXECUTED
8003adc: 31 61 00 3c sb (r11+60),r1
/*
* The sending of the signal to the process running the handling function
* specified for that signal is simulated
*/
if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) {
8003ae0: 29 62 00 44 lw r2,(r11+68)
8003ae4: 29 61 00 38 lw r1,(r11+56)
8003ae8: f8 00 18 26 calli 8009b80 <pthread_kill>
}
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
8003aec: 59 60 00 68 sw (r11+104),r0
}
8003af0: 2b 9d 00 04 lw ra,(sp+4)
8003af4: 2b 8b 00 10 lw r11,(sp+16)
8003af8: 2b 8c 00 0c lw r12,(sp+12)
8003afc: 2b 8d 00 08 lw r13,(sp+8)
8003b00: 37 9c 00 18 addi sp,sp,24
8003b04: c3 a0 00 00 ret
08011304 <_POSIX_signals_Check_signal>:
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8011304: 37 9c ff b0 addi sp,sp,-80
8011308: 5b 8b 00 1c sw (sp+28),r11
801130c: 5b 8c 00 18 sw (sp+24),r12
8011310: 5b 8d 00 14 sw (sp+20),r13
8011314: 5b 8e 00 10 sw (sp+16),r14
8011318: 5b 8f 00 0c sw (sp+12),r15
801131c: 5b 90 00 08 sw (sp+8),r16
8011320: 5b 9d 00 04 sw (sp+4),ra
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8011324: 37 90 00 48 addi r16,sp,72
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8011328: 20 64 00 ff andi r4,r3,0xff
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
801132c: 34 05 00 01 mvi r5,1
8011330: ba 00 18 00 mv r3,r16
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8011334: b8 20 68 00 mv r13,r1
8011338: b8 40 58 00 mv r11,r2
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
801133c: f8 00 00 37 calli 8011418 <_POSIX_signals_Clear_signals>
is_global, true ) )
return false;
8011340: 34 0f 00 00 mvi r15,0
{
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8011344: 44 20 00 2b be r1,r0,80113f0 <_POSIX_signals_Check_signal+0xec>
#endif
/*
* Just to prevent sending a signal which is currently being ignored.
*/
if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN )
8011348: 34 02 00 01 mvi r2,1
801134c: b9 60 08 00 mv r1,r11
8011350: f8 00 19 7c calli 8017940 <__ashlsi3>
8011354: 78 0c 08 01 mvhi r12,0x801
8011358: b4 2b 08 00 add r1,r1,r11
801135c: 34 02 00 02 mvi r2,2
8011360: f8 00 19 78 calli 8017940 <__ashlsi3>
8011364: 39 8c ae 88 ori r12,r12,0xae88
8011368: b5 81 60 00 add r12,r12,r1
801136c: 29 8e 00 08 lw r14,(r12+8)
8011370: 34 01 00 01 mvi r1,1
8011374: 45 c1 00 1f be r14,r1,80113f0 <_POSIX_signals_Check_signal+0xec><== NEVER TAKEN
return false;
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
8011378: 29 af 00 d0 lw r15,(r13+208)
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
801137c: 29 81 00 04 lw r1,(r12+4)
/*
* We have to save the blocking information of the current wait queue
* because the signal handler may subsequently go on and put the thread
* on a wait queue, for its own purposes.
*/
memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait,
8011380: 34 03 00 28 mvi r3,40
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
8011384: b8 2f 08 00 or r1,r1,r15
8011388: 59 a1 00 d0 sw (r13+208),r1
/*
* We have to save the blocking information of the current wait queue
* because the signal handler may subsequently go on and put the thread
* on a wait queue, for its own purposes.
*/
memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait,
801138c: 78 01 08 01 mvhi r1,0x801
8011390: 38 21 ae 00 ori r1,r1,0xae00
8011394: 28 22 00 10 lw r2,(r1+16)
8011398: 37 81 00 20 addi r1,sp,32
801139c: 34 42 00 20 addi r2,r2,32
80113a0: f8 00 05 23 calli 801282c <memcpy>
sizeof( Thread_Wait_information ));
/*
* Here, the signal handler function executes
*/
switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
80113a4: 29 82 00 00 lw r2,(r12+0)
80113a8: 34 01 00 02 mvi r1,2
80113ac: 5c 41 00 06 bne r2,r1,80113c4 <_POSIX_signals_Check_signal+0xc0>
case SA_SIGINFO:
(*_POSIX_signals_Vectors[ signo ].sa_sigaction)(
80113b0: b9 60 08 00 mv r1,r11
80113b4: ba 00 10 00 mv r2,r16
80113b8: 34 03 00 00 mvi r3,0
80113bc: d9 c0 00 00 call r14
signo,
&siginfo_struct,
NULL /* context is undefined per 1003.1b-1993, p. 66 */
);
break;
80113c0: e0 00 00 03 bi 80113cc <_POSIX_signals_Check_signal+0xc8>
default:
(*_POSIX_signals_Vectors[ signo ].sa_handler)( signo );
80113c4: b9 60 08 00 mv r1,r11
80113c8: d9 c0 00 00 call r14
}
/*
* Restore the blocking information
*/
memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information,
80113cc: 78 01 08 01 mvhi r1,0x801
80113d0: 38 21 ae 00 ori r1,r1,0xae00
80113d4: 28 21 00 10 lw r1,(r1+16)
80113d8: 37 82 00 20 addi r2,sp,32
80113dc: 34 03 00 28 mvi r3,40
80113e0: 34 21 00 20 addi r1,r1,32
80113e4: f8 00 05 12 calli 801282c <memcpy>
sizeof( Thread_Wait_information ));
/*
* Restore the previous set of blocked signals
*/
api->signals_blocked = saved_signals_blocked;
80113e8: 59 af 00 d0 sw (r13+208),r15
return true;
80113ec: 34 0f 00 01 mvi r15,1
}
80113f0: b9 e0 08 00 mv r1,r15
80113f4: 2b 9d 00 04 lw ra,(sp+4)
80113f8: 2b 8b 00 1c lw r11,(sp+28)
80113fc: 2b 8c 00 18 lw r12,(sp+24)
8011400: 2b 8d 00 14 lw r13,(sp+20)
8011404: 2b 8e 00 10 lw r14,(sp+16)
8011408: 2b 8f 00 0c lw r15,(sp+12)
801140c: 2b 90 00 08 lw r16,(sp+8)
8011410: 37 9c 00 50 addi sp,sp,80
8011414: c3 a0 00 00 ret
08011b64 <_POSIX_signals_Clear_process_signals>:
*/
void _POSIX_signals_Clear_process_signals(
int signo
)
{
8011b64: 37 9c ff ec addi sp,sp,-20
8011b68: 5b 8b 00 14 sw (sp+20),r11
8011b6c: 5b 8c 00 10 sw (sp+16),r12
8011b70: 5b 8d 00 0c sw (sp+12),r13
8011b74: 5b 8e 00 08 sw (sp+8),r14
8011b78: 5b 9d 00 04 sw (sp+4),ra
8011b7c: b8 20 60 00 mv r12,r1
clear_signal = true;
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
8011b80: 90 00 68 00 rcsr r13,IE
8011b84: 34 01 ff fe mvi r1,-2
8011b88: a1 a1 08 00 and r1,r13,r1
8011b8c: d0 01 00 00 wcsr IE,r1
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
8011b90: 34 02 00 01 mvi r2,1
8011b94: b9 80 08 00 mv r1,r12
8011b98: f8 00 17 6a calli 8017940 <__ashlsi3>
8011b9c: b4 2c 70 00 add r14,r1,r12
8011ba0: 34 02 00 02 mvi r2,2
8011ba4: 78 0b 08 01 mvhi r11,0x801
8011ba8: b9 c0 08 00 mv r1,r14
8011bac: f8 00 17 65 calli 8017940 <__ashlsi3>
8011bb0: 39 6b ae 88 ori r11,r11,0xae88
8011bb4: b5 61 08 00 add r1,r11,r1
8011bb8: 28 22 00 00 lw r2,(r1+0)
8011bbc: 34 01 00 02 mvi r1,2
8011bc0: 5c 41 00 0a bne r2,r1,8011be8 <_POSIX_signals_Clear_process_signals+0x84>
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
}
_ISR_Enable( level );
}
8011bc4: 34 02 00 02 mvi r2,2
8011bc8: 78 0b 08 01 mvhi r11,0x801
8011bcc: b9 c0 08 00 mv r1,r14
8011bd0: f8 00 17 5c calli 8017940 <__ashlsi3>
8011bd4: 39 6b b0 80 ori r11,r11,0xb080
8011bd8: b5 61 08 00 add r1,r11,r1
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8011bdc: 34 22 00 04 addi r2,r1,4
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
8011be0: 28 21 00 00 lw r1,(r1+0)
8011be4: 5c 22 00 0a bne r1,r2,8011c0c <_POSIX_signals_Clear_process_signals+0xa8><== NEVER TAKEN
8011be8: 35 82 ff ff addi r2,r12,-1
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
8011bec: 78 0b 08 01 mvhi r11,0x801
8011bf0: 34 01 00 01 mvi r1,1
8011bf4: f8 00 17 53 calli 8017940 <__ashlsi3>
8011bf8: 39 6b b0 7c ori r11,r11,0xb07c
8011bfc: 29 62 00 00 lw r2,(r11+0)
8011c00: a4 20 08 00 not r1,r1
8011c04: a0 22 08 00 and r1,r1,r2
8011c08: 59 61 00 00 sw (r11+0),r1
}
_ISR_Enable( level );
8011c0c: d0 0d 00 00 wcsr IE,r13
}
8011c10: 2b 9d 00 04 lw ra,(sp+4)
8011c14: 2b 8b 00 14 lw r11,(sp+20)
8011c18: 2b 8c 00 10 lw r12,(sp+16)
8011c1c: 2b 8d 00 0c lw r13,(sp+12)
8011c20: 2b 8e 00 08 lw r14,(sp+8)
8011c24: 37 9c 00 14 addi sp,sp,20
8011c28: c3 a0 00 00 ret
0800473c <_POSIX_signals_Get_lowest>:
#include <rtems/score/isr.h>
static int _POSIX_signals_Get_lowest(
sigset_t set
)
{
800473c: 37 9c ff f0 addi sp,sp,-16
8004740: 5b 8b 00 10 sw (sp+16),r11
8004744: 5b 8c 00 0c sw (sp+12),r12
8004748: 5b 8d 00 08 sw (sp+8),r13
800474c: 5b 9d 00 04 sw (sp+4),ra
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8004750: 34 0b 00 1b mvi r11,27
#include <rtems/score/isr.h>
static int _POSIX_signals_Get_lowest(
sigset_t set
)
{
8004754: b8 20 60 00 mv r12,r1
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8004758: 34 0d 00 20 mvi r13,32
800475c: 34 01 00 01 mvi r1,1
8004760: 35 62 ff ff addi r2,r11,-1
8004764: f8 00 46 45 calli 8016078 <__ashlsi3>
if ( set & signo_to_mask( signo ) ) {
8004768: a0 2c 08 00 and r1,r1,r12
800476c: 5c 20 00 0c bne r1,r0,800479c <_POSIX_signals_Get_lowest+0x60><== NEVER TAKEN
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8004770: 35 6b 00 01 addi r11,r11,1
8004774: 5d 6d ff fa bne r11,r13,800475c <_POSIX_signals_Get_lowest+0x20>
8004778: 34 0b 00 01 mvi r11,1
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
800477c: 34 0d 00 1b mvi r13,27
8004780: 34 01 00 01 mvi r1,1
8004784: 35 62 ff ff addi r2,r11,-1
8004788: f8 00 46 3c calli 8016078 <__ashlsi3>
if ( set & signo_to_mask( signo ) ) {
800478c: a0 2c 08 00 and r1,r1,r12
8004790: 5c 20 00 03 bne r1,r0,800479c <_POSIX_signals_Get_lowest+0x60>
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
8004794: 35 6b 00 01 addi r11,r11,1
8004798: 5d 6d ff fa bne r11,r13,8004780 <_POSIX_signals_Get_lowest+0x44><== ALWAYS TAKEN
* a return 0. This routine will NOT be called unless a signal
* is pending in the set passed in.
*/
found_it:
return signo;
}
800479c: b9 60 08 00 mv r1,r11
80047a0: 2b 9d 00 04 lw ra,(sp+4)
80047a4: 2b 8b 00 10 lw r11,(sp+16)
80047a8: 2b 8c 00 0c lw r12,(sp+12)
80047ac: 2b 8d 00 08 lw r13,(sp+8)
80047b0: 37 9c 00 10 addi sp,sp,16
80047b4: c3 a0 00 00 ret
0800dae0 <_POSIX_signals_Post_switch_hook>:
*/
static void _POSIX_signals_Post_switch_hook(
Thread_Control *the_thread
)
{
800dae0: 37 9c ff e0 addi sp,sp,-32
800dae4: 5b 8b 00 20 sw (sp+32),r11
800dae8: 5b 8c 00 1c sw (sp+28),r12
800daec: 5b 8d 00 18 sw (sp+24),r13
800daf0: 5b 8e 00 14 sw (sp+20),r14
800daf4: 5b 8f 00 10 sw (sp+16),r15
800daf8: 5b 90 00 0c sw (sp+12),r16
800dafc: 5b 91 00 08 sw (sp+8),r17
800db00: 5b 9d 00 04 sw (sp+4),ra
POSIX_API_Control *api;
int signo;
ISR_Level level;
int hold_errno;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
800db04: 28 2b 01 1c lw r11,(r1+284)
/*
* We need to ensure that if the signal handler executes a call
* which overwrites the unblocking status, we restore it.
*/
hold_errno = _Thread_Executing->Wait.return_code;
800db08: 78 01 08 01 mvhi r1,0x801
800db0c: 38 21 ae 00 ori r1,r1,0xae00
800db10: 28 21 00 10 lw r1,(r1+16)
800db14: 28 2e 00 34 lw r14,(r1+52)
/*
* api may be NULL in case of a thread close in progress
*/
if ( !api )
800db18: 45 60 00 2e be r11,r0,800dbd0 <_POSIX_signals_Post_switch_hook+0xf0><== NEVER TAKEN
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
800db1c: 78 0d 08 01 mvhi r13,0x801
*
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
800db20: 34 11 ff fe mvi r17,-2
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
800db24: 39 ad b0 7c ori r13,r13,0xb07c
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
800db28: 34 10 00 1b mvi r16,27
800db2c: 34 0f 00 20 mvi r15,32
*
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
800db30: 90 00 08 00 rcsr r1,IE
800db34: a0 31 10 00 and r2,r1,r17
800db38: d0 02 00 00 wcsr IE,r2
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
800db3c: 29 a3 00 00 lw r3,(r13+0)
800db40: 29 62 00 d4 lw r2,(r11+212)
800db44: b8 62 10 00 or r2,r3,r2
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
if ( !(~api->signals_blocked &
800db48: 29 63 00 d0 lw r3,(r11+208)
800db4c: a4 60 18 00 not r3,r3
800db50: a0 43 10 00 and r2,r2,r3
800db54: 5c 40 00 07 bne r2,r0,800db70 <_POSIX_signals_Post_switch_hook+0x90>
(api->signals_pending | _POSIX_signals_Pending)) ) {
_ISR_Enable( level );
800db58: d0 01 00 00 wcsr IE,r1
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
}
}
_Thread_Executing->Wait.return_code = hold_errno;
800db5c: 78 01 08 01 mvhi r1,0x801
800db60: 38 21 ae 00 ori r1,r1,0xae00
800db64: 28 21 00 10 lw r1,(r1+16)
800db68: 58 2e 00 34 sw (r1+52),r14
800db6c: e0 00 00 19 bi 800dbd0 <_POSIX_signals_Post_switch_hook+0xf0>
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
800db70: d0 01 00 00 wcsr IE,r1
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
800db74: 34 0c 00 1b mvi r12,27
_POSIX_signals_Check_signal( api, signo, false );
800db78: b9 80 10 00 mv r2,r12
800db7c: 34 03 00 00 mvi r3,0
800db80: b9 60 08 00 mv r1,r11
800db84: f8 00 0d e0 calli 8011304 <_POSIX_signals_Check_signal>
_POSIX_signals_Check_signal( api, signo, true );
800db88: b9 80 10 00 mv r2,r12
800db8c: b9 60 08 00 mv r1,r11
800db90: 34 03 00 01 mvi r3,1
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
800db94: 35 8c 00 01 addi r12,r12,1
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
800db98: f8 00 0d db calli 8011304 <_POSIX_signals_Check_signal>
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
800db9c: 5d 8f ff f7 bne r12,r15,800db78 <_POSIX_signals_Post_switch_hook+0x98>
800dba0: 34 0c 00 01 mvi r12,1
_POSIX_signals_Check_signal( api, signo, true );
}
/* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
_POSIX_signals_Check_signal( api, signo, false );
800dba4: b9 80 10 00 mv r2,r12
800dba8: 34 03 00 00 mvi r3,0
800dbac: b9 60 08 00 mv r1,r11
800dbb0: f8 00 0d d5 calli 8011304 <_POSIX_signals_Check_signal>
_POSIX_signals_Check_signal( api, signo, true );
800dbb4: b9 80 10 00 mv r2,r12
800dbb8: b9 60 08 00 mv r1,r11
800dbbc: 34 03 00 01 mvi r3,1
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
}
/* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
800dbc0: 35 8c 00 01 addi r12,r12,1
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
800dbc4: f8 00 0d d0 calli 8011304 <_POSIX_signals_Check_signal>
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
}
/* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
800dbc8: 5d 90 ff f7 bne r12,r16,800dba4 <_POSIX_signals_Post_switch_hook+0xc4>
800dbcc: e3 ff ff d9 bi 800db30 <_POSIX_signals_Post_switch_hook+0x50>
_POSIX_signals_Check_signal( api, signo, true );
}
}
_Thread_Executing->Wait.return_code = hold_errno;
}
800dbd0: 2b 9d 00 04 lw ra,(sp+4)
800dbd4: 2b 8b 00 20 lw r11,(sp+32)
800dbd8: 2b 8c 00 1c lw r12,(sp+28)
800dbdc: 2b 8d 00 18 lw r13,(sp+24)
800dbe0: 2b 8e 00 14 lw r14,(sp+20)
800dbe4: 2b 8f 00 10 lw r15,(sp+16)
800dbe8: 2b 90 00 0c lw r16,(sp+12)
800dbec: 2b 91 00 08 lw r17,(sp+8)
800dbf0: 37 9c 00 20 addi sp,sp,32
800dbf4: c3 a0 00 00 ret
0802615c <_POSIX_signals_Unblock_thread>:
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
802615c: 37 9c ff ec addi sp,sp,-20
8026160: 5b 8b 00 14 sw (sp+20),r11
8026164: 5b 8c 00 10 sw (sp+16),r12
8026168: 5b 8d 00 0c sw (sp+12),r13
802616c: 5b 8e 00 08 sw (sp+8),r14
8026170: 5b 9d 00 04 sw (sp+4),ra
8026174: b8 20 58 00 mv r11,r1
8026178: b8 40 70 00 mv r14,r2
POSIX_API_Control *api;
sigset_t mask;
siginfo_t *the_info = NULL;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
802617c: 28 2c 01 1c lw r12,(r1+284)
8026180: 34 42 ff ff addi r2,r2,-1
8026184: 34 01 00 01 mvi r1,1
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
8026188: b8 60 68 00 mv r13,r3
802618c: fb ff 6f 28 calli 8001e2c <__ashlsi3>
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
8026190: 78 03 08 02 mvhi r3,0x802
8026194: 38 63 7a 20 ori r3,r3,0x7a20
8026198: 29 64 00 10 lw r4,(r11+16)
802619c: 28 62 00 00 lw r2,(r3+0)
80261a0: a0 82 18 00 and r3,r4,r2
80261a4: 5c 62 00 1c bne r3,r2,8026214 <_POSIX_signals_Unblock_thread+0xb8>
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
80261a8: 29 62 00 30 lw r2,(r11+48)
80261ac: a0 22 10 00 and r2,r1,r2
80261b0: 5c 40 00 06 bne r2,r0,80261c8 <_POSIX_signals_Unblock_thread+0x6c>
80261b4: 29 82 00 d0 lw r2,(r12+208)
/*
* This should only be reached via pthread_kill().
*/
return false;
80261b8: 34 0c 00 00 mvi r12,0
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
80261bc: a4 40 10 00 not r2,r2
80261c0: a0 22 08 00 and r1,r1,r2
80261c4: 44 2c 00 39 be r1,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c>
the_thread->Wait.return_code = EINTR;
80261c8: 34 01 00 04 mvi r1,4
80261cc: 59 61 00 34 sw (r11+52),r1
the_info = (siginfo_t *) the_thread->Wait.return_argument;
80261d0: 29 61 00 28 lw r1,(r11+40)
if ( !info ) {
80261d4: 5d a0 00 06 bne r13,r0,80261ec <_POSIX_signals_Unblock_thread+0x90>
the_info->si_signo = signo;
the_info->si_code = SI_USER;
80261d8: 34 02 00 01 mvi r2,1
the_thread->Wait.return_code = EINTR;
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
80261dc: 58 2e 00 00 sw (r1+0),r14
the_info->si_code = SI_USER;
80261e0: 58 22 00 04 sw (r1+4),r2
the_info->si_value.sival_int = 0;
80261e4: 58 20 00 08 sw (r1+8),r0
80261e8: e0 00 00 07 bi 8026204 <_POSIX_signals_Unblock_thread+0xa8>
} else {
*the_info = *info;
80261ec: 29 a3 00 00 lw r3,(r13+0)
80261f0: 29 a2 00 04 lw r2,(r13+4)
80261f4: 29 a4 00 08 lw r4,(r13+8)
80261f8: 58 23 00 00 sw (r1+0),r3
80261fc: 58 22 00 04 sw (r1+4),r2
8026200: 58 24 00 08 sw (r1+8),r4
}
_Thread_queue_Extract_with_proxy( the_thread );
8026204: b9 60 08 00 mv r1,r11
8026208: fb ff 9c 93 calli 800d454 <_Thread_queue_Extract_with_proxy>
return true;
802620c: 34 0c 00 01 mvi r12,1
8026210: e0 00 00 26 bi 80262a8 <_POSIX_signals_Unblock_thread+0x14c>
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
8026214: 29 82 00 d0 lw r2,(r12+208)
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
8026218: 34 0c 00 00 mvi r12,0
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
802621c: a4 40 10 00 not r2,r2
8026220: a0 22 08 00 and r1,r1,r2
8026224: 44 20 00 21 be r1,r0,80262a8 <_POSIX_signals_Unblock_thread+0x14c>
8026228: 78 01 10 00 mvhi r1,0x1000
802622c: a0 81 08 00 and r1,r4,r1
* it is not blocked, THEN
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
8026230: 44 20 00 15 be r1,r0,8026284 <_POSIX_signals_Unblock_thread+0x128>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
8026234: 78 02 08 02 mvhi r2,0x802
the_thread->Wait.return_code = EINTR;
8026238: 34 01 00 04 mvi r1,4
802623c: 38 42 77 dc ori r2,r2,0x77dc
8026240: 59 61 00 34 sw (r11+52),r1
8026244: 28 41 00 00 lw r1,(r2+0)
8026248: a0 81 08 00 and r1,r4,r1
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
802624c: 44 20 00 04 be r1,r0,802625c <_POSIX_signals_Unblock_thread+0x100>
_Thread_queue_Extract_with_proxy( the_thread );
8026250: b9 60 08 00 mv r1,r11
8026254: fb ff 9c 80 calli 800d454 <_Thread_queue_Extract_with_proxy>
8026258: e0 00 00 14 bi 80262a8 <_POSIX_signals_Unblock_thread+0x14c>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_delaying (
States_Control the_states
)
{
return (the_states & STATES_DELAYING);
802625c: 20 84 00 08 andi r4,r4,0x8
else if ( _States_Is_delaying(the_thread->current_state) ) {
8026260: 44 8c 00 12 be r4,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN
(void) _Watchdog_Remove( &the_thread->Timer );
8026264: 35 61 00 48 addi r1,r11,72
8026268: fb ff 9e 76 calli 800dc40 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
802626c: 78 03 08 02 mvhi r3,0x802
8026270: 38 63 76 50 ori r3,r3,0x7650
8026274: 28 62 00 00 lw r2,(r3+0)
8026278: b9 60 08 00 mv r1,r11
802627c: fb ff 99 23 calli 800c708 <_Thread_Clear_state>
8026280: e0 00 00 0a bi 80262a8 <_POSIX_signals_Unblock_thread+0x14c>
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
8026284: 5c 8c 00 09 bne r4,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
8026288: 78 01 08 02 mvhi r1,0x802
802628c: 38 21 9f 00 ori r1,r1,0x9f00
8026290: 28 22 00 08 lw r2,(r1+8)
8026294: 44 4c 00 05 be r2,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c>
8026298: 28 22 00 10 lw r2,(r1+16)
802629c: 5d 62 00 03 bne r11,r2,80262a8 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN
_Thread_Dispatch_necessary = true;
80262a0: 34 02 00 01 mvi r2,1
80262a4: 30 22 00 0c sb (r1+12),r2
}
}
return false;
}
80262a8: b9 80 08 00 mv r1,r12
80262ac: 2b 9d 00 04 lw ra,(sp+4)
80262b0: 2b 8b 00 14 lw r11,(sp+20)
80262b4: 2b 8c 00 10 lw r12,(sp+16)
80262b8: 2b 8d 00 0c lw r13,(sp+12)
80262bc: 2b 8e 00 08 lw r14,(sp+8)
80262c0: 37 9c 00 14 addi sp,sp,20
80262c4: c3 a0 00 00 ret
0800636c <_RBTree_Extract_unprotected>:
*/
void _RBTree_Extract_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
800636c: 37 9c ff e4 addi sp,sp,-28
8006370: 5b 8b 00 1c sw (sp+28),r11
8006374: 5b 8c 00 18 sw (sp+24),r12
8006378: 5b 8d 00 14 sw (sp+20),r13
800637c: 5b 8e 00 10 sw (sp+16),r14
8006380: 5b 8f 00 0c sw (sp+12),r15
8006384: 5b 90 00 08 sw (sp+8),r16
8006388: 5b 9d 00 04 sw (sp+4),ra
800638c: b8 20 70 00 mv r14,r1
8006390: b8 40 58 00 mv r11,r2
RBTree_Node *leaf, *target;
RBTree_Color victim_color;
RBTree_Direction dir;
if (!the_node) return;
8006394: 44 40 00 53 be r2,r0,80064e0 <_RBTree_Extract_unprotected+0x174>
/* check if min needs to be updated */
if (the_node == the_rbtree->first[RBT_LEFT]) {
8006398: 28 21 00 08 lw r1,(r1+8)
800639c: 5c 41 00 05 bne r2,r1,80063b0 <_RBTree_Extract_unprotected+0x44>
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected(
const RBTree_Node *node
)
{
return _RBTree_Next_unprotected( node, RBT_RIGHT );
80063a0: b8 40 08 00 mv r1,r2
80063a4: 34 02 00 01 mvi r2,1
80063a8: f8 00 01 36 calli 8006880 <_RBTree_Next_unprotected>
RBTree_Node *next;
next = _RBTree_Successor_unprotected(the_node);
the_rbtree->first[RBT_LEFT] = next;
80063ac: 59 c1 00 08 sw (r14+8),r1
}
/* Check if max needs to be updated. min=max for 1 element trees so
* do not use else if here. */
if (the_node == the_rbtree->first[RBT_RIGHT]) {
80063b0: 29 c1 00 0c lw r1,(r14+12)
80063b4: 5d 61 00 05 bne r11,r1,80063c8 <_RBTree_Extract_unprotected+0x5c>
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected(
const RBTree_Node *node
)
{
return _RBTree_Next_unprotected( node, RBT_LEFT );
80063b8: b9 60 08 00 mv r1,r11
80063bc: 34 02 00 00 mvi r2,0
80063c0: f8 00 01 30 calli 8006880 <_RBTree_Next_unprotected>
RBTree_Node *previous;
previous = _RBTree_Predecessor_unprotected(the_node);
the_rbtree->first[RBT_RIGHT] = previous;
80063c4: 59 c1 00 0c sw (r14+12),r1
* either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT],
* and replace the_node with the target node. This maintains the binary
* search tree property, but may violate the red-black properties.
*/
if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) {
80063c8: 29 6c 00 04 lw r12,(r11+4)
80063cc: 29 6d 00 08 lw r13,(r11+8)
80063d0: 45 80 00 2b be r12,r0,800647c <_RBTree_Extract_unprotected+0x110>
80063d4: 5d a0 00 03 bne r13,r0,80063e0 <_RBTree_Extract_unprotected+0x74>
80063d8: e0 00 00 2b bi 8006484 <_RBTree_Extract_unprotected+0x118>
target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */
while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT];
80063dc: b8 20 60 00 mv r12,r1
80063e0: 29 81 00 08 lw r1,(r12+8)
80063e4: 5c 20 ff fe bne r1,r0,80063dc <_RBTree_Extract_unprotected+0x70>
* target's position (target is the right child of target->parent)
* when target vacates it. if there is no child, then target->parent
* should become NULL. This may cause the coloring to be violated.
* For now we store the color of the node being deleted in victim_color.
*/
leaf = target->child[RBT_LEFT];
80063e8: 29 8d 00 04 lw r13,(r12+4)
if(leaf) {
80063ec: 45 a1 00 04 be r13,r1,80063fc <_RBTree_Extract_unprotected+0x90>
leaf->parent = target->parent;
80063f0: 29 81 00 00 lw r1,(r12+0)
80063f4: 59 a1 00 00 sw (r13+0),r1
80063f8: e0 00 00 03 bi 8006404 <_RBTree_Extract_unprotected+0x98>
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
80063fc: b9 80 08 00 mv r1,r12
8006400: fb ff ff 70 calli 80061c0 <_RBTree_Extract_validate_unprotected>
}
victim_color = target->color;
dir = target != target->parent->child[0];
8006404: 29 90 00 00 lw r16,(r12+0)
target->parent->child[dir] = leaf;
8006408: 34 02 00 02 mvi r2,2
leaf->parent = target->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
}
victim_color = target->color;
800640c: 29 8f 00 0c lw r15,(r12+12)
dir = target != target->parent->child[0];
8006410: 2a 01 00 04 lw r1,(r16+4)
target->parent->child[dir] = leaf;
8006414: fd 81 08 00 cmpne r1,r12,r1
8006418: fb ff ea 3b calli 8000d04 <__ashlsi3>
800641c: b6 01 08 00 add r1,r16,r1
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
8006420: 29 70 00 00 lw r16,(r11+0)
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
}
victim_color = target->color;
dir = target != target->parent->child[0];
target->parent->child[dir] = leaf;
8006424: 58 2d 00 04 sw (r1+4),r13
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
the_node->parent->child[dir] = target;
8006428: 34 02 00 02 mvi r2,2
victim_color = target->color;
dir = target != target->parent->child[0];
target->parent->child[dir] = leaf;
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
800642c: 2a 01 00 04 lw r1,(r16+4)
the_node->parent->child[dir] = target;
8006430: fd 61 08 00 cmpne r1,r11,r1
8006434: fb ff ea 34 calli 8000d04 <__ashlsi3>
8006438: b6 01 08 00 add r1,r16,r1
800643c: 58 2c 00 04 sw (r1+4),r12
/* set target's new children to the original node's children */
target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT];
8006440: 29 61 00 08 lw r1,(r11+8)
8006444: 59 81 00 08 sw (r12+8),r1
if (the_node->child[RBT_RIGHT])
8006448: 29 61 00 08 lw r1,(r11+8)
800644c: 44 20 00 02 be r1,r0,8006454 <_RBTree_Extract_unprotected+0xe8><== NEVER TAKEN
the_node->child[RBT_RIGHT]->parent = target;
8006450: 58 2c 00 00 sw (r1+0),r12
target->child[RBT_LEFT] = the_node->child[RBT_LEFT];
8006454: 29 61 00 04 lw r1,(r11+4)
8006458: 59 81 00 04 sw (r12+4),r1
if (the_node->child[RBT_LEFT])
800645c: 29 61 00 04 lw r1,(r11+4)
8006460: 44 20 00 02 be r1,r0,8006468 <_RBTree_Extract_unprotected+0xfc>
the_node->child[RBT_LEFT]->parent = target;
8006464: 58 2c 00 00 sw (r1+0),r12
/* finally, update the parent node and recolor. target has completely
* replaced the_node, and target's child has moved up the tree if needed.
* the_node is no longer part of the tree, although it has valid pointers
* still.
*/
target->parent = the_node->parent;
8006468: 29 61 00 00 lw r1,(r11+0)
800646c: 59 81 00 00 sw (r12+0),r1
target->color = the_node->color;
8006470: 29 61 00 0c lw r1,(r11+12)
8006474: 59 81 00 0c sw (r12+12),r1
8006478: e0 00 00 11 bi 80064bc <_RBTree_Extract_unprotected+0x150>
* violated. We will fix it later.
* For now we store the color of the node being deleted in victim_color.
*/
leaf = the_node->child[RBT_LEFT] ?
the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT];
if( leaf ) {
800647c: 5d ac 00 03 bne r13,r12,8006488 <_RBTree_Extract_unprotected+0x11c>
8006480: e0 00 00 05 bi 8006494 <_RBTree_Extract_unprotected+0x128>
* either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT],
* and replace the_node with the target node. This maintains the binary
* search tree property, but may violate the red-black properties.
*/
if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) {
8006484: b9 80 68 00 mv r13,r12
* For now we store the color of the node being deleted in victim_color.
*/
leaf = the_node->child[RBT_LEFT] ?
the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT];
if( leaf ) {
leaf->parent = the_node->parent;
8006488: 29 61 00 00 lw r1,(r11+0)
800648c: 59 a1 00 00 sw (r13+0),r1
8006490: e0 00 00 03 bi 800649c <_RBTree_Extract_unprotected+0x130>
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
8006494: b9 60 08 00 mv r1,r11
8006498: fb ff ff 4a calli 80061c0 <_RBTree_Extract_validate_unprotected>
}
victim_color = the_node->color;
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
800649c: 29 6c 00 00 lw r12,(r11+0)
the_node->parent->child[dir] = leaf;
80064a0: 34 02 00 02 mvi r2,2
leaf->parent = the_node->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
}
victim_color = the_node->color;
80064a4: 29 6f 00 0c lw r15,(r11+12)
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
80064a8: 29 81 00 04 lw r1,(r12+4)
the_node->parent->child[dir] = leaf;
80064ac: fd 61 08 00 cmpne r1,r11,r1
80064b0: fb ff ea 15 calli 8000d04 <__ashlsi3>
80064b4: b5 81 08 00 add r1,r12,r1
80064b8: 58 2d 00 04 sw (r1+4),r13
/* fix coloring. leaf has moved up the tree. The color of the deleted
* node is in victim_color. There are two cases:
* 1. Deleted a red node, its child must be black. Nothing must be done.
* 2. Deleted a black node, its child must be red. Paint child black.
*/
if (victim_color == RBT_BLACK) { /* eliminate case 1 */
80064bc: 5d e0 00 03 bne r15,r0,80064c8 <_RBTree_Extract_unprotected+0x15c>
if (leaf) {
80064c0: 45 af 00 02 be r13,r15,80064c8 <_RBTree_Extract_unprotected+0x15c>
leaf->color = RBT_BLACK; /* case 2 */
80064c4: 59 a0 00 0c sw (r13+12),r0
/* Wipe the_node */
_RBTree_Set_off_rbtree(the_node);
/* set root to black, if it exists */
if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK;
80064c8: 29 c1 00 04 lw r1,(r14+4)
*/
RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree(
RBTree_Node *node
)
{
node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL;
80064cc: 59 60 00 08 sw (r11+8),r0
80064d0: 59 60 00 04 sw (r11+4),r0
80064d4: 59 60 00 00 sw (r11+0),r0
80064d8: 44 20 00 02 be r1,r0,80064e0 <_RBTree_Extract_unprotected+0x174>
80064dc: 58 20 00 0c sw (r1+12),r0
}
80064e0: 2b 9d 00 04 lw ra,(sp+4)
80064e4: 2b 8b 00 1c lw r11,(sp+28)
80064e8: 2b 8c 00 18 lw r12,(sp+24)
80064ec: 2b 8d 00 14 lw r13,(sp+20)
80064f0: 2b 8e 00 10 lw r14,(sp+16)
80064f4: 2b 8f 00 0c lw r15,(sp+12)
80064f8: 2b 90 00 08 lw r16,(sp+8)
80064fc: 37 9c 00 1c addi sp,sp,28
8006500: c3 a0 00 00 ret
08006fa0 <_RBTree_Initialize>:
void *starting_address,
size_t number_nodes,
size_t node_size,
bool is_unique
)
{
8006fa0: 37 9c ff ec addi sp,sp,-20
8006fa4: 5b 8b 00 14 sw (sp+20),r11
8006fa8: 5b 8c 00 10 sw (sp+16),r12
8006fac: 5b 8d 00 0c sw (sp+12),r13
8006fb0: 5b 8e 00 08 sw (sp+8),r14
8006fb4: 5b 9d 00 04 sw (sp+4),ra
8006fb8: b8 20 58 00 mv r11,r1
8006fbc: b8 80 68 00 mv r13,r4
8006fc0: b8 a0 70 00 mv r14,r5
8006fc4: 20 c6 00 ff andi r6,r6,0xff
size_t count;
RBTree_Node *next;
/* TODO: Error message? */
if (!the_rbtree) return;
8006fc8: 44 20 00 0f be r1,r0,8007004 <_RBTree_Initialize+0x64> <== NEVER TAKEN
RBTree_Control *the_rbtree,
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
8006fcc: 58 20 00 00 sw (r1+0),r0
the_rbtree->root = NULL;
8006fd0: 58 20 00 04 sw (r1+4),r0
the_rbtree->first[0] = NULL;
8006fd4: 58 20 00 08 sw (r1+8),r0
the_rbtree->first[1] = NULL;
8006fd8: 58 20 00 0c sw (r1+12),r0
the_rbtree->compare_function = compare_function;
8006fdc: 58 22 00 10 sw (r1+16),r2
the_rbtree->is_unique = is_unique;
8006fe0: 30 26 00 14 sb (r1+20),r6
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
8006fe4: b8 60 60 00 mv r12,r3
while ( count-- ) {
8006fe8: e0 00 00 06 bi 8007000 <_RBTree_Initialize+0x60>
_RBTree_Insert_unprotected(the_rbtree, next);
8006fec: b9 80 10 00 mv r2,r12
8006ff0: b9 60 08 00 mv r1,r11
8006ff4: fb ff ff 22 calli 8006c7c <_RBTree_Insert_unprotected>
#include <rtems/system.h>
#include <rtems/score/address.h>
#include <rtems/score/rbtree.h>
#include <rtems/score/isr.h>
void _RBTree_Initialize(
8006ff8: b5 8e 60 00 add r12,r12,r14
8006ffc: 35 ad ff ff addi r13,r13,-1
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
while ( count-- ) {
8007000: 5d a0 ff fb bne r13,r0,8006fec <_RBTree_Initialize+0x4c> <== NEVER TAKEN
_RBTree_Insert_unprotected(the_rbtree, next);
next = (RBTree_Node *)
_Addresses_Add_offset( (void *) next, node_size );
}
}
8007004: 2b 9d 00 04 lw ra,(sp+4)
8007008: 2b 8b 00 14 lw r11,(sp+20)
800700c: 2b 8c 00 10 lw r12,(sp+16)
8007010: 2b 8d 00 0c lw r13,(sp+12)
8007014: 2b 8e 00 08 lw r14,(sp+8)
8007018: 37 9c 00 14 addi sp,sp,20
800701c: c3 a0 00 00 ret
080065ec <_RBTree_Insert_unprotected>:
*/
RBTree_Node *_RBTree_Insert_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
80065ec: 37 9c ff e8 addi sp,sp,-24
80065f0: 5b 8b 00 18 sw (sp+24),r11
80065f4: 5b 8c 00 14 sw (sp+20),r12
80065f8: 5b 8d 00 10 sw (sp+16),r13
80065fc: 5b 8e 00 0c sw (sp+12),r14
8006600: 5b 8f 00 08 sw (sp+8),r15
8006604: 5b 9d 00 04 sw (sp+4),ra
if(!the_node) return (RBTree_Node*)-1;
8006608: 34 0d ff ff mvi r13,-1
*/
RBTree_Node *_RBTree_Insert_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
800660c: b8 20 60 00 mv r12,r1
8006610: b8 40 58 00 mv r11,r2
if(!the_node) return (RBTree_Node*)-1;
8006614: 44 40 00 5a be r2,r0,800677c <_RBTree_Insert_unprotected+0x190>
RBTree_Node *iter_node = the_rbtree->root;
8006618: 28 2d 00 04 lw r13,(r1+4)
int compare_result;
if (!iter_node) { /* special case: first node inserted */
800661c: b9 a0 78 00 mv r15,r13
8006620: 5d a0 00 2d bne r13,r0,80066d4 <_RBTree_Insert_unprotected+0xe8>
the_node->color = RBT_BLACK;
8006624: 58 40 00 0c sw (r2+12),r0
the_rbtree->root = the_node;
8006628: 59 82 00 04 sw (r12+4),r2
the_rbtree->first[0] = the_rbtree->first[1] = the_node;
800662c: 59 82 00 0c sw (r12+12),r2
8006630: 59 82 00 08 sw (r12+8),r2
the_node->parent = (RBTree_Node *) the_rbtree;
8006634: 59 61 00 00 sw (r11+0),r1
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
8006638: 58 40 00 08 sw (r2+8),r0
800663c: 58 40 00 04 sw (r2+4),r0
8006640: e0 00 00 4f bi 800677c <_RBTree_Insert_unprotected+0x190>
} else {
/* typical binary search tree insert, descend tree to leaf and insert */
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
8006644: 44 20 00 4e be r1,r0,800677c <_RBTree_Insert_unprotected+0x190>
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
8006648: 34 02 00 1f mvi r2,31
800664c: a4 20 08 00 not r1,r1
8006650: fb ff e9 d4 calli 8000da0 <__lshrsi3>
if (!iter_node->child[dir]) {
8006654: 34 02 00 02 mvi r2,2
/* typical binary search tree insert, descend tree to leaf and insert */
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
8006658: b8 20 70 00 mv r14,r1
if (!iter_node->child[dir]) {
800665c: fb ff e9 aa calli 8000d04 <__ashlsi3>
8006660: b5 a1 08 00 add r1,r13,r1
8006664: 28 2d 00 04 lw r13,(r1+4)
8006668: 34 22 00 04 addi r2,r1,4
800666c: 5d a0 00 19 bne r13,r0,80066d0 <_RBTree_Insert_unprotected+0xe4>
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
8006670: 59 60 00 08 sw (r11+8),r0
8006674: 59 60 00 04 sw (r11+4),r0
the_node->color = RBT_RED;
8006678: 34 01 00 01 mvi r1,1
800667c: 59 61 00 0c sw (r11+12),r1
iter_node->child[dir] = the_node;
8006680: 58 4b 00 00 sw (r2+0),r11
the_node->parent = iter_node;
8006684: 59 6f 00 00 sw (r11+0),r15
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
8006688: 34 02 00 02 mvi r2,2
800668c: 35 c1 00 02 addi r1,r14,2
8006690: fb ff e9 9d calli 8000d04 <__ashlsi3>
8006694: b5 81 10 00 add r2,r12,r1
/* update min/max */
compare_result = the_rbtree->compare_function(
8006698: 29 83 00 10 lw r3,(r12+16)
800669c: 28 42 00 00 lw r2,(r2+0)
80066a0: b9 60 08 00 mv r1,r11
80066a4: d8 60 00 00 call r3
the_node,
_RBTree_First(the_rbtree, dir)
);
if ( (!dir && _RBTree_Is_lesser(compare_result)) ||
80066a8: 5d cd 00 03 bne r14,r13,80066b4 <_RBTree_Insert_unprotected+0xc8>
80066ac: 49 a1 00 03 bg r13,r1,80066b8 <_RBTree_Insert_unprotected+0xcc>
80066b0: e0 00 00 2b bi 800675c <_RBTree_Insert_unprotected+0x170>
(dir && _RBTree_Is_greater(compare_result)) ) {
80066b4: 4c 01 00 2a bge r0,r1,800675c <_RBTree_Insert_unprotected+0x170>
the_rbtree->first[dir] = the_node;
80066b8: 35 c1 00 02 addi r1,r14,2
80066bc: 34 02 00 02 mvi r2,2
80066c0: fb ff e9 91 calli 8000d04 <__ashlsi3>
80066c4: b5 81 08 00 add r1,r12,r1
80066c8: 58 2b 00 00 sw (r1+0),r11
80066cc: e0 00 00 24 bi 800675c <_RBTree_Insert_unprotected+0x170>
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
if (!iter_node->child[dir]) {
80066d0: b9 a0 78 00 mv r15,r13
the_node->parent = (RBTree_Node *) the_rbtree;
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
} else {
/* typical binary search tree insert, descend tree to leaf and insert */
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
80066d4: 29 83 00 10 lw r3,(r12+16)
80066d8: b9 a0 10 00 mv r2,r13
80066dc: b9 60 08 00 mv r1,r11
80066e0: d8 60 00 00 call r3
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
80066e4: 41 82 00 14 lbu r2,(r12+20)
80066e8: 5c 40 ff d7 bne r2,r0,8006644 <_RBTree_Insert_unprotected+0x58>
80066ec: e3 ff ff d7 bi 8006648 <_RBTree_Insert_unprotected+0x5c>
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
if(!(the_node->parent->parent)) return NULL;
if(!(the_node->parent->parent->parent)) return NULL;
80066f0: 29 82 00 00 lw r2,(r12+0)
80066f4: 44 40 00 2b be r2,r0,80067a0 <_RBTree_Insert_unprotected+0x1b4><== NEVER TAKEN
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
if(!(the_node->parent->parent)) return NULL;
if(the_node == the_node->parent->child[RBT_LEFT])
80066f8: 29 82 00 04 lw r2,(r12+4)
80066fc: 5c 22 00 02 bne r1,r2,8006704 <_RBTree_Insert_unprotected+0x118>
return the_node->parent->child[RBT_RIGHT];
8006700: 29 82 00 08 lw r2,(r12+8)
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
8006704: 44 40 00 27 be r2,r0,80067a0 <_RBTree_Insert_unprotected+0x1b4>
8006708: 28 43 00 0c lw r3,(r2+12)
800670c: 5c 6e 00 25 bne r3,r14,80067a0 <_RBTree_Insert_unprotected+0x1b4>
u = _RBTree_Parent_sibling(the_node);
g = the_node->parent->parent;
/* if uncle is red, repaint uncle/parent black and grandparent red */
if(_RBTree_Is_red(u)) {
the_node->parent->color = RBT_BLACK;
8006710: 58 20 00 0c sw (r1+12),r0
u->color = RBT_BLACK;
8006714: 58 40 00 0c sw (r2+12),r0
g->color = RBT_RED;
8006718: 59 8e 00 0c sw (r12+12),r14
800671c: b9 80 58 00 mv r11,r12
8006720: e0 00 00 10 bi 8006760 <_RBTree_Insert_unprotected+0x174>
RBTree_Direction dir = the_node != the_node->parent->child[0];
RBTree_Direction pdir = the_node->parent != g->child[0];
/* ensure node is on the same branch direction as parent */
if (dir != pdir) {
_RBTree_Rotate(the_node->parent, pdir);
8006724: b9 e0 10 00 mv r2,r15
8006728: fb ff ff 84 calli 8006538 <_RBTree_Rotate>
the_node = the_node->child[pdir];
800672c: b9 e0 08 00 mv r1,r15
8006730: 34 02 00 02 mvi r2,2
8006734: fb ff e9 74 calli 8000d04 <__ashlsi3>
8006738: b5 61 08 00 add r1,r11,r1
800673c: 28 2b 00 04 lw r11,(r1+4)
}
the_node->parent->color = RBT_BLACK;
8006740: 29 61 00 00 lw r1,(r11+0)
g->color = RBT_RED;
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
8006744: c9 cf 10 00 sub r2,r14,r15
/* ensure node is on the same branch direction as parent */
if (dir != pdir) {
_RBTree_Rotate(the_node->parent, pdir);
the_node = the_node->child[pdir];
}
the_node->parent->color = RBT_BLACK;
8006748: 58 20 00 0c sw (r1+12),r0
g->color = RBT_RED;
800674c: 59 8e 00 0c sw (r12+12),r14
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
8006750: b9 80 08 00 mv r1,r12
8006754: fb ff ff 79 calli 8006538 <_RBTree_Rotate>
8006758: e0 00 00 02 bi 8006760 <_RBTree_Insert_unprotected+0x174>
800675c: 34 0e 00 01 mvi r14,1
_ISR_Disable( level );
return_node = _RBTree_Insert_unprotected( tree, node );
_ISR_Enable( level );
return return_node;
}
8006760: 29 61 00 00 lw r1,(r11+0)
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent(
const RBTree_Node *the_node
)
{
if (!the_node->parent->parent) return NULL;
8006764: 28 2c 00 00 lw r12,(r1+0)
8006768: 45 80 00 04 be r12,r0,8006778 <_RBTree_Insert_unprotected+0x18c>
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
800676c: 28 22 00 0c lw r2,(r1+12)
8006770: 5c 4e 00 03 bne r2,r14,800677c <_RBTree_Insert_unprotected+0x190>
8006774: e3 ff ff df bi 80066f0 <_RBTree_Insert_unprotected+0x104>
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
}
}
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
8006778: 59 60 00 0c sw (r11+12),r0
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
}
800677c: b9 a0 08 00 mv r1,r13
8006780: 2b 9d 00 04 lw ra,(sp+4)
8006784: 2b 8b 00 18 lw r11,(sp+24)
8006788: 2b 8c 00 14 lw r12,(sp+20)
800678c: 2b 8d 00 10 lw r13,(sp+16)
8006790: 2b 8e 00 0c lw r14,(sp+12)
8006794: 2b 8f 00 08 lw r15,(sp+8)
8006798: 37 9c 00 18 addi sp,sp,24
800679c: c3 a0 00 00 ret
u->color = RBT_BLACK;
g->color = RBT_RED;
the_node = g;
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
RBTree_Direction pdir = the_node->parent != g->child[0];
80067a0: 29 8f 00 04 lw r15,(r12+4)
the_node->parent->color = RBT_BLACK;
u->color = RBT_BLACK;
g->color = RBT_RED;
the_node = g;
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
80067a4: 28 22 00 04 lw r2,(r1+4)
RBTree_Direction pdir = the_node->parent != g->child[0];
80067a8: fc 2f 78 00 cmpne r15,r1,r15
the_node->parent->color = RBT_BLACK;
u->color = RBT_BLACK;
g->color = RBT_RED;
the_node = g;
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
80067ac: fd 62 10 00 cmpne r2,r11,r2
RBTree_Direction pdir = the_node->parent != g->child[0];
/* ensure node is on the same branch direction as parent */
if (dir != pdir) {
80067b0: 5c 4f ff dd bne r2,r15,8006724 <_RBTree_Insert_unprotected+0x138>
80067b4: e3 ff ff e3 bi 8006740 <_RBTree_Insert_unprotected+0x154>
080067ec <_RBTree_Iterate_unprotected>:
const RBTree_Control *rbtree,
RBTree_Direction dir,
RBTree_Visitor visitor,
void *visitor_arg
)
{
80067ec: 37 9c ff e8 addi sp,sp,-24
80067f0: 5b 8b 00 18 sw (sp+24),r11
80067f4: 5b 8c 00 14 sw (sp+20),r12
80067f8: 5b 8d 00 10 sw (sp+16),r13
80067fc: 5b 8e 00 0c sw (sp+12),r14
8006800: 5b 8f 00 08 sw (sp+8),r15
8006804: 5b 9d 00 04 sw (sp+4),ra
8006808: b8 40 60 00 mv r12,r2
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
800680c: 64 42 00 00 cmpei r2,r2,0
8006810: b8 20 58 00 mv r11,r1
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
8006814: 34 41 00 02 addi r1,r2,2
8006818: 34 02 00 02 mvi r2,2
800681c: b8 60 70 00 mv r14,r3
8006820: b8 80 68 00 mv r13,r4
8006824: fb ff e9 38 calli 8000d04 <__ashlsi3>
8006828: b5 61 08 00 add r1,r11,r1
800682c: 28 2b 00 00 lw r11,(r1+0)
8006830: e0 00 00 0b bi 800685c <_RBTree_Iterate_unprotected+0x70>
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
stop = (*visitor)( current, dir, visitor_arg );
8006834: b9 60 08 00 mv r1,r11
8006838: b9 80 10 00 mv r2,r12
800683c: b9 a0 18 00 mv r3,r13
8006840: d9 c0 00 00 call r14
8006844: b8 20 78 00 mv r15,r1
current = _RBTree_Next_unprotected( current, dir );
8006848: b9 80 10 00 mv r2,r12
800684c: b9 60 08 00 mv r1,r11
8006850: f8 00 00 0c calli 8006880 <_RBTree_Next_unprotected>
8006854: b8 20 58 00 mv r11,r1
{
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
8006858: 5d e0 00 02 bne r15,r0,8006860 <_RBTree_Iterate_unprotected+0x74><== NEVER TAKEN
800685c: 5d 60 ff f6 bne r11,r0,8006834 <_RBTree_Iterate_unprotected+0x48>
stop = (*visitor)( current, dir, visitor_arg );
current = _RBTree_Next_unprotected( current, dir );
}
}
8006860: 2b 9d 00 04 lw ra,(sp+4)
8006864: 2b 8b 00 18 lw r11,(sp+24)
8006868: 2b 8c 00 14 lw r12,(sp+20)
800686c: 2b 8d 00 10 lw r13,(sp+16)
8006870: 2b 8e 00 0c lw r14,(sp+12)
8006874: 2b 8f 00 08 lw r15,(sp+8)
8006878: 37 9c 00 18 addi sp,sp,24
800687c: c3 a0 00 00 ret
080060e0 <_RBTree_Sibling>:
* exists, and NULL if not.
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
80060e0: b8 20 18 00 mv r3,r1
if(!the_node) return NULL;
80060e4: 34 01 00 00 mvi r1,0
80060e8: 44 60 00 08 be r3,r0,8006108 <_RBTree_Sibling+0x28>
if(!(the_node->parent)) return NULL;
80060ec: 28 62 00 00 lw r2,(r3+0)
80060f0: 44 40 00 06 be r2,r0,8006108 <_RBTree_Sibling+0x28> <== NEVER TAKEN
if(!(the_node->parent->parent)) return NULL;
80060f4: 28 44 00 00 lw r4,(r2+0)
80060f8: 44 80 00 04 be r4,r0,8006108 <_RBTree_Sibling+0x28>
if(the_node == the_node->parent->child[RBT_LEFT])
80060fc: 28 41 00 04 lw r1,(r2+4)
8006100: 5c 61 00 02 bne r3,r1,8006108 <_RBTree_Sibling+0x28>
return the_node->parent->child[RBT_RIGHT];
8006104: 28 41 00 08 lw r1,(r2+8)
else
return the_node->parent->child[RBT_LEFT];
}
8006108: c3 a0 00 00 ret
08004afc <_RTEMS_signal_Post_switch_hook>:
#include <rtems/score/thread.h>
#include <rtems/score/apiext.h>
#include <rtems/rtems/tasks.h>
static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing )
{
8004afc: 37 9c ff f0 addi sp,sp,-16
8004b00: 5b 8b 00 0c sw (sp+12),r11
8004b04: 5b 8c 00 08 sw (sp+8),r12
8004b08: 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 ];
8004b0c: 28 2b 01 18 lw r11,(r1+280)
if ( !api )
8004b10: 45 60 00 1a be r11,r0,8004b78 <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN
* Signal Processing
*/
asr = &api->Signal;
_ISR_Disable( level );
8004b14: 90 00 08 00 rcsr r1,IE
8004b18: 34 02 ff fe mvi r2,-2
8004b1c: a0 22 10 00 and r2,r1,r2
8004b20: d0 02 00 00 wcsr IE,r2
signal_set = asr->signals_posted;
8004b24: 29 6c 00 14 lw r12,(r11+20)
asr->signals_posted = 0;
8004b28: 59 60 00 14 sw (r11+20),r0
_ISR_Enable( level );
8004b2c: d0 01 00 00 wcsr IE,r1
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
8004b30: 45 80 00 12 be r12,r0,8004b78 <_RTEMS_signal_Post_switch_hook+0x7c>
return;
asr->nest_level += 1;
8004b34: 29 61 00 1c lw r1,(r11+28)
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
8004b38: 37 83 00 10 addi r3,sp,16
8004b3c: 38 02 ff ff mvu r2,0xffff
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
return;
asr->nest_level += 1;
8004b40: 34 21 00 01 addi r1,r1,1
8004b44: 59 61 00 1c sw (r11+28),r1
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
8004b48: 29 61 00 10 lw r1,(r11+16)
8004b4c: f8 00 01 27 calli 8004fe8 <rtems_task_mode>
(*asr->handler)( signal_set );
8004b50: 29 62 00 0c lw r2,(r11+12)
8004b54: b9 80 08 00 mv r1,r12
8004b58: d8 40 00 00 call r2
asr->nest_level -= 1;
8004b5c: 29 61 00 1c lw r1,(r11+28)
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
8004b60: 38 02 ff ff mvu r2,0xffff
8004b64: 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;
8004b68: 34 21 ff ff addi r1,r1,-1
8004b6c: 59 61 00 1c sw (r11+28),r1
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
8004b70: 2b 81 00 10 lw r1,(sp+16)
8004b74: f8 00 01 1d calli 8004fe8 <rtems_task_mode>
}
8004b78: 2b 9d 00 04 lw ra,(sp+4)
8004b7c: 2b 8b 00 0c lw r11,(sp+12)
8004b80: 2b 8c 00 08 lw r12,(sp+8)
8004b84: 37 9c 00 10 addi sp,sp,16
8004b88: c3 a0 00 00 ret
08034370 <_Rate_monotonic_Get_status>:
bool _Rate_monotonic_Get_status(
Rate_monotonic_Control *the_period,
Rate_monotonic_Period_time_t *wall_since_last_period,
Thread_CPU_usage_t *cpu_since_last_period
)
{
8034370: 37 9c ff e4 addi sp,sp,-28
8034374: 5b 8b 00 14 sw (sp+20),r11
8034378: 5b 8c 00 10 sw (sp+16),r12
803437c: 5b 8d 00 0c sw (sp+12),r13
8034380: 5b 8e 00 08 sw (sp+8),r14
8034384: 5b 9d 00 04 sw (sp+4),ra
8034388: b8 40 70 00 mv r14,r2
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
803438c: 78 02 08 06 mvhi r2,0x806
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
Timestamp_Control uptime;
#endif
Thread_Control *owning_thread = the_period->owner;
8034390: 28 2c 00 40 lw r12,(r1+64)
bool _Rate_monotonic_Get_status(
Rate_monotonic_Control *the_period,
Rate_monotonic_Period_time_t *wall_since_last_period,
Thread_CPU_usage_t *cpu_since_last_period
)
{
8034394: b8 20 58 00 mv r11,r1
8034398: 38 42 9f e8 ori r2,r2,0x9fe8
803439c: 37 81 00 18 addi r1,sp,24
80343a0: b8 60 68 00 mv r13,r3
80343a4: fb ff 3f 1f calli 8004020 <_TOD_Get_with_nanoseconds>
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
80343a8: 29 61 00 54 lw r1,(r11+84)
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
80343ac: 2b 85 00 1c lw r5,(sp+28)
80343b0: 29 62 00 50 lw r2,(r11+80)
80343b4: 2b 83 00 18 lw r3,(sp+24)
80343b8: c8 a1 08 00 sub r1,r5,r1
80343bc: f4 25 20 00 cmpgu r4,r1,r5
80343c0: c8 62 10 00 sub r2,r3,r2
80343c4: c8 44 10 00 sub r2,r2,r4
80343c8: 59 c2 00 00 sw (r14+0),r2
* Determine cpu usage since period initiated.
*/
used = owning_thread->cpu_time_used;
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
if (owning_thread == _Thread_Executing) {
80343cc: 78 02 08 06 mvhi r2,0x806
80343d0: 38 42 a5 00 ori r2,r2,0xa500
80343d4: 28 47 00 10 lw r7,(r2+16)
80343d8: 59 c1 00 04 sw (r14+4),r1
#endif
/*
* Determine cpu usage since period initiated.
*/
used = owning_thread->cpu_time_used;
80343dc: 29 86 00 80 lw r6,(r12+128)
80343e0: 29 84 00 84 lw r4,(r12+132)
if (used < the_period->cpu_usage_period_initiated)
return false;
*cpu_since_last_period = used - the_period->cpu_usage_period_initiated;
#endif
return true;
80343e4: 34 01 00 01 mvi r1,1
* Determine cpu usage since period initiated.
*/
used = owning_thread->cpu_time_used;
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
if (owning_thread == _Thread_Executing) {
80343e8: 5d 87 00 19 bne r12,r7,803444c <_Rate_monotonic_Get_status+0xdc>
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
80343ec: 28 41 00 24 lw r1,(r2+36)
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
80343f0: b4 85 28 00 add r5,r4,r5
80343f4: b4 c3 18 00 add r3,r6,r3
80343f8: f4 85 20 00 cmpgu r4,r4,r5
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
80343fc: 28 46 00 20 lw r6,(r2+32)
8034400: c8 a1 08 00 sub r1,r5,r1
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
8034404: b4 83 20 00 add r4,r4,r3
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
8034408: f4 25 28 00 cmpgu r5,r1,r5
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
803440c: 29 62 00 48 lw r2,(r11+72)
8034410: c8 86 20 00 sub r4,r4,r6
8034414: c8 85 20 00 sub r4,r4,r5
8034418: 29 63 00 4c lw r3,(r11+76)
/*
* The cpu usage info was reset while executing. Can't
* determine a status.
*/
if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated))
803441c: 48 44 00 0b bg r2,r4,8034448 <_Rate_monotonic_Get_status+0xd8><== NEVER TAKEN
8034420: 5c 44 00 02 bne r2,r4,8034428 <_Rate_monotonic_Get_status+0xb8>
8034424: 54 61 00 09 bgu r3,r1,8034448 <_Rate_monotonic_Get_status+0xd8>
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
8034428: c8 23 18 00 sub r3,r1,r3
803442c: f4 61 08 00 cmpgu r1,r3,r1
8034430: c8 82 10 00 sub r2,r4,r2
8034434: c8 41 08 00 sub r1,r2,r1
8034438: 59 a1 00 00 sw (r13+0),r1
803443c: 59 a3 00 04 sw (r13+4),r3
if (used < the_period->cpu_usage_period_initiated)
return false;
*cpu_since_last_period = used - the_period->cpu_usage_period_initiated;
#endif
return true;
8034440: 34 01 00 01 mvi r1,1
8034444: e0 00 00 02 bi 803444c <_Rate_monotonic_Get_status+0xdc>
/*
* The cpu usage info was reset while executing. Can't
* determine a status.
*/
if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated))
return false;
8034448: 34 01 00 00 mvi r1,0
return false;
*cpu_since_last_period = used - the_period->cpu_usage_period_initiated;
#endif
return true;
}
803444c: 2b 9d 00 04 lw ra,(sp+4)
8034450: 2b 8b 00 14 lw r11,(sp+20)
8034454: 2b 8c 00 10 lw r12,(sp+16)
8034458: 2b 8d 00 0c lw r13,(sp+12)
803445c: 2b 8e 00 08 lw r14,(sp+8)
8034460: 37 9c 00 1c addi sp,sp,28
8034464: c3 a0 00 00 ret
08034838 <_Rate_monotonic_Timeout>:
void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
)
{
8034838: 37 9c ff f4 addi sp,sp,-12
803483c: 5b 8b 00 08 sw (sp+8),r11
8034840: 5b 9d 00 04 sw (sp+4),ra
8034844: b8 20 10 00 mv r2,r1
8034848: 78 01 08 06 mvhi r1,0x806
803484c: 38 21 ab 30 ori r1,r1,0xab30
8034850: 37 83 00 0c addi r3,sp,12
8034854: fb ff 41 16 calli 8004cac <_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 ) {
8034858: 2b 82 00 0c lw r2,(sp+12)
803485c: b8 20 58 00 mv r11,r1
8034860: 5c 40 00 22 bne r2,r0,80348e8 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN
case OBJECTS_LOCAL:
the_thread = the_period->owner;
8034864: 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);
8034868: 28 23 00 10 lw r3,(r1+16)
803486c: 20 63 40 00 andi r3,r3,0x4000
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
8034870: 44 62 00 09 be r3,r2,8034894 <_Rate_monotonic_Timeout+0x5c>
8034874: 28 23 00 20 lw r3,(r1+32)
8034878: 29 62 00 08 lw r2,(r11+8)
803487c: 5c 62 00 06 bne r3,r2,8034894 <_Rate_monotonic_Timeout+0x5c>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
8034880: 78 03 08 05 mvhi r3,0x805
8034884: 38 63 97 00 ori r3,r3,0x9700
8034888: 28 62 00 00 lw r2,(r3+0)
803488c: fb ff 62 0a calli 800d0b4 <_Thread_Clear_state>
8034890: e0 00 00 06 bi 80348a8 <_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 ) {
8034894: 29 62 00 38 lw r2,(r11+56)
8034898: 34 01 00 01 mvi r1,1
803489c: 5c 41 00 0c bne r2,r1,80348cc <_Rate_monotonic_Timeout+0x94>
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
80348a0: 34 01 00 03 mvi r1,3
80348a4: 59 61 00 38 sw (r11+56),r1
_Rate_monotonic_Initiate_statistics( the_period );
80348a8: b9 60 08 00 mv r1,r11
80348ac: fb ff ff 39 calli 8034590 <_Rate_monotonic_Initiate_statistics>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80348b0: 29 61 00 3c lw r1,(r11+60)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80348b4: 35 62 00 10 addi r2,r11,16
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80348b8: 59 61 00 1c sw (r11+28),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80348bc: 78 01 08 06 mvhi r1,0x806
80348c0: 38 21 a0 f8 ori r1,r1,0xa0f8
80348c4: fb ff 48 79 calli 8006aa8 <_Watchdog_Insert>
80348c8: e0 00 00 03 bi 80348d4 <_Rate_monotonic_Timeout+0x9c>
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
80348cc: 34 01 00 04 mvi r1,4
80348d0: 59 61 00 38 sw (r11+56),r1
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
80348d4: 78 01 08 06 mvhi r1,0x806
80348d8: 38 21 a0 60 ori r1,r1,0xa060
80348dc: 28 22 00 00 lw r2,(r1+0)
--level;
80348e0: 34 42 ff ff addi r2,r2,-1
_Thread_Dispatch_disable_level = level;
80348e4: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
80348e8: 2b 9d 00 04 lw ra,(sp+4)
80348ec: 2b 8b 00 08 lw r11,(sp+8)
80348f0: 37 9c 00 0c addi sp,sp,12
80348f4: c3 a0 00 00 ret
08034468 <_Rate_monotonic_Update_statistics>:
}
static void _Rate_monotonic_Update_statistics(
Rate_monotonic_Control *the_period
)
{
8034468: 37 9c ff e8 addi sp,sp,-24
803446c: 5b 8b 00 08 sw (sp+8),r11
8034470: 5b 9d 00 04 sw (sp+4),ra
8034474: b8 20 58 00 mv r11,r1
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8034478: 28 21 00 58 lw r1,(r1+88)
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
803447c: 29 62 00 38 lw r2,(r11+56)
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8034480: 34 21 00 01 addi r1,r1,1
8034484: 59 61 00 58 sw (r11+88),r1
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
8034488: 34 01 00 04 mvi r1,4
803448c: 5c 41 00 04 bne r2,r1,803449c <_Rate_monotonic_Update_statistics+0x34>
stats->missed_count++;
8034490: 29 61 00 5c lw r1,(r11+92)
8034494: 34 21 00 01 addi r1,r1,1
8034498: 59 61 00 5c sw (r11+92),r1
/*
* Grab status for time statistics.
*/
valid_status =
803449c: b9 60 08 00 mv r1,r11
80344a0: 37 82 00 0c addi r2,sp,12
80344a4: 37 83 00 14 addi r3,sp,20
80344a8: fb ff ff b2 calli 8034370 <_Rate_monotonic_Get_status>
_Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
if (!valid_status)
80344ac: 44 20 00 35 be r1,r0,8034580 <_Rate_monotonic_Update_statistics+0x118><== NEVER TAKEN
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
80344b0: 2b 82 00 18 lw r2,(sp+24)
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
80344b4: 29 63 00 74 lw r3,(r11+116)
80344b8: 29 64 00 70 lw r4,(r11+112)
80344bc: 2b 81 00 14 lw r1,(sp+20)
80344c0: b4 43 18 00 add r3,r2,r3
80344c4: f4 43 28 00 cmpgu r5,r2,r3
80344c8: b4 24 20 00 add r4,r1,r4
80344cc: 59 63 00 74 sw (r11+116),r3
* Update CPU time
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Add_to( &stats->total_cpu_time, &executed );
if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) )
80344d0: 29 63 00 60 lw r3,(r11+96)
80344d4: b4 a4 20 00 add r4,r5,r4
80344d8: 59 64 00 70 sw (r11+112),r4
80344dc: 48 61 00 05 bg r3,r1,80344f0 <_Rate_monotonic_Update_statistics+0x88>
80344e0: 5c 61 00 06 bne r3,r1,80344f8 <_Rate_monotonic_Update_statistics+0x90><== NEVER TAKEN
80344e4: 29 63 00 64 lw r3,(r11+100)
80344e8: 54 62 00 02 bgu r3,r2,80344f0 <_Rate_monotonic_Update_statistics+0x88>
80344ec: e0 00 00 03 bi 80344f8 <_Rate_monotonic_Update_statistics+0x90>
stats->min_cpu_time = executed;
80344f0: 59 61 00 60 sw (r11+96),r1
80344f4: 59 62 00 64 sw (r11+100),r2
if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
80344f8: 29 63 00 68 lw r3,(r11+104)
80344fc: 48 23 00 05 bg r1,r3,8034510 <_Rate_monotonic_Update_statistics+0xa8><== NEVER TAKEN
8034500: 5c 61 00 06 bne r3,r1,8034518 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN
8034504: 29 63 00 6c lw r3,(r11+108)
8034508: 54 43 00 02 bgu r2,r3,8034510 <_Rate_monotonic_Update_statistics+0xa8>
803450c: e0 00 00 03 bi 8034518 <_Rate_monotonic_Update_statistics+0xb0>
stats->max_cpu_time = executed;
8034510: 59 61 00 68 sw (r11+104),r1
8034514: 59 62 00 6c sw (r11+108),r2
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
8034518: 2b 82 00 10 lw r2,(sp+16)
803451c: 29 63 00 8c lw r3,(r11+140)
8034520: 29 64 00 88 lw r4,(r11+136)
8034524: 2b 81 00 0c lw r1,(sp+12)
8034528: b4 43 18 00 add r3,r2,r3
803452c: f4 43 28 00 cmpgu r5,r2,r3
8034530: b4 24 20 00 add r4,r1,r4
8034534: 59 63 00 8c sw (r11+140),r3
* Update Wall time
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Add_to( &stats->total_wall_time, &since_last_period );
if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
8034538: 29 63 00 78 lw r3,(r11+120)
803453c: b4 a4 20 00 add r4,r5,r4
8034540: 59 64 00 88 sw (r11+136),r4
8034544: 48 61 00 05 bg r3,r1,8034558 <_Rate_monotonic_Update_statistics+0xf0>
8034548: 5c 61 00 06 bne r3,r1,8034560 <_Rate_monotonic_Update_statistics+0xf8><== NEVER TAKEN
803454c: 29 63 00 7c lw r3,(r11+124)
8034550: 54 62 00 02 bgu r3,r2,8034558 <_Rate_monotonic_Update_statistics+0xf0>
8034554: e0 00 00 03 bi 8034560 <_Rate_monotonic_Update_statistics+0xf8>
stats->min_wall_time = since_last_period;
8034558: 59 61 00 78 sw (r11+120),r1
803455c: 59 62 00 7c sw (r11+124),r2
if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
8034560: 29 63 00 80 lw r3,(r11+128)
8034564: 48 23 00 05 bg r1,r3,8034578 <_Rate_monotonic_Update_statistics+0x110><== NEVER TAKEN
8034568: 5c 61 00 06 bne r3,r1,8034580 <_Rate_monotonic_Update_statistics+0x118><== NEVER TAKEN
803456c: 29 63 00 84 lw r3,(r11+132)
8034570: 54 43 00 02 bgu r2,r3,8034578 <_Rate_monotonic_Update_statistics+0x110>
8034574: e0 00 00 03 bi 8034580 <_Rate_monotonic_Update_statistics+0x118>
stats->max_wall_time = since_last_period;
8034578: 59 61 00 80 sw (r11+128),r1
803457c: 59 62 00 84 sw (r11+132),r2
stats->min_wall_time = since_last_period;
if ( since_last_period > stats->max_wall_time )
stats->max_wall_time = since_last_period;
#endif
}
8034580: 2b 9d 00 04 lw ra,(sp+4)
8034584: 2b 8b 00 08 lw r11,(sp+8)
8034588: 37 9c 00 18 addi sp,sp,24
803458c: c3 a0 00 00 ret
0800677c <_Scheduler_CBS_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_CBS_Allocate(
Thread_Control *the_thread
)
{
800677c: 37 9c ff f8 addi sp,sp,-8
8006780: 5b 8b 00 08 sw (sp+8),r11
8006784: 5b 9d 00 04 sw (sp+4),ra
8006788: b8 20 58 00 mv r11,r1
void *sched;
Scheduler_CBS_Per_thread *schinfo;
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
800678c: 34 01 00 1c mvi r1,28
8006790: f8 00 07 c0 calli 8008690 <_Workspace_Allocate>
if ( sched ) {
8006794: 44 20 00 06 be r1,r0,80067ac <_Scheduler_CBS_Allocate+0x30><== NEVER TAKEN
the_thread->scheduler_info = sched;
8006798: 59 61 00 88 sw (r11+136),r1
schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info);
schinfo->edf_per_thread.thread = the_thread;
schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
800679c: 34 02 00 02 mvi r2,2
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
if ( sched ) {
the_thread->scheduler_info = sched;
schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info);
schinfo->edf_per_thread.thread = the_thread;
80067a0: 58 2b 00 00 sw (r1+0),r11
schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
80067a4: 58 22 00 14 sw (r1+20),r2
schinfo->cbs_server = NULL;
80067a8: 58 20 00 18 sw (r1+24),r0
}
return sched;
}
80067ac: 2b 9d 00 04 lw ra,(sp+4)
80067b0: 2b 8b 00 08 lw r11,(sp+8)
80067b4: 37 9c 00 08 addi sp,sp,8
80067b8: c3 a0 00 00 ret
08007f08 <_Scheduler_CBS_Budget_callout>:
Scheduler_CBS_Server **_Scheduler_CBS_Server_list;
void _Scheduler_CBS_Budget_callout(
Thread_Control *the_thread
)
{
8007f08: 37 9c ff f4 addi sp,sp,-12
8007f0c: 5b 8b 00 08 sw (sp+8),r11
8007f10: 5b 9d 00 04 sw (sp+4),ra
8007f14: b8 20 58 00 mv r11,r1
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info;
Scheduler_CBS_Server_id server_id;
/* Put violating task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
8007f18: 28 22 00 ac lw r2,(r1+172)
if ( the_thread->real_priority != new_priority )
8007f1c: 28 21 00 18 lw r1,(r1+24)
8007f20: 44 22 00 02 be r1,r2,8007f28 <_Scheduler_CBS_Budget_callout+0x20><== NEVER TAKEN
the_thread->real_priority = new_priority;
8007f24: 59 62 00 18 sw (r11+24),r2
if ( the_thread->current_priority != new_priority )
8007f28: 29 61 00 14 lw r1,(r11+20)
8007f2c: 44 22 00 04 be r1,r2,8007f3c <_Scheduler_CBS_Budget_callout+0x34><== NEVER TAKEN
_Thread_Change_priority(the_thread, new_priority, true);
8007f30: b9 60 08 00 mv r1,r11
8007f34: 34 03 00 01 mvi r3,1
8007f38: f8 00 01 a8 calli 80085d8 <_Thread_Change_priority>
/* Invoke callback function if any. */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
8007f3c: 29 6b 00 88 lw r11,(r11+136)
if ( sched_info->cbs_server->cbs_budget_overrun ) {
8007f40: 29 61 00 18 lw r1,(r11+24)
8007f44: 28 22 00 0c lw r2,(r1+12)
8007f48: 44 40 00 08 be r2,r0,8007f68 <_Scheduler_CBS_Budget_callout+0x60><== NEVER TAKEN
_Scheduler_CBS_Get_server_id(
8007f4c: 28 21 00 00 lw r1,(r1+0)
8007f50: 37 82 00 0c addi r2,sp,12
8007f54: fb ff ff d9 calli 8007eb8 <_Scheduler_CBS_Get_server_id>
sched_info->cbs_server->task_id,
&server_id
);
sched_info->cbs_server->cbs_budget_overrun( server_id );
8007f58: 29 61 00 18 lw r1,(r11+24)
8007f5c: 28 22 00 0c lw r2,(r1+12)
8007f60: 2b 81 00 0c lw r1,(sp+12)
8007f64: d8 40 00 00 call r2
}
}
8007f68: 2b 9d 00 04 lw ra,(sp+4)
8007f6c: 2b 8b 00 08 lw r11,(sp+8)
8007f70: 37 9c 00 0c addi sp,sp,12
8007f74: c3 a0 00 00 ret
080079d8 <_Scheduler_CBS_Create_server>:
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
80079d8: 37 9c ff e8 addi sp,sp,-24
80079dc: 5b 8b 00 18 sw (sp+24),r11
80079e0: 5b 8c 00 14 sw (sp+20),r12
80079e4: 5b 8d 00 10 sw (sp+16),r13
80079e8: 5b 8e 00 0c sw (sp+12),r14
80079ec: 5b 8f 00 08 sw (sp+8),r15
80079f0: 5b 9d 00 04 sw (sp+4),ra
80079f4: b8 20 58 00 mv r11,r1
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
80079f8: 28 21 00 04 lw r1,(r1+4)
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
80079fc: b8 40 70 00 mv r14,r2
8007a00: b8 60 68 00 mv r13,r3
if ( params->budget <= 0 ||
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
8007a04: 34 04 ff ee mvi r4,-18
)
{
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
8007a08: 4c 01 00 2c bge r0,r1,8007ab8 <_Scheduler_CBS_Create_server+0xe0>
8007a0c: 29 61 00 00 lw r1,(r11+0)
8007a10: 4c 01 00 2a bge r0,r1,8007ab8 <_Scheduler_CBS_Create_server+0xe0>
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
8007a14: 78 01 08 02 mvhi r1,0x802
8007a18: 38 21 30 18 ori r1,r1,0x3018
8007a1c: 28 23 00 00 lw r3,(r1+0)
8007a20: 78 01 08 02 mvhi r1,0x802
8007a24: 38 21 3e e8 ori r1,r1,0x3ee8
8007a28: 28 24 00 00 lw r4,(r1+0)
if ( !_Scheduler_CBS_Server_list[i] )
8007a2c: 34 01 00 00 mvi r1,0
8007a30: e0 00 00 05 bi 8007a44 <_Scheduler_CBS_Create_server+0x6c>
8007a34: 28 82 00 00 lw r2,(r4+0)
8007a38: 34 84 00 04 addi r4,r4,4
8007a3c: 44 40 00 03 be r2,r0,8007a48 <_Scheduler_CBS_Create_server+0x70>
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
8007a40: 34 21 00 01 addi r1,r1,1
8007a44: 54 61 ff fc bgu r3,r1,8007a34 <_Scheduler_CBS_Create_server+0x5c>
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
8007a48: 34 04 ff e6 mvi r4,-26
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
8007a4c: 44 23 00 1b be r1,r3,8007ab8 <_Scheduler_CBS_Create_server+0xe0>
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
8007a50: 78 0c 08 02 mvhi r12,0x802
8007a54: 34 02 00 02 mvi r2,2
8007a58: 39 8c 3e e8 ori r12,r12,0x3ee8
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
8007a5c: 59 a1 00 00 sw (r13+0),r1
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
8007a60: fb ff e7 4f calli 800179c <__ashlsi3>
8007a64: 29 8f 00 00 lw r15,(r12+0)
8007a68: b5 e1 78 00 add r15,r15,r1
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
8007a6c: 34 01 00 10 mvi r1,16
8007a70: f8 00 09 15 calli 8009ec4 <_Workspace_Allocate>
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
8007a74: 59 e1 00 00 sw (r15+0),r1
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
8007a78: 29 a1 00 00 lw r1,(r13+0)
8007a7c: 29 8c 00 00 lw r12,(r12+0)
8007a80: 34 02 00 02 mvi r2,2
8007a84: fb ff e7 46 calli 800179c <__ashlsi3>
8007a88: b5 81 08 00 add r1,r12,r1
8007a8c: 28 21 00 00 lw r1,(r1+0)
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
8007a90: 34 04 ff ef mvi r4,-17
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
8007a94: 44 20 00 09 be r1,r0,8007ab8 <_Scheduler_CBS_Create_server+0xe0><== NEVER TAKEN
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
8007a98: 29 62 00 00 lw r2,(r11+0)
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
8007a9c: 34 04 00 00 mvi r4,0
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
8007aa0: 58 22 00 04 sw (r1+4),r2
8007aa4: 29 62 00 04 lw r2,(r11+4)
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
8007aa8: 58 2e 00 0c sw (r1+12),r14
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
8007aac: 58 22 00 08 sw (r1+8),r2
the_server->task_id = -1;
8007ab0: 34 02 ff ff mvi r2,-1
8007ab4: 58 22 00 00 sw (r1+0),r2
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
8007ab8: b8 80 08 00 mv r1,r4
8007abc: 2b 9d 00 04 lw ra,(sp+4)
8007ac0: 2b 8b 00 18 lw r11,(sp+24)
8007ac4: 2b 8c 00 14 lw r12,(sp+20)
8007ac8: 2b 8d 00 10 lw r13,(sp+16)
8007acc: 2b 8e 00 0c lw r14,(sp+12)
8007ad0: 2b 8f 00 08 lw r15,(sp+8)
8007ad4: 37 9c 00 18 addi sp,sp,24
8007ad8: c3 a0 00 00 ret
08007b8c <_Scheduler_CBS_Detach_thread>:
int _Scheduler_CBS_Detach_thread (
Scheduler_CBS_Server_id server_id,
rtems_id task_id
)
{
8007b8c: 37 9c ff e8 addi sp,sp,-24
8007b90: 5b 8b 00 14 sw (sp+20),r11
8007b94: 5b 8c 00 10 sw (sp+16),r12
8007b98: 5b 8d 00 0c sw (sp+12),r13
8007b9c: 5b 8e 00 08 sw (sp+8),r14
8007ba0: 5b 9d 00 04 sw (sp+4),ra
8007ba4: b8 20 68 00 mv r13,r1
8007ba8: b8 40 60 00 mv r12,r2
Objects_Locations location;
Thread_Control *the_thread;
Scheduler_CBS_Per_thread *sched_info;
the_thread = _Thread_Get(task_id, &location);
8007bac: b8 40 08 00 mv r1,r2
8007bb0: 37 82 00 18 addi r2,sp,24
8007bb4: f8 00 03 f8 calli 8008b94 <_Thread_Get>
8007bb8: b8 20 58 00 mv r11,r1
/* The routine _Thread_Get may disable dispatch and not enable again. */
if ( the_thread ) {
8007bbc: 44 20 00 02 be r1,r0,8007bc4 <_Scheduler_CBS_Detach_thread+0x38>
_Thread_Enable_dispatch();
8007bc0: f8 00 03 e9 calli 8008b64 <_Thread_Enable_dispatch>
}
if ( server_id >= _Scheduler_CBS_Maximum_servers )
8007bc4: 78 03 08 02 mvhi r3,0x802
8007bc8: 38 63 30 18 ori r3,r3,0x3018
8007bcc: 28 61 00 00 lw r1,(r3+0)
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
8007bd0: 34 03 ff ee mvi r3,-18
/* The routine _Thread_Get may disable dispatch and not enable again. */
if ( the_thread ) {
_Thread_Enable_dispatch();
}
if ( server_id >= _Scheduler_CBS_Maximum_servers )
8007bd4: 51 a1 00 1a bgeu r13,r1,8007c3c <_Scheduler_CBS_Detach_thread+0xb0>
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
if ( !the_thread )
8007bd8: 45 60 00 19 be r11,r0,8007c3c <_Scheduler_CBS_Detach_thread+0xb0>
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
8007bdc: 78 03 08 02 mvhi r3,0x802
8007be0: 38 63 3e e8 ori r3,r3,0x3ee8
8007be4: 28 6e 00 00 lw r14,(r3+0)
8007be8: b9 a0 08 00 mv r1,r13
8007bec: 34 02 00 02 mvi r2,2
8007bf0: fb ff e6 eb calli 800179c <__ashlsi3>
8007bf4: b5 c1 08 00 add r1,r14,r1
8007bf8: 28 24 00 00 lw r4,(r1+0)
return SCHEDULER_CBS_ERROR_NOSERVER;
8007bfc: 34 03 ff e7 mvi r3,-25
if ( server_id >= _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
if ( !the_thread )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
8007c00: 44 80 00 0f be r4,r0,8007c3c <_Scheduler_CBS_Detach_thread+0xb0>
return SCHEDULER_CBS_ERROR_NOSERVER;
/* Thread and server are not attached. */
if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
8007c04: 28 81 00 00 lw r1,(r4+0)
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
8007c08: 34 03 ff ee mvi r3,-18
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
return SCHEDULER_CBS_ERROR_NOSERVER;
/* Thread and server are not attached. */
if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
8007c0c: 5c 2c 00 0c bne r1,r12,8007c3c <_Scheduler_CBS_Detach_thread+0xb0><== NEVER TAKEN
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
_Scheduler_CBS_Server_list[server_id]->task_id = -1;
8007c10: 34 01 ff ff mvi r1,-1
8007c14: 58 81 00 00 sw (r4+0),r1
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
sched_info->cbs_server = NULL;
8007c18: 29 61 00 88 lw r1,(r11+136)
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
the_thread->budget_callout = the_thread->Start.budget_callout;
the_thread->is_preemptible = the_thread->Start.is_preemptible;
return SCHEDULER_CBS_OK;
8007c1c: 34 03 00 00 mvi r3,0
if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
_Scheduler_CBS_Server_list[server_id]->task_id = -1;
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
sched_info->cbs_server = NULL;
8007c20: 58 20 00 18 sw (r1+24),r0
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
8007c24: 29 61 00 a0 lw r1,(r11+160)
8007c28: 59 61 00 78 sw (r11+120),r1
the_thread->budget_callout = the_thread->Start.budget_callout;
8007c2c: 29 61 00 a4 lw r1,(r11+164)
8007c30: 59 61 00 7c sw (r11+124),r1
the_thread->is_preemptible = the_thread->Start.is_preemptible;
8007c34: 41 61 00 9c lbu r1,(r11+156)
8007c38: 31 61 00 70 sb (r11+112),r1
return SCHEDULER_CBS_OK;
}
8007c3c: b8 60 08 00 mv r1,r3
8007c40: 2b 9d 00 04 lw ra,(sp+4)
8007c44: 2b 8b 00 14 lw r11,(sp+20)
8007c48: 2b 8c 00 10 lw r12,(sp+16)
8007c4c: 2b 8d 00 0c lw r13,(sp+12)
8007c50: 2b 8e 00 08 lw r14,(sp+8)
8007c54: 37 9c 00 18 addi sp,sp,24
8007c58: c3 a0 00 00 ret
08007f78 <_Scheduler_CBS_Initialize>:
int _Scheduler_CBS_Initialize(void)
{
8007f78: 37 9c ff f8 addi sp,sp,-8
8007f7c: 5b 8b 00 08 sw (sp+8),r11
8007f80: 5b 9d 00 04 sw (sp+4),ra
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
8007f84: 78 0b 08 02 mvhi r11,0x802
8007f88: 39 6b 30 18 ori r11,r11,0x3018
8007f8c: 29 61 00 00 lw r1,(r11+0)
8007f90: 34 02 00 02 mvi r2,2
8007f94: fb ff e6 02 calli 800179c <__ashlsi3>
}
int _Scheduler_CBS_Initialize(void)
{
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
8007f98: f8 00 07 cb calli 8009ec4 <_Workspace_Allocate>
8007f9c: 78 02 08 02 mvhi r2,0x802
8007fa0: 38 42 3e e8 ori r2,r2,0x3ee8
8007fa4: 58 41 00 00 sw (r2+0),r1
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
8007fa8: 34 02 ff ef mvi r2,-17
int _Scheduler_CBS_Initialize(void)
{
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
8007fac: 44 20 00 09 be r1,r0,8007fd0 <_Scheduler_CBS_Initialize+0x58><== NEVER TAKEN
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
8007fb0: 29 63 00 00 lw r3,(r11+0)
8007fb4: 34 02 00 00 mvi r2,0
8007fb8: e0 00 00 04 bi 8007fc8 <_Scheduler_CBS_Initialize+0x50>
_Scheduler_CBS_Server_list[i] = NULL;
8007fbc: 58 20 00 00 sw (r1+0),r0
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
8007fc0: 34 42 00 01 addi r2,r2,1
8007fc4: 34 21 00 04 addi r1,r1,4
8007fc8: 54 62 ff fd bgu r3,r2,8007fbc <_Scheduler_CBS_Initialize+0x44>
_Scheduler_CBS_Server_list[i] = NULL;
}
return SCHEDULER_CBS_OK;
8007fcc: 34 02 00 00 mvi r2,0
}
8007fd0: b8 40 08 00 mv r1,r2
8007fd4: 2b 9d 00 04 lw ra,(sp+4)
8007fd8: 2b 8b 00 08 lw r11,(sp+8)
8007fdc: 37 9c 00 08 addi sp,sp,8
8007fe0: c3 a0 00 00 ret
080067bc <_Scheduler_CBS_Release_job>:
void _Scheduler_CBS_Release_job(
Thread_Control *the_thread,
uint32_t deadline
)
{
80067bc: 37 9c ff fc addi sp,sp,-4
80067c0: 5b 9d 00 04 sw (sp+4),ra
80067c4: b8 40 20 00 mv r4,r2
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info =
(Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
Scheduler_CBS_Server *serv_info =
(Scheduler_CBS_Server *) sched_info->cbs_server;
80067c8: 28 22 00 88 lw r2,(r1+136)
)
{
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info =
(Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
Scheduler_CBS_Server *serv_info =
80067cc: 28 43 00 18 lw r3,(r2+24)
(Scheduler_CBS_Server *) sched_info->cbs_server;
if (deadline) {
80067d0: 44 80 00 13 be r4,r0,800681c <_Scheduler_CBS_Release_job+0x60>
80067d4: 78 02 08 02 mvhi r2,0x802
80067d8: 38 42 1a c8 ori r2,r2,0x1ac8
/* Initializing or shifting deadline. */
if (serv_info)
80067dc: 44 60 00 09 be r3,r0,8006800 <_Scheduler_CBS_Release_job+0x44>
new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline)
80067e0: 28 64 00 04 lw r4,(r3+4)
80067e4: 28 42 00 00 lw r2,(r2+0)
80067e8: 78 05 08 01 mvhi r5,0x801
80067ec: 38 a5 f1 a4 ori r5,r5,0xf1a4
80067f0: b4 44 10 00 add r2,r2,r4
80067f4: 28 a4 00 00 lw r4,(r5+0)
80067f8: a0 44 10 00 and r2,r2,r4
80067fc: e0 00 00 0a bi 8006824 <_Scheduler_CBS_Release_job+0x68>
& ~SCHEDULER_EDF_PRIO_MSB;
else
new_priority = (_Watchdog_Ticks_since_boot + deadline)
8006800: 28 42 00 00 lw r2,(r2+0)
8006804: b4 82 10 00 add r2,r4,r2
8006808: 78 04 08 01 mvhi r4,0x801
800680c: 38 84 f1 a4 ori r4,r4,0xf1a4
8006810: 28 83 00 00 lw r3,(r4+0)
8006814: a0 43 10 00 and r2,r2,r3
8006818: e0 00 00 05 bi 800682c <_Scheduler_CBS_Release_job+0x70>
& ~SCHEDULER_EDF_PRIO_MSB;
}
else {
/* Switch back to background priority. */
new_priority = the_thread->Start.initial_priority;
800681c: 28 22 00 ac lw r2,(r1+172)
}
/* Budget replenishment for the next job. */
if (serv_info)
8006820: 44 64 00 03 be r3,r4,800682c <_Scheduler_CBS_Release_job+0x70><== NEVER TAKEN
the_thread->cpu_time_budget = serv_info->parameters.budget;
8006824: 28 63 00 08 lw r3,(r3+8)
8006828: 58 23 00 74 sw (r1+116),r3
the_thread->real_priority = new_priority;
800682c: 58 22 00 18 sw (r1+24),r2
_Thread_Change_priority(the_thread, new_priority, true);
8006830: 34 03 00 01 mvi r3,1
8006834: f8 00 01 3c calli 8006d24 <_Thread_Change_priority>
}
8006838: 2b 9d 00 04 lw ra,(sp+4)
800683c: 37 9c 00 04 addi sp,sp,4
8006840: c3 a0 00 00 ret
08006844 <_Scheduler_CBS_Unblock>:
#include <rtems/score/schedulercbs.h>
void _Scheduler_CBS_Unblock(
Thread_Control *the_thread
)
{
8006844: 37 9c ff ec addi sp,sp,-20
8006848: 5b 8b 00 14 sw (sp+20),r11
800684c: 5b 8c 00 10 sw (sp+16),r12
8006850: 5b 8d 00 0c sw (sp+12),r13
8006854: 5b 8e 00 08 sw (sp+8),r14
8006858: 5b 9d 00 04 sw (sp+4),ra
800685c: b8 20 58 00 mv r11,r1
Scheduler_CBS_Per_thread *sched_info;
Scheduler_CBS_Server *serv_info;
Priority_Control new_priority;
_Scheduler_EDF_Enqueue(the_thread);
8006860: f8 00 00 4d calli 8006994 <_Scheduler_EDF_Enqueue>
/* TODO: flash critical section? */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server;
8006864: 29 61 00 88 lw r1,(r11+136)
8006868: 28 2c 00 18 lw r12,(r1+24)
* Late unblock rule for deadline-driven tasks. The remaining time to
* deadline must be sufficient to serve the remaining computation time
* without increased utilization of this task. It might cause a deadline
* miss of another task.
*/
if (serv_info) {
800686c: 45 80 00 15 be r12,r0,80068c0 <_Scheduler_CBS_Unblock+0x7c>
time_t deadline = serv_info->parameters.deadline;
time_t budget = serv_info->parameters.budget;
time_t deadline_left = the_thread->cpu_time_budget;
time_t budget_left = the_thread->real_priority -
8006870: 78 01 08 02 mvhi r1,0x802
8006874: 38 21 1a c8 ori r1,r1,0x1ac8
8006878: 28 21 00 00 lw r1,(r1+0)
800687c: 29 6d 00 18 lw r13,(r11+24)
_Watchdog_Ticks_since_boot;
if ( deadline*budget_left > budget*deadline_left ) {
8006880: 29 82 00 04 lw r2,(r12+4)
8006884: c9 a1 08 00 sub r1,r13,r1
8006888: fb ff e8 d2 calli 8000bd0 <__mulsi3>
800688c: b8 20 70 00 mv r14,r1
8006890: 29 82 00 08 lw r2,(r12+8)
8006894: 29 61 00 74 lw r1,(r11+116)
8006898: fb ff e8 ce calli 8000bd0 <__mulsi3>
800689c: 4c 2e 00 09 bge r1,r14,80068c0 <_Scheduler_CBS_Unblock+0x7c>
/* Put late unblocked task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
80068a0: 29 62 00 ac lw r2,(r11+172)
if ( the_thread->real_priority != new_priority )
80068a4: 45 a2 00 02 be r13,r2,80068ac <_Scheduler_CBS_Unblock+0x68>
the_thread->real_priority = new_priority;
80068a8: 59 62 00 18 sw (r11+24),r2
if ( the_thread->current_priority != new_priority )
80068ac: 29 61 00 14 lw r1,(r11+20)
80068b0: 44 22 00 04 be r1,r2,80068c0 <_Scheduler_CBS_Unblock+0x7c>
_Thread_Change_priority(the_thread, new_priority, true);
80068b4: b9 60 08 00 mv r1,r11
80068b8: 34 03 00 01 mvi r3,1
80068bc: f8 00 01 1a calli 8006d24 <_Thread_Change_priority>
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
80068c0: 78 0c 08 02 mvhi r12,0x802
80068c4: 39 8c 1e 80 ori r12,r12,0x1e80
80068c8: 29 82 00 14 lw r2,(r12+20)
80068cc: 78 01 08 02 mvhi r1,0x802
80068d0: 38 21 10 1c ori r1,r1,0x101c
80068d4: 28 23 00 30 lw r3,(r1+48)
80068d8: 28 42 00 14 lw r2,(r2+20)
80068dc: 29 61 00 14 lw r1,(r11+20)
80068e0: d8 60 00 00 call r3
80068e4: 4c 01 00 0b bge r0,r1,8006910 <_Scheduler_CBS_Unblock+0xcc>
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
80068e8: 29 81 00 10 lw r1,(r12+16)
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
80068ec: 59 8b 00 14 sw (r12+20),r11
if ( _Thread_Executing->is_preemptible ||
80068f0: 40 21 00 70 lbu r1,(r1+112)
80068f4: 5c 20 00 03 bne r1,r0,8006900 <_Scheduler_CBS_Unblock+0xbc>
80068f8: 29 62 00 14 lw r2,(r11+20)
80068fc: 5c 41 00 05 bne r2,r1,8006910 <_Scheduler_CBS_Unblock+0xcc><== ALWAYS TAKEN
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
8006900: 78 01 08 02 mvhi r1,0x802
8006904: 38 21 1e 80 ori r1,r1,0x1e80
8006908: 34 02 00 01 mvi r2,1
800690c: 30 22 00 0c sb (r1+12),r2
}
}
8006910: 2b 9d 00 04 lw ra,(sp+4)
8006914: 2b 8b 00 14 lw r11,(sp+20)
8006918: 2b 8c 00 10 lw r12,(sp+16)
800691c: 2b 8d 00 0c lw r13,(sp+12)
8006920: 2b 8e 00 08 lw r14,(sp+8)
8006924: 37 9c 00 14 addi sp,sp,20
8006928: c3 a0 00 00 ret
0800677c <_Scheduler_EDF_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_EDF_Allocate(
Thread_Control *the_thread
)
{
800677c: 37 9c ff f8 addi sp,sp,-8
8006780: 5b 8b 00 08 sw (sp+8),r11
8006784: 5b 9d 00 04 sw (sp+4),ra
8006788: b8 20 58 00 mv r11,r1
void *sched;
Scheduler_EDF_Per_thread *schinfo;
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
800678c: 34 01 00 18 mvi r1,24
8006790: f8 00 07 95 calli 80085e4 <_Workspace_Allocate>
if ( sched ) {
8006794: 44 20 00 05 be r1,r0,80067a8 <_Scheduler_EDF_Allocate+0x2c><== NEVER TAKEN
the_thread->scheduler_info = sched;
8006798: 59 61 00 88 sw (r11+136),r1
schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info);
schinfo->thread = the_thread;
schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
800679c: 34 02 00 02 mvi r2,2
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
if ( sched ) {
the_thread->scheduler_info = sched;
schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info);
schinfo->thread = the_thread;
80067a0: 58 2b 00 00 sw (r1+0),r11
schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
80067a4: 58 22 00 14 sw (r1+20),r2
}
return sched;
}
80067a8: 2b 9d 00 04 lw ra,(sp+4)
80067ac: 2b 8b 00 08 lw r11,(sp+8)
80067b0: 37 9c 00 08 addi sp,sp,8
80067b4: c3 a0 00 00 ret
080069c4 <_Scheduler_EDF_Unblock>:
#include <rtems/score/scheduleredf.h>
void _Scheduler_EDF_Unblock(
Thread_Control *the_thread
)
{
80069c4: 37 9c ff f4 addi sp,sp,-12
80069c8: 5b 8b 00 0c sw (sp+12),r11
80069cc: 5b 8c 00 08 sw (sp+8),r12
80069d0: 5b 9d 00 04 sw (sp+4),ra
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
80069d4: 78 0b 08 02 mvhi r11,0x802
#include <rtems/score/scheduleredf.h>
void _Scheduler_EDF_Unblock(
Thread_Control *the_thread
)
{
80069d8: b8 20 60 00 mv r12,r1
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
80069dc: 39 6b 1e 80 ori r11,r11,0x1e80
void _Scheduler_EDF_Unblock(
Thread_Control *the_thread
)
{
_Scheduler_EDF_Enqueue(the_thread);
80069e0: fb ff ff 90 calli 8006820 <_Scheduler_EDF_Enqueue>
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
80069e4: 29 62 00 14 lw r2,(r11+20)
80069e8: 78 01 08 02 mvhi r1,0x802
80069ec: 38 21 10 18 ori r1,r1,0x1018
80069f0: 28 23 00 30 lw r3,(r1+48)
80069f4: 28 41 00 14 lw r1,(r2+20)
80069f8: 29 82 00 14 lw r2,(r12+20)
80069fc: d8 60 00 00 call r3
8006a00: 4c 20 00 0b bge r1,r0,8006a2c <_Scheduler_EDF_Unblock+0x68>
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
8006a04: 29 61 00 10 lw r1,(r11+16)
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
8006a08: 59 6c 00 14 sw (r11+20),r12
if ( _Thread_Executing->is_preemptible ||
8006a0c: 40 21 00 70 lbu r1,(r1+112)
8006a10: 5c 20 00 03 bne r1,r0,8006a1c <_Scheduler_EDF_Unblock+0x58>
8006a14: 29 82 00 14 lw r2,(r12+20)
8006a18: 5c 41 00 05 bne r2,r1,8006a2c <_Scheduler_EDF_Unblock+0x68><== ALWAYS TAKEN
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
8006a1c: 78 01 08 02 mvhi r1,0x802
8006a20: 38 21 1e 80 ori r1,r1,0x1e80
8006a24: 34 02 00 01 mvi r2,1
8006a28: 30 22 00 0c sb (r1+12),r2
}
}
8006a2c: 2b 9d 00 04 lw ra,(sp+4)
8006a30: 2b 8b 00 0c lw r11,(sp+12)
8006a34: 2b 8c 00 08 lw r12,(sp+8)
8006a38: 37 9c 00 0c addi sp,sp,12
8006a3c: c3 a0 00 00 ret
08007070 <_Scheduler_priority_Block>:
#include <rtems/score/thread.h>
void _Scheduler_priority_Block(
Thread_Control *the_thread
)
{
8007070: 37 9c ff ec addi sp,sp,-20
8007074: 5b 8b 00 14 sw (sp+20),r11
8007078: 5b 8c 00 10 sw (sp+16),r12
800707c: 5b 8d 00 0c sw (sp+12),r13
8007080: 5b 8e 00 08 sw (sp+8),r14
8007084: 5b 9d 00 04 sw (sp+4),ra
8007088: 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;
800708c: 28 21 00 88 lw r1,(r1+136)
ready = sched_info->ready_chain;
8007090: 28 22 00 00 lw r2,(r1+0)
if ( _Chain_Has_only_one_node( ready ) ) {
8007094: 28 44 00 00 lw r4,(r2+0)
8007098: 28 43 00 08 lw r3,(r2+8)
800709c: 5c 83 00 12 bne r4,r3,80070e4 <_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 );
80070a0: 34 43 00 04 addi r3,r2,4
head->next = tail;
80070a4: 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;
80070a8: 28 23 00 04 lw r3,(r1+4)
head->previous = NULL;
80070ac: 58 40 00 04 sw (r2+4),r0
tail->previous = head;
80070b0: 58 42 00 08 sw (r2+8),r2
80070b4: 2c 24 00 0e lhu r4,(r1+14)
80070b8: 2c 62 00 00 lhu r2,(r3+0)
80070bc: a0 44 10 00 and r2,r2,r4
80070c0: 0c 62 00 00 sh (r3+0),r2
if ( *the_priority_map->minor == 0 )
80070c4: 5c 40 00 0c bne r2,r0,80070f4 <_Scheduler_priority_Block+0x84>
_Priority_Major_bit_map &= the_priority_map->block_major;
80070c8: 78 02 08 01 mvhi r2,0x801
80070cc: 38 42 ae 40 ori r2,r2,0xae40
80070d0: 2c 43 00 00 lhu r3,(r2+0)
80070d4: 2c 21 00 0c lhu r1,(r1+12)
80070d8: a0 23 08 00 and r1,r1,r3
80070dc: 0c 41 00 00 sh (r2+0),r1
80070e0: e0 00 00 05 bi 80070f4 <_Scheduler_priority_Block+0x84>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
80070e4: 29 82 00 00 lw r2,(r12+0)
previous = the_node->previous;
80070e8: 29 81 00 04 lw r1,(r12+4)
next->previous = previous;
80070ec: 58 41 00 04 sw (r2+4),r1
previous->next = next;
80070f0: 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 );
80070f4: 78 01 08 01 mvhi r1,0x801
80070f8: 38 21 ae 00 ori r1,r1,0xae00
_Scheduler_priority_Ready_queue_extract( the_thread );
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
80070fc: 28 21 00 14 lw r1,(r1+20)
8007100: 5d 81 00 3b bne r12,r1,80071ec <_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
8007104: 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 );
8007108: 78 02 08 01 mvhi r2,0x801
800710c: 38 21 a0 18 ori r1,r1,0xa018
8007110: 38 42 ae 40 ori r2,r2,0xae40
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8007114: 28 2e 00 00 lw r14,(r1+0)
8007118: 2c 41 00 00 lhu r1,(r2+0)
800711c: 78 0b 08 01 mvhi r11,0x801
8007120: 34 02 00 ff mvi r2,255
8007124: 20 21 ff ff andi r1,r1,0xffff
8007128: 39 6b 8b 3c ori r11,r11,0x8b3c
800712c: 54 22 00 05 bgu r1,r2,8007140 <_Scheduler_priority_Block+0xd0>
8007130: b5 61 58 00 add r11,r11,r1
8007134: 41 6d 00 00 lbu r13,(r11+0)
8007138: 35 ad 00 08 addi r13,r13,8
800713c: e0 00 00 05 bi 8007150 <_Scheduler_priority_Block+0xe0>
8007140: 34 02 00 08 mvi r2,8
8007144: f8 00 42 4d calli 8017a78 <__lshrsi3>
8007148: b5 61 58 00 add r11,r11,r1
800714c: 41 6d 00 00 lbu r13,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
8007150: 34 02 00 01 mvi r2,1
8007154: 78 0b 08 01 mvhi r11,0x801
8007158: b9 a0 08 00 mv r1,r13
800715c: f8 00 41 f9 calli 8017940 <__ashlsi3>
8007160: 39 6b ae 60 ori r11,r11,0xae60
8007164: b5 61 58 00 add r11,r11,r1
8007168: 2d 62 00 00 lhu r2,(r11+0)
800716c: 34 01 00 ff mvi r1,255
8007170: 78 0b 08 01 mvhi r11,0x801
8007174: 39 6b 8b 3c ori r11,r11,0x8b3c
8007178: 54 41 00 05 bgu r2,r1,800718c <_Scheduler_priority_Block+0x11c>
800717c: b5 62 58 00 add r11,r11,r2
8007180: 41 6b 00 00 lbu r11,(r11+0)
8007184: 35 6b 00 08 addi r11,r11,8
8007188: e0 00 00 06 bi 80071a0 <_Scheduler_priority_Block+0x130>
800718c: b8 40 08 00 mv r1,r2
8007190: 34 02 00 08 mvi r2,8
8007194: f8 00 42 39 calli 8017a78 <__lshrsi3>
8007198: b5 61 58 00 add r11,r11,r1
800719c: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
80071a0: 34 02 00 04 mvi r2,4
80071a4: b9 a0 08 00 mv r1,r13
80071a8: f8 00 41 e6 calli 8017940 <__ashlsi3>
80071ac: 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 ] ) )
80071b0: 34 02 00 01 mvi r2,1
80071b4: b9 60 08 00 mv r1,r11
80071b8: f8 00 41 e2 calli 8017940 <__ashlsi3>
80071bc: 34 02 00 02 mvi r2,2
80071c0: b4 2b 08 00 add r1,r1,r11
80071c4: f8 00 41 df calli 8017940 <__ashlsi3>
80071c8: b5 c1 08 00 add r1,r14,r1
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
80071cc: 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 );
80071d0: 34 21 00 04 addi r1,r1,4
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
80071d4: 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 ] ) )
80071d8: 44 61 00 02 be r3,r1,80071e0 <_Scheduler_priority_Block+0x170><== NEVER TAKEN
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
80071dc: 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(
80071e0: 78 01 08 01 mvhi r1,0x801
80071e4: 38 21 ae 00 ori r1,r1,0xae00
80071e8: 58 22 00 14 sw (r1+20),r2
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
80071ec: 78 01 08 01 mvhi r1,0x801
80071f0: 38 21 ae 00 ori r1,r1,0xae00
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
80071f4: 28 22 00 10 lw r2,(r1+16)
80071f8: 5d 82 00 03 bne r12,r2,8007204 <_Scheduler_priority_Block+0x194>
_Thread_Dispatch_necessary = true;
80071fc: 34 02 00 01 mvi r2,1
8007200: 30 22 00 0c sb (r1+12),r2
}
8007204: 2b 9d 00 04 lw ra,(sp+4)
8007208: 2b 8b 00 14 lw r11,(sp+20)
800720c: 2b 8c 00 10 lw r12,(sp+16)
8007210: 2b 8d 00 0c lw r13,(sp+12)
8007214: 2b 8e 00 08 lw r14,(sp+8)
8007218: 37 9c 00 14 addi sp,sp,20
800721c: c3 a0 00 00 ret
08007400 <_Scheduler_priority_Schedule>:
#include <rtems/system.h>
#include <rtems/score/scheduler.h>
#include <rtems/score/schedulerpriority.h>
void _Scheduler_priority_Schedule(void)
{
8007400: 37 9c ff f0 addi sp,sp,-16
8007404: 5b 8b 00 10 sw (sp+16),r11
8007408: 5b 8c 00 0c sw (sp+12),r12
800740c: 5b 8d 00 08 sw (sp+8),r13
8007410: 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
8007414: 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 );
8007418: 78 02 08 01 mvhi r2,0x801
800741c: 38 21 a0 18 ori r1,r1,0xa018
8007420: 38 42 ae 40 ori r2,r2,0xae40
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8007424: 28 2d 00 00 lw r13,(r1+0)
8007428: 2c 41 00 00 lhu r1,(r2+0)
800742c: 78 0b 08 01 mvhi r11,0x801
8007430: 34 02 00 ff mvi r2,255
8007434: 20 21 ff ff andi r1,r1,0xffff
8007438: 39 6b 8b 3c ori r11,r11,0x8b3c
800743c: 54 22 00 05 bgu r1,r2,8007450 <_Scheduler_priority_Schedule+0x50>
8007440: b5 61 58 00 add r11,r11,r1
8007444: 41 6c 00 00 lbu r12,(r11+0)
8007448: 35 8c 00 08 addi r12,r12,8
800744c: e0 00 00 05 bi 8007460 <_Scheduler_priority_Schedule+0x60>
8007450: 34 02 00 08 mvi r2,8
8007454: f8 00 41 89 calli 8017a78 <__lshrsi3>
8007458: b5 61 58 00 add r11,r11,r1
800745c: 41 6c 00 00 lbu r12,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
8007460: 34 02 00 01 mvi r2,1
8007464: 78 0b 08 01 mvhi r11,0x801
8007468: b9 80 08 00 mv r1,r12
800746c: f8 00 41 35 calli 8017940 <__ashlsi3>
8007470: 39 6b ae 60 ori r11,r11,0xae60
8007474: b5 61 58 00 add r11,r11,r1
8007478: 2d 62 00 00 lhu r2,(r11+0)
800747c: 34 01 00 ff mvi r1,255
8007480: 78 0b 08 01 mvhi r11,0x801
8007484: 39 6b 8b 3c ori r11,r11,0x8b3c
8007488: 54 41 00 05 bgu r2,r1,800749c <_Scheduler_priority_Schedule+0x9c>
800748c: b5 62 58 00 add r11,r11,r2
8007490: 41 6b 00 00 lbu r11,(r11+0)
8007494: 35 6b 00 08 addi r11,r11,8
8007498: e0 00 00 06 bi 80074b0 <_Scheduler_priority_Schedule+0xb0>
800749c: b8 40 08 00 mv r1,r2
80074a0: 34 02 00 08 mvi r2,8
80074a4: f8 00 41 75 calli 8017a78 <__lshrsi3>
80074a8: b5 61 58 00 add r11,r11,r1
80074ac: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
80074b0: 34 02 00 04 mvi r2,4
80074b4: b9 80 08 00 mv r1,r12
80074b8: f8 00 41 22 calli 8017940 <__ashlsi3>
80074bc: 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 ] ) )
80074c0: 34 02 00 01 mvi r2,1
80074c4: b9 60 08 00 mv r1,r11
80074c8: f8 00 41 1e calli 8017940 <__ashlsi3>
80074cc: 34 02 00 02 mvi r2,2
80074d0: b4 2b 08 00 add r1,r1,r11
80074d4: f8 00 41 1b calli 8017940 <__ashlsi3>
80074d8: b5 a1 08 00 add r1,r13,r1
_Scheduler_priority_Schedule_body();
}
80074dc: 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 );
80074e0: 34 21 00 04 addi r1,r1,4
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
80074e4: 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 ] ) )
80074e8: 44 61 00 02 be r3,r1,80074f0 <_Scheduler_priority_Schedule+0xf0><== NEVER TAKEN
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
80074ec: 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(
80074f0: 78 01 08 01 mvhi r1,0x801
80074f4: 38 21 ae 00 ori r1,r1,0xae00
80074f8: 58 22 00 14 sw (r1+20),r2
80074fc: 2b 9d 00 04 lw ra,(sp+4)
8007500: 2b 8b 00 10 lw r11,(sp+16)
8007504: 2b 8c 00 0c lw r12,(sp+12)
8007508: 2b 8d 00 08 lw r13,(sp+8)
800750c: 37 9c 00 10 addi sp,sp,16
8007510: c3 a0 00 00 ret
08007514 <_Scheduler_priority_Tick>:
#include <rtems/system.h>
#include <rtems/score/schedulerpriority.h>
void _Scheduler_priority_Tick( void )
{
8007514: 37 9c ff f8 addi sp,sp,-8
8007518: 5b 8b 00 08 sw (sp+8),r11
800751c: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *executing;
executing = _Thread_Executing;
8007520: 78 01 08 01 mvhi r1,0x801
8007524: 38 21 ae 00 ori r1,r1,0xae00
8007528: 28 2b 00 10 lw r11,(r1+16)
/*
* If the thread is not preemptible or is not ready, then
* just return.
*/
if ( !executing->is_preemptible )
800752c: 41 61 00 70 lbu r1,(r11+112)
8007530: 44 20 00 1e be r1,r0,80075a8 <_Scheduler_priority_Tick+0x94>
return;
if ( !_States_Is_ready( executing->current_state ) )
8007534: 29 61 00 10 lw r1,(r11+16)
8007538: 5c 20 00 1c bne r1,r0,80075a8 <_Scheduler_priority_Tick+0x94>
/*
* The cpu budget algorithm determines what happens next.
*/
switch ( executing->budget_algorithm ) {
800753c: 29 61 00 78 lw r1,(r11+120)
8007540: 44 20 00 1a be r1,r0,80075a8 <_Scheduler_priority_Tick+0x94>
8007544: 34 02 00 02 mvi r2,2
8007548: 50 41 00 04 bgeu r2,r1,8007558 <_Scheduler_priority_Tick+0x44>
800754c: 34 02 00 03 mvi r2,3
8007550: 5c 22 00 16 bne r1,r2,80075a8 <_Scheduler_priority_Tick+0x94><== NEVER TAKEN
8007554: e0 00 00 0e bi 800758c <_Scheduler_priority_Tick+0x78>
case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
#if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
#endif
if ( (int)(--executing->cpu_time_budget) <= 0 ) {
8007558: 29 61 00 74 lw r1,(r11+116)
800755c: 34 21 ff ff addi r1,r1,-1
8007560: 59 61 00 74 sw (r11+116),r1
8007564: 48 20 00 11 bg r1,r0,80075a8 <_Scheduler_priority_Tick+0x94>
* always operates on the scheduler that 'owns' the currently executing
* thread.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void )
{
_Scheduler.Operations.yield();
8007568: 78 01 08 01 mvhi r1,0x801
800756c: 38 21 a0 18 ori r1,r1,0xa018
8007570: 28 21 00 0c lw r1,(r1+12)
8007574: d8 20 00 00 call r1
* executing thread's timeslice is reset. Otherwise, the
* currently executing thread is placed at the rear of the
* FIFO for this priority and a new heir is selected.
*/
_Scheduler_Yield();
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
8007578: 78 01 08 01 mvhi r1,0x801
800757c: 38 21 a9 10 ori r1,r1,0xa910
8007580: 28 21 00 00 lw r1,(r1+0)
8007584: 59 61 00 74 sw (r11+116),r1
8007588: e0 00 00 08 bi 80075a8 <_Scheduler_priority_Tick+0x94>
}
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
if ( --executing->cpu_time_budget == 0 )
800758c: 29 61 00 74 lw r1,(r11+116)
8007590: 34 21 ff ff addi r1,r1,-1
8007594: 59 61 00 74 sw (r11+116),r1
8007598: 5c 20 00 04 bne r1,r0,80075a8 <_Scheduler_priority_Tick+0x94>
(*executing->budget_callout)( executing );
800759c: 29 62 00 7c lw r2,(r11+124)
80075a0: b9 60 08 00 mv r1,r11
80075a4: d8 40 00 00 call r2
break;
#endif
}
}
80075a8: 2b 9d 00 04 lw ra,(sp+4)
80075ac: 2b 8b 00 08 lw r11,(sp+8)
80075b0: 37 9c 00 08 addi sp,sp,8
80075b4: c3 a0 00 00 ret
08004c00 <_TOD_Validate>:
};
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
8004c00: 37 9c ff f0 addi sp,sp,-16
8004c04: 5b 8b 00 10 sw (sp+16),r11
8004c08: 5b 8c 00 0c sw (sp+12),r12
8004c0c: 5b 8d 00 08 sw (sp+8),r13
8004c10: 5b 9d 00 04 sw (sp+4),ra
8004c14: 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();
8004c18: 78 01 08 01 mvhi r1,0x801
8004c1c: 38 21 f0 30 ori r1,r1,0xf030
8004c20: 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;
8004c24: 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) ||
8004c28: 45 60 00 22 be r11,r0,8004cb0 <_TOD_Validate+0xb0> <== NEVER TAKEN
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
8004c2c: 78 03 08 01 mvhi r3,0x801
8004c30: 38 63 f3 b0 ori r3,r3,0xf3b0
8004c34: 28 61 00 00 lw r1,(r3+0)
8004c38: f8 00 64 49 calli 801dd5c <__udivsi3>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
8004c3c: 29 62 00 18 lw r2,(r11+24)
8004c40: 50 41 00 1c bgeu r2,r1,8004cb0 <_TOD_Validate+0xb0>
(the_tod->ticks >= ticks_per_second) ||
8004c44: 29 62 00 14 lw r2,(r11+20)
8004c48: 34 01 00 3b mvi r1,59
8004c4c: 54 41 00 19 bgu r2,r1,8004cb0 <_TOD_Validate+0xb0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
8004c50: 29 62 00 10 lw r2,(r11+16)
8004c54: 54 41 00 17 bgu r2,r1,8004cb0 <_TOD_Validate+0xb0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
8004c58: 29 62 00 0c lw r2,(r11+12)
8004c5c: 34 01 00 17 mvi r1,23
8004c60: 54 41 00 14 bgu r2,r1,8004cb0 <_TOD_Validate+0xb0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
8004c64: 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) ||
8004c68: 44 20 00 12 be r1,r0,8004cb0 <_TOD_Validate+0xb0> <== NEVER TAKEN
(the_tod->month == 0) ||
8004c6c: 34 02 00 0c mvi r2,12
8004c70: 54 22 00 10 bgu r1,r2,8004cb0 <_TOD_Validate+0xb0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
8004c74: 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) ||
8004c78: 34 03 07 c3 mvi r3,1987
8004c7c: 50 62 00 0d bgeu r3,r2,8004cb0 <_TOD_Validate+0xb0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
8004c80: 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) ||
8004c84: 45 a0 00 0b be r13,r0,8004cb0 <_TOD_Validate+0xb0> <== NEVER TAKEN
8004c88: 78 0b 08 01 mvhi r11,0x801
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
8004c8c: 20 42 00 03 andi r2,r2,0x3
8004c90: 39 6b fd 38 ori r11,r11,0xfd38
8004c94: 5c 40 00 02 bne r2,r0,8004c9c <_TOD_Validate+0x9c>
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
8004c98: 34 21 00 0d addi r1,r1,13
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
8004c9c: 34 02 00 02 mvi r2,2
8004ca0: fb ff f1 7c calli 8001290 <__ashlsi3>
8004ca4: b5 61 08 00 add r1,r11,r1
8004ca8: 28 2c 00 00 lw r12,(r1+0)
const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = {
{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
{ 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
};
bool _TOD_Validate(
8004cac: f1 8d 60 00 cmpgeu r12,r12,r13
if ( the_tod->day > days_in_month )
return false;
return true;
}
8004cb0: b9 80 08 00 mv r1,r12
8004cb4: 2b 9d 00 04 lw ra,(sp+4)
8004cb8: 2b 8b 00 10 lw r11,(sp+16)
8004cbc: 2b 8c 00 0c lw r12,(sp+12)
8004cc0: 2b 8d 00 08 lw r13,(sp+8)
8004cc4: 37 9c 00 10 addi sp,sp,16
8004cc8: c3 a0 00 00 ret
080077b0 <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
80077b0: 37 9c ff e8 addi sp,sp,-24
80077b4: 5b 8b 00 18 sw (sp+24),r11
80077b8: 5b 8c 00 14 sw (sp+20),r12
80077bc: 5b 8d 00 10 sw (sp+16),r13
80077c0: 5b 8e 00 0c sw (sp+12),r14
80077c4: 5b 8f 00 08 sw (sp+8),r15
80077c8: 5b 9d 00 04 sw (sp+4),ra
80077cc: b8 20 58 00 mv r11,r1
States_Control state, original_state;
/*
* Save original state
*/
original_state = the_thread->current_state;
80077d0: 28 2f 00 10 lw r15,(r1+16)
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
80077d4: b8 40 60 00 mv r12,r2
80077d8: 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 );
80077dc: f8 00 03 42 calli 80084e4 <_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 )
80077e0: 29 61 00 14 lw r1,(r11+20)
80077e4: 44 2c 00 04 be r1,r12,80077f4 <_Thread_Change_priority+0x44>
_Thread_Set_priority( the_thread, new_priority );
80077e8: b9 60 08 00 mv r1,r11
80077ec: b9 80 10 00 mv r2,r12
80077f0: f8 00 03 1d calli 8008464 <_Thread_Set_priority>
_ISR_Disable( level );
80077f4: 90 00 60 00 rcsr r12,IE
80077f8: 34 0d ff fe mvi r13,-2
80077fc: a1 8d 68 00 and r13,r12,r13
8007800: 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;
8007804: 29 61 00 10 lw r1,(r11+16)
if ( state != STATES_TRANSIENT ) {
8007808: 34 03 00 04 mvi r3,4
800780c: 21 e2 00 04 andi r2,r15,0x4
8007810: 44 23 00 0f be r1,r3,800784c <_Thread_Change_priority+0x9c>
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
8007814: 5c 40 00 04 bne r2,r0,8007824 <_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);
8007818: 34 02 ff fb mvi r2,-5
800781c: a0 22 10 00 and r2,r1,r2
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
8007820: 59 62 00 10 sw (r11+16),r2
_ISR_Enable( level );
8007824: 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);
8007828: 78 03 08 01 mvhi r3,0x801
800782c: 38 63 8c 8c ori r3,r3,0x8c8c
8007830: 28 62 00 00 lw r2,(r3+0)
8007834: a0 22 08 00 and r1,r1,r2
if ( _States_Is_waiting_on_thread_queue( state ) ) {
8007838: 44 20 00 1f be r1,r0,80078b4 <_Thread_Change_priority+0x104>
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
800783c: 29 61 00 44 lw r1,(r11+68)
8007840: b9 60 10 00 mv r2,r11
8007844: f8 00 02 d3 calli 8008390 <_Thread_queue_Requeue>
8007848: e0 00 00 1b bi 80078b4 <_Thread_Change_priority+0x104>
}
return;
}
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) ) {
800784c: 5c 40 00 0a bne r2,r0,8007874 <_Thread_Change_priority+0xc4><== NEVER TAKEN
8007850: 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 );
8007854: 59 60 00 10 sw (r11+16),r0
8007858: 38 21 a0 18 ori r1,r1,0xa018
if ( prepend_it )
800785c: 45 c2 00 03 be r14,r2,8007868 <_Thread_Change_priority+0xb8>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue_first( the_thread );
8007860: 28 22 00 28 lw r2,(r1+40)
8007864: e0 00 00 02 bi 800786c <_Thread_Change_priority+0xbc>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue( the_thread );
8007868: 28 22 00 24 lw r2,(r1+36)
800786c: b9 60 08 00 mv r1,r11
8007870: d8 40 00 00 call r2
_Scheduler_Enqueue_first( the_thread );
else
_Scheduler_Enqueue( the_thread );
}
_ISR_Flash( level );
8007874: d0 0c 00 00 wcsr IE,r12
8007878: 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();
800787c: 78 01 08 01 mvhi r1,0x801
8007880: 38 21 a0 18 ori r1,r1,0xa018
8007884: 28 21 00 08 lw r1,(r1+8)
8007888: 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 );
800788c: 78 01 08 01 mvhi r1,0x801
8007890: 38 21 ae 00 ori r1,r1,0xae00
8007894: 28 22 00 10 lw r2,(r1+16)
* 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() &&
8007898: 28 23 00 14 lw r3,(r1+20)
800789c: 44 43 00 05 be r2,r3,80078b0 <_Thread_Change_priority+0x100>
80078a0: 40 42 00 70 lbu r2,(r2+112)
80078a4: 44 40 00 03 be r2,r0,80078b0 <_Thread_Change_priority+0x100>
_Thread_Executing->is_preemptible )
_Thread_Dispatch_necessary = true;
80078a8: 34 02 00 01 mvi r2,1
80078ac: 30 22 00 0c sb (r1+12),r2
_ISR_Enable( level );
80078b0: d0 0c 00 00 wcsr IE,r12
}
80078b4: 2b 9d 00 04 lw ra,(sp+4)
80078b8: 2b 8b 00 18 lw r11,(sp+24)
80078bc: 2b 8c 00 14 lw r12,(sp+20)
80078c0: 2b 8d 00 10 lw r13,(sp+16)
80078c4: 2b 8e 00 0c lw r14,(sp+12)
80078c8: 2b 8f 00 08 lw r15,(sp+8)
80078cc: 37 9c 00 18 addi sp,sp,24
80078d0: c3 a0 00 00 ret
0800c930 <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
800c930: 37 9c ff f8 addi sp,sp,-8
800c934: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
800c938: 37 82 00 08 addi r2,sp,8
800c93c: f8 00 00 99 calli 800cba0 <_Thread_Get>
switch ( location ) {
800c940: 2b 82 00 08 lw r2,(sp+8)
800c944: 5c 40 00 0a bne r2,r0,800c96c <_Thread_Delay_ended+0x3c> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
800c948: 78 03 08 02 mvhi r3,0x802
800c94c: 38 63 77 e4 ori r3,r3,0x77e4
800c950: 28 62 00 00 lw r2,(r3+0)
800c954: fb ff ff 6d calli 800c708 <_Thread_Clear_state>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
800c958: 78 01 08 02 mvhi r1,0x802
800c95c: 38 21 9a 78 ori r1,r1,0x9a78
800c960: 28 22 00 00 lw r2,(r1+0)
--level;
800c964: 34 42 ff ff addi r2,r2,-1
_Thread_Dispatch_disable_level = level;
800c968: 58 22 00 00 sw (r1+0),r2
| STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Thread_Unnest_dispatch();
break;
}
}
800c96c: 2b 9d 00 04 lw ra,(sp+4)
800c970: 37 9c 00 08 addi sp,sp,8
800c974: c3 a0 00 00 ret
0800fad4 <_Thread_Dispatch>:
#if defined(RTEMS_SMP)
#include <rtems/score/smp.h>
#endif
void _Thread_Dispatch( void )
{
800fad4: 37 9c ff c0 addi sp,sp,-64
800fad8: 5b 8b 00 38 sw (sp+56),r11
800fadc: 5b 8c 00 34 sw (sp+52),r12
800fae0: 5b 8d 00 30 sw (sp+48),r13
800fae4: 5b 8e 00 2c sw (sp+44),r14
800fae8: 5b 8f 00 28 sw (sp+40),r15
800faec: 5b 90 00 24 sw (sp+36),r16
800faf0: 5b 91 00 20 sw (sp+32),r17
800faf4: 5b 92 00 1c sw (sp+28),r18
800faf8: 5b 93 00 18 sw (sp+24),r19
800fafc: 5b 94 00 14 sw (sp+20),r20
800fb00: 5b 95 00 10 sw (sp+16),r21
800fb04: 5b 96 00 0c sw (sp+12),r22
800fb08: 5b 97 00 08 sw (sp+8),r23
800fb0c: 5b 9d 00 04 sw (sp+4),ra
#endif
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
800fb10: 78 01 08 01 mvhi r1,0x801
800fb14: 38 21 ae 00 ori r1,r1,0xae00
800fb18: 28 2c 00 10 lw r12,(r1+16)
_ISR_Disable( level );
800fb1c: 90 00 18 00 rcsr r3,IE
800fb20: 34 01 ff fe mvi r1,-2
800fb24: a0 61 08 00 and r1,r3,r1
800fb28: d0 01 00 00 wcsr IE,r1
while ( _Thread_Dispatch_necessary == true ) {
800fb2c: 78 0b 08 01 mvhi r11,0x801
* This routine sets thread dispatch level to the
* value passed in.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value)
{
_Thread_Dispatch_disable_level = value;
800fb30: 78 14 08 01 mvhi r20,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;
800fb34: 78 0f 08 01 mvhi r15,0x801
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
800fb38: 78 13 08 01 mvhi r19,0x801
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
800fb3c: 78 12 08 01 mvhi r18,0x801
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
800fb40: 78 11 08 01 mvhi r17,0x801
{
const Chain_Control *chain = &_User_extensions_Switches_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
800fb44: 78 10 08 01 mvhi r16,0x801
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
800fb48: 39 6b ae 00 ori r11,r11,0xae00
800fb4c: 3a 94 a9 78 ori r20,r20,0xa978
800fb50: 34 15 00 01 mvi r21,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;
800fb54: 39 ef a9 10 ori r15,r15,0xa910
_ISR_Enable( level );
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
800fb58: 37 97 00 3c addi r23,sp,60
800fb5c: 3a 73 a9 00 ori r19,r19,0xa900
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
800fb60: 3a 52 a9 e4 ori r18,r18,0xa9e4
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
800fb64: 3a 31 a1 88 ori r17,r17,0xa188
800fb68: 3a 10 a1 8c ori r16,r16,0xa18c
#endif
#endif
executing = _Thread_Executing;
_ISR_Disable( level );
800fb6c: 34 16 ff fe mvi r22,-2
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
800fb70: e0 00 00 35 bi 800fc44 <_Thread_Dispatch+0x170>
heir = _Thread_Heir;
800fb74: 29 6d 00 14 lw r13,(r11+20)
800fb78: 5a 95 00 00 sw (r20+0),r21
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 1 );
#endif
_Thread_Dispatch_necessary = false;
800fb7c: 31 60 00 0c sb (r11+12),r0
_Thread_Executing = heir;
800fb80: 59 6d 00 10 sw (r11+16),r13
/*
* 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 )
800fb84: 45 ac 00 33 be r13,r12,800fc50 <_Thread_Dispatch+0x17c>
*/
#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 )
800fb88: 29 a1 00 78 lw r1,(r13+120)
800fb8c: 5c 35 00 03 bne r1,r21,800fb98 <_Thread_Dispatch+0xc4>
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
800fb90: 29 e1 00 00 lw r1,(r15+0)
800fb94: 59 a1 00 74 sw (r13+116),r1
_ISR_Enable( level );
800fb98: d0 03 00 00 wcsr IE,r3
800fb9c: ba 60 10 00 mv r2,r19
800fba0: ba e0 08 00 mv r1,r23
800fba4: fb ff d8 f0 calli 8005f64 <_TOD_Get_with_nanoseconds>
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
800fba8: 2b 83 00 40 lw r3,(sp+64)
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
800fbac: 29 82 00 84 lw r2,(r12+132)
800fbb0: 29 85 00 80 lw r5,(r12+128)
800fbb4: 2b 81 00 3c lw r1,(sp+60)
800fbb8: b4 62 10 00 add r2,r3,r2
800fbbc: f4 62 20 00 cmpgu r4,r3,r2
800fbc0: b4 25 28 00 add r5,r1,r5
800fbc4: b4 85 28 00 add r5,r4,r5
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
800fbc8: 29 64 00 24 lw r4,(r11+36)
800fbcc: 29 66 00 20 lw r6,(r11+32)
800fbd0: c8 44 20 00 sub r4,r2,r4
800fbd4: f4 82 10 00 cmpgu r2,r4,r2
800fbd8: c8 a6 28 00 sub r5,r5,r6
800fbdc: c8 a2 10 00 sub r2,r5,r2
800fbe0: 59 82 00 80 sw (r12+128),r2
800fbe4: 59 84 00 84 sw (r12+132),r4
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
_Thread_Time_of_last_context_switch = uptime;
800fbe8: 59 63 00 24 sw (r11+36),r3
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
800fbec: 2a 43 00 00 lw r3,(r18+0)
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
_Thread_Time_of_last_context_switch = uptime;
800fbf0: 59 61 00 20 sw (r11+32),r1
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
800fbf4: 44 60 00 05 be r3,r0,800fc08 <_Thread_Dispatch+0x134> <== NEVER TAKEN
executing->libc_reent = *_Thread_libc_reent;
800fbf8: 28 61 00 00 lw r1,(r3+0)
800fbfc: 59 81 01 14 sw (r12+276),r1
*_Thread_libc_reent = heir->libc_reent;
800fc00: 29 a1 01 14 lw r1,(r13+276)
800fc04: 58 61 00 00 sw (r3+0),r1
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
800fc08: 2a 2e 00 00 lw r14,(r17+0)
800fc0c: e0 00 00 06 bi 800fc24 <_Thread_Dispatch+0x150>
const User_extensions_Switch_control *extension =
(const User_extensions_Switch_control *) node;
(*extension->thread_switch)( executing, heir );
800fc10: 29 c3 00 08 lw r3,(r14+8)
800fc14: b9 80 08 00 mv r1,r12
800fc18: b9 a0 10 00 mv r2,r13
800fc1c: d8 60 00 00 call r3
800fc20: 29 ce 00 00 lw r14,(r14+0)
{
const Chain_Control *chain = &_User_extensions_Switches_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
800fc24: 5d d0 ff fb bne r14,r16,800fc10 <_Thread_Dispatch+0x13c>
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
800fc28: 35 81 00 c0 addi r1,r12,192
800fc2c: 35 a2 00 c0 addi r2,r13,192
800fc30: fb ff e4 2c calli 8008ce0 <_CPU_Context_switch>
if ( executing->fp_context != NULL )
_Context_Restore_fp( &executing->fp_context );
#endif
#endif
executing = _Thread_Executing;
800fc34: 29 6c 00 10 lw r12,(r11+16)
_ISR_Disable( level );
800fc38: 90 00 18 00 rcsr r3,IE
800fc3c: a0 76 08 00 and r1,r3,r22
800fc40: d0 01 00 00 wcsr IE,r1
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
800fc44: 41 61 00 0c lbu r1,(r11+12)
800fc48: 20 21 00 ff andi r1,r1,0xff
800fc4c: 5c 20 ff ca bne r1,r0,800fb74 <_Thread_Dispatch+0xa0>
800fc50: 78 01 08 01 mvhi r1,0x801
800fc54: 38 21 a9 78 ori r1,r1,0xa978
800fc58: 58 20 00 00 sw (r1+0),r0
post_switch:
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 0 );
#endif
_ISR_Enable( level );
800fc5c: d0 03 00 00 wcsr IE,r3
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
800fc60: 78 01 08 01 mvhi r1,0x801
800fc64: 38 21 a9 e8 ori r1,r1,0xa9e8
{
const Chain_Control *chain = &_API_extensions_Post_switch_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
800fc68: 78 0d 08 01 mvhi r13,0x801
800fc6c: 28 2b 00 00 lw r11,(r1+0)
800fc70: 39 ad a9 ec ori r13,r13,0xa9ec
800fc74: e0 00 00 05 bi 800fc88 <_Thread_Dispatch+0x1b4>
const API_extensions_Post_switch_control *post_switch =
(const API_extensions_Post_switch_control *) node;
(*post_switch->hook)( executing );
800fc78: 29 62 00 08 lw r2,(r11+8)
800fc7c: b9 80 08 00 mv r1,r12
800fc80: d8 40 00 00 call r2
800fc84: 29 6b 00 00 lw r11,(r11+0)
{
const Chain_Control *chain = &_API_extensions_Post_switch_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
800fc88: 5d 6d ff fc bne r11,r13,800fc78 <_Thread_Dispatch+0x1a4>
800fc8c: 2b 9d 00 04 lw ra,(sp+4)
800fc90: 2b 8b 00 38 lw r11,(sp+56)
800fc94: 2b 8c 00 34 lw r12,(sp+52)
800fc98: 2b 8d 00 30 lw r13,(sp+48)
800fc9c: 2b 8e 00 2c lw r14,(sp+44)
800fca0: 2b 8f 00 28 lw r15,(sp+40)
800fca4: 2b 90 00 24 lw r16,(sp+36)
800fca8: 2b 91 00 20 lw r17,(sp+32)
800fcac: 2b 92 00 1c lw r18,(sp+28)
800fcb0: 2b 93 00 18 lw r19,(sp+24)
800fcb4: 2b 94 00 14 lw r20,(sp+20)
800fcb8: 2b 95 00 10 lw r21,(sp+16)
800fcbc: 2b 96 00 0c lw r22,(sp+12)
800fcc0: 2b 97 00 08 lw r23,(sp+8)
800fcc4: 37 9c 00 40 addi sp,sp,64
800fcc8: c3 a0 00 00 ret
08011a38 <_Thread_Handler>:
#define INIT_NAME __main
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
void _Thread_Handler( void )
{
8011a38: 37 9c ff f4 addi sp,sp,-12
8011a3c: 5b 8b 00 0c sw (sp+12),r11
8011a40: 5b 8c 00 08 sw (sp+8),r12
8011a44: 5b 9d 00 04 sw (sp+4),ra
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static bool doneConstructors;
bool doCons;
#endif
executing = _Thread_Executing;
8011a48: 78 01 08 01 mvhi r1,0x801
8011a4c: 38 21 ae 00 ori r1,r1,0xae00
8011a50: 28 2b 00 10 lw r11,(r1+16)
/*
* have to put level into a register for those cpu's that use
* inline asm here
*/
level = executing->Start.isr_level;
8011a54: 29 61 00 a8 lw r1,(r11+168)
_ISR_Set_level(level);
8011a58: 64 21 00 00 cmpei r1,r1,0
8011a5c: d0 01 00 00 wcsr IE,r1
doCons = !doneConstructors
&& _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API;
if (doCons)
doneConstructors = true;
#else
doCons = !doneConstructors;
8011a60: 78 01 08 01 mvhi r1,0x801
8011a64: 38 21 a8 10 ori r1,r1,0xa810
8011a68: 40 2c 00 00 lbu r12,(r1+0)
doneConstructors = true;
8011a6c: 34 02 00 01 mvi r2,1
8011a70: 30 22 00 00 sb (r1+0),r2
);
}
static inline void _User_extensions_Thread_begin( Thread_Control *executing )
{
_User_extensions_Iterate(
8011a74: 78 02 08 00 mvhi r2,0x800
8011a78: b9 60 08 00 mv r1,r11
8011a7c: 38 42 87 18 ori r2,r2,0x8718
8011a80: fb ff db 42 calli 8008788 <_User_extensions_Iterate>
_User_extensions_Thread_begin( executing );
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
8011a84: fb ff d7 cf calli 80079c0 <_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 (doCons) /* && (volatile void *)_init) */ {
8011a88: 5d 80 00 02 bne r12,r0,8011a90 <_Thread_Handler+0x58>
INIT_NAME ();
8011a8c: fb ff b9 5d calli 8000000 <RamBase>
_Thread_Enable_dispatch();
#endif
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
8011a90: 29 61 00 90 lw r1,(r11+144)
8011a94: 5c 20 00 04 bne r1,r0,8011aa4 <_Thread_Handler+0x6c>
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
8011a98: 29 62 00 8c lw r2,(r11+140)
8011a9c: 29 61 00 98 lw r1,(r11+152)
8011aa0: e0 00 00 05 bi 8011ab4 <_Thread_Handler+0x7c>
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
8011aa4: 34 02 00 01 mvi r2,1
8011aa8: 5c 22 00 05 bne r1,r2,8011abc <_Thread_Handler+0x84> <== NEVER TAKEN
executing->Wait.return_argument =
(*(Thread_Entry_pointer) executing->Start.entry_point)(
8011aac: 29 62 00 8c lw r2,(r11+140)
8011ab0: 29 61 00 94 lw r1,(r11+148)
8011ab4: d8 40 00 00 call r2
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
executing->Wait.return_argument =
8011ab8: 59 61 00 28 sw (r11+40),r1
}
}
static inline void _User_extensions_Thread_exitted( Thread_Control *executing )
{
_User_extensions_Iterate(
8011abc: 78 02 08 00 mvhi r2,0x800
8011ac0: b9 60 08 00 mv r1,r11
8011ac4: 38 42 87 38 ori r2,r2,0x8738
8011ac8: fb ff db 30 calli 8008788 <_User_extensions_Iterate>
* able to fit in a (void *).
*/
_User_extensions_Thread_exitted( executing );
_Internal_error_Occurred(
8011acc: 34 01 00 00 mvi r1,0
8011ad0: 34 02 00 01 mvi r2,1
8011ad4: 34 03 00 05 mvi r3,5
8011ad8: fb ff d2 8b calli 8006504 <_Internal_error_Occurred>
08007d0c <_Thread_Handler_initialization>:
#if defined(RTEMS_SMP)
#include <rtems/bspsmp.h>
#endif
void _Thread_Handler_initialization(void)
{
8007d0c: 37 9c ff f4 addi sp,sp,-12
8007d10: 5b 8b 00 0c sw (sp+12),r11
8007d14: 5b 8c 00 08 sw (sp+8),r12
8007d18: 5b 9d 00 04 sw (sp+4),ra
uint32_t ticks_per_timeslice =
8007d1c: 78 01 08 01 mvhi r1,0x801
8007d20: 38 21 87 ec ori r1,r1,0x87ec
#if defined(RTEMS_MULTIPROCESSING)
uint32_t maximum_proxies =
_Configuration_MP_table->maximum_proxies;
#endif
if ( rtems_configuration_get_stack_allocate_hook() == NULL ||
8007d24: 28 23 00 28 lw r3,(r1+40)
#include <rtems/bspsmp.h>
#endif
void _Thread_Handler_initialization(void)
{
uint32_t ticks_per_timeslice =
8007d28: 28 2b 00 14 lw r11,(r1+20)
rtems_configuration_get_ticks_per_timeslice();
uint32_t maximum_extensions =
8007d2c: 28 2c 00 08 lw r12,(r1+8)
rtems_configuration_get_maximum_extensions();
rtems_stack_allocate_init_hook stack_allocate_init_hook =
8007d30: 28 22 00 24 lw r2,(r1+36)
#if defined(RTEMS_MULTIPROCESSING)
uint32_t maximum_proxies =
_Configuration_MP_table->maximum_proxies;
#endif
if ( rtems_configuration_get_stack_allocate_hook() == NULL ||
8007d34: 44 60 00 03 be r3,r0,8007d40 <_Thread_Handler_initialization+0x34><== NEVER TAKEN
8007d38: 28 23 00 2c lw r3,(r1+44)
8007d3c: 5c 60 00 05 bne r3,r0,8007d50 <_Thread_Handler_initialization+0x44>
rtems_configuration_get_stack_free_hook() == NULL)
_Internal_error_Occurred(
8007d40: 34 01 00 00 mvi r1,0
8007d44: 34 02 00 01 mvi r2,1
8007d48: 34 03 00 0e mvi r3,14
8007d4c: fb ff f9 ee calli 8006504 <_Internal_error_Occurred>
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_BAD_STACK_HOOK
);
if ( stack_allocate_init_hook != NULL )
8007d50: 44 40 00 03 be r2,r0,8007d5c <_Thread_Handler_initialization+0x50>
(*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() );
8007d54: 28 21 00 04 lw r1,(r1+4)
8007d58: d8 40 00 00 call r2
_Thread_Dispatch_necessary = false;
8007d5c: 78 01 08 01 mvhi r1,0x801
8007d60: 38 21 ae 00 ori r1,r1,0xae00
8007d64: 30 20 00 0c sb (r1+12),r0
_Thread_Executing = NULL;
8007d68: 58 20 00 10 sw (r1+16),r0
_Thread_Heir = NULL;
8007d6c: 58 20 00 14 sw (r1+20),r0
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Thread_Allocated_fp = NULL;
#endif
_Thread_Maximum_extensions = maximum_extensions;
8007d70: 78 01 08 01 mvhi r1,0x801
8007d74: 38 21 a9 f4 ori r1,r1,0xa9f4
8007d78: 58 2c 00 00 sw (r1+0),r12
_Thread_Ticks_per_timeslice = ticks_per_timeslice;
8007d7c: 78 01 08 01 mvhi r1,0x801
8007d80: 38 21 a9 10 ori r1,r1,0xa910
8007d84: 58 2b 00 00 sw (r1+0),r11
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing )
maximum_internal_threads += 1;
#endif
_Objects_Initialize_information(
8007d88: 78 01 08 01 mvhi r1,0x801
8007d8c: 38 21 aa 68 ori r1,r1,0xaa68
8007d90: 34 02 00 01 mvi r2,1
8007d94: 34 03 00 01 mvi r3,1
8007d98: 34 04 00 01 mvi r4,1
8007d9c: 34 05 01 28 mvi r5,296
8007da0: 34 06 00 00 mvi r6,0
8007da4: 34 07 00 08 mvi r7,8
8007da8: fb ff fb a2 calli 8006c30 <_Objects_Initialize_information>
false, /* true if this is a global object class */
NULL /* Proxy extraction support callout */
#endif
);
}
8007dac: 2b 9d 00 04 lw ra,(sp+4)
8007db0: 2b 8b 00 0c lw r11,(sp+12)
8007db4: 2b 8c 00 08 lw r12,(sp+8)
8007db8: 37 9c 00 0c addi sp,sp,12
8007dbc: c3 a0 00 00 ret
08008598 <_Thread_Stack_Free>:
#include <rtems/config.h>
void _Thread_Stack_Free(
Thread_Control *the_thread
)
{
8008598: 37 9c ff fc addi sp,sp,-4
800859c: 5b 9d 00 04 sw (sp+4),ra
#if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
/*
* If the API provided the stack space, then don't free it.
*/
if ( !the_thread->Start.core_allocated_stack )
80085a0: 40 23 00 b0 lbu r3,(r1+176)
void _Thread_Stack_Free(
Thread_Control *the_thread
)
{
rtems_stack_free_hook stack_free_hook =
80085a4: 78 02 08 01 mvhi r2,0x801
80085a8: 38 42 87 ec ori r2,r2,0x87ec
80085ac: 28 42 00 2c lw r2,(r2+44)
#if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
/*
* If the API provided the stack space, then don't free it.
*/
if ( !the_thread->Start.core_allocated_stack )
80085b0: 44 60 00 03 be r3,r0,80085bc <_Thread_Stack_Free+0x24> <== NEVER TAKEN
* Call ONLY the CPU table stack free hook, or the
* the RTEMS workspace free. This is so the free
* routine properly matches the allocation of the stack.
*/
(*stack_free_hook)( the_thread->Start.Initial_stack.area );
80085b4: 28 21 00 b8 lw r1,(r1+184)
80085b8: d8 40 00 00 call r2
}
80085bc: 2b 9d 00 04 lw ra,(sp+4)
80085c0: 37 9c 00 04 addi sp,sp,4
80085c4: c3 a0 00 00 ret
08008050 <_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
)
{
8008050: 37 9c ff cc addi sp,sp,-52
8008054: 5b 8b 00 34 sw (sp+52),r11
8008058: 5b 8c 00 30 sw (sp+48),r12
800805c: 5b 8d 00 2c sw (sp+44),r13
8008060: 5b 8e 00 28 sw (sp+40),r14
8008064: 5b 8f 00 24 sw (sp+36),r15
8008068: 5b 90 00 20 sw (sp+32),r16
800806c: 5b 91 00 1c sw (sp+28),r17
8008070: 5b 92 00 18 sw (sp+24),r18
8008074: 5b 93 00 14 sw (sp+20),r19
8008078: 5b 94 00 10 sw (sp+16),r20
800807c: 5b 95 00 0c sw (sp+12),r21
8008080: 5b 96 00 08 sw (sp+8),r22
8008084: 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;
8008088: 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
)
{
800808c: 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 );
8008090: 34 41 00 3c addi r1,r2,60
head->next = tail;
8008094: 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 );
8008098: 34 41 00 38 addi r1,r2,56
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
800809c: 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;
80080a0: 58 40 00 3c sw (r2+60),r0
80080a4: 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);
80080a8: ba 00 08 00 mv r1,r16
80080ac: 34 02 00 06 mvi r2,6
80080b0: b8 60 a8 00 mv r21,r3
80080b4: f8 00 3e 71 calli 8017a78 <__lshrsi3>
80080b8: 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;
80080bc: 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 );
80080c0: 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;
80080c4: 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;
80080c8: 3a 52 a0 c0 ori r18,r18,0xa0c0
_ISR_Disable( level );
80080cc: 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 ) )
80080d0: 5c 20 00 2e bne r1,r0,8008188 <_Thread_queue_Enqueue_priority+0x138>
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
80080d4: 34 14 ff fe mvi r20,-2
80080d8: 90 00 78 00 rcsr r15,IE
80080dc: a1 f4 90 00 and r18,r15,r20
80080e0: d0 12 00 00 wcsr IE,r18
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
80080e4: 34 02 00 01 mvi r2,1
80080e8: b9 c0 08 00 mv r1,r14
80080ec: f8 00 3e 15 calli 8017940 <__ashlsi3>
80080f0: b4 2e 08 00 add r1,r1,r14
80080f4: 34 02 00 02 mvi r2,2
80080f8: f8 00 3e 12 calli 8017940 <__ashlsi3>
80080fc: 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 );
8008100: 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;
8008104: 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 ) ) {
8008108: e0 00 00 0b bi 8008134 <_Thread_queue_Enqueue_priority+0xe4>
search_priority = search_thread->current_priority;
800810c: 29 71 00 14 lw r17,(r11+20)
if ( priority <= search_priority )
8008110: 52 30 00 12 bgeu r17,r16,8008158 <_Thread_queue_Enqueue_priority+0x108>
break;
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
8008114: d0 0f 00 00 wcsr IE,r15
8008118: 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);
800811c: 29 61 00 10 lw r1,(r11+16)
8008120: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
8008124: 5c 20 00 03 bne r1,r0,8008130 <_Thread_queue_Enqueue_priority+0xe0><== ALWAYS TAKEN
_ISR_Enable( level );
8008128: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_forward_search;
800812c: e3 ff ff eb bi 80080d8 <_Thread_queue_Enqueue_priority+0x88><== NOT EXECUTED
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
8008130: 29 6b 00 00 lw r11,(r11+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
const Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Immutable_tail( the_chain ));
8008134: 34 02 00 01 mvi r2,1
8008138: b9 c0 08 00 mv r1,r14
800813c: f8 00 3e 01 calli 8017940 <__ashlsi3>
8008140: b4 2e 08 00 add r1,r1,r14
8008144: 34 02 00 02 mvi r2,2
8008148: f8 00 3d fe calli 8017940 <__ashlsi3>
800814c: b5 a1 08 00 add r1,r13,r1
8008150: 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 ) ) {
8008154: 5d 61 ff ee bne r11,r1,800810c <_Thread_queue_Enqueue_priority+0xbc>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
8008158: 29 a3 00 30 lw r3,(r13+48)
800815c: 34 02 00 01 mvi r2,1
8008160: b9 e0 08 00 mv r1,r15
8008164: 5c 62 00 3f bne r3,r2,8008260 <_Thread_queue_Enqueue_priority+0x210><== NEVER TAKEN
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8008168: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
800816c: 46 11 00 36 be r16,r17,8008244 <_Thread_queue_Enqueue_priority+0x1f4>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
8008170: 29 61 00 04 lw r1,(r11+4)
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8008174: 59 8b 00 00 sw (r12+0),r11
the_node->previous = previous_node;
8008178: 59 81 00 04 sw (r12+4),r1
previous_node->next = the_node;
800817c: 58 2c 00 00 sw (r1+0),r12
search_node->previous = the_node;
8008180: 59 6c 00 04 sw (r11+4),r12
8008184: e0 00 00 2c bi 8008234 <_Thread_queue_Enqueue_priority+0x1e4>
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
8008188: 42 51 00 00 lbu r17,(r18+0)
800818c: 36 31 00 01 addi r17,r17,1
_ISR_Disable( level );
8008190: 90 00 78 00 rcsr r15,IE
8008194: a1 f6 a0 00 and r20,r15,r22
8008198: d0 14 00 00 wcsr IE,r20
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
800819c: 34 02 00 01 mvi r2,1
80081a0: b9 c0 08 00 mv r1,r14
80081a4: f8 00 3d e7 calli 8017940 <__ashlsi3>
80081a8: b4 2e 08 00 add r1,r1,r14
80081ac: 34 02 00 02 mvi r2,2
80081b0: f8 00 3d e4 calli 8017940 <__ashlsi3>
80081b4: 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 );
80081b8: 28 2b 00 08 lw r11,(r1+8)
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
80081bc: e0 00 00 0b bi 80081e8 <_Thread_queue_Enqueue_priority+0x198>
search_priority = search_thread->current_priority;
80081c0: 29 71 00 14 lw r17,(r11+20)
if ( priority >= search_priority )
80081c4: 52 11 00 11 bgeu r16,r17,8008208 <_Thread_queue_Enqueue_priority+0x1b8>
break;
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
80081c8: d0 0f 00 00 wcsr IE,r15
80081cc: d0 14 00 00 wcsr IE,r20
80081d0: 29 61 00 10 lw r1,(r11+16)
80081d4: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
80081d8: 5c 20 00 03 bne r1,r0,80081e4 <_Thread_queue_Enqueue_priority+0x194><== ALWAYS TAKEN
_ISR_Enable( level );
80081dc: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_reverse_search;
80081e0: e3 ff ff ea bi 8008188 <_Thread_queue_Enqueue_priority+0x138><== NOT EXECUTED
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
80081e4: 29 6b 00 04 lw r11,(r11+4)
RTEMS_INLINE_ROUTINE bool _Chain_Is_head(
const Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Immutable_head( the_chain ));
80081e8: 34 02 00 01 mvi r2,1
80081ec: b9 c0 08 00 mv r1,r14
80081f0: f8 00 3d d4 calli 8017940 <__ashlsi3>
80081f4: b4 2e 08 00 add r1,r1,r14
80081f8: 34 02 00 02 mvi r2,2
80081fc: f8 00 3d d1 calli 8017940 <__ashlsi3>
8008200: 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 ) ) {
8008204: 5d 61 ff ef bne r11,r1,80081c0 <_Thread_queue_Enqueue_priority+0x170>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
8008208: 29 a3 00 30 lw r3,(r13+48)
800820c: 34 02 00 01 mvi r2,1
8008210: b9 e0 08 00 mv r1,r15
8008214: 5c 62 00 13 bne r3,r2,8008260 <_Thread_queue_Enqueue_priority+0x210><== NEVER TAKEN
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8008218: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
800821c: 46 11 00 0a be r16,r17,8008244 <_Thread_queue_Enqueue_priority+0x1f4>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
8008220: 29 61 00 00 lw r1,(r11+0)
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
8008224: 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;
8008228: 59 81 00 00 sw (r12+0),r1
the_node->previous = search_node;
search_node->next = the_node;
800822c: 59 6c 00 00 sw (r11+0),r12
next_node->previous = the_node;
8008230: 58 2c 00 04 sw (r1+4),r12
the_thread->Wait.queue = the_thread_queue;
8008234: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
8008238: d0 0f 00 00 wcsr IE,r15
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
800823c: 34 01 00 01 mvi r1,1
8008240: e0 00 00 0a bi 8008268 <_Thread_queue_Enqueue_priority+0x218>
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
previous_node = search_node->previous;
8008244: 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 );
8008248: 35 62 00 3c addi r2,r11,60
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
800824c: 59 82 00 00 sw (r12+0),r2
the_node->previous = previous_node;
8008250: 59 81 00 04 sw (r12+4),r1
previous_node->next = the_node;
8008254: 58 2c 00 00 sw (r1+0),r12
search_node->previous = the_node;
8008258: 59 6c 00 40 sw (r11+64),r12
800825c: e3 ff ff f6 bi 8008234 <_Thread_queue_Enqueue_priority+0x1e4>
* 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;
8008260: 5a a1 00 00 sw (r21+0),r1 <== NOT EXECUTED
return the_thread_queue->sync_state;
8008264: 29 a1 00 30 lw r1,(r13+48) <== NOT EXECUTED
}
8008268: 2b 9d 00 04 lw ra,(sp+4)
800826c: 2b 8b 00 34 lw r11,(sp+52)
8008270: 2b 8c 00 30 lw r12,(sp+48)
8008274: 2b 8d 00 2c lw r13,(sp+44)
8008278: 2b 8e 00 28 lw r14,(sp+40)
800827c: 2b 8f 00 24 lw r15,(sp+36)
8008280: 2b 90 00 20 lw r16,(sp+32)
8008284: 2b 91 00 1c lw r17,(sp+28)
8008288: 2b 92 00 18 lw r18,(sp+24)
800828c: 2b 93 00 14 lw r19,(sp+20)
8008290: 2b 94 00 10 lw r20,(sp+16)
8008294: 2b 95 00 0c lw r21,(sp+12)
8008298: 2b 96 00 08 lw r22,(sp+8)
800829c: 37 9c 00 34 addi sp,sp,52
80082a0: c3 a0 00 00 ret
0800fe08 <_Thread_queue_Extract_priority_helper>:
void _Thread_queue_Extract_priority_helper(
Thread_queue_Control *the_thread_queue __attribute__((unused)),
Thread_Control *the_thread,
bool requeuing
)
{
800fe08: 37 9c ff f8 addi sp,sp,-8
800fe0c: 5b 8b 00 08 sw (sp+8),r11
800fe10: 5b 9d 00 04 sw (sp+4),ra
800fe14: b8 40 58 00 mv r11,r2
800fe18: 20 63 00 ff andi r3,r3,0xff
Chain_Node *new_first_node;
Chain_Node *new_second_node;
Chain_Node *last_node;
the_node = (Chain_Node *) the_thread;
_ISR_Disable( level );
800fe1c: 90 00 10 00 rcsr r2,IE
800fe20: 34 01 ff fe mvi r1,-2
800fe24: a0 41 08 00 and r1,r2,r1
800fe28: d0 01 00 00 wcsr IE,r1
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
800fe2c: 78 05 08 01 mvhi r5,0x801
800fe30: 38 a5 8c 8c ori r5,r5,0x8c8c
800fe34: 29 64 00 10 lw r4,(r11+16)
800fe38: 28 a1 00 00 lw r1,(r5+0)
800fe3c: a0 81 08 00 and r1,r4,r1
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
800fe40: 44 20 00 19 be r1,r0,800fea4 <_Thread_queue_Extract_priority_helper+0x9c><== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
800fe44: 29 61 00 38 lw r1,(r11+56)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
800fe48: 35 66 00 3c addi r6,r11,60
/*
* The thread was actually waiting on a thread queue so let's remove it.
*/
next_node = the_node->next;
800fe4c: 29 64 00 00 lw r4,(r11+0)
previous_node = the_node->previous;
800fe50: 29 65 00 04 lw r5,(r11+4)
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
800fe54: 44 26 00 11 be r1,r6,800fe98 <_Thread_queue_Extract_priority_helper+0x90>
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
800fe58: 29 66 00 40 lw r6,(r11+64)
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
new_first_node = _Chain_First( &the_thread->Wait.Block2n );
new_first_thread = (Thread_Control *) new_first_node;
last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
800fe5c: 28 27 00 00 lw r7,(r1+0)
previous_node->next = new_first_node;
next_node->previous = new_first_node;
800fe60: 58 81 00 04 sw (r4+4),r1
new_first_node = _Chain_First( &the_thread->Wait.Block2n );
new_first_thread = (Thread_Control *) new_first_node;
last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
800fe64: 58 a1 00 00 sw (r5+0),r1
next_node->previous = new_first_node;
new_first_node->next = next_node;
800fe68: 58 24 00 00 sw (r1+0),r4
new_first_node->previous = previous_node;
800fe6c: 58 25 00 04 sw (r1+4),r5
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
800fe70: 29 64 00 40 lw r4,(r11+64)
800fe74: 29 65 00 38 lw r5,(r11+56)
800fe78: 44 a4 00 0a be r5,r4,800fea0 <_Thread_queue_Extract_priority_helper+0x98>
/* > two threads on 2-n */
head = _Chain_Head( &new_first_thread->Wait.Block2n );
800fe7c: 34 24 00 38 addi r4,r1,56
tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
new_second_node->previous = head;
800fe80: 58 e4 00 04 sw (r7+4),r4
head->next = new_second_node;
800fe84: 58 27 00 38 sw (r1+56),r7
tail->previous = last_node;
800fe88: 58 26 00 40 sw (r1+64),r6
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
/* > two threads on 2-n */
head = _Chain_Head( &new_first_thread->Wait.Block2n );
tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
800fe8c: 34 21 00 3c addi r1,r1,60
new_second_node->previous = head;
head->next = new_second_node;
tail->previous = last_node;
last_node->next = tail;
800fe90: 58 c1 00 00 sw (r6+0),r1
800fe94: e0 00 00 03 bi 800fea0 <_Thread_queue_Extract_priority_helper+0x98>
}
} else {
previous_node->next = next_node;
800fe98: 58 a4 00 00 sw (r5+0),r4
next_node->previous = previous_node;
800fe9c: 58 85 00 04 sw (r4+4),r5
/*
* If we are not supposed to touch timers or the thread's state, return.
*/
if ( requeuing ) {
800fea0: 44 60 00 03 be r3,r0,800feac <_Thread_queue_Extract_priority_helper+0xa4>
_ISR_Enable( level );
800fea4: d0 02 00 00 wcsr IE,r2
return;
800fea8: e0 00 00 10 bi 800fee8 <_Thread_queue_Extract_priority_helper+0xe0>
}
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
800feac: 29 63 00 50 lw r3,(r11+80)
800feb0: 34 01 00 02 mvi r1,2
800feb4: 44 61 00 03 be r3,r1,800fec0 <_Thread_queue_Extract_priority_helper+0xb8>
_ISR_Enable( level );
800feb8: d0 02 00 00 wcsr IE,r2
800febc: e0 00 00 06 bi 800fed4 <_Thread_queue_Extract_priority_helper+0xcc>
800fec0: 34 01 00 03 mvi r1,3
800fec4: 59 61 00 50 sw (r11+80),r1
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
800fec8: d0 02 00 00 wcsr IE,r2
(void) _Watchdog_Remove( &the_thread->Timer );
800fecc: 35 61 00 48 addi r1,r11,72
800fed0: fb ff e2 e0 calli 8008a50 <_Watchdog_Remove>
800fed4: 78 03 08 01 mvhi r3,0x801
800fed8: 38 63 8c 94 ori r3,r3,0x8c94
800fedc: 28 62 00 00 lw r2,(r3+0)
800fee0: b9 60 08 00 mv r1,r11
800fee4: fb ff fe ad calli 800f998 <_Thread_Clear_state>
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
800fee8: 2b 9d 00 04 lw ra,(sp+4)
800feec: 2b 8b 00 08 lw r11,(sp+8)
800fef0: 37 9c 00 08 addi sp,sp,8
800fef4: c3 a0 00 00 ret
0800ff38 <_Thread_queue_Process_timeout>:
#include <rtems/score/tqdata.h>
void _Thread_queue_Process_timeout(
Thread_Control *the_thread
)
{
800ff38: 37 9c ff fc addi sp,sp,-4
800ff3c: 5b 9d 00 04 sw (sp+4),ra
800ff40: b8 20 10 00 mv r2,r1
Thread_queue_Control *the_thread_queue = the_thread->Wait.queue;
800ff44: 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 &&
800ff48: 28 24 00 30 lw r4,(r1+48)
800ff4c: 44 80 00 0c be r4,r0,800ff7c <_Thread_queue_Process_timeout+0x44>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
800ff50: 78 03 08 01 mvhi r3,0x801
800ff54: 38 63 ae 00 ori r3,r3,0xae00
800ff58: 28 63 00 10 lw r3,(r3+16)
800ff5c: 5c 43 00 08 bne r2,r3,800ff7c <_Thread_queue_Process_timeout+0x44><== NEVER TAKEN
_Thread_Is_executing( the_thread ) ) {
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
800ff60: 34 03 00 03 mvi r3,3
800ff64: 44 83 00 09 be r4,r3,800ff88 <_Thread_queue_Process_timeout+0x50><== ALWAYS TAKEN
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
800ff68: 28 23 00 3c lw r3,(r1+60) <== NOT EXECUTED
800ff6c: 58 43 00 34 sw (r2+52),r3 <== NOT EXECUTED
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
800ff70: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
800ff74: 58 22 00 30 sw (r1+48),r2 <== NOT EXECUTED
800ff78: e0 00 00 04 bi 800ff88 <_Thread_queue_Process_timeout+0x50><== NOT EXECUTED
}
} else {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
800ff7c: 28 23 00 3c lw r3,(r1+60)
800ff80: 58 43 00 34 sw (r2+52),r3
_Thread_queue_Extract( the_thread->Wait.queue, the_thread );
800ff84: f8 00 06 d6 calli 8011adc <_Thread_queue_Extract>
}
}
800ff88: 2b 9d 00 04 lw ra,(sp+4)
800ff8c: 37 9c 00 04 addi sp,sp,4
800ff90: c3 a0 00 00 ret
08008390 <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
8008390: 37 9c ff ec addi sp,sp,-20
8008394: 5b 8b 00 10 sw (sp+16),r11
8008398: 5b 8c 00 0c sw (sp+12),r12
800839c: 5b 8d 00 08 sw (sp+8),r13
80083a0: 5b 9d 00 04 sw (sp+4),ra
80083a4: b8 20 58 00 mv r11,r1
80083a8: 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 )
80083ac: 44 20 00 19 be r1,r0,8008410 <_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 ) {
80083b0: 28 22 00 34 lw r2,(r1+52)
80083b4: 34 01 00 01 mvi r1,1
80083b8: 5c 41 00 16 bne r2,r1,8008410 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
80083bc: 90 00 68 00 rcsr r13,IE
80083c0: 34 01 ff fe mvi r1,-2
80083c4: a1 a1 08 00 and r1,r13,r1
80083c8: d0 01 00 00 wcsr IE,r1
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
80083cc: 78 03 08 01 mvhi r3,0x801
80083d0: 38 63 8c 8c ori r3,r3,0x8c8c
80083d4: 29 82 00 10 lw r2,(r12+16)
80083d8: 28 61 00 00 lw r1,(r3+0)
80083dc: a0 41 08 00 and r1,r2,r1
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
80083e0: 44 20 00 0b be r1,r0,800840c <_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;
80083e4: 34 01 00 01 mvi r1,1
80083e8: 59 61 00 30 sw (r11+48),r1
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
80083ec: b9 80 10 00 mv r2,r12
80083f0: b9 60 08 00 mv r1,r11
80083f4: 34 03 00 01 mvi r3,1
80083f8: f8 00 1e 84 calli 800fe08 <_Thread_queue_Extract_priority_helper>
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
80083fc: b9 60 08 00 mv r1,r11
8008400: b9 80 10 00 mv r2,r12
8008404: 37 83 00 14 addi r3,sp,20
8008408: fb ff ff 12 calli 8008050 <_Thread_queue_Enqueue_priority>
}
_ISR_Enable( level );
800840c: d0 0d 00 00 wcsr IE,r13
}
}
8008410: 2b 9d 00 04 lw ra,(sp+4)
8008414: 2b 8b 00 10 lw r11,(sp+16)
8008418: 2b 8c 00 0c lw r12,(sp+12)
800841c: 2b 8d 00 08 lw r13,(sp+8)
8008420: 37 9c 00 14 addi sp,sp,20
8008424: c3 a0 00 00 ret
08008428 <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
8008428: 37 9c ff f8 addi sp,sp,-8
800842c: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
8008430: 37 82 00 08 addi r2,sp,8
8008434: fb ff fd 6f calli 80079f0 <_Thread_Get>
switch ( location ) {
8008438: 2b 82 00 08 lw r2,(sp+8)
800843c: 5c 40 00 07 bne r2,r0,8008458 <_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 );
8008440: f8 00 1e be calli 800ff38 <_Thread_queue_Process_timeout>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8008444: 78 01 08 01 mvhi r1,0x801
8008448: 38 21 a9 78 ori r1,r1,0xa978
800844c: 28 22 00 00 lw r2,(r1+0)
--level;
8008450: 34 42 ff ff addi r2,r2,-1
_Thread_Dispatch_disable_level = level;
8008454: 58 22 00 00 sw (r1+0),r2
_Thread_Unnest_dispatch();
break;
}
}
8008458: 2b 9d 00 04 lw ra,(sp+4)
800845c: 37 9c 00 08 addi sp,sp,8
8008460: c3 a0 00 00 ret
08015648 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
8015648: 37 9c ff a8 addi sp,sp,-88
801564c: 5b 8b 00 40 sw (sp+64),r11
8015650: 5b 8c 00 3c sw (sp+60),r12
8015654: 5b 8d 00 38 sw (sp+56),r13
8015658: 5b 8e 00 34 sw (sp+52),r14
801565c: 5b 8f 00 30 sw (sp+48),r15
8015660: 5b 90 00 2c sw (sp+44),r16
8015664: 5b 91 00 28 sw (sp+40),r17
8015668: 5b 92 00 24 sw (sp+36),r18
801566c: 5b 93 00 20 sw (sp+32),r19
8015670: 5b 94 00 1c sw (sp+28),r20
8015674: 5b 95 00 18 sw (sp+24),r21
8015678: 5b 96 00 14 sw (sp+20),r22
801567c: 5b 97 00 10 sw (sp+16),r23
8015680: 5b 98 00 0c sw (sp+12),r24
8015684: 5b 99 00 08 sw (sp+8),r25
8015688: 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;
801568c: 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
)
{
8015690: b8 20 58 00 mv r11,r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8015694: 37 82 00 54 addi r2,sp,84
8015698: 37 81 00 50 addi r1,sp,80
801569c: 37 8f 00 44 addi r15,sp,68
80156a0: 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();
80156a4: 78 0d 08 03 mvhi r13,0x803
80156a8: 5b 82 00 50 sw (sp+80),r2
head->previous = NULL;
80156ac: 5b 80 00 54 sw (sp+84),r0
tail->previous = head;
80156b0: 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;
80156b4: 5b 91 00 44 sw (sp+68),r17
head->previous = NULL;
80156b8: 5b 80 00 48 sw (sp+72),r0
tail->previous = head;
80156bc: 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;
80156c0: 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;
80156c4: 3a 10 fe 38 ori r16,r16,0xfe38
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
80156c8: 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();
80156cc: 39 ad fc d0 ori r13,r13,0xfcd0
/*
* 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 );
80156d0: 35 6e 00 68 addi r14,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 ) {
80156d4: 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 );
80156d8: 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;
80156dc: 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;
80156e0: 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 );
80156e4: 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 );
80156e8: 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;
80156ec: 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;
80156f0: 2a 02 00 00 lw r2,(r16+0)
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
80156f4: 29 63 00 3c lw r3,(r11+60)
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
80156f8: ba 60 08 00 mv r1,r19
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
80156fc: 59 62 00 3c sw (r11+60),r2
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
8015700: c8 43 10 00 sub r2,r2,r3
8015704: b9 e0 18 00 mv r3,r15
8015708: f8 00 15 5a calli 801ac70 <_Watchdog_Adjust_to_chain>
801570c: 78 05 08 03 mvhi r5,0x803
8015710: 38 a5 88 cc ori r5,r5,0x88cc
8015714: 28 a4 00 00 lw r4,(r5+0)
8015718: 29 a1 00 00 lw r1,(r13+0)
801571c: 29 a2 00 04 lw r2,(r13+4)
8015720: 34 03 00 00 mvi r3,0
8015724: f8 00 56 04 calli 802af34 <__divdi3>
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
8015728: 29 64 00 74 lw r4,(r11+116)
801572c: b8 40 60 00 mv r12,r2
/*
* 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 ) {
8015730: 50 82 00 06 bgeu r4,r2,8015748 <_Timer_server_Body+0x100>
/*
* 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 );
8015734: b9 c0 08 00 mv r1,r14
8015738: c8 44 10 00 sub r2,r2,r4
801573c: b9 e0 18 00 mv r3,r15
8015740: f8 00 15 4c calli 801ac70 <_Watchdog_Adjust_to_chain>
8015744: e0 00 00 06 bi 801575c <_Timer_server_Body+0x114>
} else if ( snapshot < last_snapshot ) {
8015748: 50 44 00 05 bgeu r2,r4,801575c <_Timer_server_Body+0x114>
/*
* 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 );
801574c: b9 c0 08 00 mv r1,r14
8015750: 34 02 00 01 mvi r2,1
8015754: c8 8c 18 00 sub r3,r4,r12
8015758: f8 00 15 0f calli 801ab94 <_Watchdog_Adjust>
}
watchdogs->last_snapshot = snapshot;
801575c: 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 ) {
8015760: 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 );
8015764: 29 63 00 78 lw r3,(r11+120)
8015768: b8 60 08 00 mv r1,r3
801576c: f8 00 03 8a calli 8016594 <_Chain_Get>
8015770: b8 20 10 00 mv r2,r1
if ( timer == NULL ) {
8015774: 44 20 00 09 be r1,r0,8015798 <_Timer_server_Body+0x150>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8015778: 28 23 00 38 lw r3,(r1+56)
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
801577c: ba 60 08 00 mv r1,r19
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8015780: 44 6c 00 03 be r3,r12,801578c <_Timer_server_Body+0x144>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
8015784: 5c 78 ff f8 bne r3,r24,8015764 <_Timer_server_Body+0x11c> <== NEVER TAKEN
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
8015788: b9 c0 08 00 mv r1,r14
801578c: 34 42 00 10 addi r2,r2,16
8015790: f8 00 15 5a calli 801acf8 <_Watchdog_Insert>
8015794: e3 ff ff f4 bi 8015764 <_Timer_server_Body+0x11c>
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
8015798: 90 00 10 00 rcsr r2,IE
801579c: a0 52 08 00 and r1,r2,r18
80157a0: d0 01 00 00 wcsr IE,r1
if ( _Chain_Is_empty( insert_chain ) ) {
80157a4: 2b 81 00 50 lw r1,(sp+80)
80157a8: 5c 37 00 06 bne r1,r23,80157c0 <_Timer_server_Body+0x178> <== NEVER TAKEN
ts->insert_chain = NULL;
80157ac: 59 60 00 78 sw (r11+120),r0
_ISR_Enable( level );
80157b0: 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 ) ) {
80157b4: 2b 81 00 44 lw r1,(sp+68)
80157b8: 5c 31 00 04 bne r1,r17,80157c8 <_Timer_server_Body+0x180>
80157bc: e0 00 00 15 bi 8015810 <_Timer_server_Body+0x1c8>
ts->insert_chain = NULL;
_ISR_Enable( level );
break;
} else {
_ISR_Enable( level );
80157c0: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
80157c4: e3 ff ff cb bi 80156f0 <_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 );
80157c8: 90 00 18 00 rcsr r3,IE
80157cc: a0 72 08 00 and r1,r3,r18
80157d0: d0 01 00 00 wcsr IE,r1
initialized = false;
}
#endif
return status;
}
80157d4: 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))
80157d8: 44 51 00 0c be r2,r17,8015808 <_Timer_server_Body+0x1c0>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
80157dc: 28 44 00 00 lw r4,(r2+0)
head->next = new_first;
80157e0: 5b 84 00 44 sw (sp+68),r4
new_first->previous = head;
80157e4: 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 ) {
80157e8: 44 40 00 08 be r2,r0,8015808 <_Timer_server_Body+0x1c0> <== NEVER TAKEN
watchdog->state = WATCHDOG_INACTIVE;
80157ec: 58 40 00 08 sw (r2+8),r0
_ISR_Enable( level );
80157f0: 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 );
80157f4: 28 43 00 1c lw r3,(r2+28)
80157f8: 28 41 00 20 lw r1,(r2+32)
80157fc: 28 42 00 24 lw r2,(r2+36)
8015800: d8 60 00 00 call r3
}
8015804: e3 ff ff f1 bi 80157c8 <_Timer_server_Body+0x180>
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
_ISR_Enable( level );
} else {
_ISR_Enable( level );
8015808: d0 03 00 00 wcsr IE,r3
801580c: e3 ff ff b8 bi 80156ec <_Timer_server_Body+0xa4>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
8015810: 31 60 00 7c sb (r11+124),r0
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
8015814: fb ff ff 4d calli 8015548 <_Thread_Disable_dispatch>
_Thread_Set_state( ts->thread, STATES_DELAYING );
8015818: 29 61 00 00 lw r1,(r11+0)
801581c: 34 02 00 08 mvi r2,8
8015820: f8 00 13 c9 calli 801a744 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
8015824: b9 60 08 00 mv r1,r11
8015828: fb ff ff 4e calli 8015560 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
801582c: b9 60 08 00 mv r1,r11
8015830: fb ff ff 69 calli 80155d4 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
8015834: f8 00 10 de calli 8019bac <_Thread_Enable_dispatch>
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
8015838: 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;
801583c: 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 );
8015840: f8 00 15 8b calli 801ae6c <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
8015844: ba 80 08 00 mv r1,r20
8015848: f8 00 15 89 calli 801ae6c <_Watchdog_Remove>
801584c: e3 ff ff a8 bi 80156ec <_Timer_server_Body+0xa4>
08015850 <_Timer_server_Schedule_operation_method>:
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
8015850: 37 9c ff f0 addi sp,sp,-16
8015854: 5b 8b 00 10 sw (sp+16),r11
8015858: 5b 8c 00 0c sw (sp+12),r12
801585c: 5b 8d 00 08 sw (sp+8),r13
8015860: 5b 9d 00 04 sw (sp+4),ra
8015864: b8 20 58 00 mv r11,r1
if ( ts->insert_chain == NULL ) {
8015868: 28 21 00 78 lw r1,(r1+120)
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
801586c: b8 40 60 00 mv r12,r2
if ( ts->insert_chain == NULL ) {
8015870: 5c 20 00 49 bne r1,r0,8015994 <_Timer_server_Schedule_operation_method+0x144>
* 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();
8015874: fb ff ff 35 calli 8015548 <_Thread_Disable_dispatch>
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8015878: 29 81 00 38 lw r1,(r12+56)
801587c: 34 02 00 01 mvi r2,1
8015880: 5c 22 00 1d bne r1,r2,80158f4 <_Timer_server_Schedule_operation_method+0xa4>
/*
* We have to advance the last known ticks value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
8015884: 90 00 10 00 rcsr r2,IE
8015888: 34 01 ff fe mvi r1,-2
801588c: a0 41 08 00 and r1,r2,r1
8015890: d0 01 00 00 wcsr IE,r1
snapshot = _Watchdog_Ticks_since_boot;
8015894: 78 01 08 03 mvhi r1,0x803
8015898: 38 21 fe 38 ori r1,r1,0xfe38
801589c: 28 23 00 00 lw r3,(r1+0)
initialized = false;
}
#endif
return status;
}
80158a0: 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;
80158a4: 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 );
80158a8: 35 64 00 34 addi r4,r11,52
if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) {
80158ac: 44 24 00 07 be r1,r4,80158c8 <_Timer_server_Schedule_operation_method+0x78>
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
80158b0: 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;
80158b4: 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;
80158b8: 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) {
80158bc: 50 a6 00 02 bgeu r5,r6,80158c4 <_Timer_server_Schedule_operation_method+0x74>
delta_interval -= delta;
80158c0: c8 c5 20 00 sub r4,r6,r5
} else {
delta_interval = 0;
}
first_watchdog->delta_interval = delta_interval;
80158c4: 58 24 00 10 sw (r1+16),r4
}
ts->Interval_watchdogs.last_snapshot = snapshot;
80158c8: 59 63 00 3c sw (r11+60),r3
_ISR_Enable( level );
80158cc: d0 02 00 00 wcsr IE,r2
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
80158d0: 35 61 00 30 addi r1,r11,48
80158d4: 35 82 00 10 addi r2,r12,16
80158d8: f8 00 15 08 calli 801acf8 <_Watchdog_Insert>
if ( !ts->active ) {
80158dc: 41 61 00 7c lbu r1,(r11+124)
80158e0: 20 21 00 ff andi r1,r1,0xff
80158e4: 5c 20 00 2a bne r1,r0,801598c <_Timer_server_Schedule_operation_method+0x13c>
_Timer_server_Reset_interval_system_watchdog( ts );
80158e8: b9 60 08 00 mv r1,r11
80158ec: fb ff ff 1d calli 8015560 <_Timer_server_Reset_interval_system_watchdog>
80158f0: e0 00 00 27 bi 801598c <_Timer_server_Schedule_operation_method+0x13c>
}
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
80158f4: 34 02 00 03 mvi r2,3
80158f8: 5c 22 00 25 bne r1,r2,801598c <_Timer_server_Schedule_operation_method+0x13c>
/*
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
80158fc: 90 00 68 00 rcsr r13,IE
8015900: 34 01 ff fe mvi r1,-2
8015904: a1 a1 08 00 and r1,r13,r1
8015908: d0 01 00 00 wcsr IE,r1
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
801590c: 78 03 08 03 mvhi r3,0x803
8015910: 78 05 08 03 mvhi r5,0x803
8015914: 38 63 fc d0 ori r3,r3,0xfcd0
8015918: 38 a5 88 cc ori r5,r5,0x88cc
801591c: 28 61 00 00 lw r1,(r3+0)
8015920: 28 62 00 04 lw r2,(r3+4)
8015924: 28 a4 00 00 lw r4,(r5+0)
8015928: 34 03 00 00 mvi r3,0
801592c: f8 00 55 82 calli 802af34 <__divdi3>
initialized = false;
}
#endif
return status;
}
8015930: 29 61 00 68 lw r1,(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();
last_snapshot = ts->TOD_watchdogs.last_snapshot;
8015934: 29 65 00 74 lw r5,(r11+116)
8015938: 35 63 00 6c addi r3,r11,108
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
801593c: 44 23 00 0a be r1,r3,8015964 <_Timer_server_Schedule_operation_method+0x114>
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
8015940: 28 24 00 10 lw r4,(r1+16)
}
} else {
/*
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
8015944: b4 85 18 00 add r3,r4,r5
delta_interval += delta;
8015948: c8 62 18 00 sub r3,r3,r2
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 ) {
801594c: 50 a2 00 05 bgeu r5,r2,8015960 <_Timer_server_Schedule_operation_method+0x110>
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
8015950: c8 45 28 00 sub r5,r2,r5
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
8015954: 34 03 00 00 mvi r3,0
if ( snapshot > last_snapshot ) {
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
if (delta_interval > delta) {
8015958: 50 a4 00 02 bgeu r5,r4,8015960 <_Timer_server_Schedule_operation_method+0x110><== NEVER TAKEN
delta_interval -= delta;
801595c: 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;
8015960: 58 23 00 10 sw (r1+16),r3
}
ts->TOD_watchdogs.last_snapshot = snapshot;
8015964: 59 62 00 74 sw (r11+116),r2
_ISR_Enable( level );
8015968: d0 0d 00 00 wcsr IE,r13
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
801596c: 35 61 00 68 addi r1,r11,104
8015970: 35 82 00 10 addi r2,r12,16
8015974: f8 00 14 e1 calli 801acf8 <_Watchdog_Insert>
if ( !ts->active ) {
8015978: 41 61 00 7c lbu r1,(r11+124)
801597c: 20 21 00 ff andi r1,r1,0xff
8015980: 5c 20 00 03 bne r1,r0,801598c <_Timer_server_Schedule_operation_method+0x13c>
_Timer_server_Reset_tod_system_watchdog( ts );
8015984: b9 60 08 00 mv r1,r11
8015988: fb ff ff 13 calli 80155d4 <_Timer_server_Reset_tod_system_watchdog>
}
}
_Thread_Enable_dispatch();
801598c: f8 00 10 88 calli 8019bac <_Thread_Enable_dispatch>
8015990: e0 00 00 03 bi 801599c <_Timer_server_Schedule_operation_method+0x14c>
* 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 );
8015994: 29 61 00 78 lw r1,(r11+120)
8015998: f8 00 02 f3 calli 8016564 <_Chain_Append>
}
}
801599c: 2b 9d 00 04 lw ra,(sp+4)
80159a0: 2b 8b 00 10 lw r11,(sp+16)
80159a4: 2b 8c 00 0c lw r12,(sp+12)
80159a8: 2b 8d 00 08 lw r13,(sp+8)
80159ac: 37 9c 00 10 addi sp,sp,16
80159b0: c3 a0 00 00 ret
08008880 <_User_extensions_Handler_initialization>:
}
}
void _User_extensions_Handler_initialization(void)
{
8008880: 37 9c ff f4 addi sp,sp,-12
8008884: 5b 8b 00 08 sw (sp+8),r11
8008888: 5b 9d 00 04 sw (sp+4),ra
uint32_t number_of_initial_extensions =
800888c: 78 01 08 01 mvhi r1,0x801
8008890: 38 21 87 ec ori r1,r1,0x87ec
8008894: 28 2b 00 40 lw r11,(r1+64)
rtems_configuration_get_number_of_initial_extensions();
if ( number_of_initial_extensions > 0 ) {
8008898: 45 60 00 0d be r11,r0,80088cc <_User_extensions_Handler_initialization+0x4c><== NEVER TAKEN
User_extensions_Switch_control *initial_extension_switch_controls =
_Workspace_Allocate_or_fatal_error(
number_of_initial_extensions
* sizeof( *initial_extension_switch_controls )
800889c: 34 02 00 01 mvi r2,1
80088a0: b9 60 08 00 mv r1,r11
80088a4: f8 00 3c 27 calli 8017940 <__ashlsi3>
80088a8: 34 02 00 02 mvi r2,2
80088ac: b4 2b 08 00 add r1,r1,r11
80088b0: f8 00 3c 24 calli 8017940 <__ashlsi3>
uint32_t number_of_initial_extensions =
rtems_configuration_get_number_of_initial_extensions();
if ( number_of_initial_extensions > 0 ) {
User_extensions_Switch_control *initial_extension_switch_controls =
_Workspace_Allocate_or_fatal_error(
80088b4: f8 00 00 fc calli 8008ca4 <_Workspace_Allocate_or_fatal_error>
number_of_initial_extensions
* sizeof( *initial_extension_switch_controls )
);
User_extensions_Switch_context ctx = { initial_extension_switch_controls };
_User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
80088b8: 78 02 08 00 mvhi r2,0x800
User_extensions_Switch_control *initial_extension_switch_controls =
_Workspace_Allocate_or_fatal_error(
number_of_initial_extensions
* sizeof( *initial_extension_switch_controls )
);
User_extensions_Switch_context ctx = { initial_extension_switch_controls };
80088bc: 5b 81 00 0c sw (sp+12),r1
_User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
80088c0: 38 42 88 40 ori r2,r2,0x8840
80088c4: 37 81 00 0c addi r1,sp,12
80088c8: fb ff ff b0 calli 8008788 <_User_extensions_Iterate>
}
}
80088cc: 2b 9d 00 04 lw ra,(sp+4)
80088d0: 2b 8b 00 08 lw r11,(sp+8)
80088d4: 37 9c 00 0c addi sp,sp,12
80088d8: c3 a0 00 00 ret
080091f8 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
80091f8: 37 9c ff e4 addi sp,sp,-28
80091fc: 5b 8b 00 1c sw (sp+28),r11
8009200: 5b 8c 00 18 sw (sp+24),r12
8009204: 5b 8d 00 14 sw (sp+20),r13
8009208: 5b 8e 00 10 sw (sp+16),r14
800920c: 5b 8f 00 0c sw (sp+12),r15
8009210: 5b 90 00 08 sw (sp+8),r16
8009214: 5b 9d 00 04 sw (sp+4),ra
8009218: b8 20 60 00 mv r12,r1
800921c: b8 60 58 00 mv r11,r3
ISR_Level level;
_ISR_Disable( level );
8009220: 90 00 08 00 rcsr r1,IE
8009224: 34 03 ff fe mvi r3,-2
8009228: a0 23 18 00 and r3,r1,r3
800922c: d0 03 00 00 wcsr IE,r3
}
}
_ISR_Enable( level );
}
8009230: 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 );
8009234: 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 ) ) {
8009238: 44 6e 00 1d be r3,r14,80092ac <_Watchdog_Adjust+0xb4>
switch ( direction ) {
800923c: 44 40 00 04 be r2,r0,800924c <_Watchdog_Adjust+0x54>
8009240: 34 04 00 01 mvi r4,1
8009244: 5c 44 00 1a bne r2,r4,80092ac <_Watchdog_Adjust+0xb4> <== NEVER TAKEN
8009248: e0 00 00 04 bi 8009258 <_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;
800924c: 34 10 00 01 mvi r16,1
_ISR_Enable( level );
_Watchdog_Tickle( header );
_ISR_Disable( level );
8009250: 34 0f ff fe mvi r15,-2
8009254: e0 00 00 15 bi 80092a8 <_Watchdog_Adjust+0xb0>
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
8009258: 28 62 00 10 lw r2,(r3+16)
800925c: b4 4b 58 00 add r11,r2,r11
8009260: 58 6b 00 10 sw (r3+16),r11
break;
8009264: e0 00 00 12 bi 80092ac <_Watchdog_Adjust+0xb4>
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) _Chain_First( header ) );
8009268: 29 82 00 00 lw r2,(r12+0)
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
800926c: 28 4d 00 10 lw r13,(r2+16)
8009270: 51 6d 00 04 bgeu r11,r13,8009280 <_Watchdog_Adjust+0x88>
_Watchdog_First( header )->delta_interval -= units;
8009274: c9 ab 58 00 sub r11,r13,r11
8009278: 58 4b 00 10 sw (r2+16),r11
break;
800927c: e0 00 00 0c bi 80092ac <_Watchdog_Adjust+0xb4>
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
8009280: 58 50 00 10 sw (r2+16),r16
_ISR_Enable( level );
8009284: d0 01 00 00 wcsr IE,r1
_Watchdog_Tickle( header );
8009288: b9 80 08 00 mv r1,r12
800928c: f8 00 00 98 calli 80094ec <_Watchdog_Tickle>
_ISR_Disable( level );
8009290: 90 00 08 00 rcsr r1,IE
8009294: a0 2f 10 00 and r2,r1,r15
8009298: d0 02 00 00 wcsr IE,r2
if ( _Chain_Is_empty( header ) )
800929c: 29 82 00 00 lw r2,(r12+0)
80092a0: 44 4e 00 03 be r2,r14,80092ac <_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;
80092a4: 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 ) {
80092a8: 5d 60 ff f0 bne r11,r0,8009268 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN
}
break;
}
}
_ISR_Enable( level );
80092ac: d0 01 00 00 wcsr IE,r1
}
80092b0: 2b 9d 00 04 lw ra,(sp+4)
80092b4: 2b 8b 00 1c lw r11,(sp+28)
80092b8: 2b 8c 00 18 lw r12,(sp+24)
80092bc: 2b 8d 00 14 lw r13,(sp+20)
80092c0: 2b 8e 00 10 lw r14,(sp+16)
80092c4: 2b 8f 00 0c lw r15,(sp+12)
80092c8: 2b 90 00 08 lw r16,(sp+8)
80092cc: 37 9c 00 1c addi sp,sp,28
80092d0: c3 a0 00 00 ret
08008a50 <_Watchdog_Remove>:
{
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
8008a50: 90 00 28 00 rcsr r5,IE
8008a54: 34 02 ff fe mvi r2,-2
8008a58: a0 a2 10 00 and r2,r5,r2
8008a5c: d0 02 00 00 wcsr IE,r2
previous_state = the_watchdog->state;
8008a60: 28 23 00 08 lw r3,(r1+8)
switch ( previous_state ) {
8008a64: 34 02 00 01 mvi r2,1
8008a68: 44 62 00 05 be r3,r2,8008a7c <_Watchdog_Remove+0x2c>
8008a6c: 44 60 00 1b be r3,r0,8008ad8 <_Watchdog_Remove+0x88>
8008a70: 34 02 00 03 mvi r2,3
8008a74: 54 62 00 19 bgu r3,r2,8008ad8 <_Watchdog_Remove+0x88> <== NEVER TAKEN
8008a78: e0 00 00 03 bi 8008a84 <_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;
8008a7c: 58 20 00 08 sw (r1+8),r0
break;
8008a80: e0 00 00 16 bi 8008ad8 <_Watchdog_Remove+0x88>
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
_ISR_Enable( level );
return( previous_state );
}
8008a84: 28 22 00 00 lw r2,(r1+0)
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
8008a88: 58 20 00 08 sw (r1+8),r0
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
8008a8c: 28 44 00 00 lw r4,(r2+0)
8008a90: 44 80 00 05 be r4,r0,8008aa4 <_Watchdog_Remove+0x54>
next_watchdog->delta_interval += the_watchdog->delta_interval;
8008a94: 28 46 00 10 lw r6,(r2+16)
8008a98: 28 24 00 10 lw r4,(r1+16)
8008a9c: b4 c4 20 00 add r4,r6,r4
8008aa0: 58 44 00 10 sw (r2+16),r4
if ( _Watchdog_Sync_count )
8008aa4: 78 04 08 01 mvhi r4,0x801
8008aa8: 38 84 aa 5c ori r4,r4,0xaa5c
8008aac: 28 84 00 00 lw r4,(r4+0)
8008ab0: 44 80 00 07 be r4,r0,8008acc <_Watchdog_Remove+0x7c>
_Watchdog_Sync_level = _ISR_Nest_level;
8008ab4: 78 04 08 01 mvhi r4,0x801
8008ab8: 38 84 ae 00 ori r4,r4,0xae00
8008abc: 28 86 00 08 lw r6,(r4+8)
8008ac0: 78 04 08 01 mvhi r4,0x801
8008ac4: 38 84 a9 fc ori r4,r4,0xa9fc
8008ac8: 58 86 00 00 sw (r4+0),r6
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
8008acc: 28 24 00 04 lw r4,(r1+4)
next->previous = previous;
8008ad0: 58 44 00 04 sw (r2+4),r4
previous->next = next;
8008ad4: 58 82 00 00 sw (r4+0),r2
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
8008ad8: 78 02 08 01 mvhi r2,0x801
8008adc: 38 42 aa 60 ori r2,r2,0xaa60
8008ae0: 28 42 00 00 lw r2,(r2+0)
8008ae4: 58 22 00 18 sw (r1+24),r2
_ISR_Enable( level );
8008ae8: d0 05 00 00 wcsr IE,r5
return( previous_state );
}
8008aec: b8 60 08 00 mv r1,r3
8008af0: c3 a0 00 00 ret
08008e0c <_Watchdog_Report_chain>:
void _Watchdog_Report_chain(
const char *name,
Chain_Control *header
)
{
8008e0c: 37 9c ff ec addi sp,sp,-20
8008e10: 5b 8b 00 14 sw (sp+20),r11
8008e14: 5b 8c 00 10 sw (sp+16),r12
8008e18: 5b 8d 00 0c sw (sp+12),r13
8008e1c: 5b 8e 00 08 sw (sp+8),r14
8008e20: 5b 9d 00 04 sw (sp+4),ra
8008e24: b8 20 70 00 mv r14,r1
8008e28: b8 40 60 00 mv r12,r2
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
8008e2c: 90 00 68 00 rcsr r13,IE
8008e30: 34 01 ff fe mvi r1,-2
8008e34: a1 a1 08 00 and r1,r13,r1
8008e38: d0 01 00 00 wcsr IE,r1
printk( "Watchdog Chain: %s %p\n", name, header );
8008e3c: 78 01 08 01 mvhi r1,0x801
8008e40: b9 80 18 00 mv r3,r12
8008e44: 38 21 f6 64 ori r1,r1,0xf664
8008e48: b9 c0 10 00 mv r2,r14
8008e4c: fb ff e8 93 calli 8003098 <printk>
printk( "== end of %s \n", name );
} else {
printk( "Chain is empty\n" );
}
_ISR_Enable( level );
}
8008e50: 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 );
8008e54: 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 ) ) {
8008e58: 45 6c 00 0b be r11,r12,8008e84 <_Watchdog_Report_chain+0x78>
node != _Chain_Tail(header) ;
node = node->next )
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
8008e5c: b9 60 10 00 mv r2,r11
8008e60: 34 01 00 00 mvi r1,0
8008e64: f8 00 00 13 calli 8008eb0 <_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 )
8008e68: 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 ) ;
8008e6c: 5d 6c ff fc bne r11,r12,8008e5c <_Watchdog_Report_chain+0x50><== NEVER TAKEN
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
8008e70: 78 01 08 01 mvhi r1,0x801
8008e74: 38 21 f6 7c ori r1,r1,0xf67c
8008e78: b9 c0 10 00 mv r2,r14
8008e7c: fb ff e8 87 calli 8003098 <printk>
8008e80: e0 00 00 04 bi 8008e90 <_Watchdog_Report_chain+0x84>
} else {
printk( "Chain is empty\n" );
8008e84: 78 01 08 01 mvhi r1,0x801
8008e88: 38 21 f6 8c ori r1,r1,0xf68c
8008e8c: fb ff e8 83 calli 8003098 <printk>
}
_ISR_Enable( level );
8008e90: d0 0d 00 00 wcsr IE,r13
}
8008e94: 2b 9d 00 04 lw ra,(sp+4)
8008e98: 2b 8b 00 14 lw r11,(sp+20)
8008e9c: 2b 8c 00 10 lw r12,(sp+16)
8008ea0: 2b 8d 00 0c lw r13,(sp+12)
8008ea4: 2b 8e 00 08 lw r14,(sp+8)
8008ea8: 37 9c 00 14 addi sp,sp,20
8008eac: c3 a0 00 00 ret
0800cce8 <_Watchdog_Tickle>:
#include <rtems/score/watchdog.h>
void _Watchdog_Tickle(
Chain_Control *header
)
{
800cce8: 37 9c ff e4 addi sp,sp,-28
800ccec: 5b 8b 00 1c sw (sp+28),r11
800ccf0: 5b 8c 00 18 sw (sp+24),r12
800ccf4: 5b 8d 00 14 sw (sp+20),r13
800ccf8: 5b 8e 00 10 sw (sp+16),r14
800ccfc: 5b 8f 00 0c sw (sp+12),r15
800cd00: 5b 90 00 08 sw (sp+8),r16
800cd04: 5b 9d 00 04 sw (sp+4),ra
800cd08: 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 );
800cd0c: 90 00 18 00 rcsr r3,IE
800cd10: 34 01 ff fe mvi r1,-2
800cd14: a0 61 08 00 and r1,r3,r1
800cd18: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
800cd1c: 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 );
800cd20: 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 );
800cd24: b8 60 10 00 mv r2,r3
if ( _Chain_Is_empty( header ) )
800cd28: 45 6e 00 1a be r11,r14,800cd90 <_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) {
800cd2c: 29 61 00 10 lw r1,(r11+16)
800cd30: 44 20 00 04 be r1,r0,800cd40 <_Watchdog_Tickle+0x58> <== NEVER TAKEN
the_watchdog->delta_interval--;
800cd34: 34 21 ff ff addi r1,r1,-1
800cd38: 59 61 00 10 sw (r11+16),r1
if ( the_watchdog->delta_interval != 0 )
800cd3c: 5c 20 00 15 bne r1,r0,800cd90 <_Watchdog_Tickle+0xa8>
#include <rtems/score/watchdog.h>
void _Watchdog_Tickle(
Chain_Control *header
)
{
800cd40: b8 60 68 00 mv r13,r3
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
_ISR_Enable( level );
switch( watchdog_state ) {
800cd44: 34 10 00 02 mvi r16,2
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
800cd48: 34 0f ff fe mvi r15,-2
800cd4c: e0 00 00 02 bi 800cd54 <_Watchdog_Tickle+0x6c>
800cd50: b8 40 68 00 mv r13,r2
if ( the_watchdog->delta_interval != 0 )
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
800cd54: b9 60 08 00 mv r1,r11
800cd58: fb ff ff bb calli 800cc44 <_Watchdog_Remove>
_ISR_Enable( level );
800cd5c: d0 0d 00 00 wcsr IE,r13
switch( watchdog_state ) {
800cd60: 5c 30 00 05 bne r1,r16,800cd74 <_Watchdog_Tickle+0x8c> <== NEVER TAKEN
case WATCHDOG_ACTIVE:
(*the_watchdog->routine)(
800cd64: 29 63 00 1c lw r3,(r11+28)
800cd68: 29 61 00 20 lw r1,(r11+32)
800cd6c: 29 62 00 24 lw r2,(r11+36)
800cd70: d8 60 00 00 call r3
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
800cd74: 90 00 10 00 rcsr r2,IE
800cd78: a0 4f 08 00 and r1,r2,r15
800cd7c: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
800cd80: 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) );
800cd84: 45 6e 00 03 be r11,r14,800cd90 <_Watchdog_Tickle+0xa8>
}
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
800cd88: 29 61 00 10 lw r1,(r11+16)
800cd8c: 44 20 ff f1 be r1,r0,800cd50 <_Watchdog_Tickle+0x68>
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
800cd90: d0 02 00 00 wcsr IE,r2
}
800cd94: 2b 9d 00 04 lw ra,(sp+4)
800cd98: 2b 8b 00 1c lw r11,(sp+28)
800cd9c: 2b 8c 00 18 lw r12,(sp+24)
800cda0: 2b 8d 00 14 lw r13,(sp+20)
800cda4: 2b 8e 00 10 lw r14,(sp+16)
800cda8: 2b 8f 00 0c lw r15,(sp+12)
800cdac: 2b 90 00 08 lw r16,(sp+8)
800cdb0: 37 9c 00 1c addi sp,sp,28
800cdb4: c3 a0 00 00 ret
08008af4 <_Workspace_Handler_initialization>:
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
8008af4: 37 9c ff d0 addi sp,sp,-48
8008af8: 5b 8b 00 30 sw (sp+48),r11
8008afc: 5b 8c 00 2c sw (sp+44),r12
8008b00: 5b 8d 00 28 sw (sp+40),r13
8008b04: 5b 8e 00 24 sw (sp+36),r14
8008b08: 5b 8f 00 20 sw (sp+32),r15
8008b0c: 5b 90 00 1c sw (sp+28),r16
8008b10: 5b 91 00 18 sw (sp+24),r17
8008b14: 5b 92 00 14 sw (sp+20),r18
8008b18: 5b 93 00 10 sw (sp+16),r19
8008b1c: 5b 94 00 0c sw (sp+12),r20
8008b20: 5b 95 00 08 sw (sp+8),r21
8008b24: 5b 9d 00 04 sw (sp+4),ra
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
8008b28: 78 04 08 01 mvhi r4,0x801
8008b2c: 38 84 87 ec ori r4,r4,0x87ec
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
8008b30: b8 40 a8 00 mv r21,r2
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
8008b34: 40 82 00 32 lbu r2,(r4+50)
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
8008b38: b8 60 90 00 mv r18,r3
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
8008b3c: 28 8c 00 00 lw r12,(r4+0)
8008b40: 34 05 00 00 mvi r5,0
8008b44: 5c 40 00 02 bne r2,r0,8008b4c <_Workspace_Handler_initialization+0x58>
8008b48: 28 85 00 04 lw r5,(r4+4)
bool do_zero = rtems_configuration_get_do_zero_of_workspace();
8008b4c: 78 04 08 01 mvhi r4,0x801
8008b50: 38 84 87 ec ori r4,r4,0x87ec
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
8008b54: 78 0e 08 00 mvhi r14,0x800
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
8008b58: 78 0f 08 01 mvhi r15,0x801
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
8008b5c: b4 ac 60 00 add r12,r5,r12
bool do_zero = rtems_configuration_get_do_zero_of_workspace();
8008b60: 40 94 00 30 lbu r20,(r4+48)
bool unified = rtems_configuration_get_unified_work_area();
8008b64: 40 91 00 31 lbu r17,(r4+49)
8008b68: b8 20 58 00 mv r11,r1
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
8008b6c: 34 10 00 00 mvi r16,0
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
8008b70: 39 ce 62 44 ori r14,r14,0x6244
if ( do_zero ) {
memset( area->begin, 0, area->size );
}
if ( area->size > overhead ) {
8008b74: 34 13 00 0e mvi r19,14
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
8008b78: 39 ef a9 88 ori r15,r15,0xa988
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
8008b7c: e0 00 00 22 bi 8008c04 <_Workspace_Handler_initialization+0x110>
Heap_Area *area = &areas [i];
if ( do_zero ) {
8008b80: 46 80 00 05 be r20,r0,8008b94 <_Workspace_Handler_initialization+0xa0>
memset( area->begin, 0, area->size );
8008b84: 29 61 00 00 lw r1,(r11+0)
8008b88: 29 63 00 04 lw r3,(r11+4)
8008b8c: 34 02 00 00 mvi r2,0
8008b90: f8 00 27 68 calli 8012930 <memset>
}
if ( area->size > overhead ) {
8008b94: 29 6d 00 04 lw r13,(r11+4)
8008b98: 52 6d 00 19 bgeu r19,r13,8008bfc <_Workspace_Handler_initialization+0x108><== NEVER TAKEN
uintptr_t space_available;
uintptr_t size;
if ( unified ) {
8008b9c: 5e 20 00 07 bne r17,r0,8008bb8 <_Workspace_Handler_initialization+0xc4>
size = area->size;
} else {
if ( remaining > 0 ) {
8008ba0: 45 91 00 05 be r12,r17,8008bb4 <_Workspace_Handler_initialization+0xc0><== NEVER TAKEN
size = remaining < area->size - overhead ?
8008ba4: 35 a1 ff f2 addi r1,r13,-14
remaining + overhead : area->size;
8008ba8: 51 81 00 04 bgeu r12,r1,8008bb8 <_Workspace_Handler_initialization+0xc4><== NEVER TAKEN
8008bac: 35 8d 00 0e addi r13,r12,14
8008bb0: e0 00 00 02 bi 8008bb8 <_Workspace_Handler_initialization+0xc4>
} else {
size = 0;
8008bb4: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED
}
}
space_available = (*init_or_extend)(
8008bb8: 29 62 00 00 lw r2,(r11+0)
8008bbc: b9 a0 18 00 mv r3,r13
8008bc0: b9 e0 08 00 mv r1,r15
8008bc4: 34 04 00 04 mvi r4,4
8008bc8: d9 c0 00 00 call r14
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
8008bcc: 29 62 00 00 lw r2,(r11+0)
8008bd0: b4 4d 10 00 add r2,r2,r13
8008bd4: 59 62 00 00 sw (r11+0),r2
area->size -= size;
8008bd8: 29 62 00 04 lw r2,(r11+4)
8008bdc: c8 4d 68 00 sub r13,r2,r13
8008be0: 59 6d 00 04 sw (r11+4),r13
if ( space_available < remaining ) {
8008be4: 50 2c 00 04 bgeu r1,r12,8008bf4 <_Workspace_Handler_initialization+0x100><== ALWAYS TAKEN
remaining -= space_available;
8008be8: c9 81 60 00 sub r12,r12,r1 <== NOT EXECUTED
} else {
remaining = 0;
}
init_or_extend = extend;
8008bec: ba 40 70 00 mv r14,r18 <== NOT EXECUTED
8008bf0: e0 00 00 03 bi 8008bfc <_Workspace_Handler_initialization+0x108><== NOT EXECUTED
8008bf4: ba 40 70 00 mv r14,r18
area->size -= size;
if ( space_available < remaining ) {
remaining -= space_available;
} else {
remaining = 0;
8008bf8: 34 0c 00 00 mvi r12,0
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
8008bfc: 36 10 00 01 addi r16,r16,1
8008c00: 35 6b 00 08 addi r11,r11,8
8008c04: 56 b0 ff df bgu r21,r16,8008b80 <_Workspace_Handler_initialization+0x8c>
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
8008c08: 45 80 00 05 be r12,r0,8008c1c <_Workspace_Handler_initialization+0x128>
_Internal_error_Occurred(
8008c0c: 34 01 00 00 mvi r1,0
8008c10: 34 02 00 01 mvi r2,1
8008c14: 34 03 00 02 mvi r3,2
8008c18: fb ff f6 3b calli 8006504 <_Internal_error_Occurred>
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
);
}
}
8008c1c: 2b 9d 00 04 lw ra,(sp+4)
8008c20: 2b 8b 00 30 lw r11,(sp+48)
8008c24: 2b 8c 00 2c lw r12,(sp+44)
8008c28: 2b 8d 00 28 lw r13,(sp+40)
8008c2c: 2b 8e 00 24 lw r14,(sp+36)
8008c30: 2b 8f 00 20 lw r15,(sp+32)
8008c34: 2b 90 00 1c lw r16,(sp+28)
8008c38: 2b 91 00 18 lw r17,(sp+24)
8008c3c: 2b 92 00 14 lw r18,(sp+20)
8008c40: 2b 93 00 10 lw r19,(sp+16)
8008c44: 2b 94 00 0c lw r20,(sp+12)
8008c48: 2b 95 00 08 lw r21,(sp+8)
8008c4c: 37 9c 00 30 addi sp,sp,48
8008c50: c3 a0 00 00 ret
08003a8c <aio_cancel>:
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
8003a8c: 37 9c ff e8 addi sp,sp,-24
8003a90: 5b 8b 00 18 sw (sp+24),r11
8003a94: 5b 8c 00 14 sw (sp+20),r12
8003a98: 5b 8d 00 10 sw (sp+16),r13
8003a9c: 5b 8e 00 0c sw (sp+12),r14
8003aa0: 5b 8f 00 08 sw (sp+8),r15
8003aa4: 5b 9d 00 04 sw (sp+4),ra
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
8003aa8: 78 0b 08 01 mvhi r11,0x801
8003aac: 39 6b 78 40 ori r11,r11,0x7840
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
8003ab0: b8 20 70 00 mv r14,r1
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
8003ab4: b9 60 08 00 mv r1,r11
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
8003ab8: b8 40 60 00 mv r12,r2
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
8003abc: f8 00 04 dc calli 8004e2c <pthread_mutex_lock>
if (fcntl (fildes, F_GETFD) < 0) {
8003ac0: b9 c0 08 00 mv r1,r14
8003ac4: 34 02 00 01 mvi r2,1
8003ac8: f8 00 1c 56 calli 800ac20 <fcntl>
8003acc: 4c 20 00 06 bge r1,r0,8003ae4 <aio_cancel+0x58>
pthread_mutex_unlock(&aio_request_queue.mutex);
8003ad0: b9 60 08 00 mv r1,r11
8003ad4: f8 00 05 09 calli 8004ef8 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EBADF);
8003ad8: f8 00 2c 97 calli 800ed34 <__errno>
8003adc: 34 02 00 09 mvi r2,9
8003ae0: e0 00 00 32 bi 8003ba8 <aio_cancel+0x11c>
}
/* if aiocbp is NULL remove all request for given file descriptor */
if (aiocbp == NULL) {
8003ae4: 5d 80 00 2b bne r12,r0,8003b90 <aio_cancel+0x104>
AIO_printf ("Cancel all requests\n");
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
8003ae8: 78 01 08 01 mvhi r1,0x801
8003aec: 38 21 78 88 ori r1,r1,0x7888
8003af0: b9 c0 10 00 mv r2,r14
8003af4: 34 03 00 00 mvi r3,0
8003af8: f8 00 01 86 calli 8004110 <rtems_aio_search_fd>
8003afc: b8 20 68 00 mv r13,r1
if (r_chain == NULL) {
8003b00: 5c 2c 00 17 bne r1,r12,8003b5c <aio_cancel+0xd0>
AIO_printf ("Request chain not on [WQ]\n");
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003b04: 29 62 00 54 lw r2,(r11+84)
8003b08: 78 01 08 01 mvhi r1,0x801
8003b0c: 38 21 78 98 ori r1,r1,0x7898
8003b10: 44 41 00 3f be r2,r1,8003c0c <aio_cancel+0x180> <== NEVER TAKEN
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
8003b14: 78 01 08 01 mvhi r1,0x801
8003b18: 38 21 78 94 ori r1,r1,0x7894
8003b1c: b9 c0 10 00 mv r2,r14
8003b20: 34 03 00 00 mvi r3,0
8003b24: f8 00 01 7b calli 8004110 <rtems_aio_search_fd>
8003b28: b8 20 60 00 mv r12,r1
if (r_chain == NULL) {
8003b2c: 44 2d 00 38 be r1,r13,8003c0c <aio_cancel+0x180>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
8003b30: f8 00 0a 89 calli 8006554 <_Chain_Extract>
}
AIO_printf ("Request chain on [IQ]\n");
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
8003b34: b9 80 08 00 mv r1,r12
8003b38: f8 00 01 ac calli 80041e8 <rtems_aio_remove_fd>
pthread_mutex_destroy (&r_chain->mutex);
8003b3c: 35 8d 00 1c addi r13,r12,28
8003b40: b9 a0 08 00 mv r1,r13
8003b44: f8 00 04 00 calli 8004b44 <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->mutex);
8003b48: b9 a0 08 00 mv r1,r13
8003b4c: f8 00 02 ff calli 8004748 <pthread_cond_destroy>
free (r_chain);
8003b50: b9 80 08 00 mv r1,r12
8003b54: fb ff f7 62 calli 80018dc <free>
8003b58: e0 00 00 0a bi 8003b80 <aio_cancel+0xf4>
return AIO_ALLDONE;
}
AIO_printf ("Request chain on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
8003b5c: 34 2c 00 1c addi r12,r1,28
8003b60: b9 80 08 00 mv r1,r12
8003b64: f8 00 04 b2 calli 8004e2c <pthread_mutex_lock>
8003b68: b9 a0 08 00 mv r1,r13
8003b6c: f8 00 0a 7a calli 8006554 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
8003b70: b9 a0 08 00 mv r1,r13
8003b74: f8 00 01 9d calli 80041e8 <rtems_aio_remove_fd>
pthread_mutex_unlock (&r_chain->mutex);
8003b78: b9 80 08 00 mv r1,r12
8003b7c: f8 00 04 df calli 8004ef8 <pthread_mutex_unlock>
pthread_mutex_unlock (&aio_request_queue.mutex);
8003b80: b9 60 08 00 mv r1,r11
8003b84: f8 00 04 dd calli 8004ef8 <pthread_mutex_unlock>
return AIO_CANCELED;
8003b88: 34 0c 00 00 mvi r12,0
8003b8c: e0 00 00 2f bi 8003c48 <aio_cancel+0x1bc>
} else {
AIO_printf ("Cancel request\n");
if (aiocbp->aio_fildes != fildes) {
8003b90: 29 8f 00 00 lw r15,(r12+0)
8003b94: 45 ee 00 08 be r15,r14,8003bb4 <aio_cancel+0x128>
pthread_mutex_unlock (&aio_request_queue.mutex);
8003b98: b9 60 08 00 mv r1,r11
8003b9c: f8 00 04 d7 calli 8004ef8 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EINVAL);
8003ba0: f8 00 2c 65 calli 800ed34 <__errno>
8003ba4: 34 02 00 16 mvi r2,22
8003ba8: 58 22 00 00 sw (r1+0),r2
8003bac: 34 0c ff ff mvi r12,-1
8003bb0: e0 00 00 26 bi 8003c48 <aio_cancel+0x1bc>
}
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
8003bb4: 78 01 08 01 mvhi r1,0x801
8003bb8: 38 21 78 88 ori r1,r1,0x7888
8003bbc: b9 e0 10 00 mv r2,r15
8003bc0: 34 03 00 00 mvi r3,0
8003bc4: f8 00 01 53 calli 8004110 <rtems_aio_search_fd>
8003bc8: b8 20 68 00 mv r13,r1
if (r_chain == NULL) {
8003bcc: 5c 20 00 14 bne r1,r0,8003c1c <aio_cancel+0x190>
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003bd0: 29 62 00 54 lw r2,(r11+84)
8003bd4: 78 01 08 01 mvhi r1,0x801
8003bd8: 38 21 78 98 ori r1,r1,0x7898
8003bdc: 44 41 00 0c be r2,r1,8003c0c <aio_cancel+0x180> <== NEVER TAKEN
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
8003be0: 78 01 08 01 mvhi r1,0x801
8003be4: 38 21 78 94 ori r1,r1,0x7894
8003be8: b9 e0 10 00 mv r2,r15
8003bec: 34 03 00 00 mvi r3,0
8003bf0: f8 00 01 48 calli 8004110 <rtems_aio_search_fd>
if (r_chain == NULL) {
8003bf4: 44 20 ff e9 be r1,r0,8003b98 <aio_cancel+0x10c>
rtems_set_errno_and_return_minus_one (EINVAL);
}
AIO_printf ("Request on [IQ]\n");
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
8003bf8: b9 80 10 00 mv r2,r12
8003bfc: 34 21 00 08 addi r1,r1,8
8003c00: f8 00 01 95 calli 8004254 <rtems_aio_remove_req>
8003c04: b8 20 60 00 mv r12,r1
8003c08: e0 00 00 0e bi 8003c40 <aio_cancel+0x1b4>
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
} else {
pthread_mutex_unlock (&aio_request_queue.mutex);
8003c0c: b9 60 08 00 mv r1,r11
8003c10: f8 00 04 ba calli 8004ef8 <pthread_mutex_unlock>
return AIO_ALLDONE;
8003c14: 34 0c 00 02 mvi r12,2
8003c18: e0 00 00 0c bi 8003c48 <aio_cancel+0x1bc>
}
}
AIO_printf ("Request on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
8003c1c: 34 2e 00 1c addi r14,r1,28
8003c20: b9 c0 08 00 mv r1,r14
8003c24: f8 00 04 82 calli 8004e2c <pthread_mutex_lock>
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
8003c28: b9 80 10 00 mv r2,r12
8003c2c: 35 a1 00 08 addi r1,r13,8
8003c30: f8 00 01 89 calli 8004254 <rtems_aio_remove_req>
8003c34: b8 20 60 00 mv r12,r1
pthread_mutex_unlock (&r_chain->mutex);
8003c38: b9 c0 08 00 mv r1,r14
8003c3c: f8 00 04 af calli 8004ef8 <pthread_mutex_unlock>
pthread_mutex_unlock (&aio_request_queue.mutex);
8003c40: b9 60 08 00 mv r1,r11
8003c44: f8 00 04 ad calli 8004ef8 <pthread_mutex_unlock>
return result;
}
return AIO_ALLDONE;
}
8003c48: b9 80 08 00 mv r1,r12
8003c4c: 2b 9d 00 04 lw ra,(sp+4)
8003c50: 2b 8b 00 18 lw r11,(sp+24)
8003c54: 2b 8c 00 14 lw r12,(sp+20)
8003c58: 2b 8d 00 10 lw r13,(sp+16)
8003c5c: 2b 8e 00 0c lw r14,(sp+12)
8003c60: 2b 8f 00 08 lw r15,(sp+8)
8003c64: 37 9c 00 18 addi sp,sp,24
8003c68: c3 a0 00 00 ret
08003c74 <aio_fsync>:
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
8003c74: 37 9c ff f4 addi sp,sp,-12
8003c78: 5b 8b 00 0c sw (sp+12),r11
8003c7c: 5b 8c 00 08 sw (sp+8),r12
8003c80: 5b 9d 00 04 sw (sp+4),ra
8003c84: b8 40 58 00 mv r11,r2
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
8003c88: 34 02 20 00 mvi r2,8192
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
8003c8c: 34 0c 00 16 mvi r12,22
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
8003c90: 5c 22 00 09 bne r1,r2,8003cb4 <aio_fsync+0x40>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
8003c94: 29 61 00 00 lw r1,(r11+0)
8003c98: 34 02 00 03 mvi r2,3
8003c9c: f8 00 1b e1 calli 800ac20 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
8003ca0: 20 21 00 03 andi r1,r1,0x3
8003ca4: 34 21 ff ff addi r1,r1,-1
8003ca8: 34 02 00 01 mvi r2,1
8003cac: 50 41 00 09 bgeu r2,r1,8003cd0 <aio_fsync+0x5c>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
8003cb0: 34 0c 00 09 mvi r12,9
8003cb4: 34 01 ff ff mvi r1,-1
8003cb8: 59 6c 00 2c sw (r11+44),r12
8003cbc: 59 61 00 30 sw (r11+48),r1
8003cc0: f8 00 2c 1d calli 800ed34 <__errno>
8003cc4: 58 2c 00 00 sw (r1+0),r12
8003cc8: 34 01 ff ff mvi r1,-1
8003ccc: e0 00 00 09 bi 8003cf0 <aio_fsync+0x7c>
req = malloc (sizeof (rtems_aio_request));
8003cd0: 34 01 00 18 mvi r1,24
8003cd4: fb ff f8 67 calli 8001e70 <malloc>
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
8003cd8: 34 0c 00 0b mvi r12,11
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
8003cdc: 44 20 ff f6 be r1,r0,8003cb4 <aio_fsync+0x40> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
8003ce0: 58 2b 00 14 sw (r1+20),r11
req->aiocbp->aio_lio_opcode = LIO_SYNC;
8003ce4: 34 02 00 03 mvi r2,3
8003ce8: 59 62 00 28 sw (r11+40),r2
return rtems_aio_enqueue (req);
8003cec: f8 00 01 76 calli 80042c4 <rtems_aio_enqueue>
}
8003cf0: 2b 9d 00 04 lw ra,(sp+4)
8003cf4: 2b 8b 00 0c lw r11,(sp+12)
8003cf8: 2b 8c 00 08 lw r12,(sp+8)
8003cfc: 37 9c 00 0c addi sp,sp,12
8003d00: c3 a0 00 00 ret
0800451c <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
800451c: 37 9c ff f4 addi sp,sp,-12
8004520: 5b 8b 00 0c sw (sp+12),r11
8004524: 5b 8c 00 08 sw (sp+8),r12
8004528: 5b 9d 00 04 sw (sp+4),ra
800452c: b8 20 58 00 mv r11,r1
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
8004530: 28 21 00 00 lw r1,(r1+0)
8004534: 34 02 00 03 mvi r2,3
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
8004538: 34 0c 00 09 mvi r12,9
aio_read (struct aiocb *aiocbp)
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
800453c: f8 00 19 b9 calli 800ac20 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
8004540: 20 21 00 03 andi r1,r1,0x3
8004544: 7c 22 00 02 cmpnei r2,r1,2
8004548: 7c 21 00 00 cmpnei r1,r1,0
800454c: a0 41 08 00 and r1,r2,r1
8004550: 5c 20 00 04 bne r1,r0,8004560 <aio_read+0x44>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
8004554: 29 6c 00 10 lw r12,(r11+16)
8004558: 45 81 00 09 be r12,r1,800457c <aio_read+0x60>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
800455c: 34 0c 00 16 mvi r12,22
8004560: 34 01 ff ff mvi r1,-1
8004564: 59 6c 00 2c sw (r11+44),r12
8004568: 59 61 00 30 sw (r11+48),r1
800456c: f8 00 29 f2 calli 800ed34 <__errno>
8004570: 58 2c 00 00 sw (r1+0),r12
8004574: 34 01 ff ff mvi r1,-1
8004578: e0 00 00 0d bi 80045ac <aio_read+0x90>
if (aiocbp->aio_offset < 0)
800457c: 29 61 00 04 lw r1,(r11+4)
8004580: 4c 2c 00 02 bge r1,r12,8004588 <aio_read+0x6c>
8004584: e3 ff ff f6 bi 800455c <aio_read+0x40>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
8004588: 34 01 00 18 mvi r1,24
800458c: fb ff f6 39 calli 8001e70 <malloc>
if (req == NULL)
8004590: 5c 2c 00 03 bne r1,r12,800459c <aio_read+0x80> <== ALWAYS TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
8004594: 34 0c 00 0b mvi r12,11 <== NOT EXECUTED
8004598: e3 ff ff f2 bi 8004560 <aio_read+0x44> <== NOT EXECUTED
req->aiocbp = aiocbp;
800459c: 58 2b 00 14 sw (r1+20),r11
req->aiocbp->aio_lio_opcode = LIO_READ;
80045a0: 34 02 00 01 mvi r2,1
80045a4: 59 62 00 28 sw (r11+40),r2
return rtems_aio_enqueue (req);
80045a8: fb ff ff 47 calli 80042c4 <rtems_aio_enqueue>
}
80045ac: 2b 9d 00 04 lw ra,(sp+4)
80045b0: 2b 8b 00 0c lw r11,(sp+12)
80045b4: 2b 8c 00 08 lw r12,(sp+8)
80045b8: 37 9c 00 0c addi sp,sp,12
80045bc: c3 a0 00 00 ret
080045c8 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
80045c8: 37 9c ff f4 addi sp,sp,-12
80045cc: 5b 8b 00 0c sw (sp+12),r11
80045d0: 5b 8c 00 08 sw (sp+8),r12
80045d4: 5b 9d 00 04 sw (sp+4),ra
80045d8: b8 20 58 00 mv r11,r1
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
80045dc: 28 21 00 00 lw r1,(r1+0)
80045e0: 34 02 00 03 mvi r2,3
80045e4: f8 00 19 8f calli 800ac20 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
80045e8: 20 21 00 03 andi r1,r1,0x3
80045ec: 34 21 ff ff addi r1,r1,-1
80045f0: 34 02 00 01 mvi r2,1
80045f4: 50 41 00 03 bgeu r2,r1,8004600 <aio_write+0x38>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
80045f8: 34 0c 00 09 mvi r12,9
80045fc: e0 00 00 04 bi 800460c <aio_write+0x44>
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
8004600: 29 61 00 10 lw r1,(r11+16)
8004604: 44 20 00 09 be r1,r0,8004628 <aio_write+0x60>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
8004608: 34 0c 00 16 mvi r12,22
800460c: 34 01 ff ff mvi r1,-1
8004610: 59 6c 00 2c sw (r11+44),r12
8004614: 59 61 00 30 sw (r11+48),r1
8004618: f8 00 29 c7 calli 800ed34 <__errno>
800461c: 58 2c 00 00 sw (r1+0),r12
8004620: 34 01 ff ff mvi r1,-1
8004624: e0 00 00 0c bi 8004654 <aio_write+0x8c>
if (aiocbp->aio_offset < 0)
8004628: 29 62 00 04 lw r2,(r11+4)
800462c: 4c 41 00 02 bge r2,r1,8004634 <aio_write+0x6c>
8004630: e3 ff ff f6 bi 8004608 <aio_write+0x40>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
8004634: 34 01 00 18 mvi r1,24
8004638: fb ff f6 0e calli 8001e70 <malloc>
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
800463c: 34 0c 00 0b mvi r12,11
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
8004640: 44 20 ff f3 be r1,r0,800460c <aio_write+0x44> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
8004644: 58 2b 00 14 sw (r1+20),r11
req->aiocbp->aio_lio_opcode = LIO_WRITE;
8004648: 34 02 00 02 mvi r2,2
800464c: 59 62 00 28 sw (r11+40),r2
return rtems_aio_enqueue (req);
8004650: fb ff ff 1d calli 80042c4 <rtems_aio_enqueue>
}
8004654: 2b 9d 00 04 lw ra,(sp+4)
8004658: 2b 8b 00 0c lw r11,(sp+12)
800465c: 2b 8c 00 08 lw r12,(sp+8)
8004660: 37 9c 00 0c addi sp,sp,12
8004664: c3 a0 00 00 ret
080035c8 <clock_gettime>:
int clock_gettime(
clockid_t clock_id,
struct timespec *tp
)
{
80035c8: 37 9c ff e8 addi sp,sp,-24
80035cc: 5b 8b 00 10 sw (sp+16),r11
80035d0: 5b 8c 00 0c sw (sp+12),r12
80035d4: 5b 8d 00 08 sw (sp+8),r13
80035d8: 5b 9d 00 04 sw (sp+4),ra
80035dc: b8 20 18 00 mv r3,r1
80035e0: b8 40 58 00 mv r11,r2
if ( !tp )
80035e4: 44 40 00 27 be r2,r0,8003680 <clock_gettime+0xb8>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
80035e8: 34 01 00 01 mvi r1,1
80035ec: 5c 61 00 18 bne r3,r1,800364c <clock_gettime+0x84>
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
80035f0: 78 02 08 01 mvhi r2,0x801
80035f4: 38 42 88 b8 ori r2,r2,0x88b8
80035f8: 37 81 00 14 addi r1,sp,20
80035fc: f8 00 07 52 calli 8005344 <_TOD_Get_with_nanoseconds>
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
8003600: 78 05 08 01 mvhi r5,0x801
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
}
8003604: 28 2c 00 04 lw r12,(r1+4)
8003608: 28 2d 00 00 lw r13,(r1+0)
800360c: 38 a5 6e 60 ori r5,r5,0x6e60
8003610: 28 a4 00 00 lw r4,(r5+0)
8003614: 34 03 00 00 mvi r3,0
8003618: b9 a0 08 00 mv r1,r13
800361c: b9 80 10 00 mv r2,r12
8003620: f8 00 41 18 calli 8013a80 <__divdi3>
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
8003624: 78 05 08 01 mvhi r5,0x801
8003628: 38 a5 6e 60 ori r5,r5,0x6e60
800362c: 28 a4 00 00 lw r4,(r5+0)
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
8003630: 59 62 00 00 sw (r11+0),r2
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
8003634: b9 a0 08 00 mv r1,r13
8003638: b9 80 10 00 mv r2,r12
800363c: 34 03 00 00 mvi r3,0
8003640: f8 00 43 12 calli 8014288 <__moddi3>
8003644: 59 62 00 04 sw (r11+4),r2
8003648: e0 00 00 07 bi 8003664 <clock_gettime+0x9c>
if ( clock_id == CLOCK_REALTIME ) {
_TOD_Get(tp);
return 0;
}
#ifdef CLOCK_MONOTONIC
if ( clock_id == CLOCK_MONOTONIC ) {
800364c: 34 01 00 04 mvi r1,4
8003650: 44 61 00 03 be r3,r1,800365c <clock_gettime+0x94> <== NEVER TAKEN
return 0;
}
#endif
#ifdef _POSIX_CPUTIME
if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
8003654: 34 01 00 02 mvi r1,2
8003658: 5c 61 00 05 bne r3,r1,800366c <clock_gettime+0xa4>
_TOD_Get_uptime_as_timespec( tp );
800365c: b9 60 08 00 mv r1,r11
8003660: f8 00 07 57 calli 80053bc <_TOD_Get_uptime_as_timespec>
return 0;
8003664: 34 01 00 00 mvi r1,0
8003668: e0 00 00 0a bi 8003690 <clock_gettime+0xc8>
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
800366c: 34 01 00 03 mvi r1,3
8003670: 5c 61 00 04 bne r3,r1,8003680 <clock_gettime+0xb8>
rtems_set_errno_and_return_minus_one( ENOSYS );
8003674: f8 00 28 52 calli 800d7bc <__errno>
8003678: 34 02 00 58 mvi r2,88
800367c: e0 00 00 03 bi 8003688 <clock_gettime+0xc0>
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
8003680: f8 00 28 4f calli 800d7bc <__errno>
8003684: 34 02 00 16 mvi r2,22
8003688: 58 22 00 00 sw (r1+0),r2
800368c: 34 01 ff ff mvi r1,-1
return 0;
}
8003690: 2b 9d 00 04 lw ra,(sp+4)
8003694: 2b 8b 00 10 lw r11,(sp+16)
8003698: 2b 8c 00 0c lw r12,(sp+12)
800369c: 2b 8d 00 08 lw r13,(sp+8)
80036a0: 37 9c 00 18 addi sp,sp,24
80036a4: c3 a0 00 00 ret
08025394 <clock_settime>:
int clock_settime(
clockid_t clock_id,
const struct timespec *tp
)
{
8025394: 37 9c ff e8 addi sp,sp,-24
8025398: 5b 8b 00 10 sw (sp+16),r11
802539c: 5b 8c 00 0c sw (sp+12),r12
80253a0: 5b 8d 00 08 sw (sp+8),r13
80253a4: 5b 9d 00 04 sw (sp+4),ra
80253a8: b8 40 58 00 mv r11,r2
if ( !tp )
80253ac: 44 40 00 30 be r2,r0,802546c <clock_settime+0xd8> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
80253b0: 34 02 00 01 mvi r2,1
80253b4: 5c 22 00 27 bne r1,r2,8025450 <clock_settime+0xbc>
if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 )
80253b8: 78 03 08 05 mvhi r3,0x805
80253bc: 38 63 f7 8c ori r3,r3,0xf78c
80253c0: 29 62 00 00 lw r2,(r11+0)
80253c4: 28 61 00 00 lw r1,(r3+0)
80253c8: 54 41 00 02 bgu r2,r1,80253d0 <clock_settime+0x3c>
80253cc: e0 00 00 28 bi 802546c <clock_settime+0xd8>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
80253d0: 78 01 08 06 mvhi r1,0x806
80253d4: 38 21 a0 60 ori r1,r1,0xa060
80253d8: 28 22 00 00 lw r2,(r1+0)
++level;
80253dc: 34 42 00 01 addi r2,r2,1
_Thread_Dispatch_disable_level = level;
80253e0: 58 22 00 00 sw (r1+0),r2
const struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
_Timestamp_Set(
80253e4: 29 6c 00 00 lw r12,(r11+0)
80253e8: 34 02 00 1f mvi r2,31
80253ec: b9 80 08 00 mv r1,r12
80253f0: f8 00 cc 60 calli 8058570 <__ashrsi3>
Timestamp64_Control *_time,
Timestamp64_Control _seconds,
Timestamp64_Control _nanoseconds
)
{
*_time = _seconds * 1000000000L + _nanoseconds;
80253f4: 78 05 08 05 mvhi r5,0x805
80253f8: 38 a5 94 90 ori r5,r5,0x9490
80253fc: 28 a4 00 00 lw r4,(r5+0)
8025400: 34 03 00 00 mvi r3,0
8025404: b9 80 10 00 mv r2,r12
8025408: f8 00 b4 d1 calli 805274c <__muldi3>
802540c: 29 6b 00 04 lw r11,(r11+4)
8025410: b8 40 60 00 mv r12,r2
8025414: b8 20 68 00 mv r13,r1
8025418: 34 02 00 1f mvi r2,31
802541c: b9 60 08 00 mv r1,r11
8025420: f8 00 cc 54 calli 8058570 <__ashrsi3>
8025424: b5 8b 18 00 add r3,r12,r11
8025428: f5 83 60 00 cmpgu r12,r12,r3
802542c: b5 a1 08 00 add r1,r13,r1
8025430: b5 81 08 00 add r1,r12,r1
8025434: 5b 81 00 14 sw (sp+20),r1
&tod_as_timestamp,
tod_as_timespec->tv_sec,
tod_as_timespec->tv_nsec
);
_TOD_Set_with_timestamp( &tod_as_timestamp );
8025438: 37 81 00 14 addi r1,sp,20
802543c: 5b 83 00 18 sw (sp+24),r3
8025440: f8 00 05 9b calli 8026aac <_TOD_Set_with_timestamp>
rtems_set_errno_and_return_minus_one( EINVAL );
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
8025444: fb ff 81 e3 calli 8005bd0 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
8025448: 34 01 00 00 mvi r1,0
802544c: e0 00 00 0c bi 802547c <clock_settime+0xe8>
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
}
#ifdef _POSIX_CPUTIME
else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID )
8025450: 34 02 00 02 mvi r2,2
8025454: 44 22 00 03 be r1,r2,8025460 <clock_settime+0xcc>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
8025458: 34 02 00 03 mvi r2,3
802545c: 5c 22 00 04 bne r1,r2,802546c <clock_settime+0xd8>
rtems_set_errno_and_return_minus_one( ENOSYS );
8025460: f8 00 4e 4b calli 8038d8c <__errno>
8025464: 34 02 00 58 mvi r2,88
8025468: e0 00 00 03 bi 8025474 <clock_settime+0xe0>
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
802546c: f8 00 4e 48 calli 8038d8c <__errno>
8025470: 34 02 00 16 mvi r2,22
8025474: 58 22 00 00 sw (r1+0),r2
8025478: 34 01 ff ff mvi r1,-1
return 0;
}
802547c: 2b 9d 00 04 lw ra,(sp+4)
8025480: 2b 8b 00 10 lw r11,(sp+16)
8025484: 2b 8c 00 0c lw r12,(sp+12)
8025488: 2b 8d 00 08 lw r13,(sp+8)
802548c: 37 9c 00 18 addi sp,sp,24
8025490: c3 a0 00 00 ret
08025e38 <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
8025e38: 37 9c ff dc addi sp,sp,-36
8025e3c: 5b 8b 00 18 sw (sp+24),r11
8025e40: 5b 8c 00 14 sw (sp+20),r12
8025e44: 5b 8d 00 10 sw (sp+16),r13
8025e48: 5b 8e 00 0c sw (sp+12),r14
8025e4c: 5b 8f 00 08 sw (sp+8),r15
8025e50: 5b 9d 00 04 sw (sp+4),ra
8025e54: b8 20 60 00 mv r12,r1
8025e58: b8 40 58 00 mv r11,r2
8025e5c: b8 60 68 00 mv r13,r3
POSIX_signals_Siginfo_node *psiginfo;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
8025e60: fb ff ff 3d calli 8025b54 <getpid>
8025e64: 45 81 00 04 be r12,r1,8025e74 <killinfo+0x3c>
rtems_set_errno_and_return_minus_one( ESRCH );
8025e68: fb ff b4 7c calli 8013058 <__errno>
8025e6c: 34 02 00 03 mvi r2,3
8025e70: e0 00 00 04 bi 8025e80 <killinfo+0x48>
/*
* Validate the signal passed.
*/
if ( !sig )
8025e74: 5d 60 00 06 bne r11,r0,8025e8c <killinfo+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
8025e78: fb ff b4 78 calli 8013058 <__errno>
8025e7c: 34 02 00 16 mvi r2,22
8025e80: 58 22 00 00 sw (r1+0),r2
8025e84: 34 01 ff ff mvi r1,-1
8025e88: e0 00 00 a2 bi 8026110 <killinfo+0x2d8>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
8025e8c: 35 6f ff ff addi r15,r11,-1
if ( !is_valid_signo(sig) )
8025e90: 34 01 00 1f mvi r1,31
8025e94: 50 2f 00 02 bgeu r1,r15,8025e9c <killinfo+0x64>
8025e98: e3 ff ff f8 bi 8025e78 <killinfo+0x40>
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
8025e9c: 34 02 00 01 mvi r2,1
8025ea0: b9 60 08 00 mv r1,r11
8025ea4: fb ff 6f e2 calli 8001e2c <__ashlsi3>
8025ea8: 34 02 00 02 mvi r2,2
8025eac: 78 0c 08 02 mvhi r12,0x802
8025eb0: b4 2b 08 00 add r1,r1,r11
8025eb4: fb ff 6f de calli 8001e2c <__ashlsi3>
8025eb8: 39 8c 9f 88 ori r12,r12,0x9f88
8025ebc: b5 81 08 00 add r1,r12,r1
8025ec0: 28 22 00 08 lw r2,(r1+8)
8025ec4: 34 0e 00 01 mvi r14,1
return 0;
8025ec8: 34 01 00 00 mvi r1,0
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
8025ecc: 44 4e 00 91 be r2,r14,8026110 <killinfo+0x2d8> <== NEVER TAKEN
/*
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
8025ed0: 65 62 00 04 cmpei r2,r11,4
8025ed4: 65 61 00 08 cmpei r1,r11,8
8025ed8: b8 41 08 00 or r1,r2,r1
8025edc: 5c 20 00 03 bne r1,r0,8025ee8 <killinfo+0xb0>
8025ee0: 34 01 00 0b mvi r1,11
8025ee4: 5d 61 00 05 bne r11,r1,8025ef8 <killinfo+0xc0>
return pthread_kill( pthread_self(), sig );
8025ee8: f8 00 01 3c calli 80263d8 <pthread_self>
8025eec: b9 60 10 00 mv r2,r11
8025ef0: f8 00 00 f6 calli 80262c8 <pthread_kill>
8025ef4: e0 00 00 87 bi 8026110 <killinfo+0x2d8>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
8025ef8: 34 01 00 01 mvi r1,1
8025efc: b9 e0 10 00 mv r2,r15
8025f00: fb ff 6f cb calli 8001e2c <__ashlsi3>
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
8025f04: 5b 8b 00 1c sw (sp+28),r11
siginfo->si_code = SI_USER;
8025f08: 5b 8e 00 20 sw (sp+32),r14
8025f0c: b8 20 60 00 mv r12,r1
if ( !value ) {
8025f10: 5d a0 00 03 bne r13,r0,8025f1c <killinfo+0xe4>
siginfo->si_value.sival_int = 0;
8025f14: 5b 80 00 24 sw (sp+36),r0
8025f18: e0 00 00 03 bi 8025f24 <killinfo+0xec>
} else {
siginfo->si_value = *value;
8025f1c: 29 a1 00 00 lw r1,(r13+0)
8025f20: 5b 81 00 24 sw (sp+36),r1
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8025f24: 78 01 08 02 mvhi r1,0x802
8025f28: 38 21 9a 78 ori r1,r1,0x9a78
8025f2c: 28 22 00 00 lw r2,(r1+0)
++level;
8025f30: 34 42 00 01 addi r2,r2,1
_Thread_Dispatch_disable_level = level;
8025f34: 58 22 00 00 sw (r1+0),r2
*/
void _POSIX_signals_Manager_Initialization(void);
static inline void _POSIX_signals_Add_post_switch_extension(void)
{
_API_extensions_Add_post_switch( &_POSIX_signals_Post_switch );
8025f38: 78 01 08 02 mvhi r1,0x802
8025f3c: 38 21 91 d4 ori r1,r1,0x91d4
8025f40: fb ff 91 4d calli 800a474 <_API_extensions_Add_post_switch>
/*
* Is the currently executing thread interested? If so then it will
* get it an execute it as soon as the dispatcher executes.
*/
the_thread = _Thread_Executing;
8025f44: 78 01 08 02 mvhi r1,0x802
8025f48: 38 21 9f 00 ori r1,r1,0x9f00
8025f4c: 28 23 00 10 lw r3,(r1+16)
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
8025f50: 28 61 01 1c lw r1,(r3+284)
8025f54: 28 21 00 d0 lw r1,(r1+208)
8025f58: a4 20 08 00 not r1,r1
8025f5c: a1 81 08 00 and r1,r12,r1
8025f60: 5c 20 00 3f bne r1,r0,802605c <killinfo+0x224>
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
8025f64: 78 01 08 02 mvhi r1,0x802
8025f68: 38 21 a1 14 ori r1,r1,0xa114
8025f6c: 28 22 00 00 lw r2,(r1+0)
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
8025f70: 78 01 08 02 mvhi r1,0x802
8025f74: 38 21 a1 18 ori r1,r1,0xa118
8025f78: e0 00 00 0b bi 8025fa4 <killinfo+0x16c>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
8025f7c: 28 44 00 30 lw r4,(r2+48)
for ( the_node = _Chain_First( the_chain );
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
8025f80: b8 40 18 00 mv r3,r2
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8025f84: 28 45 01 1c lw r5,(r2+284)
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
8025f88: a1 84 20 00 and r4,r12,r4
8025f8c: 5c 80 00 34 bne r4,r0,802605c <killinfo+0x224>
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
8025f90: 28 a5 00 d0 lw r5,(r5+208)
8025f94: a4 a0 28 00 not r5,r5
8025f98: a1 85 28 00 and r5,r12,r5
8025f9c: 5c a4 00 30 bne r5,r4,802605c <killinfo+0x224>
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
8025fa0: 28 42 00 00 lw r2,(r2+0)
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
8025fa4: 5c 41 ff f6 bne r2,r1,8025f7c <killinfo+0x144>
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
8025fa8: 78 01 08 02 mvhi r1,0x802
8025fac: 38 21 90 d8 ori r1,r1,0x90d8
8025fb0: 40 21 00 00 lbu r1,(r1+0)
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
8025fb4: 78 02 08 02 mvhi r2,0x802
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
8025fb8: 78 04 08 02 mvhi r4,0x802
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
8025fbc: 38 42 9a 14 ori r2,r2,0x9a14
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
8025fc0: 34 21 00 01 addi r1,r1,1
8025fc4: 38 84 9a 1c ori r4,r4,0x9a1c
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
8025fc8: 34 4d 00 10 addi r13,r2,16
*
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
8025fcc: 34 03 00 00 mvi r3,0
*/
RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal (
States_Control the_states
)
{
return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL);
8025fd0: 78 08 10 00 mvhi r8,0x1000
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
/*
* This can occur when no one is interested and an API is not configured.
*/
if ( !_Objects_Information_table[ the_api ] )
8025fd4: 28 85 00 00 lw r5,(r4+0)
8025fd8: 44 a0 00 1e be r5,r0,8026050 <killinfo+0x218> <== NEVER TAKEN
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
8025fdc: 28 a5 00 04 lw r5,(r5+4)
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
8025fe0: 34 06 00 01 mvi r6,1
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
8025fe4: 2c ae 00 10 lhu r14,(r5+16)
8025fe8: 28 a7 00 1c lw r7,(r5+28)
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
8025fec: e0 00 00 18 bi 802604c <killinfo+0x214>
the_thread = (Thread_Control *) object_table[ index ];
8025ff0: 28 e2 00 04 lw r2,(r7+4)
if ( !the_thread )
8025ff4: 44 40 00 14 be r2,r0,8026044 <killinfo+0x20c>
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
8025ff8: 28 45 00 14 lw r5,(r2+20)
8025ffc: 54 a1 00 12 bgu r5,r1,8026044 <killinfo+0x20c>
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
8026000: 28 49 01 1c lw r9,(r2+284)
8026004: 29 29 00 d0 lw r9,(r9+208)
8026008: a5 20 48 00 not r9,r9
802600c: a1 89 48 00 and r9,r12,r9
8026010: 45 20 00 0d be r9,r0,8026044 <killinfo+0x20c>
*
* NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1
* so we never have to worry about deferencing a NULL
* interested thread.
*/
if ( the_thread->current_priority < interested_priority ) {
8026014: 54 25 00 0a bgu r1,r5,802603c <killinfo+0x204>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
8026018: 44 60 00 0b be r3,r0,8026044 <killinfo+0x20c> <== NEVER TAKEN
802601c: 28 69 00 10 lw r9,(r3+16)
8026020: 45 20 00 09 be r9,r0,8026044 <killinfo+0x20c> <== NEVER TAKEN
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
8026024: 28 4a 00 10 lw r10,(r2+16)
8026028: 45 40 00 05 be r10,r0,802603c <killinfo+0x204>
802602c: a1 28 48 00 and r9,r9,r8
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
8026030: 5d 20 00 05 bne r9,r0,8026044 <killinfo+0x20c>
8026034: a1 48 50 00 and r10,r10,r8
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
8026038: 45 49 00 03 be r10,r9,8026044 <killinfo+0x20c>
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
802603c: b8 a0 08 00 mv r1,r5
8026040: b8 40 18 00 mv r3,r2
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
8026044: 34 c6 00 01 addi r6,r6,1
8026048: 34 e7 00 04 addi r7,r7,4
802604c: 51 c6 ff e9 bgeu r14,r6,8025ff0 <killinfo+0x1b8>
8026050: 34 84 00 04 addi r4,r4,4
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
8026054: 5c 8d ff e0 bne r4,r13,8025fd4 <killinfo+0x19c>
}
}
}
}
if ( interested ) {
8026058: 44 60 00 06 be r3,r0,8026070 <killinfo+0x238>
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
802605c: b8 60 08 00 mv r1,r3
8026060: b9 60 10 00 mv r2,r11
8026064: 37 83 00 1c addi r3,sp,28
8026068: f8 00 00 3d calli 802615c <_POSIX_signals_Unblock_thread>
802606c: 5c 20 00 27 bne r1,r0,8026108 <killinfo+0x2d0>
/*
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
8026070: b9 80 08 00 mv r1,r12
8026074: f8 00 00 2f calli 8026130 <_POSIX_signals_Set_process_signals>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
8026078: b9 60 08 00 mv r1,r11
802607c: 34 02 00 01 mvi r2,1
8026080: fb ff 6f 6b calli 8001e2c <__ashlsi3>
8026084: b4 2b 58 00 add r11,r1,r11
8026088: 34 02 00 02 mvi r2,2
802608c: 78 0c 08 02 mvhi r12,0x802
8026090: b9 60 08 00 mv r1,r11
8026094: fb ff 6f 66 calli 8001e2c <__ashlsi3>
8026098: 39 8c 9f 88 ori r12,r12,0x9f88
802609c: b5 81 08 00 add r1,r12,r1
80260a0: 28 22 00 00 lw r2,(r1+0)
80260a4: 34 01 00 02 mvi r1,2
80260a8: 5c 41 00 18 bne r2,r1,8026108 <killinfo+0x2d0>
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
80260ac: 78 01 08 02 mvhi r1,0x802
80260b0: 38 21 a1 08 ori r1,r1,0xa108
80260b4: fb ff 91 77 calli 800a690 <_Chain_Get>
80260b8: b8 20 60 00 mv r12,r1
if ( !psiginfo ) {
80260bc: 5c 20 00 05 bne r1,r0,80260d0 <killinfo+0x298>
_Thread_Enable_dispatch();
80260c0: fb ff 9a ac calli 800cb70 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
80260c4: fb ff b3 e5 calli 8013058 <__errno>
80260c8: 34 02 00 0b mvi r2,11
80260cc: e3 ff ff 6d bi 8025e80 <killinfo+0x48>
}
psiginfo->Info = *siginfo;
80260d0: 2b 81 00 1c lw r1,(sp+28)
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
80260d4: 34 02 00 02 mvi r2,2
if ( !psiginfo ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
80260d8: 59 81 00 08 sw (r12+8),r1
80260dc: 2b 81 00 20 lw r1,(sp+32)
80260e0: 59 81 00 0c sw (r12+12),r1
80260e4: 2b 81 00 24 lw r1,(sp+36)
80260e8: 59 81 00 10 sw (r12+16),r1
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
80260ec: b9 60 08 00 mv r1,r11
80260f0: fb ff 6f 4f calli 8001e2c <__ashlsi3>
80260f4: 78 02 08 02 mvhi r2,0x802
80260f8: 38 42 a1 80 ori r2,r2,0xa180
80260fc: b4 22 08 00 add r1,r1,r2
8026100: b9 80 10 00 mv r2,r12
8026104: fb ff 91 4d calli 800a638 <_Chain_Append>
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
8026108: fb ff 9a 9a calli 800cb70 <_Thread_Enable_dispatch>
return 0;
802610c: 34 01 00 00 mvi r1,0
}
8026110: 2b 9d 00 04 lw ra,(sp+4)
8026114: 2b 8b 00 18 lw r11,(sp+24)
8026118: 2b 8c 00 14 lw r12,(sp+20)
802611c: 2b 8d 00 10 lw r13,(sp+16)
8026120: 2b 8e 00 0c lw r14,(sp+12)
8026124: 2b 8f 00 08 lw r15,(sp+8)
8026128: 37 9c 00 24 addi sp,sp,36
802612c: c3 a0 00 00 ret
08008524 <pthread_attr_setschedpolicy>:
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
8008524: 34 03 00 16 mvi r3,22
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
8008528: 44 20 00 0c be r1,r0,8008558 <pthread_attr_setschedpolicy+0x34>
800852c: 28 24 00 00 lw r4,(r1+0)
8008530: 44 80 00 0a be r4,r0,8008558 <pthread_attr_setschedpolicy+0x34>
return EINVAL;
switch ( policy ) {
8008534: 48 02 00 08 bg r0,r2,8008554 <pthread_attr_setschedpolicy+0x30>
8008538: 34 03 00 02 mvi r3,2
800853c: 4c 62 00 03 bge r3,r2,8008548 <pthread_attr_setschedpolicy+0x24>
8008540: 34 03 00 04 mvi r3,4
8008544: 5c 43 00 04 bne r2,r3,8008554 <pthread_attr_setschedpolicy+0x30><== NEVER TAKEN
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
8008548: 58 22 00 14 sw (r1+20),r2
return 0;
800854c: 34 03 00 00 mvi r3,0
8008550: e0 00 00 02 bi 8008558 <pthread_attr_setschedpolicy+0x34>
default:
return ENOTSUP;
8008554: 34 03 00 86 mvi r3,134
}
}
8008558: b8 60 08 00 mv r1,r3
800855c: c3 a0 00 00 ret
08003c28 <pthread_barrier_init>:
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
8003c28: 37 9c ff dc addi sp,sp,-36
8003c2c: 5b 8b 00 14 sw (sp+20),r11
8003c30: 5b 8c 00 10 sw (sp+16),r12
8003c34: 5b 8d 00 0c sw (sp+12),r13
8003c38: 5b 8e 00 08 sw (sp+8),r14
8003c3c: 5b 9d 00 04 sw (sp+4),ra
/*
* Error check parameters
*/
if ( !barrier )
return EINVAL;
8003c40: 34 04 00 16 mvi r4,22
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
8003c44: b8 20 68 00 mv r13,r1
8003c48: b8 60 58 00 mv r11,r3
const pthread_barrierattr_t *the_attr;
/*
* Error check parameters
*/
if ( !barrier )
8003c4c: 44 20 00 2a be r1,r0,8003cf4 <pthread_barrier_init+0xcc>
return EINVAL;
if ( count == 0 )
8003c50: 44 60 00 29 be r3,r0,8003cf4 <pthread_barrier_init+0xcc>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
8003c54: 5c 40 00 05 bne r2,r0,8003c68 <pthread_barrier_init+0x40>
the_attr = attr;
} else {
(void) pthread_barrierattr_init( &my_attr );
8003c58: 37 8c 00 18 addi r12,sp,24
8003c5c: b9 80 08 00 mv r1,r12
8003c60: fb ff ff bb calli 8003b4c <pthread_barrierattr_init>
the_attr = &my_attr;
8003c64: b9 80 10 00 mv r2,r12
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
8003c68: 28 41 00 00 lw r1,(r2+0)
return EINVAL;
8003c6c: 34 04 00 16 mvi r4,22
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
8003c70: 44 20 00 21 be r1,r0,8003cf4 <pthread_barrier_init+0xcc>
return EINVAL;
switch ( the_attr->process_shared ) {
8003c74: 28 4e 00 04 lw r14,(r2+4)
8003c78: 5d c0 00 1f bne r14,r0,8003cf4 <pthread_barrier_init+0xcc> <== NEVER TAKEN
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8003c7c: 78 02 08 01 mvhi r2,0x801
8003c80: 38 42 69 08 ori r2,r2,0x6908
8003c84: 28 41 00 00 lw r1,(r2+0)
}
/*
* Convert from POSIX attributes to Core Barrier attributes
*/
the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE;
8003c88: 5b 80 00 20 sw (sp+32),r0
the_attributes.maximum_count = count;
8003c8c: 5b 8b 00 24 sw (sp+36),r11
++level;
8003c90: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
8003c94: 58 41 00 00 sw (r2+0),r1
* the inactive chain of free barrier control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void )
{
return (POSIX_Barrier_Control *)
_Objects_Allocate( &_POSIX_Barrier_Information );
8003c98: 78 0c 08 01 mvhi r12,0x801
8003c9c: 39 8c 6c 04 ori r12,r12,0x6c04
8003ca0: b9 80 08 00 mv r1,r12
8003ca4: f8 00 08 10 calli 8005ce4 <_Objects_Allocate>
8003ca8: b8 20 58 00 mv r11,r1
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_barrier = _POSIX_Barrier_Allocate();
if ( !the_barrier ) {
8003cac: 5c 2e 00 04 bne r1,r14,8003cbc <pthread_barrier_init+0x94>
_Thread_Enable_dispatch();
8003cb0: f8 00 0d 4c calli 80071e0 <_Thread_Enable_dispatch>
return EAGAIN;
8003cb4: 34 04 00 0b mvi r4,11
8003cb8: e0 00 00 0f bi 8003cf4 <pthread_barrier_init+0xcc>
}
_CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes );
8003cbc: 34 21 00 10 addi r1,r1,16
8003cc0: 37 82 00 20 addi r2,sp,32
8003cc4: f8 00 05 02 calli 80050cc <_CORE_barrier_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8003cc8: 29 6e 00 08 lw r14,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8003ccc: 29 8c 00 1c lw r12,(r12+28)
8003cd0: 34 02 00 02 mvi r2,2
8003cd4: 21 c1 ff ff andi r1,r14,0xffff
8003cd8: f8 00 3d 64 calli 8013268 <__ashlsi3>
8003cdc: b5 81 08 00 add r1,r12,r1
8003ce0: 58 2b 00 00 sw (r1+0),r11
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
8003ce4: 59 60 00 0c sw (r11+12),r0
);
/*
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
8003ce8: 59 ae 00 00 sw (r13+0),r14
_Thread_Enable_dispatch();
8003cec: f8 00 0d 3d calli 80071e0 <_Thread_Enable_dispatch>
return 0;
8003cf0: 34 04 00 00 mvi r4,0
}
8003cf4: b8 80 08 00 mv r1,r4
8003cf8: 2b 9d 00 04 lw ra,(sp+4)
8003cfc: 2b 8b 00 14 lw r11,(sp+20)
8003d00: 2b 8c 00 10 lw r12,(sp+16)
8003d04: 2b 8d 00 0c lw r13,(sp+12)
8003d08: 2b 8e 00 08 lw r14,(sp+8)
8003d0c: 37 9c 00 24 addi sp,sp,36
8003d10: c3 a0 00 00 ret
080034bc <pthread_cleanup_push>:
void pthread_cleanup_push(
void (*routine)( void * ),
void *arg
)
{
80034bc: 37 9c ff f4 addi sp,sp,-12
80034c0: 5b 8b 00 0c sw (sp+12),r11
80034c4: 5b 8c 00 08 sw (sp+8),r12
80034c8: 5b 9d 00 04 sw (sp+4),ra
80034cc: b8 20 58 00 mv r11,r1
80034d0: b8 40 60 00 mv r12,r2
/*
* The POSIX standard does not address what to do when the routine
* is NULL. It also does not address what happens when we cannot
* allocate memory or anything else bad happens.
*/
if ( !routine )
80034d4: 44 20 00 13 be r1,r0,8003520 <pthread_cleanup_push+0x64>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
80034d8: 78 03 08 01 mvhi r3,0x801
80034dc: 38 63 68 e0 ori r3,r3,0x68e0
80034e0: 28 61 00 00 lw r1,(r3+0)
++level;
80034e4: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
80034e8: 58 61 00 00 sw (r3+0),r1
return;
_Thread_Disable_dispatch();
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
80034ec: 34 01 00 10 mvi r1,16
80034f0: f8 00 12 61 calli 8007e74 <_Workspace_Allocate>
80034f4: b8 20 10 00 mv r2,r1
if ( handler ) {
80034f8: 44 20 00 09 be r1,r0,800351c <pthread_cleanup_push+0x60> <== NEVER TAKEN
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
80034fc: 78 03 08 01 mvhi r3,0x801
8003500: 38 63 6d 80 ori r3,r3,0x6d80
8003504: 28 61 00 10 lw r1,(r3+16)
handler_stack = &thread_support->Cancellation_Handlers;
8003508: 28 21 01 1c lw r1,(r1+284)
handler->routine = routine;
800350c: 58 4b 00 08 sw (r2+8),r11
handler->arg = arg;
8003510: 58 4c 00 0c sw (r2+12),r12
_Chain_Append( handler_stack, &handler->Node );
8003514: 34 21 00 e4 addi r1,r1,228
8003518: f8 00 05 29 calli 80049bc <_Chain_Append>
}
_Thread_Enable_dispatch();
800351c: f8 00 0d 58 calli 8006a7c <_Thread_Enable_dispatch>
}
8003520: 2b 9d 00 04 lw ra,(sp+4)
8003524: 2b 8b 00 0c lw r11,(sp+12)
8003528: 2b 8c 00 08 lw r12,(sp+8)
800352c: 37 9c 00 0c addi sp,sp,12
8003530: c3 a0 00 00 ret
080045dc <pthread_cond_init>:
*/
int pthread_cond_init(
pthread_cond_t *cond,
const pthread_condattr_t *attr
)
{
80045dc: 37 9c ff ec addi sp,sp,-20
80045e0: 5b 8b 00 14 sw (sp+20),r11
80045e4: 5b 8c 00 10 sw (sp+16),r12
80045e8: 5b 8d 00 0c sw (sp+12),r13
80045ec: 5b 8e 00 08 sw (sp+8),r14
80045f0: 5b 9d 00 04 sw (sp+4),ra
80045f4: b8 20 70 00 mv r14,r1
80045f8: b8 40 58 00 mv r11,r2
POSIX_Condition_variables_Control *the_cond;
const pthread_condattr_t *the_attr;
if ( attr ) the_attr = attr;
80045fc: 5c 40 00 03 bne r2,r0,8004608 <pthread_cond_init+0x2c>
else the_attr = &_POSIX_Condition_variables_Default_attributes;
8004600: 78 0b 08 01 mvhi r11,0x801
8004604: 39 6b 62 d4 ori r11,r11,0x62d4
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
8004608: 29 63 00 04 lw r3,(r11+4)
800460c: 34 02 00 01 mvi r2,1
return EINVAL;
8004610: 34 01 00 16 mvi r1,22
else the_attr = &_POSIX_Condition_variables_Default_attributes;
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
8004614: 44 62 00 26 be r3,r2,80046ac <pthread_cond_init+0xd0> <== NEVER TAKEN
return EINVAL;
if ( !the_attr->is_initialized )
8004618: 29 62 00 00 lw r2,(r11+0)
800461c: 44 40 00 24 be r2,r0,80046ac <pthread_cond_init+0xd0>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8004620: 78 02 08 01 mvhi r2,0x801
8004624: 38 42 78 f8 ori r2,r2,0x78f8
8004628: 28 41 00 00 lw r1,(r2+0)
++level;
800462c: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
8004630: 58 41 00 00 sw (r2+0),r1
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
*_POSIX_Condition_variables_Allocate( void )
{
return (POSIX_Condition_variables_Control *)
_Objects_Allocate( &_POSIX_Condition_variables_Information );
8004634: 78 0d 08 01 mvhi r13,0x801
8004638: 39 ad 7c 8c ori r13,r13,0x7c8c
800463c: b9 a0 08 00 mv r1,r13
8004640: f8 00 09 f9 calli 8006e24 <_Objects_Allocate>
8004644: b8 20 60 00 mv r12,r1
_Thread_Disable_dispatch();
the_cond = _POSIX_Condition_variables_Allocate();
if ( !the_cond ) {
8004648: 5c 20 00 04 bne r1,r0,8004658 <pthread_cond_init+0x7c>
_Thread_Enable_dispatch();
800464c: f8 00 0f a7 calli 80084e8 <_Thread_Enable_dispatch>
return ENOMEM;
8004650: 34 01 00 0c mvi r1,12
8004654: e0 00 00 16 bi 80046ac <pthread_cond_init+0xd0>
the_cond->process_shared = the_attr->process_shared;
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
8004658: 78 04 08 01 mvhi r4,0x801
if ( !the_cond ) {
_Thread_Enable_dispatch();
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
800465c: 29 61 00 04 lw r1,(r11+4)
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
8004660: 38 84 62 dc ori r4,r4,0x62dc
8004664: 28 83 00 00 lw r3,(r4+0)
if ( !the_cond ) {
_Thread_Enable_dispatch();
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
8004668: 59 81 00 10 sw (r12+16),r1
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
800466c: 34 04 00 74 mvi r4,116
8004670: 35 81 00 18 addi r1,r12,24
8004674: 34 02 00 00 mvi r2,0
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
8004678: 59 80 00 14 sw (r12+20),r0
_Thread_queue_Initialize(
800467c: f8 00 12 25 calli 8008f10 <_Thread_queue_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8004680: 29 8b 00 08 lw r11,(r12+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8004684: 29 ad 00 1c lw r13,(r13+28)
8004688: 34 02 00 02 mvi r2,2
800468c: 21 61 ff ff andi r1,r11,0xffff
8004690: f8 00 3f 1b calli 80142fc <__ashlsi3>
8004694: b5 a1 10 00 add r2,r13,r1
8004698: 58 4c 00 00 sw (r2+0),r12
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
800469c: 59 80 00 0c sw (r12+12),r0
&_POSIX_Condition_variables_Information,
&the_cond->Object,
0
);
*cond = the_cond->Object.id;
80046a0: 59 cb 00 00 sw (r14+0),r11
_Thread_Enable_dispatch();
80046a4: f8 00 0f 91 calli 80084e8 <_Thread_Enable_dispatch>
return 0;
80046a8: 34 01 00 00 mvi r1,0
}
80046ac: 2b 9d 00 04 lw ra,(sp+4)
80046b0: 2b 8b 00 14 lw r11,(sp+20)
80046b4: 2b 8c 00 10 lw r12,(sp+16)
80046b8: 2b 8d 00 0c lw r13,(sp+12)
80046bc: 2b 8e 00 08 lw r14,(sp+8)
80046c0: 37 9c 00 14 addi sp,sp,20
80046c4: c3 a0 00 00 ret
08004450 <pthread_condattr_destroy>:
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
if ( !attr || attr->is_initialized == false )
return EINVAL;
8004450: 34 02 00 16 mvi r2,22
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
if ( !attr || attr->is_initialized == false )
8004454: 44 20 00 05 be r1,r0,8004468 <pthread_condattr_destroy+0x18>
8004458: 28 23 00 00 lw r3,(r1+0)
800445c: 44 60 00 03 be r3,r0,8004468 <pthread_condattr_destroy+0x18><== NEVER TAKEN
return EINVAL;
attr->is_initialized = false;
8004460: 58 20 00 00 sw (r1+0),r0
return 0;
8004464: 34 02 00 00 mvi r2,0
}
8004468: b8 40 08 00 mv r1,r2
800446c: c3 a0 00 00 ret
080038bc <pthread_create>:
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
80038bc: 37 9c ff a0 addi sp,sp,-96
80038c0: 5b 8b 00 3c sw (sp+60),r11
80038c4: 5b 8c 00 38 sw (sp+56),r12
80038c8: 5b 8d 00 34 sw (sp+52),r13
80038cc: 5b 8e 00 30 sw (sp+48),r14
80038d0: 5b 8f 00 2c sw (sp+44),r15
80038d4: 5b 90 00 28 sw (sp+40),r16
80038d8: 5b 91 00 24 sw (sp+36),r17
80038dc: 5b 92 00 20 sw (sp+32),r18
80038e0: 5b 93 00 1c sw (sp+28),r19
80038e4: 5b 94 00 18 sw (sp+24),r20
80038e8: 5b 95 00 14 sw (sp+20),r21
80038ec: 5b 9d 00 10 sw (sp+16),ra
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
return EFAULT;
80038f0: 34 0d 00 0e mvi r13,14
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
80038f4: b8 20 88 00 mv r17,r1
80038f8: b8 60 80 00 mv r16,r3
80038fc: b8 80 90 00 mv r18,r4
int schedpolicy = SCHED_RR;
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
8003900: 44 60 00 a5 be r3,r0,8003b94 <pthread_create+0x2d8> <== NEVER TAKEN
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
8003904: b8 40 58 00 mv r11,r2
8003908: 5c 40 00 03 bne r2,r0,8003914 <pthread_create+0x58>
800390c: 78 0b 08 01 mvhi r11,0x801
8003910: 39 6b e2 1c ori r11,r11,0xe21c
if ( !the_attr->is_initialized )
8003914: 29 61 00 00 lw r1,(r11+0)
return EINVAL;
8003918: 34 0d 00 16 mvi r13,22
if ( !start_routine )
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
if ( !the_attr->is_initialized )
800391c: 44 20 00 9e be r1,r0,8003b94 <pthread_create+0x2d8>
* stack space if it is allowed to allocate it itself.
*
* NOTE: If the user provides the stack we will let it drop below
* twice the minimum.
*/
if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) )
8003920: 29 61 00 04 lw r1,(r11+4)
8003924: 44 20 00 06 be r1,r0,800393c <pthread_create+0x80>
8003928: 78 02 08 02 mvhi r2,0x802
800392c: 38 42 00 f8 ori r2,r2,0xf8
8003930: 29 63 00 08 lw r3,(r11+8)
8003934: 28 41 00 00 lw r1,(r2+0)
8003938: 54 23 00 97 bgu r1,r3,8003b94 <pthread_create+0x2d8>
* If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread
* inherits scheduling attributes from the creating thread. If it is
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
800393c: 29 62 00 10 lw r2,(r11+16)
8003940: 34 01 00 01 mvi r1,1
8003944: 44 41 00 05 be r2,r1,8003958 <pthread_create+0x9c>
8003948: 34 01 00 02 mvi r1,2
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
break;
default:
return EINVAL;
800394c: 34 0d 00 16 mvi r13,22
* If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread
* inherits scheduling attributes from the creating thread. If it is
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
8003950: 5c 41 00 91 bne r2,r1,8003b94 <pthread_create+0x2d8>
8003954: e0 00 00 14 bi 80039a4 <pthread_create+0xe8>
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
8003958: 78 02 08 02 mvhi r2,0x802
800395c: 38 42 0d 80 ori r2,r2,0xd80
8003960: 28 41 00 10 lw r1,(r2+16)
8003964: 28 22 01 1c lw r2,(r1+284)
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
8003968: 28 48 00 88 lw r8,(r2+136)
800396c: 28 47 00 8c lw r7,(r2+140)
8003970: 28 46 00 90 lw r6,(r2+144)
8003974: 28 45 00 94 lw r5,(r2+148)
8003978: 28 44 00 98 lw r4,(r2+152)
800397c: 28 43 00 9c lw r3,(r2+156)
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
schedpolicy = api->schedpolicy;
8003980: 28 4f 00 84 lw r15,(r2+132)
schedparam = api->schedparam;
8003984: 28 41 00 a0 lw r1,(r2+160)
8003988: 5b 88 00 40 sw (sp+64),r8
800398c: 5b 87 00 44 sw (sp+68),r7
8003990: 5b 86 00 48 sw (sp+72),r6
8003994: 5b 85 00 4c sw (sp+76),r5
8003998: 5b 84 00 50 sw (sp+80),r4
800399c: 5b 83 00 54 sw (sp+84),r3
80039a0: e0 00 00 0f bi 80039dc <pthread_create+0x120>
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
80039a4: 29 67 00 18 lw r7,(r11+24)
80039a8: 29 66 00 1c lw r6,(r11+28)
80039ac: 29 65 00 20 lw r5,(r11+32)
80039b0: 29 64 00 24 lw r4,(r11+36)
80039b4: 29 63 00 28 lw r3,(r11+40)
80039b8: 29 62 00 2c lw r2,(r11+44)
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
80039bc: 29 6f 00 14 lw r15,(r11+20)
schedparam = the_attr->schedparam;
80039c0: 29 61 00 30 lw r1,(r11+48)
80039c4: 5b 87 00 40 sw (sp+64),r7
80039c8: 5b 86 00 44 sw (sp+68),r6
80039cc: 5b 85 00 48 sw (sp+72),r5
80039d0: 5b 84 00 4c sw (sp+76),r4
80039d4: 5b 83 00 50 sw (sp+80),r3
80039d8: 5b 82 00 54 sw (sp+84),r2
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
80039dc: 29 6c 00 0c lw r12,(r11+12)
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
80039e0: 5b 81 00 58 sw (sp+88),r1
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
return ENOTSUP;
80039e4: 34 0d 00 86 mvi r13,134
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
80039e8: 5d 80 00 6b bne r12,r0,8003b94 <pthread_create+0x2d8>
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
80039ec: 2b 81 00 40 lw r1,(sp+64)
return EINVAL;
80039f0: 34 0d 00 16 mvi r13,22
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
80039f4: f8 00 1a d2 calli 800a53c <_POSIX_Priority_Is_valid>
80039f8: 44 2c 00 67 be r1,r12,8003b94 <pthread_create+0x2d8> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
80039fc: 78 02 08 02 mvhi r2,0x802
8003a00: 38 42 00 fc ori r2,r2,0xfc
8003a04: 40 54 00 00 lbu r20,(r2+0)
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
8003a08: b9 e0 08 00 mv r1,r15
8003a0c: 37 82 00 40 addi r2,sp,64
8003a10: 37 83 00 60 addi r3,sp,96
8003a14: 37 84 00 5c addi r4,sp,92
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
return EINVAL;
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
8003a18: 2b 93 00 40 lw r19,(sp+64)
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
8003a1c: f8 00 1a d0 calli 800a55c <_POSIX_Thread_Translate_sched_param>
8003a20: b8 20 68 00 mv r13,r1
schedpolicy,
&schedparam,
&budget_algorithm,
&budget_callout
);
if ( rc )
8003a24: 5c 20 00 5c bne r1,r0,8003b94 <pthread_create+0x2d8>
#endif
/*
* Lock the allocator mutex for protection
*/
_RTEMS_Lock_allocator();
8003a28: 78 0c 08 02 mvhi r12,0x802
8003a2c: 39 8c 09 68 ori r12,r12,0x968
8003a30: 29 81 00 00 lw r1,(r12+0)
8003a34: f8 00 05 2c calli 8004ee4 <_API_Mutex_Lock>
* _POSIX_Threads_Allocate
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
8003a38: 78 02 08 02 mvhi r2,0x802
8003a3c: b8 40 08 00 mv r1,r2
8003a40: 38 21 0a 64 ori r1,r1,0xa64
8003a44: f8 00 08 52 calli 8005b8c <_Objects_Allocate>
8003a48: b8 20 70 00 mv r14,r1
* Allocate the thread control block.
*
* NOTE: Global threads are not currently supported.
*/
the_thread = _POSIX_Threads_Allocate();
if ( !the_thread ) {
8003a4c: 5c 2d 00 03 bne r1,r13,8003a58 <pthread_create+0x19c>
_RTEMS_Unlock_allocator();
8003a50: 29 81 00 00 lw r1,(r12+0)
8003a54: e0 00 00 21 bi 8003ad8 <pthread_create+0x21c>
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
8003a58: 78 02 08 02 mvhi r2,0x802
8003a5c: 38 42 00 f8 ori r2,r2,0xf8
8003a60: 28 41 00 00 lw r1,(r2+0)
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
8003a64: 29 6c 00 08 lw r12,(r11+8)
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
8003a68: 34 02 00 01 mvi r2,1
8003a6c: f8 00 63 4c calli 801c79c <__ashlsi3>
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
8003a70: 29 75 00 04 lw r21,(r11+4)
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
8003a74: b8 20 28 00 mv r5,r1
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
8003a78: 50 2c 00 02 bgeu r1,r12,8003a80 <pthread_create+0x1c4>
8003a7c: b9 80 28 00 mv r5,r12
8003a80: 2b 81 00 5c lw r1,(sp+92)
8003a84: 78 0c 08 02 mvhi r12,0x802
8003a88: 2b 88 00 60 lw r8,(sp+96)
8003a8c: 39 8c 0a 64 ori r12,r12,0xa64
8003a90: 5b 81 00 04 sw (sp+4),r1
8003a94: b8 a0 20 00 mv r4,r5
8003a98: b9 80 08 00 mv r1,r12
8003a9c: b9 c0 10 00 mv r2,r14
8003aa0: ba a0 18 00 mv r3,r21
8003aa4: 34 05 00 00 mvi r5,0
8003aa8: ca 93 30 00 sub r6,r20,r19
8003aac: 34 07 00 01 mvi r7,1
8003ab0: 5b 80 00 08 sw (sp+8),r0
8003ab4: 5b 80 00 0c sw (sp+12),r0
8003ab8: f8 00 0e 0d calli 80072ec <_Thread_Initialize>
budget_callout,
0, /* isr level */
name /* posix threads don't have a name */
);
if ( !status ) {
8003abc: 5c 20 00 0a bne r1,r0,8003ae4 <pthread_create+0x228>
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
8003ac0: b9 80 08 00 mv r1,r12
8003ac4: b9 c0 10 00 mv r2,r14
8003ac8: f8 00 09 31 calli 8005f8c <_Objects_Free>
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
8003acc: 78 01 08 02 mvhi r1,0x802
8003ad0: 38 21 09 68 ori r1,r1,0x968
8003ad4: 28 21 00 00 lw r1,(r1+0)
8003ad8: f8 00 05 20 calli 8004f58 <_API_Mutex_Unlock>
return EAGAIN;
8003adc: 34 0d 00 0b mvi r13,11
8003ae0: e0 00 00 2d bi 8003b94 <pthread_create+0x2d8>
}
/*
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8003ae4: 29 cc 01 1c lw r12,(r14+284)
api->Attributes = *the_attr;
8003ae8: b9 60 10 00 mv r2,r11
8003aec: 34 03 00 40 mvi r3,64
8003af0: b9 80 08 00 mv r1,r12
8003af4: f8 00 28 b3 calli 800ddc0 <memcpy>
api->detachstate = the_attr->detachstate;
8003af8: 29 61 00 3c lw r1,(r11+60)
api->schedparam = schedparam;
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003afc: 34 02 00 01 mvi r2,1
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
8003b00: 59 8f 00 84 sw (r12+132),r15
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
8003b04: 59 81 00 40 sw (r12+64),r1
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
8003b08: 2b 81 00 40 lw r1,(sp+64)
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003b0c: ba 00 18 00 mv r3,r16
8003b10: ba 40 20 00 mv r4,r18
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
8003b14: 59 81 00 88 sw (r12+136),r1
8003b18: 2b 81 00 44 lw r1,(sp+68)
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003b1c: 34 05 00 00 mvi r5,0
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
8003b20: 59 81 00 8c sw (r12+140),r1
8003b24: 2b 81 00 48 lw r1,(sp+72)
8003b28: 59 81 00 90 sw (r12+144),r1
8003b2c: 2b 81 00 4c lw r1,(sp+76)
8003b30: 59 81 00 94 sw (r12+148),r1
8003b34: 2b 81 00 50 lw r1,(sp+80)
8003b38: 59 81 00 98 sw (r12+152),r1
8003b3c: 2b 81 00 54 lw r1,(sp+84)
8003b40: 59 81 00 9c sw (r12+156),r1
8003b44: 2b 81 00 58 lw r1,(sp+88)
8003b48: 59 81 00 a0 sw (r12+160),r1
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003b4c: b9 c0 08 00 mv r1,r14
8003b50: f8 00 10 b0 calli 8007e10 <_Thread_Start>
_RTEMS_Unlock_allocator();
return EINVAL;
}
#endif
if ( schedpolicy == SCHED_SPORADIC ) {
8003b54: 34 01 00 04 mvi r1,4
8003b58: 5d e1 00 09 bne r15,r1,8003b7c <pthread_create+0x2c0>
_Watchdog_Insert_ticks(
8003b5c: 35 81 00 90 addi r1,r12,144
8003b60: f8 00 10 e1 calli 8007ee4 <_Timespec_To_ticks>
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003b64: 78 02 08 02 mvhi r2,0x802
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8003b68: 59 81 00 b4 sw (r12+180),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003b6c: b8 40 08 00 mv r1,r2
8003b70: 38 21 09 80 ori r1,r1,0x980
8003b74: 35 82 00 a8 addi r2,r12,168
8003b78: f8 00 11 ab calli 8008224 <_Watchdog_Insert>
}
/*
* Return the id and indicate we successfully created the thread
*/
*thread = the_thread->Object.id;
8003b7c: 29 c1 00 08 lw r1,(r14+8)
8003b80: 5a 21 00 00 sw (r17+0),r1
_RTEMS_Unlock_allocator();
8003b84: 78 01 08 02 mvhi r1,0x802
8003b88: 38 21 09 68 ori r1,r1,0x968
8003b8c: 28 21 00 00 lw r1,(r1+0)
8003b90: f8 00 04 f2 calli 8004f58 <_API_Mutex_Unlock>
return 0;
}
8003b94: b9 a0 08 00 mv r1,r13
8003b98: 2b 9d 00 10 lw ra,(sp+16)
8003b9c: 2b 8b 00 3c lw r11,(sp+60)
8003ba0: 2b 8c 00 38 lw r12,(sp+56)
8003ba4: 2b 8d 00 34 lw r13,(sp+52)
8003ba8: 2b 8e 00 30 lw r14,(sp+48)
8003bac: 2b 8f 00 2c lw r15,(sp+44)
8003bb0: 2b 90 00 28 lw r16,(sp+40)
8003bb4: 2b 91 00 24 lw r17,(sp+36)
8003bb8: 2b 92 00 20 lw r18,(sp+32)
8003bbc: 2b 93 00 1c lw r19,(sp+28)
8003bc0: 2b 94 00 18 lw r20,(sp+24)
8003bc4: 2b 95 00 14 lw r21,(sp+20)
8003bc8: 37 9c 00 60 addi sp,sp,96
8003bcc: c3 a0 00 00 ret
080116b4 <pthread_exit>:
void pthread_exit(
void *value_ptr
)
{
80116b4: 37 9c ff fc addi sp,sp,-4
80116b8: 5b 9d 00 04 sw (sp+4),ra
_POSIX_Thread_Exit( _Thread_Executing, value_ptr );
80116bc: 78 03 08 01 mvhi r3,0x801
80116c0: 38 63 ae 00 ori r3,r3,0xae00
}
void pthread_exit(
void *value_ptr
)
{
80116c4: b8 20 10 00 mv r2,r1
_POSIX_Thread_Exit( _Thread_Executing, value_ptr );
80116c8: 28 61 00 10 lw r1,(r3+16)
80116cc: fb ff ff bb calli 80115b8 <_POSIX_Thread_Exit>
}
80116d0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
80116d4: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
80116d8: c3 a0 00 00 ret <== NOT EXECUTED
080262c8 <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
80262c8: 37 9c ff e4 addi sp,sp,-28
80262cc: 5b 8b 00 18 sw (sp+24),r11
80262d0: 5b 8c 00 14 sw (sp+20),r12
80262d4: 5b 8d 00 10 sw (sp+16),r13
80262d8: 5b 8e 00 0c sw (sp+12),r14
80262dc: 5b 8f 00 08 sw (sp+8),r15
80262e0: 5b 9d 00 04 sw (sp+4),ra
80262e4: b8 40 58 00 mv r11,r2
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
80262e8: 44 40 00 04 be r2,r0,80262f8 <pthread_kill+0x30>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
80262ec: 34 4f ff ff addi r15,r2,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
80262f0: 34 02 00 1f mvi r2,31
80262f4: 50 4f 00 04 bgeu r2,r15,8026304 <pthread_kill+0x3c>
rtems_set_errno_and_return_minus_one( EINVAL );
80262f8: fb ff b3 58 calli 8013058 <__errno>
80262fc: 34 02 00 16 mvi r2,22
8026300: e0 00 00 2c bi 80263b0 <pthread_kill+0xe8>
the_thread = _Thread_Get( thread, &location );
8026304: 37 82 00 1c addi r2,sp,28
8026308: fb ff 9a 26 calli 800cba0 <_Thread_Get>
802630c: b8 20 60 00 mv r12,r1
switch ( location ) {
8026310: 2b 81 00 1c lw r1,(sp+28)
8026314: 5c 20 00 25 bne r1,r0,80263a8 <pthread_kill+0xe0> <== NEVER TAKEN
8026318: 78 01 08 02 mvhi r1,0x802
802631c: 38 21 91 d4 ori r1,r1,0x91d4
8026320: fb ff 90 55 calli 800a474 <_API_extensions_Add_post_switch>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
8026324: 34 02 00 01 mvi r2,1
8026328: b9 60 08 00 mv r1,r11
802632c: fb ff 6e c0 calli 8001e2c <__ashlsi3>
8026330: 78 0d 08 02 mvhi r13,0x802
8026334: b4 2b 08 00 add r1,r1,r11
8026338: 34 02 00 02 mvi r2,2
802633c: 39 ad 9f 88 ori r13,r13,0x9f88
8026340: fb ff 6e bb calli 8001e2c <__ashlsi3>
8026344: b5 a1 08 00 add r1,r13,r1
8026348: 28 21 00 08 lw r1,(r1+8)
802634c: 34 0d 00 01 mvi r13,1
* If sig == 0 then just validate arguments
*/
_POSIX_signals_Add_post_switch_extension();
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8026350: 29 8e 01 1c lw r14,(r12+284)
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
8026354: 44 2d 00 12 be r1,r13,802639c <pthread_kill+0xd4>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
8026358: b9 e0 10 00 mv r2,r15
802635c: 34 01 00 01 mvi r1,1
8026360: fb ff 6e b3 calli 8001e2c <__ashlsi3>
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
8026364: 29 c2 00 d4 lw r2,(r14+212)
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
8026368: 34 03 00 00 mvi r3,0
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
802636c: b8 41 08 00 or r1,r2,r1
8026370: 59 c1 00 d4 sw (r14+212),r1
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
8026374: b9 60 10 00 mv r2,r11
8026378: b9 80 08 00 mv r1,r12
802637c: fb ff ff 78 calli 802615c <_POSIX_signals_Unblock_thread>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
8026380: 78 02 08 02 mvhi r2,0x802
8026384: 38 42 9f 00 ori r2,r2,0x9f00
8026388: 28 41 00 08 lw r1,(r2+8)
802638c: 44 20 00 04 be r1,r0,802639c <pthread_kill+0xd4>
8026390: 28 41 00 10 lw r1,(r2+16)
8026394: 5d 81 00 02 bne r12,r1,802639c <pthread_kill+0xd4>
_Thread_Dispatch_necessary = true;
8026398: 30 4d 00 0c sb (r2+12),r13
}
_Thread_Enable_dispatch();
802639c: fb ff 99 f5 calli 800cb70 <_Thread_Enable_dispatch>
return 0;
80263a0: 34 01 00 00 mvi r1,0
80263a4: e0 00 00 05 bi 80263b8 <pthread_kill+0xf0>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
80263a8: fb ff b3 2c calli 8013058 <__errno> <== NOT EXECUTED
80263ac: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
80263b0: 58 22 00 00 sw (r1+0),r2
80263b4: 34 01 ff ff mvi r1,-1
}
80263b8: 2b 9d 00 04 lw ra,(sp+4)
80263bc: 2b 8b 00 18 lw r11,(sp+24)
80263c0: 2b 8c 00 14 lw r12,(sp+20)
80263c4: 2b 8d 00 10 lw r13,(sp+16)
80263c8: 2b 8e 00 0c lw r14,(sp+12)
80263cc: 2b 8f 00 08 lw r15,(sp+8)
80263d0: 37 9c 00 1c addi sp,sp,28
80263d4: c3 a0 00 00 ret
08005ee8 <pthread_mutex_timedlock>:
*/
int pthread_mutex_timedlock(
pthread_mutex_t *mutex,
const struct timespec *abstime
)
{
8005ee8: 37 9c ff ec addi sp,sp,-20
8005eec: 5b 8b 00 10 sw (sp+16),r11
8005ef0: 5b 8c 00 0c sw (sp+12),r12
8005ef4: 5b 8d 00 08 sw (sp+8),r13
8005ef8: 5b 9d 00 04 sw (sp+4),ra
8005efc: b8 20 68 00 mv r13,r1
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
8005f00: b8 40 08 00 mv r1,r2
8005f04: 37 82 00 14 addi r2,sp,20
8005f08: f8 00 00 41 calli 800600c <_POSIX_Absolute_timeout_to_ticks>
int _EXFUN(pthread_mutex_trylock, (pthread_mutex_t *__mutex));
int _EXFUN(pthread_mutex_unlock, (pthread_mutex_t *__mutex));
#if defined(_POSIX_TIMEOUTS)
int _EXFUN(pthread_mutex_timedlock,
8005f0c: 64 2c 00 03 cmpei r12,r1,3
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
8005f10: 2b 83 00 14 lw r3,(sp+20)
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
8005f14: b8 20 58 00 mv r11,r1
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
8005f18: b9 80 10 00 mv r2,r12
8005f1c: b9 a0 08 00 mv r1,r13
8005f20: fb ff ff a3 calli 8005dac <_POSIX_Mutex_Lock_support>
* This service only gives us the option to block. We used a polling
* attempt to lock if the abstime was not in the future. If we did
* not obtain the mutex, then not look at the status immediately,
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
8005f24: 5d 80 00 0b bne r12,r0,8005f50 <pthread_mutex_timedlock+0x68>
8005f28: 34 02 00 10 mvi r2,16
8005f2c: 5c 22 00 09 bne r1,r2,8005f50 <pthread_mutex_timedlock+0x68>
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
8005f30: 45 60 00 05 be r11,r0,8005f44 <pthread_mutex_timedlock+0x5c><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8005f34: 35 6b ff ff addi r11,r11,-1
8005f38: 34 02 00 01 mvi r2,1
8005f3c: 50 4b 00 04 bgeu r2,r11,8005f4c <pthread_mutex_timedlock+0x64><== ALWAYS TAKEN
8005f40: e0 00 00 04 bi 8005f50 <pthread_mutex_timedlock+0x68> <== NOT EXECUTED
* not obtain the mutex, then not look at the status immediately,
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
8005f44: 34 01 00 16 mvi r1,22 <== NOT EXECUTED
8005f48: e0 00 00 02 bi 8005f50 <pthread_mutex_timedlock+0x68> <== NOT EXECUTED
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
8005f4c: 34 01 00 74 mvi r1,116
}
return lock_status;
}
8005f50: 2b 9d 00 04 lw ra,(sp+4)
8005f54: 2b 8b 00 10 lw r11,(sp+16)
8005f58: 2b 8c 00 0c lw r12,(sp+12)
8005f5c: 2b 8d 00 08 lw r13,(sp+8)
8005f60: 37 9c 00 14 addi sp,sp,20
8005f64: c3 a0 00 00 ret
08005a18 <pthread_mutexattr_setpshared>:
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
8005a18: 34 03 00 16 mvi r3,22
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
8005a1c: 44 20 00 07 be r1,r0,8005a38 <pthread_mutexattr_setpshared+0x20>
8005a20: 28 24 00 00 lw r4,(r1+0)
8005a24: 44 80 00 05 be r4,r0,8005a38 <pthread_mutexattr_setpshared+0x20>
return EINVAL;
switch ( pshared ) {
8005a28: 34 04 00 01 mvi r4,1
8005a2c: 54 44 00 03 bgu r2,r4,8005a38 <pthread_mutexattr_setpshared+0x20><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
8005a30: 58 22 00 04 sw (r1+4),r2
return 0;
8005a34: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
8005a38: b8 60 08 00 mv r1,r3
8005a3c: c3 a0 00 00 ret
080031d4 <pthread_mutexattr_settype>:
pthread_mutexattr_t *attr,
int type
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
80031d4: 34 03 00 16 mvi r3,22
int pthread_mutexattr_settype(
pthread_mutexattr_t *attr,
int type
)
{
if ( !attr || !attr->is_initialized )
80031d8: 44 20 00 07 be r1,r0,80031f4 <pthread_mutexattr_settype+0x20>
80031dc: 28 24 00 00 lw r4,(r1+0)
80031e0: 44 80 00 05 be r4,r0,80031f4 <pthread_mutexattr_settype+0x20><== NEVER TAKEN
return EINVAL;
switch ( type ) {
80031e4: 34 04 00 03 mvi r4,3
80031e8: 54 44 00 03 bgu r2,r4,80031f4 <pthread_mutexattr_settype+0x20>
case PTHREAD_MUTEX_NORMAL:
case PTHREAD_MUTEX_RECURSIVE:
case PTHREAD_MUTEX_ERRORCHECK:
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
80031ec: 58 22 00 10 sw (r1+16),r2
return 0;
80031f0: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
80031f4: b8 60 08 00 mv r1,r3
80031f8: c3 a0 00 00 ret
08004138 <pthread_once>:
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
8004138: 37 9c ff ec addi sp,sp,-20
800413c: 5b 8b 00 10 sw (sp+16),r11
8004140: 5b 8c 00 0c sw (sp+12),r12
8004144: 5b 8d 00 08 sw (sp+8),r13
8004148: 5b 9d 00 04 sw (sp+4),ra
800414c: b8 20 58 00 mv r11,r1
8004150: b8 40 60 00 mv r12,r2
if ( !once_control || !init_routine )
8004154: 64 21 00 00 cmpei r1,r1,0
8004158: 64 42 00 00 cmpei r2,r2,0
800415c: b8 41 10 00 or r2,r2,r1
return EINVAL;
8004160: 34 01 00 16 mvi r1,22
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
if ( !once_control || !init_routine )
8004164: 5c 40 00 13 bne r2,r0,80041b0 <pthread_once+0x78>
return EINVAL;
if ( !once_control->init_executed ) {
8004168: 29 6d 00 04 lw r13,(r11+4)
once_control->init_executed = true;
(*init_routine)();
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
}
return 0;
800416c: 34 01 00 00 mvi r1,0
)
{
if ( !once_control || !init_routine )
return EINVAL;
if ( !once_control->init_executed ) {
8004170: 5d a2 00 10 bne r13,r2,80041b0 <pthread_once+0x78>
rtems_mode saveMode;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
8004174: 34 01 01 00 mvi r1,256
8004178: 34 02 01 00 mvi r2,256
800417c: 37 83 00 14 addi r3,sp,20
8004180: f8 00 01 b0 calli 8004840 <rtems_task_mode>
if ( !once_control->init_executed ) {
8004184: 29 61 00 04 lw r1,(r11+4)
8004188: 5c 2d 00 05 bne r1,r13,800419c <pthread_once+0x64> <== NEVER TAKEN
once_control->is_initialized = true;
800418c: 34 01 00 01 mvi r1,1
8004190: 59 61 00 00 sw (r11+0),r1
once_control->init_executed = true;
8004194: 59 61 00 04 sw (r11+4),r1
(*init_routine)();
8004198: d9 80 00 00 call r12
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
800419c: 2b 81 00 14 lw r1,(sp+20)
80041a0: 34 02 01 00 mvi r2,256
80041a4: 37 83 00 14 addi r3,sp,20
80041a8: f8 00 01 a6 calli 8004840 <rtems_task_mode>
}
return 0;
80041ac: 34 01 00 00 mvi r1,0
}
80041b0: 2b 9d 00 04 lw ra,(sp+4)
80041b4: 2b 8b 00 10 lw r11,(sp+16)
80041b8: 2b 8c 00 0c lw r12,(sp+12)
80041bc: 2b 8d 00 08 lw r13,(sp+8)
80041c0: 37 9c 00 14 addi sp,sp,20
80041c4: c3 a0 00 00 ret
08004414 <pthread_rwlock_init>:
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
8004414: 37 9c ff e0 addi sp,sp,-32
8004418: 5b 8b 00 14 sw (sp+20),r11
800441c: 5b 8c 00 10 sw (sp+16),r12
8004420: 5b 8d 00 0c sw (sp+12),r13
8004424: 5b 8e 00 08 sw (sp+8),r14
8004428: 5b 9d 00 04 sw (sp+4),ra
/*
* Error check parameters
*/
if ( !rwlock )
return EINVAL;
800442c: 34 03 00 16 mvi r3,22
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
8004430: b8 20 68 00 mv r13,r1
const pthread_rwlockattr_t *the_attr;
/*
* Error check parameters
*/
if ( !rwlock )
8004434: 44 20 00 28 be r1,r0,80044d4 <pthread_rwlock_init+0xc0>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
8004438: 5c 40 00 05 bne r2,r0,800444c <pthread_rwlock_init+0x38>
the_attr = attr;
} else {
(void) pthread_rwlockattr_init( &default_attr );
800443c: 37 8b 00 18 addi r11,sp,24
8004440: b9 60 08 00 mv r1,r11
8004444: f8 00 02 2a calli 8004cec <pthread_rwlockattr_init>
the_attr = &default_attr;
8004448: b9 60 10 00 mv r2,r11
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
800444c: 28 41 00 00 lw r1,(r2+0)
return EINVAL;
8004450: 34 03 00 16 mvi r3,22
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
8004454: 44 20 00 20 be r1,r0,80044d4 <pthread_rwlock_init+0xc0> <== NEVER TAKEN
return EINVAL;
switch ( the_attr->process_shared ) {
8004458: 28 4e 00 04 lw r14,(r2+4)
800445c: 5d c0 00 1e bne r14,r0,80044d4 <pthread_rwlock_init+0xc0> <== NEVER TAKEN
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8004460: 78 02 08 02 mvhi r2,0x802
8004464: 38 42 43 28 ori r2,r2,0x4328
8004468: 28 41 00 00 lw r1,(r2+0)
*/
RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes(
CORE_RWLock_Attributes *the_attributes
)
{
the_attributes->XXX = 0;
800446c: 5b 80 00 20 sw (sp+32),r0
++level;
8004470: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
8004474: 58 41 00 00 sw (r2+0),r1
* the inactive chain of free RWLock control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void )
{
return (POSIX_RWLock_Control *)
_Objects_Allocate( &_POSIX_RWLock_Information );
8004478: 78 0c 08 02 mvhi r12,0x802
800447c: 39 8c 44 a4 ori r12,r12,0x44a4
8004480: b9 80 08 00 mv r1,r12
8004484: f8 00 0b 13 calli 80070d0 <_Objects_Allocate>
8004488: b8 20 58 00 mv r11,r1
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_rwlock = _POSIX_RWLock_Allocate();
if ( !the_rwlock ) {
800448c: 5c 2e 00 04 bne r1,r14,800449c <pthread_rwlock_init+0x88>
_Thread_Enable_dispatch();
8004490: f8 00 10 b1 calli 8008754 <_Thread_Enable_dispatch>
return EAGAIN;
8004494: 34 03 00 0b mvi r3,11
8004498: e0 00 00 0f bi 80044d4 <pthread_rwlock_init+0xc0>
}
_CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes );
800449c: 34 21 00 10 addi r1,r1,16
80044a0: 37 82 00 20 addi r2,sp,32
80044a4: f8 00 09 01 calli 80068a8 <_CORE_RWLock_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
80044a8: 29 6e 00 08 lw r14,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
80044ac: 29 8c 00 1c lw r12,(r12+28)
80044b0: 34 02 00 02 mvi r2,2
80044b4: 21 c1 ff ff andi r1,r14,0xffff
80044b8: fb ff f1 d9 calli 8000c1c <__ashlsi3>
80044bc: b5 81 08 00 add r1,r12,r1
80044c0: 58 2b 00 00 sw (r1+0),r11
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
80044c4: 59 60 00 0c sw (r11+12),r0
&_POSIX_RWLock_Information,
&the_rwlock->Object,
0
);
*rwlock = the_rwlock->Object.id;
80044c8: 59 ae 00 00 sw (r13+0),r14
_Thread_Enable_dispatch();
80044cc: f8 00 10 a2 calli 8008754 <_Thread_Enable_dispatch>
return 0;
80044d0: 34 03 00 00 mvi r3,0
}
80044d4: b8 60 08 00 mv r1,r3
80044d8: 2b 9d 00 04 lw ra,(sp+4)
80044dc: 2b 8b 00 14 lw r11,(sp+20)
80044e0: 2b 8c 00 10 lw r12,(sp+16)
80044e4: 2b 8d 00 0c lw r13,(sp+12)
80044e8: 2b 8e 00 08 lw r14,(sp+8)
80044ec: 37 9c 00 20 addi sp,sp,32
80044f0: c3 a0 00 00 ret
08004c60 <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004c60: 37 9c ff e0 addi sp,sp,-32
8004c64: 5b 8b 00 18 sw (sp+24),r11
8004c68: 5b 8c 00 14 sw (sp+20),r12
8004c6c: 5b 8d 00 10 sw (sp+16),r13
8004c70: 5b 8e 00 0c sw (sp+12),r14
8004c74: 5b 8f 00 08 sw (sp+8),r15
8004c78: 5b 9d 00 04 sw (sp+4),ra
8004c7c: b8 20 70 00 mv r14,r1
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
return EINVAL;
8004c80: 34 0b 00 16 mvi r11,22
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004c84: b8 40 08 00 mv r1,r2
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
8004c88: 45 c0 00 25 be r14,r0,8004d1c <pthread_rwlock_timedrdlock+0xbc>
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
8004c8c: 37 82 00 1c addi r2,sp,28
8004c90: f8 00 1b 21 calli 800b914 <_POSIX_Absolute_timeout_to_ticks>
8004c94: 29 c2 00 00 lw r2,(r14+0)
8004c98: b8 20 60 00 mv r12,r1
8004c9c: 78 01 08 01 mvhi r1,0x801
8004ca0: 38 21 9a 44 ori r1,r1,0x9a44
8004ca4: 37 83 00 20 addi r3,sp,32
8004ca8: f8 00 0b 0b calli 80078d4 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
8004cac: 2b 8f 00 20 lw r15,(sp+32)
8004cb0: 5d e0 00 1b bne r15,r0,8004d1c <pthread_rwlock_timedrdlock+0xbc>
int _EXFUN(pthread_rwlock_init,
(pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr));
int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_timedrdlock,
8004cb4: 65 8d 00 03 cmpei r13,r12,3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
8004cb8: 29 c2 00 00 lw r2,(r14+0)
8004cbc: 2b 84 00 1c lw r4,(sp+28)
8004cc0: 34 21 00 10 addi r1,r1,16
8004cc4: b9 a0 18 00 mv r3,r13
8004cc8: 34 05 00 00 mvi r5,0
8004ccc: f8 00 06 d2 calli 8006814 <_CORE_RWLock_Obtain_for_reading>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
8004cd0: f8 00 0e d7 calli 800882c <_Thread_Enable_dispatch>
if ( !do_wait ) {
8004cd4: 5d af 00 0c bne r13,r15,8004d04 <pthread_rwlock_timedrdlock+0xa4>
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
8004cd8: 78 01 08 01 mvhi r1,0x801
8004cdc: 38 21 9d a0 ori r1,r1,0x9da0
8004ce0: 28 21 00 10 lw r1,(r1+16)
8004ce4: 28 22 00 34 lw r2,(r1+52)
8004ce8: 34 01 00 02 mvi r1,2
8004cec: 5c 41 00 06 bne r2,r1,8004d04 <pthread_rwlock_timedrdlock+0xa4>
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
8004cf0: 45 8d 00 0b be r12,r13,8004d1c <pthread_rwlock_timedrdlock+0xbc><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8004cf4: 35 8c ff ff addi r12,r12,-1
8004cf8: 34 01 00 01 mvi r1,1
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
8004cfc: 34 0b 00 74 mvi r11,116
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8004d00: 50 2c 00 07 bgeu r1,r12,8004d1c <pthread_rwlock_timedrdlock+0xbc><== ALWAYS TAKEN
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
(CORE_RWLock_Status) _Thread_Executing->Wait.return_code
8004d04: 78 01 08 01 mvhi r1,0x801
8004d08: 38 21 9d a0 ori r1,r1,0x9da0
8004d0c: 28 21 00 10 lw r1,(r1+16)
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
8004d10: 28 21 00 34 lw r1,(r1+52)
8004d14: f8 00 00 43 calli 8004e20 <_POSIX_RWLock_Translate_core_RWLock_return_code>
8004d18: b8 20 58 00 mv r11,r1
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
8004d1c: b9 60 08 00 mv r1,r11
8004d20: 2b 9d 00 04 lw ra,(sp+4)
8004d24: 2b 8b 00 18 lw r11,(sp+24)
8004d28: 2b 8c 00 14 lw r12,(sp+20)
8004d2c: 2b 8d 00 10 lw r13,(sp+16)
8004d30: 2b 8e 00 0c lw r14,(sp+12)
8004d34: 2b 8f 00 08 lw r15,(sp+8)
8004d38: 37 9c 00 20 addi sp,sp,32
8004d3c: c3 a0 00 00 ret
08004d40 <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004d40: 37 9c ff e0 addi sp,sp,-32
8004d44: 5b 8b 00 18 sw (sp+24),r11
8004d48: 5b 8c 00 14 sw (sp+20),r12
8004d4c: 5b 8d 00 10 sw (sp+16),r13
8004d50: 5b 8e 00 0c sw (sp+12),r14
8004d54: 5b 8f 00 08 sw (sp+8),r15
8004d58: 5b 9d 00 04 sw (sp+4),ra
8004d5c: b8 20 70 00 mv r14,r1
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
return EINVAL;
8004d60: 34 0b 00 16 mvi r11,22
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004d64: b8 40 08 00 mv r1,r2
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
8004d68: 45 c0 00 25 be r14,r0,8004dfc <pthread_rwlock_timedwrlock+0xbc>
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
8004d6c: 37 82 00 1c addi r2,sp,28
8004d70: f8 00 1a e9 calli 800b914 <_POSIX_Absolute_timeout_to_ticks>
8004d74: 29 c2 00 00 lw r2,(r14+0)
8004d78: b8 20 60 00 mv r12,r1
8004d7c: 78 01 08 01 mvhi r1,0x801
8004d80: 38 21 9a 44 ori r1,r1,0x9a44
8004d84: 37 83 00 20 addi r3,sp,32
8004d88: f8 00 0a d3 calli 80078d4 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
8004d8c: 2b 8f 00 20 lw r15,(sp+32)
8004d90: 5d e0 00 1b bne r15,r0,8004dfc <pthread_rwlock_timedwrlock+0xbc>
(pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime));
int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_timedwrlock,
8004d94: 65 8d 00 03 cmpei r13,r12,3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
8004d98: 29 c2 00 00 lw r2,(r14+0)
8004d9c: 2b 84 00 1c lw r4,(sp+28)
8004da0: 34 21 00 10 addi r1,r1,16
8004da4: b9 a0 18 00 mv r3,r13
8004da8: 34 05 00 00 mvi r5,0
8004dac: f8 00 06 d8 calli 800690c <_CORE_RWLock_Obtain_for_writing>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
8004db0: f8 00 0e 9f calli 800882c <_Thread_Enable_dispatch>
if ( !do_wait &&
8004db4: 5d af 00 0c bne r13,r15,8004de4 <pthread_rwlock_timedwrlock+0xa4>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
8004db8: 78 01 08 01 mvhi r1,0x801
8004dbc: 38 21 9d a0 ori r1,r1,0x9da0
8004dc0: 28 21 00 10 lw r1,(r1+16)
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
8004dc4: 28 22 00 34 lw r2,(r1+52)
8004dc8: 34 01 00 02 mvi r1,2
8004dcc: 5c 41 00 06 bne r2,r1,8004de4 <pthread_rwlock_timedwrlock+0xa4>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
8004dd0: 45 8d 00 0b be r12,r13,8004dfc <pthread_rwlock_timedwrlock+0xbc><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8004dd4: 35 8c ff ff addi r12,r12,-1
8004dd8: 34 01 00 01 mvi r1,1
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
8004ddc: 34 0b 00 74 mvi r11,116
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8004de0: 50 2c 00 07 bgeu r1,r12,8004dfc <pthread_rwlock_timedwrlock+0xbc><== ALWAYS TAKEN
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
(CORE_RWLock_Status) _Thread_Executing->Wait.return_code
8004de4: 78 01 08 01 mvhi r1,0x801
8004de8: 38 21 9d a0 ori r1,r1,0x9da0
8004dec: 28 21 00 10 lw r1,(r1+16)
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
8004df0: 28 21 00 34 lw r1,(r1+52)
8004df4: f8 00 00 0b calli 8004e20 <_POSIX_RWLock_Translate_core_RWLock_return_code>
8004df8: b8 20 58 00 mv r11,r1
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
8004dfc: b9 60 08 00 mv r1,r11
8004e00: 2b 9d 00 04 lw ra,(sp+4)
8004e04: 2b 8b 00 18 lw r11,(sp+24)
8004e08: 2b 8c 00 14 lw r12,(sp+20)
8004e0c: 2b 8d 00 10 lw r13,(sp+16)
8004e10: 2b 8e 00 0c lw r14,(sp+12)
8004e14: 2b 8f 00 08 lw r15,(sp+8)
8004e18: 37 9c 00 20 addi sp,sp,32
8004e1c: c3 a0 00 00 ret
08004fcc <pthread_rwlock_wrlock>:
*/
int pthread_rwlock_wrlock(
pthread_rwlock_t *rwlock
)
{
8004fcc: 37 9c ff f0 addi sp,sp,-16
8004fd0: 5b 8b 00 0c sw (sp+12),r11
8004fd4: 5b 8c 00 08 sw (sp+8),r12
8004fd8: 5b 9d 00 04 sw (sp+4),ra
POSIX_RWLock_Control *the_rwlock;
Objects_Locations location;
if ( !rwlock )
return EINVAL;
8004fdc: 34 0c 00 16 mvi r12,22
*/
int pthread_rwlock_wrlock(
pthread_rwlock_t *rwlock
)
{
8004fe0: b8 20 58 00 mv r11,r1
POSIX_RWLock_Control *the_rwlock;
Objects_Locations location;
if ( !rwlock )
8004fe4: 44 20 00 16 be r1,r0,800503c <pthread_rwlock_wrlock+0x70> <== NEVER TAKEN
8004fe8: 29 62 00 00 lw r2,(r11+0)
8004fec: 78 01 08 01 mvhi r1,0x801
8004ff0: 38 21 9a 44 ori r1,r1,0x9a44
8004ff4: 37 83 00 10 addi r3,sp,16
8004ff8: f8 00 0a 37 calli 80078d4 <_Objects_Get>
8004ffc: b8 20 10 00 mv r2,r1
return EINVAL;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
8005000: 2b 81 00 10 lw r1,(sp+16)
8005004: 5c 20 00 0e bne r1,r0,800503c <pthread_rwlock_wrlock+0x70>
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
8005008: 34 41 00 10 addi r1,r2,16
800500c: 29 62 00 00 lw r2,(r11+0)
8005010: 34 03 00 01 mvi r3,1
8005014: 34 04 00 00 mvi r4,0
8005018: 34 05 00 00 mvi r5,0
800501c: f8 00 06 3c calli 800690c <_CORE_RWLock_Obtain_for_writing>
true, /* do not timeout -- wait forever */
0,
NULL
);
_Thread_Enable_dispatch();
8005020: f8 00 0e 03 calli 800882c <_Thread_Enable_dispatch>
return _POSIX_RWLock_Translate_core_RWLock_return_code(
(CORE_RWLock_Status) _Thread_Executing->Wait.return_code
8005024: 78 01 08 01 mvhi r1,0x801
8005028: 38 21 9d a0 ori r1,r1,0x9da0
800502c: 28 21 00 10 lw r1,(r1+16)
0,
NULL
);
_Thread_Enable_dispatch();
return _POSIX_RWLock_Translate_core_RWLock_return_code(
8005030: 28 21 00 34 lw r1,(r1+52)
8005034: fb ff ff 7b calli 8004e20 <_POSIX_RWLock_Translate_core_RWLock_return_code>
8005038: b8 20 60 00 mv r12,r1
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
800503c: b9 80 08 00 mv r1,r12
8005040: 2b 9d 00 04 lw ra,(sp+4)
8005044: 2b 8b 00 0c lw r11,(sp+12)
8005048: 2b 8c 00 08 lw r12,(sp+8)
800504c: 37 9c 00 10 addi sp,sp,16
8005050: c3 a0 00 00 ret
0800578c <pthread_rwlockattr_setpshared>:
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
return EINVAL;
800578c: 34 03 00 16 mvi r3,22
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
8005790: 44 20 00 07 be r1,r0,80057ac <pthread_rwlockattr_setpshared+0x20>
return EINVAL;
if ( !attr->is_initialized )
8005794: 28 24 00 00 lw r4,(r1+0)
8005798: 44 80 00 05 be r4,r0,80057ac <pthread_rwlockattr_setpshared+0x20>
return EINVAL;
switch ( pshared ) {
800579c: 34 04 00 01 mvi r4,1
80057a0: 54 44 00 03 bgu r2,r4,80057ac <pthread_rwlockattr_setpshared+0x20><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
80057a4: 58 22 00 04 sw (r1+4),r2
return 0;
80057a8: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
80057ac: b8 60 08 00 mv r1,r3
80057b0: c3 a0 00 00 ret
08006a6c <pthread_setschedparam>:
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
8006a6c: 37 9c ff dc addi sp,sp,-36
8006a70: 5b 8b 00 18 sw (sp+24),r11
8006a74: 5b 8c 00 14 sw (sp+20),r12
8006a78: 5b 8d 00 10 sw (sp+16),r13
8006a7c: 5b 8e 00 0c sw (sp+12),r14
8006a80: 5b 8f 00 08 sw (sp+8),r15
8006a84: 5b 9d 00 04 sw (sp+4),ra
/*
* Check all the parameters
*/
if ( !param )
return EINVAL;
8006a88: 34 0e 00 16 mvi r14,22
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
8006a8c: b8 20 58 00 mv r11,r1
8006a90: b8 40 78 00 mv r15,r2
8006a94: b8 60 60 00 mv r12,r3
int rc;
/*
* Check all the parameters
*/
if ( !param )
8006a98: 44 60 00 43 be r3,r0,8006ba4 <pthread_setschedparam+0x138>
return EINVAL;
rc = _POSIX_Thread_Translate_sched_param(
8006a9c: b8 40 08 00 mv r1,r2
8006aa0: 37 84 00 20 addi r4,sp,32
8006aa4: b8 60 10 00 mv r2,r3
8006aa8: 37 83 00 24 addi r3,sp,36
8006aac: f8 00 19 3b calli 800cf98 <_POSIX_Thread_Translate_sched_param>
8006ab0: b8 20 70 00 mv r14,r1
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( rc )
8006ab4: 5c 20 00 3c bne r1,r0,8006ba4 <pthread_setschedparam+0x138>
return rc;
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _Thread_Get( thread, &location );
8006ab8: b9 60 08 00 mv r1,r11
8006abc: 37 82 00 1c addi r2,sp,28
8006ac0: f8 00 0c 0f calli 8009afc <_Thread_Get>
8006ac4: b8 20 68 00 mv r13,r1
switch ( location ) {
8006ac8: 2b 81 00 1c lw r1,(sp+28)
8006acc: 5c 2e 00 35 bne r1,r14,8006ba0 <pthread_setschedparam+0x134>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8006ad0: 29 ab 01 1c lw r11,(r13+284)
if ( api->schedpolicy == SCHED_SPORADIC )
8006ad4: 34 01 00 04 mvi r1,4
8006ad8: 29 62 00 84 lw r2,(r11+132)
8006adc: 5c 41 00 03 bne r2,r1,8006ae8 <pthread_setschedparam+0x7c>
(void) _Watchdog_Remove( &api->Sporadic_timer );
8006ae0: 35 61 00 a8 addi r1,r11,168
8006ae4: f8 00 10 c4 calli 800adf4 <_Watchdog_Remove>
api->schedpolicy = policy;
8006ae8: 59 6f 00 84 sw (r11+132),r15
api->schedparam = *param;
8006aec: 29 81 00 14 lw r1,(r12+20)
8006af0: 29 82 00 00 lw r2,(r12+0)
8006af4: 29 86 00 04 lw r6,(r12+4)
8006af8: 29 85 00 08 lw r5,(r12+8)
8006afc: 29 84 00 0c lw r4,(r12+12)
8006b00: 29 83 00 10 lw r3,(r12+16)
8006b04: 29 87 00 18 lw r7,(r12+24)
8006b08: 59 61 00 9c sw (r11+156),r1
the_thread->budget_algorithm = budget_algorithm;
8006b0c: 2b 81 00 24 lw r1,(sp+36)
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
api->schedpolicy = policy;
api->schedparam = *param;
8006b10: 59 62 00 88 sw (r11+136),r2
8006b14: 59 66 00 8c sw (r11+140),r6
8006b18: 59 65 00 90 sw (r11+144),r5
8006b1c: 59 64 00 94 sw (r11+148),r4
8006b20: 59 63 00 98 sw (r11+152),r3
8006b24: 59 67 00 a0 sw (r11+160),r7
the_thread->budget_algorithm = budget_algorithm;
8006b28: 59 a1 00 78 sw (r13+120),r1
the_thread->budget_callout = budget_callout;
8006b2c: 2b 81 00 20 lw r1,(sp+32)
8006b30: 59 a1 00 7c sw (r13+124),r1
switch ( api->schedpolicy ) {
8006b34: 48 0f 00 19 bg r0,r15,8006b98 <pthread_setschedparam+0x12c><== NEVER TAKEN
8006b38: 34 01 00 02 mvi r1,2
8006b3c: 4c 2f 00 04 bge r1,r15,8006b4c <pthread_setschedparam+0xe0>
8006b40: 34 01 00 04 mvi r1,4
8006b44: 5d e1 00 15 bne r15,r1,8006b98 <pthread_setschedparam+0x12c><== NEVER TAKEN
8006b48: e0 00 00 0e bi 8006b80 <pthread_setschedparam+0x114>
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
8006b4c: 78 01 08 01 mvhi r1,0x801
8006b50: 38 21 a8 e0 ori r1,r1,0xa8e0
8006b54: 28 21 00 00 lw r1,(r1+0)
the_thread->real_priority =
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
8006b58: 34 03 00 01 mvi r3,1
switch ( api->schedpolicy ) {
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
8006b5c: 59 a1 00 74 sw (r13+116),r1
8006b60: 78 01 08 01 mvhi r1,0x801
8006b64: 38 21 a0 fc ori r1,r1,0xa0fc
8006b68: 40 21 00 00 lbu r1,(r1+0)
8006b6c: c8 22 10 00 sub r2,r1,r2
the_thread->real_priority =
8006b70: 59 a2 00 18 sw (r13+24),r2
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
8006b74: b9 a0 08 00 mv r1,r13
8006b78: f8 00 0a 9b calli 80095e4 <_Thread_Change_priority>
the_thread,
the_thread->real_priority,
true
);
break;
8006b7c: e0 00 00 07 bi 8006b98 <pthread_setschedparam+0x12c>
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
8006b80: 59 62 00 a4 sw (r11+164),r2
_Watchdog_Remove( &api->Sporadic_timer );
8006b84: 35 61 00 a8 addi r1,r11,168
8006b88: f8 00 10 9b calli 800adf4 <_Watchdog_Remove>
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
8006b8c: 34 01 00 00 mvi r1,0
8006b90: b9 a0 10 00 mv r2,r13
8006b94: fb ff ff 65 calli 8006928 <_POSIX_Threads_Sporadic_budget_TSR>
break;
}
_Thread_Enable_dispatch();
8006b98: f8 00 0b cd calli 8009acc <_Thread_Enable_dispatch>
return 0;
8006b9c: e0 00 00 02 bi 8006ba4 <pthread_setschedparam+0x138>
#endif
case OBJECTS_ERROR:
break;
}
return ESRCH;
8006ba0: 34 0e 00 03 mvi r14,3
}
8006ba4: b9 c0 08 00 mv r1,r14
8006ba8: 2b 9d 00 04 lw ra,(sp+4)
8006bac: 2b 8b 00 18 lw r11,(sp+24)
8006bb0: 2b 8c 00 14 lw r12,(sp+20)
8006bb4: 2b 8d 00 10 lw r13,(sp+16)
8006bb8: 2b 8e 00 0c lw r14,(sp+12)
8006bbc: 2b 8f 00 08 lw r15,(sp+8)
8006bc0: 37 9c 00 24 addi sp,sp,36
8006bc4: c3 a0 00 00 ret
08003e64 <pthread_testcancel>:
/*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
void pthread_testcancel( void )
{
8003e64: 37 9c ff f8 addi sp,sp,-8
8003e68: 5b 8b 00 08 sw (sp+8),r11
8003e6c: 5b 9d 00 04 sw (sp+4),ra
* Don't even think about deleting a resource from an ISR.
* Besides this request is supposed to be for _Thread_Executing
* and the ISR context is not a thread.
*/
if ( _ISR_Is_in_progress() )
8003e70: 78 01 08 01 mvhi r1,0x801
8003e74: 38 21 6d 80 ori r1,r1,0x6d80
8003e78: 28 22 00 08 lw r2,(r1+8)
8003e7c: 5c 40 00 14 bne r2,r0,8003ecc <pthread_testcancel+0x68> <== NEVER TAKEN
return;
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
8003e80: 28 21 00 10 lw r1,(r1+16)
8003e84: 28 22 01 1c lw r2,(r1+284)
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8003e88: 78 01 08 01 mvhi r1,0x801
8003e8c: 38 21 68 e0 ori r1,r1,0x68e0
8003e90: 28 23 00 00 lw r3,(r1+0)
++level;
8003e94: 34 63 00 01 addi r3,r3,1
_Thread_Dispatch_disable_level = level;
8003e98: 58 23 00 00 sw (r1+0),r3
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
8003e9c: 28 41 00 d8 lw r1,(r2+216)
*/
void pthread_testcancel( void )
{
POSIX_API_Control *thread_support;
bool cancel = false;
8003ea0: 34 0b 00 00 mvi r11,0
return;
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
8003ea4: 5c 2b 00 03 bne r1,r11,8003eb0 <pthread_testcancel+0x4c> <== NEVER TAKEN
/* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */
int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate));
int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype));
void _EXFUN(pthread_testcancel, (void));
8003ea8: 28 4b 00 e0 lw r11,(r2+224)
8003eac: 7d 6b 00 00 cmpnei r11,r11,0
thread_support->cancelation_requested )
cancel = true;
_Thread_Enable_dispatch();
8003eb0: f8 00 0a f3 calli 8006a7c <_Thread_Enable_dispatch>
if ( cancel )
8003eb4: 45 60 00 06 be r11,r0,8003ecc <pthread_testcancel+0x68>
_POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED );
8003eb8: 78 01 08 01 mvhi r1,0x801
8003ebc: 38 21 6d 80 ori r1,r1,0x6d80
8003ec0: 28 21 00 10 lw r1,(r1+16)
8003ec4: 34 02 ff ff mvi r2,-1
8003ec8: f8 00 18 36 calli 8009fa0 <_POSIX_Thread_Exit>
}
8003ecc: 2b 9d 00 04 lw ra,(sp+4)
8003ed0: 2b 8b 00 08 lw r11,(sp+8)
8003ed4: 37 9c 00 08 addi sp,sp,8
8003ed8: c3 a0 00 00 ret
080042c4 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
80042c4: 37 9c ff bc addi sp,sp,-68
80042c8: 5b 8b 00 20 sw (sp+32),r11
80042cc: 5b 8c 00 1c sw (sp+28),r12
80042d0: 5b 8d 00 18 sw (sp+24),r13
80042d4: 5b 8e 00 14 sw (sp+20),r14
80042d8: 5b 8f 00 10 sw (sp+16),r15
80042dc: 5b 90 00 0c sw (sp+12),r16
80042e0: 5b 91 00 08 sw (sp+8),r17
80042e4: 5b 9d 00 04 sw (sp+4),ra
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
80042e8: 78 0c 08 01 mvhi r12,0x801
80042ec: 39 8c 78 40 ori r12,r12,0x7840
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
80042f0: b8 20 58 00 mv r11,r1
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
80042f4: b9 80 08 00 mv r1,r12
80042f8: f8 00 02 cd calli 8004e2c <pthread_mutex_lock>
80042fc: b8 20 70 00 mv r14,r1
if (result != 0) {
8004300: 44 20 00 04 be r1,r0,8004310 <rtems_aio_enqueue+0x4c> <== ALWAYS TAKEN
free (req);
8004304: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8004308: fb ff f5 75 calli 80018dc <free> <== NOT EXECUTED
return result;
800430c: e0 00 00 79 bi 80044f0 <rtems_aio_enqueue+0x22c> <== NOT EXECUTED
}
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
8004310: f8 00 05 71 calli 80058d4 <pthread_self>
8004314: 37 82 00 40 addi r2,sp,64
8004318: 37 83 00 24 addi r3,sp,36
800431c: f8 00 04 34 calli 80053ec <pthread_getschedparam>
req->caller_thread = pthread_self ();
8004320: f8 00 05 6d calli 80058d4 <pthread_self>
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
8004324: 29 62 00 14 lw r2,(r11+20)
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
8004328: 59 61 00 10 sw (r11+16),r1
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
800432c: 2b 83 00 24 lw r3,(sp+36)
8004330: 28 41 00 10 lw r1,(r2+16)
8004334: c8 61 08 00 sub r1,r3,r1
8004338: 59 61 00 0c sw (r11+12),r1
req->policy = policy;
800433c: 2b 81 00 40 lw r1,(sp+64)
8004340: 59 61 00 08 sw (r11+8),r1
req->aiocbp->error_code = EINPROGRESS;
8004344: 34 01 00 77 mvi r1,119
8004348: 58 41 00 2c sw (r2+44),r1
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
800434c: 29 81 00 68 lw r1,(r12+104)
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
req->aiocbp->return_value = 0;
8004350: 58 40 00 30 sw (r2+48),r0
if ((aio_request_queue.idle_threads == 0) &&
8004354: 5c 2e 00 34 bne r1,r14,8004424 <rtems_aio_enqueue+0x160> <== NEVER TAKEN
8004358: 29 83 00 64 lw r3,(r12+100)
800435c: 34 01 00 04 mvi r1,4
8004360: 48 61 00 31 bg r3,r1,8004424 <rtems_aio_enqueue+0x160>
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
8004364: 28 42 00 00 lw r2,(r2+0)
8004368: 78 01 08 01 mvhi r1,0x801
800436c: 38 21 78 88 ori r1,r1,0x7888
8004370: 34 03 00 01 mvi r3,1
8004374: fb ff ff 67 calli 8004110 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
8004378: 28 22 00 18 lw r2,(r1+24)
if ((aio_request_queue.idle_threads == 0) &&
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
800437c: b8 20 68 00 mv r13,r1
8004380: 34 31 00 08 addi r17,r1,8
8004384: 34 2f 00 1c addi r15,r1,28
8004388: 34 30 00 20 addi r16,r1,32
if (r_chain->new_fd == 1) {
800438c: 34 01 00 01 mvi r1,1
8004390: 5c 41 00 1c bne r2,r1,8004400 <rtems_aio_enqueue+0x13c>
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
8004394: b9 60 10 00 mv r2,r11
8004398: ba 20 08 00 mv r1,r17
800439c: f8 00 08 87 calli 80065b8 <_Chain_Insert>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
80043a0: 34 02 00 00 mvi r2,0
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
if (r_chain->new_fd == 1) {
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
80043a4: 59 a0 00 18 sw (r13+24),r0
pthread_mutex_init (&r_chain->mutex, NULL);
80043a8: b9 e0 08 00 mv r1,r15
80043ac: f8 00 02 43 calli 8004cb8 <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
80043b0: 34 02 00 00 mvi r2,0
80043b4: ba 00 08 00 mv r1,r16
80043b8: f8 00 01 1e calli 8004830 <pthread_cond_init>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
80043bc: 78 02 08 01 mvhi r2,0x801
80043c0: 78 03 08 00 mvhi r3,0x800
80043c4: 37 81 00 44 addi r1,sp,68
80043c8: 38 42 78 48 ori r2,r2,0x7848
80043cc: 38 63 3d 5c ori r3,r3,0x3d5c
80043d0: b9 a0 20 00 mv r4,r13
80043d4: f8 00 03 41 calli 80050d8 <pthread_create>
80043d8: b8 20 58 00 mv r11,r1
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
80043dc: 44 20 00 05 be r1,r0,80043f0 <rtems_aio_enqueue+0x12c> <== ALWAYS TAKEN
pthread_mutex_unlock (&aio_request_queue.mutex);
80043e0: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80043e4: f8 00 02 c5 calli 8004ef8 <pthread_mutex_unlock> <== NOT EXECUTED
return result;
80043e8: b9 60 70 00 mv r14,r11 <== NOT EXECUTED
80043ec: e0 00 00 41 bi 80044f0 <rtems_aio_enqueue+0x22c> <== NOT EXECUTED
}
++aio_request_queue.active_threads;
80043f0: 29 81 00 64 lw r1,(r12+100)
80043f4: 34 21 00 01 addi r1,r1,1
80043f8: 59 81 00 64 sw (r12+100),r1
80043fc: e0 00 00 3a bi 80044e4 <rtems_aio_enqueue+0x220>
}
else {
/* put request in the fd chain it belongs to */
pthread_mutex_lock (&r_chain->mutex);
8004400: b9 e0 08 00 mv r1,r15
8004404: f8 00 02 8a calli 8004e2c <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
8004408: ba 20 08 00 mv r1,r17
800440c: b9 60 10 00 mv r2,r11
8004410: fb ff fe 3d calli 8003d04 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
8004414: ba 00 08 00 mv r1,r16
8004418: f8 00 01 41 calli 800491c <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
800441c: b9 e0 08 00 mv r1,r15
8004420: e0 00 00 11 bi 8004464 <rtems_aio_enqueue+0x1a0>
else
{
/* the maximum number of threads has been already created
even though some of them might be idle.
The request belongs to one of the active fd chain */
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
8004424: 28 42 00 00 lw r2,(r2+0)
8004428: 78 01 08 01 mvhi r1,0x801
800442c: 38 21 78 88 ori r1,r1,0x7888
8004430: 34 03 00 00 mvi r3,0
8004434: fb ff ff 37 calli 8004110 <rtems_aio_search_fd>
8004438: b8 20 60 00 mv r12,r1
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
800443c: 44 20 00 0c be r1,r0,800446c <rtems_aio_enqueue+0x1a8>
{
pthread_mutex_lock (&r_chain->mutex);
8004440: 34 2d 00 1c addi r13,r1,28
8004444: b9 a0 08 00 mv r1,r13
8004448: f8 00 02 79 calli 8004e2c <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
800444c: 35 81 00 08 addi r1,r12,8
8004450: b9 60 10 00 mv r2,r11
8004454: fb ff fe 2c calli 8003d04 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
8004458: 35 81 00 20 addi r1,r12,32
800445c: f8 00 01 30 calli 800491c <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
8004460: b9 a0 08 00 mv r1,r13
8004464: f8 00 02 a5 calli 8004ef8 <pthread_mutex_unlock>
8004468: e0 00 00 1f bi 80044e4 <rtems_aio_enqueue+0x220>
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
800446c: 29 62 00 14 lw r2,(r11+20)
8004470: 78 01 08 01 mvhi r1,0x801
8004474: 34 03 00 01 mvi r3,1
8004478: 28 42 00 00 lw r2,(r2+0)
800447c: 38 21 78 94 ori r1,r1,0x7894
8004480: fb ff ff 24 calli 8004110 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
8004484: 28 23 00 18 lw r3,(r1+24)
8004488: 34 02 00 01 mvi r2,1
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
800448c: b8 20 60 00 mv r12,r1
8004490: 34 21 00 08 addi r1,r1,8
if (r_chain->new_fd == 1) {
8004494: 5c 62 00 0b bne r3,r2,80044c0 <rtems_aio_enqueue+0x1fc>
8004498: b9 60 10 00 mv r2,r11
800449c: f8 00 08 47 calli 80065b8 <_Chain_Insert>
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
80044a0: 35 81 00 1c addi r1,r12,28
if (r_chain->new_fd == 1) {
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
80044a4: 59 80 00 18 sw (r12+24),r0
pthread_mutex_init (&r_chain->mutex, NULL);
80044a8: 34 02 00 00 mvi r2,0
80044ac: f8 00 02 03 calli 8004cb8 <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
80044b0: 35 81 00 20 addi r1,r12,32
80044b4: 34 02 00 00 mvi r2,0
80044b8: f8 00 00 de calli 8004830 <pthread_cond_init>
80044bc: e0 00 00 03 bi 80044c8 <rtems_aio_enqueue+0x204>
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
80044c0: b9 60 10 00 mv r2,r11
80044c4: fb ff fe 10 calli 8003d04 <rtems_aio_insert_prio>
if (aio_request_queue.idle_threads > 0)
80044c8: 78 01 08 01 mvhi r1,0x801
80044cc: 38 21 78 40 ori r1,r1,0x7840
80044d0: 28 21 00 68 lw r1,(r1+104)
80044d4: 4c 01 00 04 bge r0,r1,80044e4 <rtems_aio_enqueue+0x220> <== ALWAYS TAKEN
pthread_cond_signal (&aio_request_queue.new_req);
80044d8: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
80044dc: 38 21 78 44 ori r1,r1,0x7844 <== NOT EXECUTED
80044e0: f8 00 01 0f calli 800491c <pthread_cond_signal> <== NOT EXECUTED
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
80044e4: 78 01 08 01 mvhi r1,0x801
80044e8: 38 21 78 40 ori r1,r1,0x7840
80044ec: f8 00 02 83 calli 8004ef8 <pthread_mutex_unlock>
return 0;
}
80044f0: b9 c0 08 00 mv r1,r14
80044f4: 2b 9d 00 04 lw ra,(sp+4)
80044f8: 2b 8b 00 20 lw r11,(sp+32)
80044fc: 2b 8c 00 1c lw r12,(sp+28)
8004500: 2b 8d 00 18 lw r13,(sp+24)
8004504: 2b 8e 00 14 lw r14,(sp+20)
8004508: 2b 8f 00 10 lw r15,(sp+16)
800450c: 2b 90 00 0c lw r16,(sp+12)
8004510: 2b 91 00 08 lw r17,(sp+8)
8004514: 37 9c 00 44 addi sp,sp,68
8004518: c3 a0 00 00 ret
08003d5c <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
8003d5c: 37 9c ff a0 addi sp,sp,-96
8003d60: 5b 8b 00 38 sw (sp+56),r11
8003d64: 5b 8c 00 34 sw (sp+52),r12
8003d68: 5b 8d 00 30 sw (sp+48),r13
8003d6c: 5b 8e 00 2c sw (sp+44),r14
8003d70: 5b 8f 00 28 sw (sp+40),r15
8003d74: 5b 90 00 24 sw (sp+36),r16
8003d78: 5b 91 00 20 sw (sp+32),r17
8003d7c: 5b 92 00 1c sw (sp+28),r18
8003d80: 5b 93 00 18 sw (sp+24),r19
8003d84: 5b 94 00 14 sw (sp+20),r20
8003d88: 5b 95 00 10 sw (sp+16),r21
8003d8c: 5b 96 00 0c sw (sp+12),r22
8003d90: 5b 97 00 08 sw (sp+8),r23
8003d94: 5b 9d 00 04 sw (sp+4),ra
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
8003d98: 78 0b 08 01 mvhi r11,0x801
pthread_cond_destroy (&r_chain->cond);
free (r_chain);
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003d9c: 78 12 08 01 mvhi r18,0x801
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
8003da0: 78 11 08 01 mvhi r17,0x801
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003da4: 78 10 08 01 mvhi r16,0x801
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
8003da8: b8 20 60 00 mv r12,r1
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
8003dac: 39 6b 78 40 ori r11,r11,0x7840
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
8003db0: 37 8e 00 58 addi r14,sp,88
&aio_request_queue.mutex,
&timeout);
/* If no requests were added to the chain we delete the fd chain from
the queue and start working with idle fd chains */
if (result == ETIMEDOUT) {
8003db4: 34 15 00 74 mvi r21,116
pthread_cond_destroy (&r_chain->cond);
free (r_chain);
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003db8: 3a 52 78 98 ori r18,r18,0x7898
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
8003dbc: 3a 31 78 8c ori r17,r17,0x788c
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003dc0: 3a 10 78 44 ori r16,r16,0x7844
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
8003dc4: 37 94 00 3c addi r20,sp,60
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
switch (req->aiocbp->aio_lio_opcode) {
8003dc8: 34 17 00 02 mvi r23,2
default:
result = -1;
}
if (result == -1) {
req->aiocbp->return_value = -1;
8003dcc: 34 13 ff ff mvi r19,-1
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
switch (req->aiocbp->aio_lio_opcode) {
8003dd0: 34 16 00 03 mvi r22,3
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
8003dd4: 35 8f 00 1c addi r15,r12,28
8003dd8: b9 e0 08 00 mv r1,r15
8003ddc: f8 00 04 14 calli 8004e2c <pthread_mutex_lock>
if (result != 0)
8003de0: 5c 20 00 7d bne r1,r0,8003fd4 <rtems_aio_handle+0x278> <== NEVER TAKEN
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003de4: 29 8d 00 08 lw r13,(r12+8)
8003de8: 35 81 00 0c addi r1,r12,12
/* If the locked chain is not empty, take the first
request extract it, unlock the chain and process
the request, in this way the user can supply more
requests to this fd chain */
if (!rtems_chain_is_empty (chain)) {
8003dec: 45 a1 00 2e be r13,r1,8003ea4 <rtems_aio_handle+0x148>
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
8003df0: f8 00 06 b9 calli 80058d4 <pthread_self>
8003df4: 37 82 00 60 addi r2,sp,96
8003df8: ba 80 18 00 mv r3,r20
8003dfc: f8 00 05 7c calli 80053ec <pthread_getschedparam>
param.sched_priority = req->priority;
8003e00: 29 a1 00 0c lw r1,(r13+12)
8003e04: 5b 81 00 3c sw (sp+60),r1
pthread_setschedparam (pthread_self(), req->policy, ¶m);
8003e08: f8 00 06 b3 calli 80058d4 <pthread_self>
8003e0c: 29 a2 00 08 lw r2,(r13+8)
8003e10: ba 80 18 00 mv r3,r20
8003e14: f8 00 06 b5 calli 80058e8 <pthread_setschedparam>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
8003e18: b9 a0 08 00 mv r1,r13
8003e1c: f8 00 09 ce calli 8006554 <_Chain_Extract>
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
8003e20: b9 e0 08 00 mv r1,r15
8003e24: f8 00 04 35 calli 8004ef8 <pthread_mutex_unlock>
switch (req->aiocbp->aio_lio_opcode) {
8003e28: 29 a4 00 14 lw r4,(r13+20)
8003e2c: 28 81 00 28 lw r1,(r4+40)
8003e30: 44 37 00 0a be r1,r23,8003e58 <rtems_aio_handle+0xfc>
8003e34: 44 36 00 0f be r1,r22,8003e70 <rtems_aio_handle+0x114> <== NEVER TAKEN
8003e38: 34 02 00 01 mvi r2,1
8003e3c: 5c 22 00 10 bne r1,r2,8003e7c <rtems_aio_handle+0x120> <== NEVER TAKEN
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
8003e40: 28 82 00 08 lw r2,(r4+8)
8003e44: 28 83 00 0c lw r3,(r4+12)
8003e48: 28 81 00 00 lw r1,(r4+0)
8003e4c: 28 84 00 04 lw r4,(r4+4)
8003e50: f8 00 2f 69 calli 800fbf4 <pread>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
8003e54: e0 00 00 09 bi 8003e78 <rtems_aio_handle+0x11c>
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
8003e58: 28 82 00 08 lw r2,(r4+8)
8003e5c: 28 83 00 0c lw r3,(r4+12)
8003e60: 28 81 00 00 lw r1,(r4+0)
8003e64: 28 84 00 04 lw r4,(r4+4)
8003e68: f8 00 2f a7 calli 800fd04 <pwrite>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
8003e6c: e0 00 00 03 bi 8003e78 <rtems_aio_handle+0x11c>
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
8003e70: 28 81 00 00 lw r1,(r4+0) <== NOT EXECUTED
8003e74: f8 00 1c 18 calli 800aed4 <fsync> <== NOT EXECUTED
break;
default:
result = -1;
}
if (result == -1) {
8003e78: 5c 33 00 07 bne r1,r19,8003e94 <rtems_aio_handle+0x138> <== ALWAYS TAKEN
req->aiocbp->return_value = -1;
8003e7c: 29 ad 00 14 lw r13,(r13+20) <== NOT EXECUTED
8003e80: 59 b3 00 30 sw (r13+48),r19 <== NOT EXECUTED
req->aiocbp->error_code = errno;
8003e84: f8 00 2b ac calli 800ed34 <__errno> <== NOT EXECUTED
8003e88: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
8003e8c: 59 a1 00 2c sw (r13+44),r1 <== NOT EXECUTED
8003e90: e3 ff ff d1 bi 8003dd4 <rtems_aio_handle+0x78> <== NOT EXECUTED
} else {
req->aiocbp->return_value = result;
8003e94: 29 a2 00 14 lw r2,(r13+20)
8003e98: 58 41 00 30 sw (r2+48),r1
req->aiocbp->error_code = 0;
8003e9c: 58 40 00 2c sw (r2+44),r0
8003ea0: e3 ff ff cd bi 8003dd4 <rtems_aio_handle+0x78>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
8003ea4: b9 e0 08 00 mv r1,r15
8003ea8: f8 00 04 14 calli 8004ef8 <pthread_mutex_unlock>
pthread_mutex_lock (&aio_request_queue.mutex);
8003eac: b9 60 08 00 mv r1,r11
8003eb0: f8 00 03 df calli 8004e2c <pthread_mutex_lock>
if (rtems_chain_is_empty (chain))
8003eb4: 29 81 00 08 lw r1,(r12+8)
8003eb8: 5c 2d 00 44 bne r1,r13,8003fc8 <rtems_aio_handle+0x26c> <== NEVER TAKEN
{
clock_gettime (CLOCK_REALTIME, &timeout);
8003ebc: b9 c0 10 00 mv r2,r14
8003ec0: 34 01 00 01 mvi r1,1
8003ec4: f8 00 01 e9 calli 8004668 <clock_gettime>
timeout.tv_sec += 3;
8003ec8: 2b 81 00 58 lw r1,(sp+88)
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
8003ecc: 35 8d 00 20 addi r13,r12,32
8003ed0: b9 60 10 00 mv r2,r11
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
8003ed4: 34 21 00 03 addi r1,r1,3
8003ed8: 5b 81 00 58 sw (sp+88),r1
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
8003edc: b9 c0 18 00 mv r3,r14
8003ee0: b9 a0 08 00 mv r1,r13
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
8003ee4: 5b 80 00 5c sw (sp+92),r0
result = pthread_cond_timedwait (&r_chain->cond,
8003ee8: f8 00 02 b1 calli 80049ac <pthread_cond_timedwait>
&aio_request_queue.mutex,
&timeout);
/* If no requests were added to the chain we delete the fd chain from
the queue and start working with idle fd chains */
if (result == ETIMEDOUT) {
8003eec: 5c 35 00 37 bne r1,r21,8003fc8 <rtems_aio_handle+0x26c> <== NEVER TAKEN
8003ef0: b9 80 08 00 mv r1,r12
8003ef4: f8 00 09 98 calli 8006554 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
8003ef8: b9 e0 08 00 mv r1,r15
8003efc: f8 00 03 12 calli 8004b44 <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->cond);
8003f00: b9 a0 08 00 mv r1,r13
8003f04: f8 00 02 11 calli 8004748 <pthread_cond_destroy>
free (r_chain);
8003f08: b9 80 08 00 mv r1,r12
8003f0c: fb ff f6 74 calli 80018dc <free>
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003f10: 29 61 00 54 lw r1,(r11+84)
8003f14: 5c 32 00 19 bne r1,r18,8003f78 <rtems_aio_handle+0x21c>
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
8003f18: 29 61 00 68 lw r1,(r11+104)
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
8003f1c: b9 c0 10 00 mv r2,r14
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
8003f20: 34 21 00 01 addi r1,r1,1
8003f24: 59 61 00 68 sw (r11+104),r1
--aio_request_queue.active_threads;
8003f28: 29 61 00 64 lw r1,(r11+100)
8003f2c: 34 21 ff ff addi r1,r1,-1
8003f30: 59 61 00 64 sw (r11+100),r1
clock_gettime (CLOCK_REALTIME, &timeout);
8003f34: 34 01 00 01 mvi r1,1
8003f38: f8 00 01 cc calli 8004668 <clock_gettime>
timeout.tv_sec += 3;
8003f3c: 2b 81 00 58 lw r1,(sp+88)
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003f40: b9 60 10 00 mv r2,r11
8003f44: b9 c0 18 00 mv r3,r14
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
8003f48: 34 21 00 03 addi r1,r1,3
8003f4c: 5b 81 00 58 sw (sp+88),r1
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003f50: ba 00 08 00 mv r1,r16
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
8003f54: 5b 80 00 5c sw (sp+92),r0
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003f58: f8 00 02 95 calli 80049ac <pthread_cond_timedwait>
&aio_request_queue.mutex,
&timeout);
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
8003f5c: 5c 35 00 07 bne r1,r21,8003f78 <rtems_aio_handle+0x21c> <== NEVER TAKEN
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
8003f60: 29 61 00 68 lw r1,(r11+104)
8003f64: 34 21 ff ff addi r1,r1,-1
8003f68: 59 61 00 68 sw (r11+104),r1
pthread_mutex_unlock (&aio_request_queue.mutex);
8003f6c: b9 60 08 00 mv r1,r11
8003f70: f8 00 03 e2 calli 8004ef8 <pthread_mutex_unlock>
return NULL;
8003f74: e0 00 00 18 bi 8003fd4 <rtems_aio_handle+0x278>
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
8003f78: 29 61 00 68 lw r1,(r11+104)
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003f7c: 29 6d 00 54 lw r13,(r11+84)
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
8003f80: 34 21 ff ff addi r1,r1,-1
8003f84: 59 61 00 68 sw (r11+104),r1
++aio_request_queue.active_threads;
8003f88: 29 61 00 64 lw r1,(r11+100)
node = rtems_chain_first (&aio_request_queue.idle_req);
rtems_chain_extract (node);
r_chain = (rtems_aio_request_chain *) node;
8003f8c: b9 a0 60 00 mv r12,r13
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
++aio_request_queue.active_threads;
8003f90: 34 21 00 01 addi r1,r1,1
8003f94: 59 61 00 64 sw (r11+100),r1
8003f98: b9 a0 08 00 mv r1,r13
8003f9c: f8 00 09 6e calli 8006554 <_Chain_Extract>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003fa0: 29 64 00 48 lw r4,(r11+72)
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
8003fa4: 29 a1 00 14 lw r1,(r13+20)
8003fa8: e0 00 00 02 bi 8003fb0 <rtems_aio_handle+0x254>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003fac: 28 84 00 00 lw r4,(r4+0)
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
8003fb0: 28 82 00 14 lw r2,(r4+20)
8003fb4: 4c 41 00 02 bge r2,r1,8003fbc <rtems_aio_handle+0x260>
8003fb8: 5c 91 ff fd bne r4,r17,8003fac <rtems_aio_handle+0x250> <== ALWAYS TAKEN
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
8003fbc: 28 81 00 04 lw r1,(r4+4)
8003fc0: b9 a0 10 00 mv r2,r13
8003fc4: f8 00 09 7d calli 80065b8 <_Chain_Insert>
}
}
/* If there was a request added in the initial fd chain then release
the mutex and process it */
pthread_mutex_unlock (&aio_request_queue.mutex);
8003fc8: b9 60 08 00 mv r1,r11
8003fcc: f8 00 03 cb calli 8004ef8 <pthread_mutex_unlock>
8003fd0: e3 ff ff 81 bi 8003dd4 <rtems_aio_handle+0x78>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003fd4: 34 01 00 00 mvi r1,0
8003fd8: 2b 9d 00 04 lw ra,(sp+4)
8003fdc: 2b 8b 00 38 lw r11,(sp+56)
8003fe0: 2b 8c 00 34 lw r12,(sp+52)
8003fe4: 2b 8d 00 30 lw r13,(sp+48)
8003fe8: 2b 8e 00 2c lw r14,(sp+44)
8003fec: 2b 8f 00 28 lw r15,(sp+40)
8003ff0: 2b 90 00 24 lw r16,(sp+36)
8003ff4: 2b 91 00 20 lw r17,(sp+32)
8003ff8: 2b 92 00 1c lw r18,(sp+28)
8003ffc: 2b 93 00 18 lw r19,(sp+24)
8004000: 2b 94 00 14 lw r20,(sp+20)
8004004: 2b 95 00 10 lw r21,(sp+16)
8004008: 2b 96 00 0c lw r22,(sp+12)
800400c: 2b 97 00 08 lw r23,(sp+8)
8004010: 37 9c 00 60 addi sp,sp,96
8004014: c3 a0 00 00 ret
08004018 <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
8004018: 37 9c ff f4 addi sp,sp,-12
800401c: 5b 8b 00 0c sw (sp+12),r11
8004020: 5b 8c 00 08 sw (sp+8),r12
8004024: 5b 9d 00 04 sw (sp+4),ra
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
8004028: 78 0c 08 01 mvhi r12,0x801
800402c: 39 8c 78 48 ori r12,r12,0x7848
8004030: b9 80 08 00 mv r1,r12
8004034: f8 00 04 12 calli 800507c <pthread_attr_init>
8004038: b8 20 58 00 mv r11,r1
if (result != 0)
800403c: 5c 20 00 2f bne r1,r0,80040f8 <rtems_aio_init+0xe0> <== NEVER TAKEN
return result;
result =
8004040: b9 80 08 00 mv r1,r12
8004044: 34 02 00 00 mvi r2,0
8004048: f8 00 04 1a calli 80050b0 <pthread_attr_setdetachstate>
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
800404c: 44 2b 00 03 be r1,r11,8004058 <rtems_aio_init+0x40> <== ALWAYS TAKEN
pthread_attr_destroy (&aio_request_queue.attr);
8004050: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8004054: f8 00 04 02 calli 800505c <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
8004058: 78 01 08 01 mvhi r1,0x801
800405c: 38 21 78 40 ori r1,r1,0x7840
8004060: 34 02 00 00 mvi r2,0
8004064: f8 00 03 15 calli 8004cb8 <pthread_mutex_init>
if (result != 0)
8004068: 44 20 00 04 be r1,r0,8004078 <rtems_aio_init+0x60> <== ALWAYS TAKEN
pthread_attr_destroy (&aio_request_queue.attr);
800406c: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
8004070: 38 21 78 48 ori r1,r1,0x7848 <== NOT EXECUTED
8004074: f8 00 03 fa calli 800505c <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
8004078: 78 01 08 01 mvhi r1,0x801
800407c: 38 21 78 44 ori r1,r1,0x7844
8004080: 34 02 00 00 mvi r2,0
8004084: f8 00 01 eb calli 8004830 <pthread_cond_init>
8004088: b8 20 58 00 mv r11,r1
if (result != 0) {
800408c: 44 20 00 07 be r1,r0,80040a8 <rtems_aio_init+0x90> <== ALWAYS TAKEN
pthread_mutex_destroy (&aio_request_queue.mutex);
8004090: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
8004094: 38 21 78 40 ori r1,r1,0x7840 <== NOT EXECUTED
8004098: f8 00 02 ab calli 8004b44 <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
800409c: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
80040a0: 38 21 78 48 ori r1,r1,0x7848 <== NOT EXECUTED
80040a4: f8 00 03 ee calli 800505c <pthread_attr_destroy> <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80040a8: 78 02 08 01 mvhi r2,0x801
80040ac: 78 01 08 01 mvhi r1,0x801
80040b0: 38 42 78 40 ori r2,r2,0x7840
80040b4: 38 21 78 8c ori r1,r1,0x788c
80040b8: 58 41 00 48 sw (r2+72),r1
head->previous = NULL;
tail->previous = head;
80040bc: 78 01 08 01 mvhi r1,0x801
80040c0: 38 21 78 88 ori r1,r1,0x7888
80040c4: 58 41 00 50 sw (r2+80),r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80040c8: 78 01 08 01 mvhi r1,0x801
80040cc: 38 21 78 98 ori r1,r1,0x7898
80040d0: 58 41 00 54 sw (r2+84),r1
head->previous = NULL;
tail->previous = head;
80040d4: 78 01 08 01 mvhi r1,0x801
80040d8: 38 21 78 94 ori r1,r1,0x7894
80040dc: 58 41 00 5c sw (r2+92),r1
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
aio_request_queue.idle_threads = 0;
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
80040e0: 38 01 b0 0b mvu r1,0xb00b
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
80040e4: 58 40 00 4c sw (r2+76),r0
80040e8: 58 40 00 58 sw (r2+88),r0
}
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
80040ec: 58 40 00 64 sw (r2+100),r0
aio_request_queue.idle_threads = 0;
80040f0: 58 40 00 68 sw (r2+104),r0
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
80040f4: 58 41 00 60 sw (r2+96),r1
return result;
}
80040f8: b9 60 08 00 mv r1,r11
80040fc: 2b 9d 00 04 lw ra,(sp+4)
8004100: 2b 8b 00 0c lw r11,(sp+12)
8004104: 2b 8c 00 08 lw r12,(sp+8)
8004108: 37 9c 00 0c addi sp,sp,12
800410c: c3 a0 00 00 ret
08003d04 <rtems_aio_insert_prio>:
* NONE
*/
static void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
8003d04: 37 9c ff fc addi sp,sp,-4
8003d08: 5b 9d 00 04 sw (sp+4),ra
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003d0c: 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 );
8003d10: 34 25 00 04 addi r5,r1,4
* NONE
*/
static void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
8003d14: b8 40 20 00 mv r4,r2
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
8003d18: 44 65 00 0d be r3,r5,8003d4c <rtems_aio_insert_prio+0x48> <== NEVER TAKEN
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
8003d1c: 28 61 00 14 lw r1,(r3+20)
while (req->aiocbp->aio_reqprio > prio &&
8003d20: 28 42 00 14 lw r2,(r2+20)
if (rtems_chain_is_empty (chain)) {
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
8003d24: 28 21 00 10 lw r1,(r1+16)
while (req->aiocbp->aio_reqprio > prio &&
8003d28: 28 42 00 10 lw r2,(r2+16)
8003d2c: e0 00 00 04 bi 8003d3c <rtems_aio_insert_prio+0x38>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003d30: 28 63 00 00 lw r3,(r3+0) <== NOT EXECUTED
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
!rtems_chain_is_tail (chain, node)) {
node = rtems_chain_next (node);
prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
8003d34: 28 61 00 14 lw r1,(r3+20) <== NOT EXECUTED
8003d38: 28 21 00 10 lw r1,(r1+16) <== NOT EXECUTED
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
8003d3c: 4c 22 00 02 bge r1,r2,8003d44 <rtems_aio_insert_prio+0x40> <== ALWAYS TAKEN
8003d40: 5c 65 ff fc bne r3,r5,8003d30 <rtems_aio_insert_prio+0x2c> <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
8003d44: 28 61 00 04 lw r1,(r3+4)
8003d48: b8 80 10 00 mv r2,r4
8003d4c: f8 00 0a 1b calli 80065b8 <_Chain_Insert>
}
rtems_chain_insert (node->previous, &req->next_prio);
}
}
8003d50: 2b 9d 00 04 lw ra,(sp+4)
8003d54: 37 9c 00 04 addi sp,sp,4
8003d58: c3 a0 00 00 ret
08004254 <rtems_aio_remove_req>:
* AIO_NOTCANCELED - if request was not canceled
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
8004254: 37 9c ff f8 addi sp,sp,-8
8004258: 5b 8b 00 08 sw (sp+8),r11
800425c: 5b 9d 00 04 sw (sp+4),ra
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8004260: 28 2b 00 00 lw r11,(r1+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8004264: 34 23 00 04 addi r3,r1,4
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
return AIO_ALLDONE;
8004268: 34 01 00 02 mvi r1,2
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
800426c: 5d 63 00 04 bne r11,r3,800427c <rtems_aio_remove_req+0x28>
8004270: e0 00 00 11 bi 80042b4 <rtems_aio_remove_req+0x60>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8004274: 29 6b 00 00 lw r11,(r11+0) <== NOT EXECUTED
rtems_chain_node *node = rtems_chain_first (chain);
rtems_aio_request *current;
current = (rtems_aio_request *) node;
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
8004278: 45 63 00 0e be r11,r3,80042b0 <rtems_aio_remove_req+0x5c> <== NOT EXECUTED
800427c: 29 61 00 14 lw r1,(r11+20)
8004280: 5c 22 ff fd bne r1,r2,8004274 <rtems_aio_remove_req+0x20> <== NEVER TAKEN
8004284: b9 60 08 00 mv r1,r11
8004288: f8 00 08 b3 calli 8006554 <_Chain_Extract>
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
800428c: 29 61 00 14 lw r1,(r11+20)
8004290: 34 02 00 8c mvi r2,140
8004294: 58 22 00 2c sw (r1+44),r2
current->aiocbp->return_value = -1;
8004298: 34 02 ff ff mvi r2,-1
800429c: 58 22 00 30 sw (r1+48),r2
free (current);
80042a0: b9 60 08 00 mv r1,r11
80042a4: fb ff f5 8e calli 80018dc <free>
}
return AIO_CANCELED;
80042a8: 34 01 00 00 mvi r1,0
80042ac: e0 00 00 02 bi 80042b4 <rtems_aio_remove_req+0x60>
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
80042b0: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
80042b4: 2b 9d 00 04 lw ra,(sp+4)
80042b8: 2b 8b 00 08 lw r11,(sp+8)
80042bc: 37 9c 00 08 addi sp,sp,8
80042c0: c3 a0 00 00 ret
0800419c <rtems_chain_get_with_wait>:
rtems_chain_control *chain,
rtems_event_set events,
rtems_interval timeout,
rtems_chain_node **node_ptr
)
{
800419c: 37 9c ff e4 addi sp,sp,-28
80041a0: 5b 8b 00 18 sw (sp+24),r11
80041a4: 5b 8c 00 14 sw (sp+20),r12
80041a8: 5b 8d 00 10 sw (sp+16),r13
80041ac: 5b 8e 00 0c sw (sp+12),r14
80041b0: 5b 8f 00 08 sw (sp+8),r15
80041b4: 5b 9d 00 04 sw (sp+4),ra
80041b8: b8 20 78 00 mv r15,r1
80041bc: b8 40 70 00 mv r14,r2
80041c0: b8 60 68 00 mv r13,r3
80041c4: b8 80 60 00 mv r12,r4
80041c8: e0 00 00 08 bi 80041e8 <rtems_chain_get_with_wait+0x4c>
while (
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
) {
rtems_event_set out;
sc = rtems_event_receive(
80041cc: b9 c0 08 00 mv r1,r14
80041d0: 34 02 00 00 mvi r2,0
80041d4: b9 a0 18 00 mv r3,r13
80041d8: 37 84 00 1c addi r4,sp,28
80041dc: fb ff fd b8 calli 80038bc <rtems_event_receive>
80041e0: b8 20 28 00 mv r5,r1
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
80041e4: 5c 2b 00 06 bne r1,r11,80041fc <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 );
80041e8: b9 e0 08 00 mv r1,r15
80041ec: f8 00 01 9b calli 8004858 <_Chain_Get>
80041f0: b8 20 58 00 mv r11,r1
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
80041f4: 44 20 ff f6 be r1,r0,80041cc <rtems_chain_get_with_wait+0x30>
80041f8: 34 05 00 00 mvi r5,0
}
*node_ptr = node;
return sc;
}
80041fc: b8 a0 08 00 mv r1,r5
timeout,
&out
);
}
*node_ptr = node;
8004200: 59 8b 00 00 sw (r12+0),r11
return sc;
}
8004204: 2b 9d 00 04 lw ra,(sp+4)
8004208: 2b 8b 00 18 lw r11,(sp+24)
800420c: 2b 8c 00 14 lw r12,(sp+20)
8004210: 2b 8d 00 10 lw r13,(sp+16)
8004214: 2b 8e 00 0c lw r14,(sp+12)
8004218: 2b 8f 00 08 lw r15,(sp+8)
800421c: 37 9c 00 1c addi sp,sp,28
8004220: c3 a0 00 00 ret
080115d8 <rtems_clock_set_nanoseconds_extension>:
* error code - if unsuccessful
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
80115d8: b8 20 18 00 mv r3,r1
if ( !routine )
return RTEMS_INVALID_ADDRESS;
80115dc: 34 01 00 09 mvi r1,9
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
if ( !routine )
80115e0: 44 60 00 05 be r3,r0,80115f4 <rtems_clock_set_nanoseconds_extension+0x1c><== ALWAYS TAKEN
return RTEMS_INVALID_ADDRESS;
_Watchdog_Nanoseconds_since_tick_handler = routine;
80115e4: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
80115e8: 38 42 b1 c8 ori r2,r2,0xb1c8 <== NOT EXECUTED
80115ec: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED
return RTEMS_SUCCESSFUL;
80115f0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
80115f4: c3 a0 00 00 ret
0800e924 <rtems_event_system_receive>:
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
800e924: 37 9c ff f8 addi sp,sp,-8
800e928: 5b 8b 00 08 sw (sp+8),r11
800e92c: 5b 9d 00 04 sw (sp+4),ra
} else {
*event_out = event->pending_events;
sc = RTEMS_SUCCESSFUL;
}
} else {
sc = RTEMS_INVALID_ADDRESS;
800e930: 34 05 00 09 mvi r5,9
rtems_event_set *event_out
)
{
rtems_status_code sc;
if ( event_out != NULL ) {
800e934: 44 80 00 17 be r4,r0,800e990 <rtems_event_system_receive+0x6c><== NEVER TAKEN
Thread_Control *executing = _Thread_Executing;
800e938: 78 05 08 01 mvhi r5,0x801
800e93c: 38 a5 ae 00 ori r5,r5,0xae00
800e940: 28 ab 00 10 lw r11,(r5+16)
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
800e944: 29 66 01 18 lw r6,(r11+280)
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
800e948: 44 20 00 0f be r1,r0,800e984 <rtems_event_system_receive+0x60><== NEVER TAKEN
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
800e94c: 78 07 08 01 mvhi r7,0x801
800e950: 38 e7 a9 78 ori r7,r7,0xa978
800e954: 28 e5 00 00 lw r5,(r7+0)
++level;
800e958: 34 a5 00 01 addi r5,r5,1
_Thread_Dispatch_disable_level = level;
800e95c: 58 e5 00 00 sw (r7+0),r5
_Thread_Disable_dispatch();
_Event_Seize(
800e960: 78 07 08 01 mvhi r7,0x801
800e964: b9 60 28 00 mv r5,r11
800e968: 34 c6 00 04 addi r6,r6,4
800e96c: 38 e7 b2 28 ori r7,r7,0xb228
800e970: 78 08 00 04 mvhi r8,0x4
800e974: fb ff fe a1 calli 800e3f8 <_Event_Seize>
executing,
event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
800e978: fb ff e4 12 calli 80079c0 <_Thread_Enable_dispatch>
sc = executing->Wait.return_code;
800e97c: 29 65 00 34 lw r5,(r11+52)
800e980: e0 00 00 04 bi 800e990 <rtems_event_system_receive+0x6c>
} else {
*event_out = event->pending_events;
800e984: 28 c1 00 04 lw r1,(r6+4) <== NOT EXECUTED
sc = RTEMS_SUCCESSFUL;
800e988: 34 05 00 00 mvi r5,0 <== NOT EXECUTED
);
_Thread_Enable_dispatch();
sc = executing->Wait.return_code;
} else {
*event_out = event->pending_events;
800e98c: 58 81 00 00 sw (r4+0),r1 <== NOT EXECUTED
} else {
sc = RTEMS_INVALID_ADDRESS;
}
return sc;
}
800e990: b8 a0 08 00 mv r1,r5
800e994: 2b 9d 00 04 lw ra,(sp+4)
800e998: 2b 8b 00 08 lw r11,(sp+8)
800e99c: 37 9c 00 08 addi sp,sp,8
800e9a0: c3 a0 00 00 ret
08005164 <rtems_event_system_send>:
rtems_status_code rtems_event_system_send(
rtems_id id,
rtems_event_set event_in
)
{
8005164: 37 9c ff f4 addi sp,sp,-12
8005168: 5b 8b 00 08 sw (sp+8),r11
800516c: 5b 9d 00 04 sw (sp+4),ra
8005170: b8 40 58 00 mv r11,r2
rtems_status_code sc;
Thread_Control *thread;
Objects_Locations location;
RTEMS_API_Control *api;
thread = _Thread_Get( id, &location );
8005174: 37 82 00 0c addi r2,sp,12
8005178: f8 00 0a 1e calli 80079f0 <_Thread_Get>
switch ( location ) {
800517c: 2b 82 00 0c lw r2,(sp+12)
8005180: 5c 40 00 0b bne r2,r0,80051ac <rtems_event_system_send+0x48><== NEVER TAKEN
case OBJECTS_LOCAL:
api = thread->API_Extensions[ THREAD_API_RTEMS ];
_Event_Surrender(
8005184: 28 23 01 18 lw r3,(r1+280)
8005188: 78 04 08 01 mvhi r4,0x801
800518c: b9 60 10 00 mv r2,r11
8005190: 34 63 00 04 addi r3,r3,4
8005194: 38 84 b2 28 ori r4,r4,0xb228
8005198: 78 05 00 04 mvhi r5,0x4
800519c: f8 00 24 f4 calli 800e56c <_Event_Surrender>
event_in,
&api->System_event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
80051a0: f8 00 0a 08 calli 80079c0 <_Thread_Enable_dispatch>
sc = RTEMS_SUCCESSFUL;
80051a4: 34 01 00 00 mvi r1,0
break;
80051a8: e0 00 00 02 bi 80051b0 <rtems_event_system_send+0x4c>
case OBJECTS_REMOTE:
sc = RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
break;
#endif
default:
sc = RTEMS_INVALID_ID;
80051ac: 34 01 00 04 mvi r1,4 <== NOT EXECUTED
break;
}
return sc;
}
80051b0: 2b 9d 00 04 lw ra,(sp+4)
80051b4: 2b 8b 00 08 lw r11,(sp+8)
80051b8: 37 9c 00 0c addi sp,sp,12
80051bc: c3 a0 00 00 ret
08006a90 <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)
{
8006a90: 37 9c ff e4 addi sp,sp,-28
8006a94: 5b 8b 00 1c sw (sp+28),r11
8006a98: 5b 8c 00 18 sw (sp+24),r12
8006a9c: 5b 8d 00 14 sw (sp+20),r13
8006aa0: 5b 8e 00 10 sw (sp+16),r14
8006aa4: 5b 8f 00 0c sw (sp+12),r15
8006aa8: 5b 90 00 08 sw (sp+8),r16
8006aac: 5b 9d 00 04 sw (sp+4),ra
8006ab0: b8 20 78 00 mv r15,r1
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006ab4: 44 20 00 17 be r1,r0,8006b10 <rtems_iterate_over_all_threads+0x80><== NEVER TAKEN
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8006ab8: 78 02 08 02 mvhi r2,0x802
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006abc: 78 0b 08 02 mvhi r11,0x802
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8006ac0: 38 42 2c f4 ori r2,r2,0x2cf4
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006ac4: 39 6b 2c f8 ori r11,r11,0x2cf8
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8006ac8: 34 50 00 10 addi r16,r2,16
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
8006acc: 29 61 00 00 lw r1,(r11+0)
if ( !information )
8006ad0: 34 0e 00 04 mvi r14,4
8006ad4: 34 0d 00 01 mvi r13,1
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
8006ad8: 28 2c 00 04 lw r12,(r1+4)
if ( !information )
8006adc: 5d 80 00 09 bne r12,r0,8006b00 <rtems_iterate_over_all_threads+0x70>
8006ae0: e0 00 00 0a bi 8006b08 <rtems_iterate_over_all_threads+0x78>
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
8006ae4: 29 81 00 1c lw r1,(r12+28)
8006ae8: b4 2e 08 00 add r1,r1,r14
8006aec: 28 21 00 00 lw r1,(r1+0)
if ( !the_thread )
8006af0: 44 20 00 02 be r1,r0,8006af8 <rtems_iterate_over_all_threads+0x68>
continue;
(*routine)(the_thread);
8006af4: d9 e0 00 00 call r15
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
8006af8: 35 ad 00 01 addi r13,r13,1
8006afc: 35 ce 00 04 addi r14,r14,4
8006b00: 2d 81 00 10 lhu r1,(r12+16)
8006b04: 50 2d ff f8 bgeu r1,r13,8006ae4 <rtems_iterate_over_all_threads+0x54>
8006b08: 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++ ) {
8006b0c: 5d 70 ff f0 bne r11,r16,8006acc <rtems_iterate_over_all_threads+0x3c>
(*routine)(the_thread);
}
}
}
8006b10: 2b 9d 00 04 lw ra,(sp+4)
8006b14: 2b 8b 00 1c lw r11,(sp+28)
8006b18: 2b 8c 00 18 lw r12,(sp+24)
8006b1c: 2b 8d 00 14 lw r13,(sp+20)
8006b20: 2b 8e 00 10 lw r14,(sp+16)
8006b24: 2b 8f 00 0c lw r15,(sp+12)
8006b28: 2b 90 00 08 lw r16,(sp+8)
8006b2c: 37 9c 00 1c addi sp,sp,28
8006b30: c3 a0 00 00 ret
08011fc0 <rtems_message_queue_broadcast>:
rtems_id id,
const void *buffer,
size_t size,
uint32_t *count
)
{
8011fc0: 37 9c ff e4 addi sp,sp,-28
8011fc4: 5b 8b 00 14 sw (sp+20),r11
8011fc8: 5b 8c 00 10 sw (sp+16),r12
8011fcc: 5b 8d 00 0c sw (sp+12),r13
8011fd0: 5b 8e 00 08 sw (sp+8),r14
8011fd4: 5b 9d 00 04 sw (sp+4),ra
8011fd8: b8 20 60 00 mv r12,r1
8011fdc: b8 40 68 00 mv r13,r2
8011fe0: b8 60 70 00 mv r14,r3
8011fe4: b8 80 58 00 mv r11,r4
register Message_queue_Control *the_message_queue;
Objects_Locations location;
CORE_message_queue_Status core_status;
if ( !buffer )
return RTEMS_INVALID_ADDRESS;
8011fe8: 34 01 00 09 mvi r1,9
{
register Message_queue_Control *the_message_queue;
Objects_Locations location;
CORE_message_queue_Status core_status;
if ( !buffer )
8011fec: 44 40 00 16 be r2,r0,8012044 <rtems_message_queue_broadcast+0x84><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( !count )
8011ff0: 44 80 00 15 be r4,r0,8012044 <rtems_message_queue_broadcast+0x84><== NEVER TAKEN
Objects_Id id,
Objects_Locations *location
)
{
return (Message_queue_Control *)
_Objects_Get( &_Message_queue_Information, id, location );
8011ff4: 78 01 08 04 mvhi r1,0x804
8011ff8: b9 80 10 00 mv r2,r12
8011ffc: 38 21 06 10 ori r1,r1,0x610
8012000: 37 83 00 1c addi r3,sp,28
8012004: f8 00 1a 7a calli 80189ec <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_message_queue = _Message_queue_Get( id, &location );
switch ( location ) {
8012008: 2b 82 00 1c lw r2,(sp+28)
801200c: 5c 40 00 0d bne r2,r0,8012040 <rtems_message_queue_broadcast+0x80>
case OBJECTS_LOCAL:
core_status = _CORE_message_queue_Broadcast(
8012010: b9 a0 10 00 mv r2,r13
8012014: b9 c0 18 00 mv r3,r14
8012018: b9 80 20 00 mv r4,r12
801201c: 34 05 00 00 mvi r5,0
8012020: b9 60 30 00 mv r6,r11
8012024: 34 21 00 14 addi r1,r1,20
8012028: f8 00 11 77 calli 8016604 <_CORE_message_queue_Broadcast>
NULL,
#endif
count
);
_Thread_Enable_dispatch();
801202c: 5b 81 00 18 sw (sp+24),r1
8012030: f8 00 1e df calli 8019bac <_Thread_Enable_dispatch>
return
8012034: 2b 81 00 18 lw r1,(sp+24)
8012038: f8 00 01 0e calli 8012470 <_Message_queue_Translate_core_message_queue_return_code>
801203c: e0 00 00 02 bi 8012044 <rtems_message_queue_broadcast+0x84>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8012040: 34 01 00 04 mvi r1,4
}
8012044: 2b 9d 00 04 lw ra,(sp+4)
8012048: 2b 8b 00 14 lw r11,(sp+20)
801204c: 2b 8c 00 10 lw r12,(sp+16)
8012050: 2b 8d 00 0c lw r13,(sp+12)
8012054: 2b 8e 00 08 lw r14,(sp+8)
8012058: 37 9c 00 1c addi sp,sp,28
801205c: c3 a0 00 00 ret
08005048 <rtems_partition_create>:
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
8005048: 37 9c ff d8 addi sp,sp,-40
800504c: 5b 8b 00 28 sw (sp+40),r11
8005050: 5b 8c 00 24 sw (sp+36),r12
8005054: 5b 8d 00 20 sw (sp+32),r13
8005058: 5b 8e 00 1c sw (sp+28),r14
800505c: 5b 8f 00 18 sw (sp+24),r15
8005060: 5b 90 00 14 sw (sp+20),r16
8005064: 5b 91 00 10 sw (sp+16),r17
8005068: 5b 92 00 0c sw (sp+12),r18
800506c: 5b 93 00 08 sw (sp+8),r19
8005070: 5b 9d 00 04 sw (sp+4),ra
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
8005074: 34 07 00 03 mvi r7,3
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
8005078: b8 20 88 00 mv r17,r1
800507c: b8 40 70 00 mv r14,r2
8005080: b8 60 78 00 mv r15,r3
8005084: b8 80 60 00 mv r12,r4
8005088: b8 a0 98 00 mv r19,r5
800508c: b8 c0 80 00 mv r16,r6
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
8005090: 44 20 00 36 be r1,r0,8005168 <rtems_partition_create+0x120>
return RTEMS_INVALID_NAME;
if ( !starting_address )
return RTEMS_INVALID_ADDRESS;
8005094: 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 )
8005098: 44 40 00 34 be r2,r0,8005168 <rtems_partition_create+0x120>
return RTEMS_INVALID_ADDRESS;
if ( !id )
800509c: 44 c0 00 33 be r6,r0,8005168 <rtems_partition_create+0x120><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
80050a0: 64 82 00 00 cmpei r2,r4,0
80050a4: 64 61 00 00 cmpei r1,r3,0
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
80050a8: 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 ||
80050ac: b8 41 08 00 or r1,r2,r1
80050b0: 5c 20 00 2e bne r1,r0,8005168 <rtems_partition_create+0x120>
80050b4: 54 83 00 2d bgu r4,r3,8005168 <rtems_partition_create+0x120>
*/
RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned (
uint32_t buffer_size
)
{
return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0);
80050b8: 20 81 00 03 andi r1,r4,0x3
80050bc: 5c 20 00 2b bne r1,r0,8005168 <rtems_partition_create+0x120>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
80050c0: 21 d2 00 03 andi r18,r14,0x3
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
return RTEMS_INVALID_ADDRESS;
80050c4: 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 ) )
80050c8: 5e 41 00 28 bne r18,r1,8005168 <rtems_partition_create+0x120>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
80050cc: 78 02 08 02 mvhi r2,0x802
80050d0: 38 42 43 28 ori r2,r2,0x4328
80050d4: 28 41 00 00 lw r1,(r2+0)
++level;
80050d8: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
80050dc: 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 );
80050e0: 78 0d 08 02 mvhi r13,0x802
80050e4: 39 ad 41 68 ori r13,r13,0x4168
80050e8: b9 a0 08 00 mv r1,r13
80050ec: f8 00 07 f9 calli 80070d0 <_Objects_Allocate>
80050f0: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
80050f4: 5c 32 00 04 bne r1,r18,8005104 <rtems_partition_create+0xbc>
_Thread_Enable_dispatch();
80050f8: f8 00 0d 97 calli 8008754 <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
80050fc: 34 07 00 05 mvi r7,5
8005100: e0 00 00 1a bi 8005168 <rtems_partition_create+0x120>
}
#endif
the_partition->starting_address = starting_address;
the_partition->length = length;
the_partition->buffer_size = buffer_size;
8005104: 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 );
8005108: b9 80 10 00 mv r2,r12
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
800510c: 58 2e 00 10 sw (r1+16),r14
the_partition->length = length;
8005110: 58 2f 00 14 sw (r1+20),r15
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
8005114: 58 33 00 1c sw (r1+28),r19
the_partition->number_of_used_blocks = 0;
8005118: 58 20 00 20 sw (r1+32),r0
_Chain_Initialize( &the_partition->Memory, starting_address,
800511c: 34 32 00 24 addi r18,r1,36
length / buffer_size, buffer_size );
8005120: b9 e0 08 00 mv r1,r15
8005124: f8 00 63 0c calli 801dd54 <__udivsi3>
8005128: 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,
800512c: b9 80 20 00 mv r4,r12
8005130: ba 40 08 00 mv r1,r18
8005134: b9 c0 10 00 mv r2,r14
8005138: f8 00 04 e3 calli 80064c4 <_Chain_Initialize>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
800513c: 29 6c 00 08 lw r12,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8005140: 29 ad 00 1c lw r13,(r13+28)
8005144: 34 02 00 02 mvi r2,2
8005148: 21 81 ff ff andi r1,r12,0xffff
800514c: fb ff ee b4 calli 8000c1c <__ashlsi3>
8005150: b5 a1 08 00 add r1,r13,r1
8005154: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8005158: 59 71 00 0c sw (r11+12),r17
&_Partition_Information,
&the_partition->Object,
(Objects_Name) name
);
*id = the_partition->Object.id;
800515c: 5a 0c 00 00 sw (r16+0),r12
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
8005160: f8 00 0d 7d calli 8008754 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8005164: 34 07 00 00 mvi r7,0
}
8005168: b8 e0 08 00 mv r1,r7
800516c: 2b 9d 00 04 lw ra,(sp+4)
8005170: 2b 8b 00 28 lw r11,(sp+40)
8005174: 2b 8c 00 24 lw r12,(sp+36)
8005178: 2b 8d 00 20 lw r13,(sp+32)
800517c: 2b 8e 00 1c lw r14,(sp+28)
8005180: 2b 8f 00 18 lw r15,(sp+24)
8005184: 2b 90 00 14 lw r16,(sp+20)
8005188: 2b 91 00 10 lw r17,(sp+16)
800518c: 2b 92 00 0c lw r18,(sp+12)
8005190: 2b 93 00 08 lw r19,(sp+8)
8005194: 37 9c 00 28 addi sp,sp,40
8005198: c3 a0 00 00 ret
08034644 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
8034644: 37 9c ff e8 addi sp,sp,-24
8034648: 5b 8b 00 14 sw (sp+20),r11
803464c: 5b 8c 00 10 sw (sp+16),r12
8034650: 5b 8d 00 0c sw (sp+12),r13
8034654: 5b 8e 00 08 sw (sp+8),r14
8034658: 5b 9d 00 04 sw (sp+4),ra
803465c: b8 20 60 00 mv r12,r1
8034660: 78 01 08 06 mvhi r1,0x806
8034664: b8 40 68 00 mv r13,r2
8034668: 38 21 ab 30 ori r1,r1,0xab30
803466c: b9 80 10 00 mv r2,r12
8034670: 37 83 00 18 addi r3,sp,24
8034674: fb ff 41 8e calli 8004cac <_Objects_Get>
8034678: 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 ) {
803467c: 2b 81 00 18 lw r1,(sp+24)
8034680: 5c 20 00 65 bne r1,r0,8034814 <rtems_rate_monotonic_period+0x1d0>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
8034684: 78 03 08 06 mvhi r3,0x806
8034688: 38 63 a5 00 ori r3,r3,0xa500
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
803468c: 29 62 00 40 lw r2,(r11+64)
8034690: 28 61 00 10 lw r1,(r3+16)
8034694: 44 41 00 04 be r2,r1,80346a4 <rtems_rate_monotonic_period+0x60>
_Thread_Enable_dispatch();
8034698: fb ff 45 4e calli 8005bd0 <_Thread_Enable_dispatch>
return RTEMS_NOT_OWNER_OF_RESOURCE;
803469c: 34 0c 00 17 mvi r12,23
80346a0: e0 00 00 5e bi 8034818 <rtems_rate_monotonic_period+0x1d4>
}
if ( length == RTEMS_PERIOD_STATUS ) {
80346a4: 5d a0 00 0d bne r13,r0,80346d8 <rtems_rate_monotonic_period+0x94>
switch ( the_period->state ) {
80346a8: 29 61 00 38 lw r1,(r11+56)
80346ac: 34 02 00 04 mvi r2,4
80346b0: 34 0c 00 00 mvi r12,0
80346b4: 54 22 00 07 bgu r1,r2,80346d0 <rtems_rate_monotonic_period+0x8c><== NEVER TAKEN
80346b8: 78 0b 08 06 mvhi r11,0x806
80346bc: 34 02 00 02 mvi r2,2
80346c0: fb ff 2e ce calli 80001f8 <__ashlsi3>
80346c4: 39 6b 27 44 ori r11,r11,0x2744
80346c8: b5 61 08 00 add r1,r11,r1
80346cc: 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();
80346d0: fb ff 45 40 calli 8005bd0 <_Thread_Enable_dispatch>
return( return_value );
80346d4: e0 00 00 51 bi 8034818 <rtems_rate_monotonic_period+0x1d4>
}
_ISR_Disable( level );
80346d8: 90 00 70 00 rcsr r14,IE
80346dc: 34 01 ff fe mvi r1,-2
80346e0: a1 c1 08 00 and r1,r14,r1
80346e4: d0 01 00 00 wcsr IE,r1
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
80346e8: 29 63 00 38 lw r3,(r11+56)
80346ec: 5c 60 00 13 bne r3,r0,8034738 <rtems_rate_monotonic_period+0xf4>
_ISR_Enable( level );
80346f0: d0 0e 00 00 wcsr IE,r14
the_period->next_length = length;
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
80346f4: b9 60 08 00 mv r1,r11
_ISR_Disable( level );
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
_ISR_Enable( level );
the_period->next_length = length;
80346f8: 59 6d 00 3c sw (r11+60),r13
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
80346fc: fb ff ff a5 calli 8034590 <_Rate_monotonic_Initiate_statistics>
the_period->state = RATE_MONOTONIC_ACTIVE;
8034700: 34 01 00 02 mvi r1,2
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
8034704: 78 03 08 03 mvhi r3,0x803
8034708: 59 61 00 38 sw (r11+56),r1
803470c: 38 63 48 38 ori r3,r3,0x4838
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8034710: 78 01 08 06 mvhi r1,0x806
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8034714: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8034718: 59 63 00 2c sw (r11+44),r3
the_watchdog->id = id;
803471c: 59 6c 00 30 sw (r11+48),r12
the_watchdog->user_data = user_data;
8034720: 59 60 00 34 sw (r11+52),r0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8034724: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8034728: 38 21 a0 f8 ori r1,r1,0xa0f8
803472c: 35 62 00 10 addi r2,r11,16
8034730: fb ff 48 de calli 8006aa8 <_Watchdog_Insert>
8034734: e0 00 00 1f bi 80347b0 <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 ) {
8034738: 34 01 00 02 mvi r1,2
803473c: 5c 61 00 20 bne r3,r1,80347bc <rtems_rate_monotonic_period+0x178>
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
8034740: b9 60 08 00 mv r1,r11
8034744: fb ff ff 49 calli 8034468 <_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;
8034748: 34 01 00 01 mvi r1,1
803474c: 59 61 00 38 sw (r11+56),r1
the_period->next_length = length;
8034750: 59 6d 00 3c sw (r11+60),r13
_ISR_Enable( level );
8034754: d0 0e 00 00 wcsr IE,r14
_Thread_Executing->Wait.id = the_period->Object.id;
8034758: 78 01 08 06 mvhi r1,0x806
803475c: 38 21 a5 00 ori r1,r1,0xa500
8034760: 29 62 00 08 lw r2,(r11+8)
8034764: 28 21 00 10 lw r1,(r1+16)
8034768: 58 22 00 20 sw (r1+32),r2
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
803476c: 34 02 40 00 mvi r2,16384
8034770: fb ff 47 ba calli 8006658 <_Thread_Set_state>
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
8034774: 90 00 08 00 rcsr r1,IE
8034778: 34 02 ff fe mvi r2,-2
803477c: a0 22 10 00 and r2,r1,r2
8034780: d0 02 00 00 wcsr IE,r2
local_state = the_period->state;
the_period->state = RATE_MONOTONIC_ACTIVE;
8034784: 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;
8034788: 29 62 00 38 lw r2,(r11+56)
the_period->state = RATE_MONOTONIC_ACTIVE;
803478c: 59 63 00 38 sw (r11+56),r3
_ISR_Enable( level );
8034790: 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 )
8034794: 34 01 00 03 mvi r1,3
8034798: 5c 41 00 06 bne r2,r1,80347b0 <rtems_rate_monotonic_period+0x16c>
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
803479c: 78 01 08 06 mvhi r1,0x806
80347a0: 38 21 a5 00 ori r1,r1,0xa500
80347a4: 28 21 00 10 lw r1,(r1+16)
80347a8: 34 02 40 00 mvi r2,16384
80347ac: fb ff 62 42 calli 800d0b4 <_Thread_Clear_state>
_Thread_Enable_dispatch();
80347b0: fb ff 45 08 calli 8005bd0 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
80347b4: 34 0c 00 00 mvi r12,0
80347b8: e0 00 00 18 bi 8034818 <rtems_rate_monotonic_period+0x1d4>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
80347bc: 34 0c 00 04 mvi r12,4
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_EXPIRED ) {
80347c0: 5c 6c 00 16 bne r3,r12,8034818 <rtems_rate_monotonic_period+0x1d4><== NEVER TAKEN
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
80347c4: b9 60 08 00 mv r1,r11
80347c8: fb ff ff 28 calli 8034468 <_Rate_monotonic_Update_statistics>
_ISR_Enable( level );
80347cc: d0 0e 00 00 wcsr IE,r14
the_period->state = RATE_MONOTONIC_ACTIVE;
80347d0: 34 01 00 02 mvi r1,2
80347d4: 59 61 00 38 sw (r11+56),r1
80347d8: 78 01 08 06 mvhi r1,0x806
80347dc: 38 21 a0 f8 ori r1,r1,0xa0f8
80347e0: 35 62 00 10 addi r2,r11,16
the_period->next_length = length;
80347e4: 59 6d 00 3c sw (r11+60),r13
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80347e8: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80347ec: fb ff 48 af calli 8006aa8 <_Watchdog_Insert>
80347f0: 78 01 08 06 mvhi r1,0x806
80347f4: 38 21 60 18 ori r1,r1,0x6018
80347f8: 28 23 00 34 lw r3,(r1+52)
80347fc: 29 62 00 3c lw r2,(r11+60)
8034800: 29 61 00 40 lw r1,(r11+64)
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Scheduler_Release_job(the_period->owner, the_period->next_length);
_Thread_Enable_dispatch();
return RTEMS_TIMEOUT;
8034804: 34 0c 00 06 mvi r12,6
8034808: d8 60 00 00 call r3
the_period->state = RATE_MONOTONIC_ACTIVE;
the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Scheduler_Release_job(the_period->owner, the_period->next_length);
_Thread_Enable_dispatch();
803480c: fb ff 44 f1 calli 8005bd0 <_Thread_Enable_dispatch>
return RTEMS_TIMEOUT;
8034810: e0 00 00 02 bi 8034818 <rtems_rate_monotonic_period+0x1d4>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8034814: 34 0c 00 04 mvi r12,4
}
8034818: b9 80 08 00 mv r1,r12
803481c: 2b 9d 00 04 lw ra,(sp+4)
8034820: 2b 8b 00 14 lw r11,(sp+20)
8034824: 2b 8c 00 10 lw r12,(sp+16)
8034828: 2b 8d 00 0c lw r13,(sp+12)
803482c: 2b 8e 00 08 lw r14,(sp+8)
8034830: 37 9c 00 18 addi sp,sp,24
8034834: c3 a0 00 00 ret
08025f28 <rtems_rate_monotonic_report_statistics_with_plugin>:
void rtems_rate_monotonic_report_statistics_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
8025f28: 37 9c ff 5c addi sp,sp,-164
8025f2c: 5b 8b 00 44 sw (sp+68),r11
8025f30: 5b 8c 00 40 sw (sp+64),r12
8025f34: 5b 8d 00 3c sw (sp+60),r13
8025f38: 5b 8e 00 38 sw (sp+56),r14
8025f3c: 5b 8f 00 34 sw (sp+52),r15
8025f40: 5b 90 00 30 sw (sp+48),r16
8025f44: 5b 91 00 2c sw (sp+44),r17
8025f48: 5b 92 00 28 sw (sp+40),r18
8025f4c: 5b 93 00 24 sw (sp+36),r19
8025f50: 5b 94 00 20 sw (sp+32),r20
8025f54: 5b 95 00 1c sw (sp+28),r21
8025f58: 5b 96 00 18 sw (sp+24),r22
8025f5c: 5b 97 00 14 sw (sp+20),r23
8025f60: 5b 98 00 10 sw (sp+16),r24
8025f64: 5b 99 00 0c sw (sp+12),r25
8025f68: 5b 9b 00 08 sw (sp+8),fp
8025f6c: 5b 9d 00 04 sw (sp+4),ra
8025f70: b8 20 60 00 mv r12,r1
8025f74: 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 )
8025f78: 44 40 00 72 be r2,r0,8026140 <rtems_rate_monotonic_report_statistics_with_plugin+0x218><== NEVER TAKEN
return;
(*print)( context, "Period information by period\n" );
8025f7c: 78 02 08 05 mvhi r2,0x805
8025f80: 38 42 f8 48 ori r2,r2,0xf848
8025f84: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)( context, "--- CPU times are in seconds ---\n" );
8025f88: 78 02 08 05 mvhi r2,0x805
8025f8c: 38 42 f8 68 ori r2,r2,0xf868
8025f90: b9 80 08 00 mv r1,r12
8025f94: d9 60 00 00 call r11
(*print)( context, "--- Wall times are in seconds ---\n" );
8025f98: 78 02 08 05 mvhi r2,0x805
8025f9c: 38 42 f8 8c ori r2,r2,0xf88c
8025fa0: b9 80 08 00 mv r1,r12
8025fa4: d9 60 00 00 call r11
Be sure to test the various cases.
(*print)( context,"\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
*/
(*print)( context, " ID OWNER COUNT MISSED "
8025fa8: 78 02 08 05 mvhi r2,0x805
8025fac: 38 42 f8 b0 ori r2,r2,0xf8b0
8025fb0: b9 80 08 00 mv r1,r12
8025fb4: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
" "
#endif
" WALL TIME\n"
);
(*print)( context, " "
8025fb8: 78 02 08 05 mvhi r2,0x805
8025fbc: b9 80 08 00 mv r1,r12
8025fc0: 38 42 f8 fc ori r2,r2,0xf8fc
8025fc4: 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 ;
8025fc8: 78 01 08 06 mvhi r1,0x806
8025fcc: 38 21 ab 30 ori r1,r1,0xab30
rtems_object_get_name( the_status.owner, sizeof(name), name );
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8025fd0: 78 11 08 05 mvhi r17,0x805
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,
8025fd4: 78 10 08 05 mvhi r16,0x805
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,
8025fd8: 78 0f 08 05 mvhi r15,0x805
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
8025fdc: 78 0e 08 06 mvhi r14,0x806
/*
* 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 ;
8025fe0: 28 2d 00 08 lw r13,(r1+8)
id <= _Rate_monotonic_Information.maximum_id ;
8025fe4: b8 20 a0 00 mv r20,r1
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
8025fe8: 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 );
8025fec: 37 98 00 80 addi r24,sp,128
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
8025ff0: 37 93 00 a0 addi r19,sp,160
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8025ff4: 3a 31 f9 48 ori r17,r17,0xf948
{
#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;
8025ff8: 37 97 00 60 addi r23,sp,96
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
8025ffc: 37 92 00 98 addi r18,sp,152
(*print)( context,
8026000: 3a 10 f9 60 ori r16,r16,0xf960
{
#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;
8026004: 37 96 00 78 addi r22,sp,120
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
8026008: 39 ef f9 80 ori r15,r15,0xf980
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
802600c: 39 ce 10 00 ori r14,r14,0x1000
/*
* 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 ;
8026010: e0 00 00 4a bi 8026138 <rtems_rate_monotonic_report_statistics_with_plugin+0x210>
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
8026014: b9 a0 08 00 mv r1,r13
8026018: bb 20 10 00 mv r2,r25
802601c: f8 00 37 f8 calli 8033ffc <rtems_rate_monotonic_get_statistics>
8026020: b8 20 a8 00 mv r21,r1
if ( status != RTEMS_SUCCESSFUL )
8026024: 5c 20 00 44 bne r1,r0,8026134 <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 );
8026028: bb 00 10 00 mv r2,r24
802602c: b9 a0 08 00 mv r1,r13
8026030: f8 00 38 80 calli 8034230 <rtems_rate_monotonic_get_status>
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
8026034: 2b 81 00 80 lw r1,(sp+128)
8026038: 34 02 00 05 mvi r2,5
802603c: ba 60 18 00 mv r3,r19
8026040: fb ff 98 8e calli 800c278 <rtems_object_get_name>
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8026044: 2b 85 00 48 lw r5,(sp+72)
8026048: 2b 86 00 4c lw r6,(sp+76)
802604c: ba 20 10 00 mv r2,r17
8026050: b9 80 08 00 mv r1,r12
8026054: b9 a0 18 00 mv r3,r13
8026058: ba 60 20 00 mv r4,r19
802605c: d9 60 00 00 call r11
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
8026060: 2b 82 00 48 lw r2,(sp+72)
8026064: 5c 55 00 05 bne r2,r21,8026078 <rtems_rate_monotonic_report_statistics_with_plugin+0x150>
(*print)( context, "\n" );
8026068: b9 80 08 00 mv r1,r12
802606c: b9 c0 10 00 mv r2,r14
8026070: d9 60 00 00 call r11
continue;
8026074: e0 00 00 30 bi 8026134 <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 );
8026078: ba 40 18 00 mv r3,r18
802607c: ba e0 08 00 mv r1,r23
8026080: f8 00 04 c0 calli 8027380 <_Timespec_Divide_by_integer>
(*print)( context,
8026084: 2b 81 00 54 lw r1,(sp+84)
8026088: 34 02 03 e8 mvi r2,1000
802608c: f8 00 c9 93 calli 80586d8 <__divsi3>
8026090: b8 20 d8 00 mv fp,r1
8026094: 2b 81 00 5c lw r1,(sp+92)
8026098: 34 02 03 e8 mvi r2,1000
802609c: f8 00 c9 8f calli 80586d8 <__divsi3>
80260a0: b8 20 a8 00 mv r21,r1
80260a4: 2b 81 00 9c lw r1,(sp+156)
80260a8: 34 02 03 e8 mvi r2,1000
80260ac: f8 00 c9 8b calli 80586d8 <__divsi3>
80260b0: 2b 85 00 58 lw r5,(sp+88)
80260b4: 2b 87 00 98 lw r7,(sp+152)
80260b8: 2b 83 00 50 lw r3,(sp+80)
80260bc: b8 20 40 00 mv r8,r1
80260c0: bb 60 20 00 mv r4,fp
80260c4: ba a0 30 00 mv r6,r21
80260c8: ba 00 10 00 mv r2,r16
80260cc: b9 80 08 00 mv r1,r12
80260d0: 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);
80260d4: 2b 82 00 48 lw r2,(sp+72)
80260d8: ba 40 18 00 mv r3,r18
80260dc: ba c0 08 00 mv r1,r22
80260e0: f8 00 04 a8 calli 8027380 <_Timespec_Divide_by_integer>
(*print)( context,
80260e4: 2b 81 00 6c lw r1,(sp+108)
80260e8: 34 02 03 e8 mvi r2,1000
80260ec: f8 00 c9 7b calli 80586d8 <__divsi3>
80260f0: b8 20 d8 00 mv fp,r1
80260f4: 2b 81 00 74 lw r1,(sp+116)
80260f8: 34 02 03 e8 mvi r2,1000
80260fc: f8 00 c9 77 calli 80586d8 <__divsi3>
8026100: b8 20 a8 00 mv r21,r1
8026104: 2b 81 00 9c lw r1,(sp+156)
8026108: 34 02 03 e8 mvi r2,1000
802610c: f8 00 c9 73 calli 80586d8 <__divsi3>
8026110: 2b 83 00 68 lw r3,(sp+104)
8026114: 2b 85 00 70 lw r5,(sp+112)
8026118: 2b 87 00 98 lw r7,(sp+152)
802611c: b8 20 40 00 mv r8,r1
8026120: b9 e0 10 00 mv r2,r15
8026124: b9 80 08 00 mv r1,r12
8026128: bb 60 20 00 mv r4,fp
802612c: ba a0 30 00 mv r6,r21
8026130: 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++ ) {
8026134: 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 ;
8026138: 2a 81 00 0c lw r1,(r20+12)
802613c: 50 2d ff b6 bgeu r1,r13,8026014 <rtems_rate_monotonic_report_statistics_with_plugin+0xec>
the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall
);
#endif
}
}
}
8026140: 2b 9d 00 04 lw ra,(sp+4)
8026144: 2b 8b 00 44 lw r11,(sp+68)
8026148: 2b 8c 00 40 lw r12,(sp+64)
802614c: 2b 8d 00 3c lw r13,(sp+60)
8026150: 2b 8e 00 38 lw r14,(sp+56)
8026154: 2b 8f 00 34 lw r15,(sp+52)
8026158: 2b 90 00 30 lw r16,(sp+48)
802615c: 2b 91 00 2c lw r17,(sp+44)
8026160: 2b 92 00 28 lw r18,(sp+40)
8026164: 2b 93 00 24 lw r19,(sp+36)
8026168: 2b 94 00 20 lw r20,(sp+32)
802616c: 2b 95 00 1c lw r21,(sp+28)
8026170: 2b 96 00 18 lw r22,(sp+24)
8026174: 2b 97 00 14 lw r23,(sp+20)
8026178: 2b 98 00 10 lw r24,(sp+16)
802617c: 2b 99 00 0c lw r25,(sp+12)
8026180: 2b 9b 00 08 lw fp,(sp+8)
8026184: 37 9c 00 a4 addi sp,sp,164
8026188: c3 a0 00 00 ret
08004720 <rtems_rbheap_allocate>:
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
8004720: 37 9c ff e8 addi sp,sp,-24
8004724: 5b 8b 00 18 sw (sp+24),r11
8004728: 5b 8c 00 14 sw (sp+20),r12
800472c: 5b 8d 00 10 sw (sp+16),r13
8004730: 5b 8e 00 0c sw (sp+12),r14
8004734: 5b 8f 00 08 sw (sp+8),r15
8004738: 5b 9d 00 04 sw (sp+4),ra
void *ptr = NULL;
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
800473c: 28 2d 00 30 lw r13,(r1+48)
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
8004740: b8 40 60 00 mv r12,r2
8004744: b8 20 58 00 mv r11,r1
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
8004748: b8 40 08 00 mv r1,r2
800474c: b9 a0 10 00 mv r2,r13
8004750: f8 00 3c d8 calli 8013ab0 <__umodsi3>
if (excess > 0) {
8004754: b9 80 70 00 mv r14,r12
8004758: 44 20 00 03 be r1,r0,8004764 <rtems_rbheap_allocate+0x44> <== ALWAYS TAKEN
value += alignment - excess;
800475c: b5 8d 70 00 add r14,r12,r13 <== NOT EXECUTED
8004760: c9 c1 70 00 sub r14,r14,r1 <== NOT EXECUTED
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
8004764: f1 cc 08 00 cmpgeu r1,r14,r12
8004768: 7d 8c 00 00 cmpnei r12,r12,0
800476c: a0 2c 60 00 and r12,r1,r12
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
8004770: 34 01 00 00 mvi r1,0
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
8004774: 45 80 00 3b be r12,r0,8004860 <rtems_rbheap_allocate+0x140>
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
8004778: 29 61 00 00 lw r1,(r11+0)
rtems_chain_control *free_chain,
size_t size
)
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
800477c: 35 63 00 04 addi r3,r11,4
rtems_rbheap_chunk *big_enough = NULL;
8004780: 34 0c 00 00 mvi r12,0
8004784: e0 00 00 06 bi 800479c <rtems_rbheap_allocate+0x7c>
while (current != tail && big_enough == NULL) {
rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current;
if (free_chunk->size >= size) {
8004788: 28 2c 00 1c lw r12,(r1+28)
800478c: f1 8e 60 00 cmpgeu r12,r12,r14
8004790: c8 0c 60 00 sub r12,r0,r12
8004794: a0 2c 60 00 and r12,r1,r12
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
8004798: 28 21 00 00 lw r1,(r1+0)
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
rtems_rbheap_chunk *big_enough = NULL;
while (current != tail && big_enough == NULL) {
800479c: 65 84 00 00 cmpei r4,r12,0
80047a0: fc 23 10 00 cmpne r2,r1,r3
80047a4: a0 82 10 00 and r2,r4,r2
80047a8: 5c 40 ff f8 bne r2,r0,8004788 <rtems_rbheap_allocate+0x68>
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
80047ac: 34 01 00 00 mvi r1,0
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size);
if (free_chunk != NULL) {
80047b0: 45 82 00 2c be r12,r2,8004860 <rtems_rbheap_allocate+0x140>
uintptr_t free_size = free_chunk->size;
80047b4: 29 8f 00 1c lw r15,(r12+28)
if (free_size > aligned_size) {
80047b8: 51 cf 00 21 bgeu r14,r15,800483c <rtems_rbheap_allocate+0x11c>
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
80047bc: 29 6d 00 0c lw r13,(r11+12)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
80047c0: 35 61 00 10 addi r1,r11,16
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
80047c4: 45 a1 00 06 be r13,r1,80047dc <rtems_rbheap_allocate+0xbc> <== NEVER TAKEN
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
80047c8: 29 a1 00 00 lw r1,(r13+0)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
80047cc: 35 62 00 0c addi r2,r11,12
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
80047d0: 59 61 00 0c sw (r11+12),r1
new_first->previous = head;
80047d4: 58 22 00 04 sw (r1+4),r2
80047d8: e0 00 00 0b bi 8004804 <rtems_rbheap_allocate+0xe4>
{
rtems_chain_control *chain = &control->spare_descriptor_chain;
rtems_chain_node *chunk = rtems_chain_get_unprotected(chain);
if (chunk == NULL) {
(*control->extend_descriptors)(control);
80047dc: 29 62 00 34 lw r2,(r11+52) <== NOT EXECUTED
80047e0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
80047e4: d8 40 00 00 call r2 <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
80047e8: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
80047ec: 44 2d 00 1c be r1,r13,800485c <rtems_rbheap_allocate+0x13c><== NOT EXECUTED
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
80047f0: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
80047f4: 35 63 00 0c addi r3,r11,12 <== NOT EXECUTED
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
new_first->previous = head;
80047f8: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
80047fc: 59 62 00 0c sw (r11+12),r2 <== NOT EXECUTED
new_first->previous = head;
8004800: 58 43 00 04 sw (r2+4),r3 <== NOT EXECUTED
uintptr_t free_size = free_chunk->size;
if (free_size > aligned_size) {
rtems_rbheap_chunk *new_chunk = get_chunk(control);
if (new_chunk != NULL) {
8004804: 45 a0 00 16 be r13,r0,800485c <rtems_rbheap_allocate+0x13c><== NEVER TAKEN
uintptr_t new_free_size = free_size - aligned_size;
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
8004808: 29 82 00 18 lw r2,(r12+24)
if (free_size > aligned_size) {
rtems_rbheap_chunk *new_chunk = get_chunk(control);
if (new_chunk != NULL) {
uintptr_t new_free_size = free_size - aligned_size;
800480c: c9 ee 08 00 sub r1,r15,r14
free_chunk->size = new_free_size;
8004810: 59 81 00 1c sw (r12+28),r1
new_chunk->begin = free_chunk->begin + new_free_size;
8004814: b4 22 08 00 add r1,r1,r2
8004818: 59 a1 00 18 sw (r13+24),r1
new_chunk->size = aligned_size;
800481c: 59 ae 00 1c sw (r13+28),r14
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
8004820: 59 a0 00 04 sw (r13+4),r0
8004824: 59 a0 00 00 sw (r13+0),r0
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
8004828: 35 61 00 18 addi r1,r11,24
800482c: 35 a2 00 08 addi r2,r13,8
8004830: f8 00 07 6f calli 80065ec <_RBTree_Insert_unprotected>
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
new_chunk->size = aligned_size;
rtems_chain_set_off_chain(&new_chunk->chain_node);
insert_into_tree(chunk_tree, new_chunk);
ptr = (void *) new_chunk->begin;
8004834: 29 a1 00 18 lw r1,(r13+24)
8004838: e0 00 00 0a bi 8004860 <rtems_rbheap_allocate+0x140>
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
800483c: 29 81 00 04 lw r1,(r12+4)
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
8004840: 29 82 00 00 lw r2,(r12+0)
previous = the_node->previous;
next->previous = previous;
8004844: 58 41 00 04 sw (r2+4),r1
previous->next = next;
8004848: 58 22 00 00 sw (r1+0),r2
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
800484c: 59 80 00 04 sw (r12+4),r0
8004850: 59 80 00 00 sw (r12+0),r0
}
} else {
rtems_chain_extract_unprotected(&free_chunk->chain_node);
rtems_chain_set_off_chain(&free_chunk->chain_node);
ptr = (void *) free_chunk->begin;
8004854: 29 81 00 18 lw r1,(r12+24)
8004858: e0 00 00 02 bi 8004860 <rtems_rbheap_allocate+0x140>
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
800485c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
}
}
return ptr;
}
8004860: 2b 9d 00 04 lw ra,(sp+4)
8004864: 2b 8b 00 18 lw r11,(sp+24)
8004868: 2b 8c 00 14 lw r12,(sp+20)
800486c: 2b 8d 00 10 lw r13,(sp+16)
8004870: 2b 8e 00 0c lw r14,(sp+12)
8004874: 2b 8f 00 08 lw r15,(sp+8)
8004878: 37 9c 00 18 addi sp,sp,24
800487c: c3 a0 00 00 ret
080049bc <rtems_rbheap_extend_descriptors_with_malloc>:
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
80049bc: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED
80049c0: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED
80049c4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
80049c8: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
80049cc: 34 01 00 20 mvi r1,32 <== NOT EXECUTED
80049d0: fb ff f5 a0 calli 8002050 <malloc> <== NOT EXECUTED
if (chunk != NULL) {
80049d4: 44 20 00 07 be r1,r0,80049f0 <rtems_rbheap_extend_descriptors_with_malloc+0x34><== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert_unprotected(_Chain_Head(the_chain), the_node);
80049d8: 35 62 00 0c addi r2,r11,12 <== NOT EXECUTED
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
80049dc: 58 22 00 04 sw (r1+4),r2 <== NOT EXECUTED
before_node = after_node->next;
80049e0: 29 62 00 0c lw r2,(r11+12) <== NOT EXECUTED
after_node->next = the_node;
80049e4: 59 61 00 0c sw (r11+12),r1 <== NOT EXECUTED
the_node->next = before_node;
80049e8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
before_node->previous = the_node;
80049ec: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
80049f0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
80049f4: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED
80049f8: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED
80049fc: c3 a0 00 00 ret <== NOT EXECUTED
08004880 <rtems_rbheap_free>:
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
8004880: 37 9c ff c8 addi sp,sp,-56
8004884: 5b 8b 00 18 sw (sp+24),r11
8004888: 5b 8c 00 14 sw (sp+20),r12
800488c: 5b 8d 00 10 sw (sp+16),r13
8004890: 5b 8e 00 0c sw (sp+12),r14
8004894: 5b 8f 00 08 sw (sp+8),r15
8004898: 5b 9d 00 04 sw (sp+4),ra
800489c: b8 20 58 00 mv r11,r1
80048a0: b8 40 60 00 mv r12,r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
80048a4: 34 01 00 00 mvi r1,0
if (ptr != NULL) {
80048a8: 44 40 00 3c be r2,r0,8004998 <rtems_rbheap_free+0x118>
#define NULL_PAGE rtems_rbheap_chunk_of_node(NULL)
static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)
{
rtems_rbheap_chunk chunk = { .begin = key };
80048ac: 37 81 00 1c addi r1,sp,28
80048b0: 34 02 00 00 mvi r2,0
80048b4: 34 03 00 20 mvi r3,32
80048b8: f8 00 27 dd calli 800e82c <memset>
return rtems_rbheap_chunk_of_node(
80048bc: 37 8e 00 24 addi r14,sp,36
#define NULL_PAGE rtems_rbheap_chunk_of_node(NULL)
static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)
{
rtems_rbheap_chunk chunk = { .begin = key };
80048c0: 5b 8c 00 34 sw (sp+52),r12
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
80048c4: 29 6d 00 1c lw r13,(r11+28)
RBTree_Node* found = NULL;
80048c8: 34 0c 00 00 mvi r12,0
80048cc: e0 00 00 0e bi 8004904 <rtems_rbheap_free+0x84>
int compare_result;
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
80048d0: 29 63 00 28 lw r3,(r11+40)
80048d4: b9 c0 08 00 mv r1,r14
80048d8: b9 a0 10 00 mv r2,r13
80048dc: d8 60 00 00 call r3
if ( _RBTree_Is_equal( compare_result ) ) {
80048e0: 5c 20 00 04 bne r1,r0,80048f0 <rtems_rbheap_free+0x70>
found = iter_node;
if ( the_rbtree->is_unique )
80048e4: 41 62 00 2c lbu r2,(r11+44)
80048e8: 5c 41 00 09 bne r2,r1,800490c <rtems_rbheap_free+0x8c> <== ALWAYS TAKEN
80048ec: b9 a0 60 00 mv r12,r13 <== NOT EXECUTED
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
80048f0: 68 21 00 00 cmpgi r1,r1,0
80048f4: 34 02 00 02 mvi r2,2
80048f8: fb ff f1 03 calli 8000d04 <__ashlsi3>
80048fc: b5 a1 68 00 add r13,r13,r1
8004900: 29 ad 00 04 lw r13,(r13+4)
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
8004904: 5d a0 ff f3 bne r13,r0,80048d0 <rtems_rbheap_free+0x50>
8004908: b9 80 68 00 mv r13,r12
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
800490c: 35 ac ff f8 addi r12,r13,-8
check_and_merge(free_chain, chunk_tree, chunk, pred);
} else {
sc = RTEMS_INCORRECT_STATE;
}
} else {
sc = RTEMS_INVALID_ID;
8004910: 34 01 00 04 mvi r1,4
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
8004914: 45 a0 00 21 be r13,r0,8004998 <rtems_rbheap_free+0x118>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
8004918: 29 a2 ff f8 lw r2,(r13+-8)
800491c: 34 01 00 00 mvi r1,0
8004920: 5c 40 00 03 bne r2,r0,800492c <rtems_rbheap_free+0xac>
add_to_chain(free_chain, b);
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
8004924: 29 81 00 04 lw r1,(r12+4)
8004928: 64 21 00 00 cmpei r1,r1,0
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
800492c: 18 22 00 01 xori r2,r1,0x1
check_and_merge(free_chain, chunk_tree, chunk, succ);
add_to_chain(free_chain, chunk);
check_and_merge(free_chain, chunk_tree, chunk, pred);
} else {
sc = RTEMS_INCORRECT_STATE;
8004930: 34 01 00 0e mvi r1,14
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
8004934: 5c 40 00 19 bne r2,r0,8004998 <rtems_rbheap_free+0x118>
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
8004938: 35 8e 00 08 addi r14,r12,8
800493c: b9 c0 08 00 mv r1,r14
8004940: f8 00 07 d0 calli 8006880 <_RBTree_Next_unprotected>
8004944: b8 20 78 00 mv r15,r1
8004948: 34 02 00 01 mvi r2,1
800494c: b9 c0 08 00 mv r1,r14
8004950: f8 00 07 cc calli 8006880 <_RBTree_Next_unprotected>
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
8004954: 35 6d 00 18 addi r13,r11,24
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
8004958: 34 24 ff f8 addi r4,r1,-8
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT);
rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT);
check_and_merge(free_chain, chunk_tree, chunk, succ);
800495c: b9 a0 10 00 mv r2,r13
8004960: b9 60 08 00 mv r1,r11
8004964: b9 80 18 00 mv r3,r12
8004968: fb ff fe f0 calli 8004528 <check_and_merge>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
800496c: 29 62 00 00 lw r2,(r11+0)
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
8004970: 59 8b 00 04 sw (r12+4),r11
before_node = after_node->next;
after_node->next = the_node;
8004974: 59 6c 00 00 sw (r11+0),r12
the_node->next = before_node;
8004978: 59 82 00 00 sw (r12+0),r2
before_node->previous = the_node;
800497c: 58 4c 00 04 sw (r2+4),r12
add_to_chain(free_chain, chunk);
check_and_merge(free_chain, chunk_tree, chunk, pred);
8004980: b9 60 08 00 mv r1,r11
8004984: b9 a0 10 00 mv r2,r13
8004988: b9 80 18 00 mv r3,r12
800498c: 35 e4 ff f8 addi r4,r15,-8
8004990: fb ff fe e6 calli 8004528 <check_and_merge>
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
8004994: 34 01 00 00 mvi r1,0
sc = RTEMS_INVALID_ID;
}
}
return sc;
}
8004998: 2b 9d 00 04 lw ra,(sp+4)
800499c: 2b 8b 00 18 lw r11,(sp+24)
80049a0: 2b 8c 00 14 lw r12,(sp+20)
80049a4: 2b 8d 00 10 lw r13,(sp+16)
80049a8: 2b 8e 00 0c lw r14,(sp+12)
80049ac: 2b 8f 00 08 lw r15,(sp+8)
80049b0: 37 9c 00 38 addi sp,sp,56
80049b4: c3 a0 00 00 ret
080045b8 <rtems_rbheap_initialize>:
uintptr_t area_size,
uintptr_t alignment,
rtems_rbheap_extend_descriptors extend_descriptors,
void *handler_arg
)
{
80045b8: 37 9c ff dc addi sp,sp,-36
80045bc: 5b 8b 00 24 sw (sp+36),r11
80045c0: 5b 8c 00 20 sw (sp+32),r12
80045c4: 5b 8d 00 1c sw (sp+28),r13
80045c8: 5b 8e 00 18 sw (sp+24),r14
80045cc: 5b 8f 00 14 sw (sp+20),r15
80045d0: 5b 90 00 10 sw (sp+16),r16
80045d4: 5b 91 00 0c sw (sp+12),r17
80045d8: 5b 92 00 08 sw (sp+8),r18
80045dc: 5b 9d 00 04 sw (sp+4),ra
}
} else {
sc = RTEMS_INVALID_ADDRESS;
}
} else {
sc = RTEMS_INVALID_NUMBER;
80045e0: 34 0f 00 0a mvi r15,10
uintptr_t area_size,
uintptr_t alignment,
rtems_rbheap_extend_descriptors extend_descriptors,
void *handler_arg
)
{
80045e4: b8 20 58 00 mv r11,r1
80045e8: b8 40 60 00 mv r12,r2
80045ec: b8 80 70 00 mv r14,r4
80045f0: b8 a0 88 00 mv r17,r5
80045f4: b8 c0 90 00 mv r18,r6
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (alignment > 0) {
80045f8: 44 80 00 3e be r4,r0,80046f0 <rtems_rbheap_initialize+0x138>
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
80045fc: b4 43 80 00 add r16,r2,r3
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
8004600: b8 40 08 00 mv r1,r2
8004604: b8 80 10 00 mv r2,r4
8004608: f8 00 3d 2a calli 8013ab0 <__umodsi3>
if (excess > 0) {
800460c: b9 80 68 00 mv r13,r12
8004610: 44 20 00 03 be r1,r0,800461c <rtems_rbheap_initialize+0x64>
value += alignment - excess;
8004614: b5 8e 68 00 add r13,r12,r14
8004618: c9 a1 68 00 sub r13,r13,r1
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
uintptr_t aligned_begin = align_up(alignment, begin);
uintptr_t aligned_end = align_down(alignment, end);
if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) {
800461c: f1 ac 08 00 cmpgeu r1,r13,r12
8004620: f6 0c 60 00 cmpgu r12,r16,r12
insert_into_tree(chunk_tree, first);
} else {
sc = RTEMS_NO_MEMORY;
}
} else {
sc = RTEMS_INVALID_ADDRESS;
8004624: 34 0f 00 09 mvi r15,9
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
uintptr_t aligned_begin = align_up(alignment, begin);
uintptr_t aligned_end = align_down(alignment, end);
if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) {
8004628: a0 2c 60 00 and r12,r1,r12
800462c: 45 80 00 31 be r12,r0,80046f0 <rtems_rbheap_initialize+0x138>
return value;
}
static uintptr_t align_down(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
8004630: ba 00 08 00 mv r1,r16
8004634: b9 c0 10 00 mv r2,r14
8004638: f8 00 3d 1e calli 8013ab0 <__umodsi3>
return value - excess;
800463c: ca 01 80 00 sub r16,r16,r1
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
uintptr_t aligned_begin = align_up(alignment, begin);
uintptr_t aligned_end = align_down(alignment, end);
if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) {
8004640: 51 b0 00 2c bgeu r13,r16,80046f0 <rtems_rbheap_initialize+0x138>
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 );
8004644: 35 61 00 04 addi r1,r11,4
{
the_rbtree->permanent_null = NULL;
the_rbtree->root = NULL;
the_rbtree->first[0] = NULL;
the_rbtree->first[1] = NULL;
the_rbtree->compare_function = compare_function;
8004648: 78 02 08 00 mvhi r2,0x800
800464c: 38 42 45 18 ori r2,r2,0x4518
head->next = tail;
8004650: 59 61 00 00 sw (r11+0),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
8004654: 35 6c 00 0c addi r12,r11,12
the_rbtree->is_unique = is_unique;
8004658: 34 01 00 01 mvi r1,1
Chain_Node *tail = _Chain_Tail( the_chain );
800465c: 35 6f 00 10 addi r15,r11,16
{
the_rbtree->permanent_null = NULL;
the_rbtree->root = NULL;
the_rbtree->first[0] = NULL;
the_rbtree->first[1] = NULL;
the_rbtree->compare_function = compare_function;
8004660: 59 62 00 28 sw (r11+40),r2
the_rbtree->is_unique = is_unique;
8004664: 31 61 00 2c sb (r11+44),r1
head->next = tail;
head->previous = NULL;
8004668: 59 60 00 04 sw (r11+4),r0
tail->previous = head;
800466c: 59 6b 00 08 sw (r11+8),r11
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8004670: 59 6f 00 0c sw (r11+12),r15
head->previous = NULL;
8004674: 59 60 00 10 sw (r11+16),r0
tail->previous = head;
8004678: 59 6c 00 14 sw (r11+20),r12
RBTree_Control *the_rbtree,
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
800467c: 59 60 00 18 sw (r11+24),r0
the_rbtree->root = NULL;
8004680: 59 60 00 1c sw (r11+28),r0
the_rbtree->first[0] = NULL;
8004684: 59 60 00 20 sw (r11+32),r0
the_rbtree->first[1] = NULL;
8004688: 59 60 00 24 sw (r11+36),r0
rtems_rbheap_chunk *first = NULL;
rtems_chain_initialize_empty(free_chain);
rtems_chain_initialize_empty(&control->spare_descriptor_chain);
rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true);
control->alignment = alignment;
800468c: 59 6e 00 30 sw (r11+48),r14
control->handler_arg = handler_arg;
8004690: 59 72 00 38 sw (r11+56),r18
control->extend_descriptors = extend_descriptors;
8004694: 59 71 00 34 sw (r11+52),r17
{
rtems_chain_control *chain = &control->spare_descriptor_chain;
rtems_chain_node *chunk = rtems_chain_get_unprotected(chain);
if (chunk == NULL) {
(*control->extend_descriptors)(control);
8004698: b9 60 08 00 mv r1,r11
800469c: da 20 00 00 call r17
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
80046a0: 29 62 00 0c lw r2,(r11+12)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
80046a4: 44 4f 00 12 be r2,r15,80046ec <rtems_rbheap_initialize+0x134>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
80046a8: 28 41 00 00 lw r1,(r2+0)
head->next = new_first;
80046ac: 59 61 00 0c sw (r11+12),r1
new_first->previous = head;
80046b0: 58 2c 00 04 sw (r1+4),r12
control->alignment = alignment;
control->handler_arg = handler_arg;
control->extend_descriptors = extend_descriptors;
first = get_chunk(control);
if (first != NULL) {
80046b4: 44 40 00 0e be r2,r0,80046ec <rtems_rbheap_initialize+0x134><== NEVER TAKEN
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
80046b8: 29 61 00 00 lw r1,(r11+0)
first->begin = aligned_begin;
first->size = aligned_end - aligned_begin;
80046bc: ca 0d 80 00 sub r16,r16,r13
control->handler_arg = handler_arg;
control->extend_descriptors = extend_descriptors;
first = get_chunk(control);
if (first != NULL) {
first->begin = aligned_begin;
80046c0: 58 4d 00 18 sw (r2+24),r13
first->size = aligned_end - aligned_begin;
80046c4: 58 50 00 1c sw (r2+28),r16
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
80046c8: 58 4b 00 04 sw (r2+4),r11
before_node = after_node->next;
after_node->next = the_node;
80046cc: 59 62 00 00 sw (r11+0),r2
the_node->next = before_node;
80046d0: 58 41 00 00 sw (r2+0),r1
before_node->previous = the_node;
80046d4: 58 22 00 04 sw (r1+4),r2
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
80046d8: 35 61 00 18 addi r1,r11,24
80046dc: 34 42 00 08 addi r2,r2,8
80046e0: f8 00 07 c3 calli 80065ec <_RBTree_Insert_unprotected>
uintptr_t alignment,
rtems_rbheap_extend_descriptors extend_descriptors,
void *handler_arg
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
80046e4: 34 0f 00 00 mvi r15,0
80046e8: e0 00 00 02 bi 80046f0 <rtems_rbheap_initialize+0x138>
first->begin = aligned_begin;
first->size = aligned_end - aligned_begin;
add_to_chain(free_chain, first);
insert_into_tree(chunk_tree, first);
} else {
sc = RTEMS_NO_MEMORY;
80046ec: 34 0f 00 1a mvi r15,26
} else {
sc = RTEMS_INVALID_NUMBER;
}
return sc;
}
80046f0: b9 e0 08 00 mv r1,r15
80046f4: 2b 9d 00 04 lw ra,(sp+4)
80046f8: 2b 8b 00 24 lw r11,(sp+36)
80046fc: 2b 8c 00 20 lw r12,(sp+32)
8004700: 2b 8d 00 1c lw r13,(sp+28)
8004704: 2b 8e 00 18 lw r14,(sp+24)
8004708: 2b 8f 00 14 lw r15,(sp+20)
800470c: 2b 90 00 10 lw r16,(sp+16)
8004710: 2b 91 00 0c lw r17,(sp+12)
8004714: 2b 92 00 08 lw r18,(sp+8)
8004718: 37 9c 00 24 addi sp,sp,36
800471c: c3 a0 00 00 ret
080141fc <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
80141fc: 37 9c ff f4 addi sp,sp,-12
8014200: 5b 8b 00 08 sw (sp+8),r11
8014204: 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;
8014208: 34 03 00 0a mvi r3,10
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
801420c: 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 )
8014210: 44 40 00 29 be r2,r0,80142b4 <rtems_signal_send+0xb8>
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
8014214: 37 82 00 0c addi r2,sp,12
8014218: f8 00 16 71 calli 8019bdc <_Thread_Get>
switch ( location ) {
801421c: 2b 82 00 0c lw r2,(sp+12)
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8014220: 34 03 00 04 mvi r3,4
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
switch ( location ) {
8014224: 5c 40 00 24 bne r2,r0,80142b4 <rtems_signal_send+0xb8>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
8014228: 28 23 01 18 lw r3,(r1+280)
asr = &api->Signal;
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
801422c: 28 64 00 0c lw r4,(r3+12)
8014230: 44 82 00 1f be r4,r2,80142ac <rtems_signal_send+0xb0>
if ( asr->is_enabled ) {
8014234: 40 62 00 08 lbu r2,(r3+8)
8014238: 44 40 00 12 be r2,r0,8014280 <rtems_signal_send+0x84>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
801423c: 90 00 10 00 rcsr r2,IE
8014240: 34 04 ff fe mvi r4,-2
8014244: a0 44 20 00 and r4,r2,r4
8014248: d0 04 00 00 wcsr IE,r4
*signal_set |= signals;
801424c: 28 64 00 14 lw r4,(r3+20)
8014250: b8 8b 58 00 or r11,r4,r11
8014254: 58 6b 00 14 sw (r3+20),r11
_ISR_Enable( _level );
8014258: 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 ) )
801425c: 78 02 08 04 mvhi r2,0x804
8014260: 38 42 01 e0 ori r2,r2,0x1e0
8014264: 28 43 00 08 lw r3,(r2+8)
8014268: 44 60 00 0e be r3,r0,80142a0 <rtems_signal_send+0xa4>
801426c: 28 43 00 10 lw r3,(r2+16)
8014270: 5c 23 00 0c bne r1,r3,80142a0 <rtems_signal_send+0xa4> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
8014274: 34 01 00 01 mvi r1,1
8014278: 30 41 00 0c sb (r2+12),r1
801427c: e0 00 00 09 bi 80142a0 <rtems_signal_send+0xa4>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
8014280: 90 00 08 00 rcsr r1,IE
8014284: 34 02 ff fe mvi r2,-2
8014288: a0 22 10 00 and r2,r1,r2
801428c: d0 02 00 00 wcsr IE,r2
*signal_set |= signals;
8014290: 28 62 00 18 lw r2,(r3+24)
8014294: b8 4b 58 00 or r11,r2,r11
8014298: 58 6b 00 18 sw (r3+24),r11
_ISR_Enable( _level );
801429c: d0 01 00 00 wcsr IE,r1
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
80142a0: f8 00 16 43 calli 8019bac <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
80142a4: 34 03 00 00 mvi r3,0
80142a8: e0 00 00 03 bi 80142b4 <rtems_signal_send+0xb8>
}
_Thread_Enable_dispatch();
80142ac: f8 00 16 40 calli 8019bac <_Thread_Enable_dispatch>
return RTEMS_NOT_DEFINED;
80142b0: 34 03 00 0b mvi r3,11
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
80142b4: b8 60 08 00 mv r1,r3
80142b8: 2b 9d 00 04 lw ra,(sp+4)
80142bc: 2b 8b 00 08 lw r11,(sp+8)
80142c0: 37 9c 00 0c addi sp,sp,12
80142c4: c3 a0 00 00 ret
0800eb90 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
800eb90: 37 9c ff e0 addi sp,sp,-32
800eb94: 5b 8b 00 20 sw (sp+32),r11
800eb98: 5b 8c 00 1c sw (sp+28),r12
800eb9c: 5b 8d 00 18 sw (sp+24),r13
800eba0: 5b 8e 00 14 sw (sp+20),r14
800eba4: 5b 8f 00 10 sw (sp+16),r15
800eba8: 5b 90 00 0c sw (sp+12),r16
800ebac: 5b 91 00 08 sw (sp+8),r17
800ebb0: 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;
800ebb4: 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
)
{
800ebb8: b8 20 68 00 mv r13,r1
800ebbc: b8 40 70 00 mv r14,r2
800ebc0: 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 )
800ebc4: 44 60 00 51 be r3,r0,800ed08 <rtems_task_mode+0x178>
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
800ebc8: 78 01 08 01 mvhi r1,0x801
800ebcc: 38 21 ae 00 ori r1,r1,0xae00
800ebd0: 28 2c 00 10 lw r12,(r1+16)
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
800ebd4: 41 8f 00 70 lbu r15,(r12+112)
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800ebd8: 29 81 00 78 lw r1,(r12+120)
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
800ebdc: 29 8b 01 18 lw r11,(r12+280)
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
800ebe0: 65 ef 00 00 cmpei r15,r15,0
800ebe4: c8 0f 78 00 sub r15,r0,r15
800ebe8: 21 ef 01 00 andi r15,r15,0x100
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800ebec: 44 20 00 02 be r1,r0,800ebf4 <rtems_task_mode+0x64>
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
800ebf0: 39 ef 02 00 ori r15,r15,0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
800ebf4: 41 71 00 08 lbu r17,(r11+8)
old_mode |= _ISR_Get_level();
800ebf8: fb ff e8 9f calli 8008e74 <_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;
800ebfc: 66 31 00 00 cmpei r17,r17,0
800ec00: c8 11 88 00 sub r17,r0,r17
800ec04: 22 31 04 00 andi r17,r17,0x400
800ec08: ba 21 08 00 or r1,r17,r1
old_mode |= _ISR_Get_level();
800ec0c: b8 2f 78 00 or r15,r1,r15
*previous_mode_set = old_mode;
800ec10: 5a 0f 00 00 sw (r16+0),r15
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
800ec14: 21 c1 01 00 andi r1,r14,0x100
800ec18: 44 20 00 04 be r1,r0,800ec28 <rtems_task_mode+0x98>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
800ec1c: 21 a1 01 00 andi r1,r13,0x100
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
800ec20: 64 21 00 00 cmpei r1,r1,0
800ec24: 31 81 00 70 sb (r12+112),r1
if ( mask & RTEMS_TIMESLICE_MASK ) {
800ec28: 21 c1 02 00 andi r1,r14,0x200
800ec2c: 44 20 00 0b be r1,r0,800ec58 <rtems_task_mode+0xc8>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
800ec30: 21 a1 02 00 andi r1,r13,0x200
if ( _Modes_Is_timeslice(mode_set) ) {
800ec34: 44 20 00 08 be r1,r0,800ec54 <rtems_task_mode+0xc4>
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
800ec38: 34 01 00 01 mvi r1,1
800ec3c: 59 81 00 78 sw (r12+120),r1
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
800ec40: 78 01 08 01 mvhi r1,0x801
800ec44: 38 21 a9 10 ori r1,r1,0xa910
800ec48: 28 21 00 00 lw r1,(r1+0)
800ec4c: 59 81 00 74 sw (r12+116),r1
800ec50: e0 00 00 02 bi 800ec58 <rtems_task_mode+0xc8>
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
800ec54: 59 80 00 78 sw (r12+120),r0
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
800ec58: 21 c1 00 01 andi r1,r14,0x1
800ec5c: 44 20 00 04 be r1,r0,800ec6c <rtems_task_mode+0xdc>
*/
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
Modes_Control mode_set
)
{
return ( mode_set & RTEMS_INTERRUPT_MASK );
800ec60: 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 ) );
800ec64: 64 21 00 00 cmpei r1,r1,0
800ec68: 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 ) {
800ec6c: 21 ce 04 00 andi r14,r14,0x400
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800ec70: 34 03 00 00 mvi r3,0
if ( mask & RTEMS_ASR_MASK ) {
800ec74: 45 c0 00 11 be r14,r0,800ecb8 <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;
800ec78: 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 ) {
800ec7c: 41 61 00 08 lbu r1,(r11+8)
#include <rtems/score/tod.h>
#include <rtems/score/wkspace.h>
#include <rtems/score/apiext.h>
#include <rtems/score/sysstate.h>
rtems_status_code rtems_task_mode(
800ec80: 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 ) {
800ec84: 44 2d 00 0d be r1,r13,800ecb8 <rtems_task_mode+0x128>
asr->is_enabled = is_asr_enabled;
800ec88: 31 6d 00 08 sb (r11+8),r13
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
800ec8c: 90 00 08 00 rcsr r1,IE
800ec90: 34 02 ff fe mvi r2,-2
800ec94: a0 22 10 00 and r2,r1,r2
800ec98: d0 02 00 00 wcsr IE,r2
_signals = information->signals_pending;
800ec9c: 29 62 00 18 lw r2,(r11+24)
information->signals_pending = information->signals_posted;
800eca0: 29 63 00 14 lw r3,(r11+20)
information->signals_posted = _signals;
800eca4: 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;
800eca8: 59 63 00 18 sw (r11+24),r3
information->signals_posted = _signals;
_ISR_Enable( _level );
800ecac: d0 01 00 00 wcsr IE,r1
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
800ecb0: 29 63 00 14 lw r3,(r11+20)
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800ecb4: 7c 63 00 00 cmpnei r3,r3,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
800ecb8: 78 01 08 01 mvhi r1,0x801
800ecbc: 38 21 ad f8 ori r1,r1,0xadf8
800ecc0: 28 22 00 00 lw r2,(r1+0)
800ecc4: 34 01 00 03 mvi r1,3
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
800ecc8: 34 04 00 00 mvi r4,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
800eccc: 5c 41 00 0f bne r2,r1,800ed08 <rtems_task_mode+0x178>
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
800ecd0: 78 01 08 01 mvhi r1,0x801
800ecd4: 38 21 ae 00 ori r1,r1,0xae00
800ecd8: 28 22 00 10 lw r2,(r1+16)
if ( are_signals_pending ||
800ecdc: 5c 60 00 05 bne r3,r0,800ecf0 <rtems_task_mode+0x160>
800ece0: 28 21 00 14 lw r1,(r1+20)
800ece4: 44 41 00 09 be r2,r1,800ed08 <rtems_task_mode+0x178>
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
800ece8: 40 41 00 70 lbu r1,(r2+112)
800ecec: 44 20 00 07 be r1,r0,800ed08 <rtems_task_mode+0x178> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
800ecf0: 78 01 08 01 mvhi r1,0x801
800ecf4: 38 21 ae 00 ori r1,r1,0xae00
800ecf8: 34 02 00 01 mvi r2,1
800ecfc: 30 22 00 0c sb (r1+12),r2
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
800ed00: f8 00 03 75 calli 800fad4 <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
800ed04: 34 04 00 00 mvi r4,0
}
800ed08: b8 80 08 00 mv r1,r4
800ed0c: 2b 9d 00 04 lw ra,(sp+4)
800ed10: 2b 8b 00 20 lw r11,(sp+32)
800ed14: 2b 8c 00 1c lw r12,(sp+28)
800ed18: 2b 8d 00 18 lw r13,(sp+24)
800ed1c: 2b 8e 00 14 lw r14,(sp+20)
800ed20: 2b 8f 00 10 lw r15,(sp+16)
800ed24: 2b 90 00 0c lw r16,(sp+12)
800ed28: 2b 91 00 08 lw r17,(sp+8)
800ed2c: 37 9c 00 20 addi sp,sp,32
800ed30: c3 a0 00 00 ret
08008e30 <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
8008e30: 37 9c ff f0 addi sp,sp,-16
8008e34: 5b 8b 00 0c sw (sp+12),r11
8008e38: 5b 8c 00 08 sw (sp+8),r12
8008e3c: 5b 9d 00 04 sw (sp+4),ra
8008e40: b8 40 58 00 mv r11,r2
8008e44: b8 60 60 00 mv r12,r3
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
8008e48: 44 40 00 06 be r2,r0,8008e60 <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 ) );
8008e4c: 78 02 08 01 mvhi r2,0x801
8008e50: 38 42 a0 d8 ori r2,r2,0xa0d8
8008e54: 40 43 00 00 lbu r3,(r2+0)
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
8008e58: 34 02 00 13 mvi r2,19
)
{
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
8008e5c: 55 63 00 16 bgu r11,r3,8008eb4 <rtems_task_set_priority+0x84>
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
return RTEMS_INVALID_ADDRESS;
8008e60: 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 )
8008e64: 45 80 00 14 be r12,r0,8008eb4 <rtems_task_set_priority+0x84>
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
8008e68: 37 82 00 10 addi r2,sp,16
8008e6c: f8 00 0b 4e calli 800bba4 <_Thread_Get>
switch ( location ) {
8008e70: 2b 82 00 10 lw r2,(sp+16)
8008e74: 5c 40 00 0f bne r2,r0,8008eb0 <rtems_task_set_priority+0x80>
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
8008e78: 28 23 00 14 lw r3,(r1+20)
8008e7c: 59 83 00 00 sw (r12+0),r3
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
8008e80: 45 62 00 09 be r11,r2,8008ea4 <rtems_task_set_priority+0x74>
the_thread->real_priority = new_priority;
if ( the_thread->resource_count == 0 ||
8008e84: 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;
8008e88: 58 2b 00 18 sw (r1+24),r11
if ( the_thread->resource_count == 0 ||
8008e8c: 44 40 00 03 be r2,r0,8008e98 <rtems_task_set_priority+0x68>
8008e90: 28 22 00 14 lw r2,(r1+20)
8008e94: 51 62 00 04 bgeu r11,r2,8008ea4 <rtems_task_set_priority+0x74><== ALWAYS TAKEN
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
8008e98: b9 60 10 00 mv r2,r11
8008e9c: 34 03 00 00 mvi r3,0
8008ea0: f8 00 09 e4 calli 800b630 <_Thread_Change_priority>
}
_Thread_Enable_dispatch();
8008ea4: f8 00 0b 34 calli 800bb74 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8008ea8: 34 02 00 00 mvi r2,0
8008eac: e0 00 00 02 bi 8008eb4 <rtems_task_set_priority+0x84>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8008eb0: 34 02 00 04 mvi r2,4
}
8008eb4: b8 40 08 00 mv r1,r2
8008eb8: 2b 9d 00 04 lw ra,(sp+4)
8008ebc: 2b 8b 00 0c lw r11,(sp+12)
8008ec0: 2b 8c 00 08 lw r12,(sp+8)
8008ec4: 37 9c 00 10 addi sp,sp,16
8008ec8: c3 a0 00 00 ret
08014db4 <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
8014db4: 37 9c ff f8 addi sp,sp,-8
8014db8: 5b 9d 00 04 sw (sp+4),ra
8014dbc: b8 20 10 00 mv r2,r1
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
_Objects_Get( &_Timer_Information, id, location );
8014dc0: 78 01 08 04 mvhi r1,0x804
8014dc4: 38 21 06 50 ori r1,r1,0x650
8014dc8: 37 83 00 08 addi r3,sp,8
8014dcc: f8 00 0f 08 calli 80189ec <_Objects_Get>
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
8014dd0: 2b 82 00 08 lw r2,(sp+8)
8014dd4: 5c 40 00 09 bne r2,r0,8014df8 <rtems_timer_cancel+0x44>
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
8014dd8: 28 23 00 38 lw r3,(r1+56)
8014ddc: 34 02 00 04 mvi r2,4
8014de0: 44 62 00 03 be r3,r2,8014dec <rtems_timer_cancel+0x38> <== NEVER TAKEN
(void) _Watchdog_Remove( &the_timer->Ticker );
8014de4: 34 21 00 10 addi r1,r1,16
8014de8: f8 00 18 21 calli 801ae6c <_Watchdog_Remove>
_Thread_Enable_dispatch();
8014dec: f8 00 13 70 calli 8019bac <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8014df0: 34 01 00 00 mvi r1,0
8014df4: e0 00 00 02 bi 8014dfc <rtems_timer_cancel+0x48>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8014df8: 34 01 00 04 mvi r1,4
}
8014dfc: 2b 9d 00 04 lw ra,(sp+4)
8014e00: 37 9c 00 08 addi sp,sp,8
8014e04: c3 a0 00 00 ret
08003ce4 <rtems_timer_fire_after>:
rtems_id id,
rtems_interval ticks,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
8003ce4: 37 9c ff e0 addi sp,sp,-32
8003ce8: 5b 8b 00 1c sw (sp+28),r11
8003cec: 5b 8c 00 18 sw (sp+24),r12
8003cf0: 5b 8d 00 14 sw (sp+20),r13
8003cf4: 5b 8e 00 10 sw (sp+16),r14
8003cf8: 5b 8f 00 0c sw (sp+12),r15
8003cfc: 5b 90 00 08 sw (sp+8),r16
8003d00: 5b 9d 00 04 sw (sp+4),ra
8003d04: b8 20 70 00 mv r14,r1
8003d08: b8 40 68 00 mv r13,r2
8003d0c: b8 60 78 00 mv r15,r3
8003d10: b8 80 80 00 mv r16,r4
Timer_Control *the_timer;
Objects_Locations location;
ISR_Level level;
if ( ticks == 0 )
return RTEMS_INVALID_NUMBER;
8003d14: 34 01 00 0a mvi r1,10
{
Timer_Control *the_timer;
Objects_Locations location;
ISR_Level level;
if ( ticks == 0 )
8003d18: 44 40 00 25 be r2,r0,8003dac <rtems_timer_fire_after+0xc8> <== NEVER TAKEN
return RTEMS_INVALID_NUMBER;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
8003d1c: 34 01 00 09 mvi r1,9
ISR_Level level;
if ( ticks == 0 )
return RTEMS_INVALID_NUMBER;
if ( !routine )
8003d20: 44 60 00 23 be r3,r0,8003dac <rtems_timer_fire_after+0xc8> <== NEVER TAKEN
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
_Objects_Get( &_Timer_Information, id, location );
8003d24: 78 01 08 02 mvhi r1,0x802
8003d28: 38 21 01 f0 ori r1,r1,0x1f0
8003d2c: b9 c0 10 00 mv r2,r14
8003d30: 37 83 00 20 addi r3,sp,32
8003d34: f8 00 05 d9 calli 8005498 <_Objects_Get>
8003d38: b8 20 58 00 mv r11,r1
return RTEMS_INVALID_ADDRESS;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
8003d3c: 2b 81 00 20 lw r1,(sp+32)
8003d40: 5c 20 00 1a bne r1,r0,8003da8 <rtems_timer_fire_after+0xc4><== NEVER TAKEN
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
8003d44: 35 6c 00 10 addi r12,r11,16
8003d48: b9 80 08 00 mv r1,r12
8003d4c: f8 00 0d c1 calli 8007450 <_Watchdog_Remove>
_ISR_Disable( level );
8003d50: 90 00 28 00 rcsr r5,IE
8003d54: 34 01 ff fe mvi r1,-2
8003d58: a0 a1 08 00 and r1,r5,r1
8003d5c: d0 01 00 00 wcsr IE,r1
/*
* Check to see if the watchdog has just been inserted by a
* higher priority interrupt. If so, abandon this insert.
*/
if ( the_timer->Ticker.state != WATCHDOG_INACTIVE ) {
8003d60: 29 61 00 18 lw r1,(r11+24)
8003d64: 44 20 00 03 be r1,r0,8003d70 <rtems_timer_fire_after+0x8c>
_ISR_Enable( level );
8003d68: d0 05 00 00 wcsr IE,r5
8003d6c: e0 00 00 0c bi 8003d9c <rtems_timer_fire_after+0xb8>
/*
* OK. Now we now the timer was not rescheduled by an interrupt
* so we can atomically initialize it as in use.
*/
the_timer->the_class = TIMER_INTERVAL;
8003d70: 59 60 00 38 sw (r11+56),r0
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8003d74: 59 61 00 18 sw (r11+24),r1
the_watchdog->routine = routine;
8003d78: 59 6f 00 2c sw (r11+44),r15
the_watchdog->id = id;
8003d7c: 59 6e 00 30 sw (r11+48),r14
the_watchdog->user_data = user_data;
8003d80: 59 70 00 34 sw (r11+52),r16
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
_ISR_Enable( level );
8003d84: d0 05 00 00 wcsr IE,r5
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003d88: 78 01 08 01 mvhi r1,0x801
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8003d8c: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003d90: 38 21 f9 b8 ori r1,r1,0xf9b8
8003d94: b9 80 10 00 mv r2,r12
8003d98: f8 00 0d 51 calli 80072dc <_Watchdog_Insert>
_Watchdog_Insert_ticks( &the_timer->Ticker, ticks );
_Thread_Enable_dispatch();
8003d9c: f8 00 09 9a calli 8006404 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8003da0: 34 01 00 00 mvi r1,0
8003da4: e0 00 00 02 bi 8003dac <rtems_timer_fire_after+0xc8>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8003da8: 34 01 00 04 mvi r1,4
}
8003dac: 2b 9d 00 04 lw ra,(sp+4)
8003db0: 2b 8b 00 1c lw r11,(sp+28)
8003db4: 2b 8c 00 18 lw r12,(sp+24)
8003db8: 2b 8d 00 14 lw r13,(sp+20)
8003dbc: 2b 8e 00 10 lw r14,(sp+16)
8003dc0: 2b 8f 00 0c lw r15,(sp+12)
8003dc4: 2b 90 00 08 lw r16,(sp+8)
8003dc8: 37 9c 00 20 addi sp,sp,32
8003dcc: c3 a0 00 00 ret
080153f8 <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
80153f8: 37 9c ff dc addi sp,sp,-36
80153fc: 5b 8b 00 20 sw (sp+32),r11
8015400: 5b 8c 00 1c sw (sp+28),r12
8015404: 5b 8d 00 18 sw (sp+24),r13
8015408: 5b 8e 00 14 sw (sp+20),r14
801540c: 5b 8f 00 10 sw (sp+16),r15
8015410: 5b 90 00 0c sw (sp+12),r16
8015414: 5b 91 00 08 sw (sp+8),r17
8015418: 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;
801541c: 78 05 08 04 mvhi r5,0x804
8015420: 38 a5 06 90 ori r5,r5,0x690
8015424: 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
)
{
8015428: b8 20 78 00 mv r15,r1
801542c: b8 40 70 00 mv r14,r2
8015430: b8 60 80 00 mv r16,r3
8015434: 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;
8015438: 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 )
801543c: 45 a0 00 38 be r13,r0,801551c <rtems_timer_server_fire_when+0x124>
return RTEMS_INCORRECT_STATE;
if ( !_TOD.is_set )
8015440: 78 0c 08 03 mvhi r12,0x803
8015444: 39 8c fc d0 ori r12,r12,0xfcd0
8015448: 41 81 00 14 lbu r1,(r12+20)
return RTEMS_NOT_DEFINED;
801544c: 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 )
8015450: 44 20 00 33 be r1,r0,801551c <rtems_timer_server_fire_when+0x124><== NEVER TAKEN
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
8015454: 34 0b 00 09 mvi r11,9
return RTEMS_INCORRECT_STATE;
if ( !_TOD.is_set )
return RTEMS_NOT_DEFINED;
if ( !routine )
8015458: 44 60 00 31 be r3,r0,801551c <rtems_timer_server_fire_when+0x124>
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
801545c: b8 40 08 00 mv r1,r2
8015460: fb ff f0 f6 calli 8011838 <_TOD_Validate>
return RTEMS_INVALID_CLOCK;
8015464: 34 0b 00 14 mvi r11,20
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
8015468: 44 20 00 2d be r1,r0,801551c <rtems_timer_server_fire_when+0x124>
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
801546c: b9 c0 08 00 mv r1,r14
8015470: fb ff f0 aa calli 8011718 <_TOD_To_seconds>
8015474: 78 05 08 03 mvhi r5,0x803
8015478: 38 a5 88 cc ori r5,r5,0x88cc
801547c: b8 20 70 00 mv r14,r1
8015480: 29 82 00 04 lw r2,(r12+4)
8015484: 29 81 00 00 lw r1,(r12+0)
8015488: 28 a4 00 00 lw r4,(r5+0)
801548c: 34 03 00 00 mvi r3,0
8015490: f8 00 56 a9 calli 802af34 <__divdi3>
if ( seconds <= _TOD_Seconds_since_epoch() )
8015494: 50 4e 00 22 bgeu r2,r14,801551c <rtems_timer_server_fire_when+0x124>
8015498: 78 01 08 04 mvhi r1,0x804
801549c: 38 21 06 50 ori r1,r1,0x650
80154a0: b9 e0 10 00 mv r2,r15
80154a4: 37 83 00 24 addi r3,sp,36
80154a8: f8 00 0d 51 calli 80189ec <_Objects_Get>
80154ac: b8 20 58 00 mv r11,r1
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
80154b0: 2b 81 00 24 lw r1,(sp+36)
80154b4: 5c 20 00 19 bne r1,r0,8015518 <rtems_timer_server_fire_when+0x120>
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
80154b8: 35 61 00 10 addi r1,r11,16
80154bc: f8 00 16 6c calli 801ae6c <_Watchdog_Remove>
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
80154c0: 34 01 00 03 mvi r1,3
80154c4: 78 05 08 03 mvhi r5,0x803
80154c8: 59 61 00 38 sw (r11+56),r1
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
80154cc: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
80154d0: 59 70 00 2c sw (r11+44),r16
the_watchdog->id = id;
80154d4: 59 6f 00 30 sw (r11+48),r15
the_watchdog->user_data = user_data;
80154d8: 59 71 00 34 sw (r11+52),r17
80154dc: 38 a5 88 cc ori r5,r5,0x88cc
80154e0: 29 81 00 00 lw r1,(r12+0)
80154e4: 29 82 00 04 lw r2,(r12+4)
80154e8: 28 a4 00 00 lw r4,(r5+0)
80154ec: 34 03 00 00 mvi r3,0
80154f0: f8 00 56 91 calli 802af34 <__divdi3>
_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 );
80154f4: 29 a3 00 04 lw r3,(r13+4)
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();
80154f8: c9 c2 10 00 sub r2,r14,r2
80154fc: 59 62 00 1c sw (r11+28),r2
(*timer_server->schedule_operation)( timer_server, the_timer );
8015500: b9 a0 08 00 mv r1,r13
8015504: b9 60 10 00 mv r2,r11
8015508: d8 60 00 00 call r3
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
801550c: 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();
8015510: f8 00 11 a7 calli 8019bac <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8015514: e0 00 00 02 bi 801551c <rtems_timer_server_fire_when+0x124>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8015518: 34 0b 00 04 mvi r11,4
}
801551c: b9 60 08 00 mv r1,r11
8015520: 2b 9d 00 04 lw ra,(sp+4)
8015524: 2b 8b 00 20 lw r11,(sp+32)
8015528: 2b 8c 00 1c lw r12,(sp+28)
801552c: 2b 8d 00 18 lw r13,(sp+24)
8015530: 2b 8e 00 14 lw r14,(sp+20)
8015534: 2b 8f 00 10 lw r15,(sp+16)
8015538: 2b 90 00 0c lw r16,(sp+12)
801553c: 2b 91 00 08 lw r17,(sp+8)
8015540: 37 9c 00 24 addi sp,sp,36
8015544: c3 a0 00 00 ret
080041dc <sched_get_priority_max>:
#include <rtems/posix/priority.h>
int sched_get_priority_max(
int policy
)
{
80041dc: 37 9c ff fc addi sp,sp,-4
80041e0: 5b 9d 00 04 sw (sp+4),ra
switch ( policy ) {
80041e4: 48 01 00 05 bg r0,r1,80041f8 <sched_get_priority_max+0x1c>
80041e8: 34 02 00 02 mvi r2,2
80041ec: 4c 41 00 08 bge r2,r1,800420c <sched_get_priority_max+0x30>
80041f0: 34 02 00 04 mvi r2,4
80041f4: 44 22 00 06 be r1,r2,800420c <sched_get_priority_max+0x30> <== ALWAYS TAKEN
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
80041f8: f8 00 24 1a calli 800d260 <__errno>
80041fc: 34 02 00 16 mvi r2,22
8004200: 58 22 00 00 sw (r1+0),r2
8004204: 34 01 ff ff mvi r1,-1
8004208: e0 00 00 05 bi 800421c <sched_get_priority_max+0x40>
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
800420c: 78 01 08 02 mvhi r1,0x802
8004210: 38 21 00 fc ori r1,r1,0xfc
8004214: 40 21 00 00 lbu r1,(r1+0)
8004218: 34 21 ff ff addi r1,r1,-1
}
800421c: 2b 9d 00 04 lw ra,(sp+4)
8004220: 37 9c 00 04 addi sp,sp,4
8004224: c3 a0 00 00 ret
08004228 <sched_get_priority_min>:
* 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
*/
int sched_get_priority_min(
int policy
)
{
8004228: 37 9c ff fc addi sp,sp,-4
800422c: 5b 9d 00 04 sw (sp+4),ra
switch ( policy ) {
8004230: 48 01 00 05 bg r0,r1,8004244 <sched_get_priority_min+0x1c>
8004234: 34 02 00 02 mvi r2,2
8004238: 4c 41 00 08 bge r2,r1,8004258 <sched_get_priority_min+0x30><== ALWAYS TAKEN
800423c: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
8004240: 44 22 00 06 be r1,r2,8004258 <sched_get_priority_min+0x30> <== NOT EXECUTED
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
8004244: f8 00 24 07 calli 800d260 <__errno>
8004248: 34 02 00 16 mvi r2,22
800424c: 58 22 00 00 sw (r1+0),r2
8004250: 34 01 ff ff mvi r1,-1
8004254: e0 00 00 02 bi 800425c <sched_get_priority_min+0x34>
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
8004258: 34 01 00 01 mvi r1,1
}
800425c: 2b 9d 00 04 lw ra,(sp+4)
8004260: 37 9c 00 04 addi sp,sp,4
8004264: c3 a0 00 00 ret
08004268 <sched_rr_get_interval>:
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
)
{
8004268: 37 9c ff f4 addi sp,sp,-12
800426c: 5b 8b 00 08 sw (sp+8),r11
8004270: 5b 9d 00 04 sw (sp+4),ra
8004274: b8 20 58 00 mv r11,r1
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid && pid != getpid() )
8004278: 44 20 00 08 be r1,r0,8004298 <sched_rr_get_interval+0x30> <== NEVER TAKEN
800427c: 5b 82 00 0c sw (sp+12),r2
8004280: fb ff f5 c6 calli 8001998 <getpid>
8004284: 2b 82 00 0c lw r2,(sp+12)
8004288: 45 61 00 04 be r11,r1,8004298 <sched_rr_get_interval+0x30>
rtems_set_errno_and_return_minus_one( ESRCH );
800428c: f8 00 23 f5 calli 800d260 <__errno>
8004290: 34 02 00 03 mvi r2,3
8004294: e0 00 00 04 bi 80042a4 <sched_rr_get_interval+0x3c>
if ( !interval )
8004298: 5c 40 00 06 bne r2,r0,80042b0 <sched_rr_get_interval+0x48>
rtems_set_errno_and_return_minus_one( EINVAL );
800429c: f8 00 23 f1 calli 800d260 <__errno>
80042a0: 34 02 00 16 mvi r2,22
80042a4: 58 22 00 00 sw (r1+0),r2
80042a8: 34 01 ff ff mvi r1,-1
80042ac: e0 00 00 06 bi 80042c4 <sched_rr_get_interval+0x5c>
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
80042b0: 78 01 08 02 mvhi r1,0x802
80042b4: 38 21 08 80 ori r1,r1,0x880
80042b8: 28 21 00 00 lw r1,(r1+0)
80042bc: f8 00 0e ee calli 8007e74 <_Timespec_From_ticks>
return 0;
80042c0: 34 01 00 00 mvi r1,0
}
80042c4: 2b 9d 00 04 lw ra,(sp+4)
80042c8: 2b 8b 00 08 lw r11,(sp+8)
80042cc: 37 9c 00 0c addi sp,sp,12
80042d0: c3 a0 00 00 ret
08004d0c <sem_open>:
int oflag,
...
/* mode_t mode, */
/* unsigned int value */
)
{
8004d0c: 37 9c ff b8 addi sp,sp,-72
8004d10: 5b 8b 00 1c sw (sp+28),r11
8004d14: 5b 8c 00 18 sw (sp+24),r12
8004d18: 5b 8d 00 14 sw (sp+20),r13
8004d1c: 5b 8e 00 10 sw (sp+16),r14
8004d20: 5b 8f 00 0c sw (sp+12),r15
8004d24: 5b 90 00 08 sw (sp+8),r16
8004d28: 5b 9d 00 04 sw (sp+4),ra
8004d2c: 5b 83 00 34 sw (sp+52),r3
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8004d30: 78 03 08 02 mvhi r3,0x802
8004d34: 5b 82 00 30 sw (sp+48),r2
8004d38: 5b 84 00 38 sw (sp+56),r4
8004d3c: 5b 85 00 3c sw (sp+60),r5
8004d40: 5b 86 00 40 sw (sp+64),r6
8004d44: 5b 87 00 44 sw (sp+68),r7
8004d48: 5b 88 00 48 sw (sp+72),r8
8004d4c: 38 63 43 28 ori r3,r3,0x4328
8004d50: b8 20 70 00 mv r14,r1
8004d54: 28 61 00 00 lw r1,(r3+0)
8004d58: b8 40 78 00 mv r15,r2
++level;
8004d5c: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
8004d60: 58 61 00 00 sw (r3+0),r1
Objects_Locations location;
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
8004d64: 20 50 02 00 andi r16,r2,0x200
/* unsigned int value */
)
{
va_list arg;
mode_t mode;
unsigned int value = 0;
8004d68: 34 0d 00 00 mvi r13,0
Objects_Locations location;
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
8004d6c: 46 00 00 02 be r16,r0,8004d74 <sem_open+0x68>
va_start(arg, oflag);
mode = va_arg( arg, mode_t );
value = va_arg( arg, unsigned int );
8004d70: 2b 8d 00 38 lw r13,(sp+56)
const char *name,
Objects_Id *id,
size_t *len
)
{
return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len );
8004d74: 78 0b 08 02 mvhi r11,0x802
8004d78: 39 6b 45 64 ori r11,r11,0x4564
8004d7c: b9 60 08 00 mv r1,r11
8004d80: b9 c0 10 00 mv r2,r14
8004d84: 37 83 00 2c addi r3,sp,44
8004d88: 37 84 00 20 addi r4,sp,32
8004d8c: fb ff fe 09 calli 80045b0 <_POSIX_Name_to_id>
8004d90: b8 20 60 00 mv r12,r1
* and we can just return a pointer to the id. Otherwise we may
* need to check to see if this is a "semaphore does not exist"
* or some other miscellaneous error on the name.
*/
if ( status ) {
8004d94: 44 20 00 08 be r1,r0,8004db4 <sem_open+0xa8>
/*
* Unless provided a valid name that did not already exist
* and we are willing to create then it is an error.
*/
if ( !( status == ENOENT && (oflag & O_CREAT) ) ) {
8004d98: 34 01 00 02 mvi r1,2
8004d9c: 5d 81 00 02 bne r12,r1,8004da4 <sem_open+0x98>
8004da0: 5e 00 00 19 bne r16,r0,8004e04 <sem_open+0xf8>
_Thread_Enable_dispatch();
8004da4: f8 00 0e 6c calli 8008754 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
8004da8: f8 00 28 4e calli 800eee0 <__errno>
8004dac: 58 2c 00 00 sw (r1+0),r12
8004db0: e0 00 00 08 bi 8004dd0 <sem_open+0xc4>
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
8004db4: 21 ef 0a 00 andi r15,r15,0xa00
8004db8: 34 01 0a 00 mvi r1,2560
8004dbc: 5d e1 00 07 bne r15,r1,8004dd8 <sem_open+0xcc>
_Thread_Enable_dispatch();
8004dc0: f8 00 0e 65 calli 8008754 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
8004dc4: f8 00 28 47 calli 800eee0 <__errno>
8004dc8: 34 02 00 11 mvi r2,17
8004dcc: 58 22 00 00 sw (r1+0),r2
8004dd0: 34 01 ff ff mvi r1,-1
8004dd4: e0 00 00 18 bi 8004e34 <sem_open+0x128>
sem_t *id,
Objects_Locations *location
)
{
return (POSIX_Semaphore_Control *)
_Objects_Get( &_POSIX_Semaphore_Information, (Objects_Id)*id, location );
8004dd8: 2b 82 00 2c lw r2,(sp+44)
8004ddc: 37 83 00 24 addi r3,sp,36
8004de0: b9 60 08 00 mv r1,r11
8004de4: f8 00 0a 48 calli 8007704 <_Objects_Get>
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
the_semaphore->open_count += 1;
8004de8: 28 22 00 18 lw r2,(r1+24)
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
8004dec: 5b 81 00 28 sw (sp+40),r1
the_semaphore->open_count += 1;
8004df0: 34 42 00 01 addi r2,r2,1
8004df4: 58 22 00 18 sw (r1+24),r2
_Thread_Enable_dispatch();
8004df8: f8 00 0e 57 calli 8008754 <_Thread_Enable_dispatch>
_Thread_Enable_dispatch();
8004dfc: f8 00 0e 56 calli 8008754 <_Thread_Enable_dispatch>
goto return_id;
8004e00: e0 00 00 0b bi 8004e2c <sem_open+0x120>
/*
* At this point, the semaphore does not exist and everything has been
* checked. We should go ahead and create a semaphore.
*/
status =_POSIX_Semaphore_Create_support(
8004e04: 2b 82 00 20 lw r2,(sp+32)
8004e08: 34 03 00 00 mvi r3,0
8004e0c: b9 a0 20 00 mv r4,r13
8004e10: 37 85 00 28 addi r5,sp,40
8004e14: b9 c0 08 00 mv r1,r14
8004e18: f8 00 1c 35 calli 800beec <_POSIX_Semaphore_Create_support>
8004e1c: b8 20 58 00 mv r11,r1
/*
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
8004e20: f8 00 0e 4d calli 8008754 <_Thread_Enable_dispatch>
if ( status == -1 )
return SEM_FAILED;
8004e24: 34 01 ff ff mvi r1,-1
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
if ( status == -1 )
8004e28: 45 61 00 03 be r11,r1,8004e34 <sem_open+0x128> <== NEVER TAKEN
return_id:
#if defined(RTEMS_USE_16_BIT_OBJECT)
the_semaphore->Semaphore_id = the_semaphore->Object.id;
return &the_semaphore->Semaphore_id;
#else
return (sem_t *)&the_semaphore->Object.id;
8004e2c: 2b 81 00 28 lw r1,(sp+40)
8004e30: 34 21 00 08 addi r1,r1,8
#endif
}
8004e34: 2b 9d 00 04 lw ra,(sp+4)
8004e38: 2b 8b 00 1c lw r11,(sp+28)
8004e3c: 2b 8c 00 18 lw r12,(sp+24)
8004e40: 2b 8d 00 14 lw r13,(sp+20)
8004e44: 2b 8e 00 10 lw r14,(sp+16)
8004e48: 2b 8f 00 0c lw r15,(sp+12)
8004e4c: 2b 90 00 08 lw r16,(sp+8)
8004e50: 37 9c 00 48 addi sp,sp,72
8004e54: c3 a0 00 00 ret
08004140 <sigaction>:
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
8004140: 37 9c ff ec addi sp,sp,-20
8004144: 5b 8b 00 14 sw (sp+20),r11
8004148: 5b 8c 00 10 sw (sp+16),r12
800414c: 5b 8d 00 0c sw (sp+12),r13
8004150: 5b 8e 00 08 sw (sp+8),r14
8004154: 5b 9d 00 04 sw (sp+4),ra
8004158: b8 20 58 00 mv r11,r1
800415c: b8 40 60 00 mv r12,r2
8004160: b8 60 68 00 mv r13,r3
ISR_Level level;
if ( oact )
8004164: 44 60 00 0f be r3,r0,80041a0 <sigaction+0x60>
*oact = _POSIX_signals_Vectors[ sig ];
8004168: 34 02 00 01 mvi r2,1
800416c: f8 00 46 0b calli 8015998 <__ashlsi3>
8004170: 34 02 00 02 mvi r2,2
8004174: 78 0e 08 01 mvhi r14,0x801
8004178: b4 2b 08 00 add r1,r1,r11
800417c: f8 00 46 07 calli 8015998 <__ashlsi3>
8004180: 39 ce 8e 48 ori r14,r14,0x8e48
8004184: b5 c1 08 00 add r1,r14,r1
8004188: 28 23 00 00 lw r3,(r1+0)
800418c: 28 22 00 04 lw r2,(r1+4)
8004190: 28 21 00 08 lw r1,(r1+8)
8004194: 59 a3 00 00 sw (r13+0),r3
8004198: 59 a2 00 04 sw (r13+4),r2
800419c: 59 a1 00 08 sw (r13+8),r1
if ( !sig )
80041a0: 45 60 00 07 be r11,r0,80041bc <sigaction+0x7c>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
80041a4: 35 61 ff ff addi r1,r11,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
80041a8: 34 02 00 1f mvi r2,31
80041ac: 50 41 00 02 bgeu r2,r1,80041b4 <sigaction+0x74>
80041b0: e0 00 00 03 bi 80041bc <sigaction+0x7c>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
80041b4: 34 01 00 09 mvi r1,9
80041b8: 5d 61 00 06 bne r11,r1,80041d0 <sigaction+0x90>
rtems_set_errno_and_return_minus_one( EINVAL );
80041bc: f8 00 25 80 calli 800d7bc <__errno>
80041c0: 34 02 00 16 mvi r2,22
80041c4: 58 22 00 00 sw (r1+0),r2
80041c8: 34 01 ff ff mvi r1,-1
80041cc: e0 00 00 31 bi 8004290 <sigaction+0x150>
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
80041d0: 34 01 00 00 mvi r1,0
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
80041d4: 45 80 00 2f be r12,r0,8004290 <sigaction+0x150> <== NEVER TAKEN
/*
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
80041d8: 90 00 70 00 rcsr r14,IE
80041dc: 34 01 ff fe mvi r1,-2
80041e0: a1 c1 08 00 and r1,r14,r1
80041e4: d0 01 00 00 wcsr IE,r1
if ( act->sa_handler == SIG_DFL ) {
80041e8: 29 81 00 08 lw r1,(r12+8)
80041ec: 78 0d 08 01 mvhi r13,0x801
80041f0: 39 ad 8e 48 ori r13,r13,0x8e48
80041f4: 5c 20 00 16 bne r1,r0,800424c <sigaction+0x10c>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
80041f8: b9 60 08 00 mv r1,r11
80041fc: 34 02 00 01 mvi r2,1
8004200: f8 00 45 e6 calli 8015998 <__ashlsi3>
8004204: b4 2b 58 00 add r11,r1,r11
8004208: 34 02 00 02 mvi r2,2
800420c: b9 60 08 00 mv r1,r11
8004210: f8 00 45 e2 calli 8015998 <__ashlsi3>
8004214: b5 a1 68 00 add r13,r13,r1
8004218: 34 02 00 02 mvi r2,2
800421c: 78 0c 08 01 mvhi r12,0x801
8004220: b9 60 08 00 mv r1,r11
8004224: f8 00 45 dd calli 8015998 <__ashlsi3>
8004228: 39 8c 73 58 ori r12,r12,0x7358
800422c: b5 81 08 00 add r1,r12,r1
8004230: 28 23 00 00 lw r3,(r1+0)
8004234: 28 22 00 04 lw r2,(r1+4)
8004238: 28 21 00 08 lw r1,(r1+8)
800423c: 59 a3 00 00 sw (r13+0),r3
8004240: 59 a2 00 04 sw (r13+4),r2
8004244: 59 a1 00 08 sw (r13+8),r1
8004248: e0 00 00 10 bi 8004288 <sigaction+0x148>
} else {
_POSIX_signals_Clear_process_signals( sig );
800424c: b9 60 08 00 mv r1,r11
8004250: f8 00 17 b9 calli 800a134 <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
8004254: 34 02 00 01 mvi r2,1
8004258: b9 60 08 00 mv r1,r11
800425c: f8 00 45 cf calli 8015998 <__ashlsi3>
8004260: 34 02 00 02 mvi r2,2
8004264: b4 2b 08 00 add r1,r1,r11
8004268: f8 00 45 cc calli 8015998 <__ashlsi3>
800426c: 29 83 00 00 lw r3,(r12+0)
8004270: 29 82 00 04 lw r2,(r12+4)
8004274: 29 84 00 08 lw r4,(r12+8)
8004278: b5 a1 08 00 add r1,r13,r1
800427c: 58 23 00 00 sw (r1+0),r3
8004280: 58 22 00 04 sw (r1+4),r2
8004284: 58 24 00 08 sw (r1+8),r4
}
_ISR_Enable( level );
8004288: d0 0e 00 00 wcsr IE,r14
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
800428c: 34 01 00 00 mvi r1,0
}
8004290: 2b 9d 00 04 lw ra,(sp+4)
8004294: 2b 8b 00 14 lw r11,(sp+20)
8004298: 2b 8c 00 10 lw r12,(sp+16)
800429c: 2b 8d 00 0c lw r13,(sp+12)
80042a0: 2b 8e 00 08 lw r14,(sp+8)
80042a4: 37 9c 00 14 addi sp,sp,20
80042a8: c3 a0 00 00 ret
080047b8 <sigtimedwait>:
int sigtimedwait(
const sigset_t *set,
siginfo_t *info,
const struct timespec *timeout
)
{
80047b8: 37 9c ff dc addi sp,sp,-36
80047bc: 5b 8b 00 18 sw (sp+24),r11
80047c0: 5b 8c 00 14 sw (sp+20),r12
80047c4: 5b 8d 00 10 sw (sp+16),r13
80047c8: 5b 8e 00 0c sw (sp+12),r14
80047cc: 5b 8f 00 08 sw (sp+8),r15
80047d0: 5b 9d 00 04 sw (sp+4),ra
80047d4: b8 20 68 00 mv r13,r1
80047d8: b8 40 58 00 mv r11,r2
80047dc: b8 60 60 00 mv r12,r3
ISR_Level level;
/*
* Error check parameters before disabling interrupts.
*/
if ( !set )
80047e0: 44 20 00 09 be r1,r0,8004804 <sigtimedwait+0x4c>
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
if ( timeout ) {
80047e4: 44 60 00 0b be r3,r0,8004810 <sigtimedwait+0x58>
if ( !_Timespec_Is_valid( timeout ) )
80047e8: b8 60 08 00 mv r1,r3
80047ec: f8 00 0f 47 calli 8008508 <_Timespec_Is_valid>
80047f0: 44 20 00 05 be r1,r0,8004804 <sigtimedwait+0x4c>
rtems_set_errno_and_return_minus_one( EINVAL );
interval = _Timespec_To_ticks( timeout );
80047f4: b9 80 08 00 mv r1,r12
80047f8: f8 00 0f 50 calli 8008538 <_Timespec_To_ticks>
80047fc: b8 20 10 00 mv r2,r1
if ( !interval )
8004800: 5c 20 00 05 bne r1,r0,8004814 <sigtimedwait+0x5c> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
8004804: f8 00 25 bd calli 800def8 <__errno>
8004808: 34 02 00 16 mvi r2,22
800480c: e0 00 00 61 bi 8004990 <sigtimedwait+0x1d8>
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
8004810: 34 02 00 00 mvi r2,0
/*
* Initialize local variables.
*/
the_info = ( info ) ? info : &signal_information;
8004814: 5d 60 00 02 bne r11,r0,800481c <sigtimedwait+0x64>
8004818: 37 8b 00 1c addi r11,sp,28
the_thread = _Thread_Executing;
800481c: 78 01 08 01 mvhi r1,0x801
8004820: 38 21 9d c0 ori r1,r1,0x9dc0
8004824: 28 23 00 10 lw r3,(r1+16)
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8004828: 28 6e 01 1c lw r14,(r3+284)
* What if they are already pending?
*/
/* API signals pending? */
_ISR_Disable( level );
800482c: 90 00 78 00 rcsr r15,IE
8004830: 34 01 ff fe mvi r1,-2
8004834: a1 e1 08 00 and r1,r15,r1
8004838: d0 01 00 00 wcsr IE,r1
if ( *set & api->signals_pending ) {
800483c: 29 a5 00 00 lw r5,(r13+0)
8004840: 29 c1 00 d4 lw r1,(r14+212)
8004844: a0 a1 20 00 and r4,r5,r1
8004848: 44 80 00 0f be r4,r0,8004884 <sigtimedwait+0xcc>
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending );
800484c: fb ff ff bc calli 800473c <_POSIX_signals_Get_lowest>
8004850: b8 20 10 00 mv r2,r1
8004854: 59 61 00 00 sw (r11+0),r1
_POSIX_signals_Clear_signals(
8004858: b9 60 18 00 mv r3,r11
800485c: b9 c0 08 00 mv r1,r14
8004860: 34 04 00 00 mvi r4,0
8004864: 34 05 00 00 mvi r5,0
8004868: f8 00 18 fa calli 800ac50 <_POSIX_signals_Clear_signals>
the_info->si_signo,
the_info,
false,
false
);
_ISR_Enable( level );
800486c: d0 0f 00 00 wcsr IE,r15
the_info->si_code = SI_USER;
8004870: 34 01 00 01 mvi r1,1
8004874: 59 61 00 04 sw (r11+4),r1
the_info->si_value.sival_int = 0;
8004878: 59 60 00 08 sw (r11+8),r0
return the_info->si_signo;
800487c: 29 6c 00 00 lw r12,(r11+0)
8004880: e0 00 00 46 bi 8004998 <sigtimedwait+0x1e0>
}
/* Process pending signals? */
if ( *set & _POSIX_signals_Pending ) {
8004884: 78 01 08 01 mvhi r1,0x801
8004888: 38 21 a0 3c ori r1,r1,0xa03c
800488c: 28 21 00 00 lw r1,(r1+0)
8004890: a0 a1 28 00 and r5,r5,r1
8004894: 44 a4 00 0f be r5,r4,80048d0 <sigtimedwait+0x118>
signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending );
8004898: fb ff ff a9 calli 800473c <_POSIX_signals_Get_lowest>
800489c: b8 20 60 00 mv r12,r1
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
80048a0: b9 80 10 00 mv r2,r12
80048a4: b9 c0 08 00 mv r1,r14
80048a8: b9 60 18 00 mv r3,r11
80048ac: 34 04 00 01 mvi r4,1
80048b0: 34 05 00 00 mvi r5,0
80048b4: f8 00 18 e7 calli 800ac50 <_POSIX_signals_Clear_signals>
_ISR_Enable( level );
80048b8: d0 0f 00 00 wcsr IE,r15
the_info->si_signo = signo;
the_info->si_code = SI_USER;
80048bc: 34 01 00 01 mvi r1,1
if ( *set & _POSIX_signals_Pending ) {
signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending );
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
_ISR_Enable( level );
the_info->si_signo = signo;
80048c0: 59 6c 00 00 sw (r11+0),r12
the_info->si_code = SI_USER;
80048c4: 59 61 00 04 sw (r11+4),r1
the_info->si_value.sival_int = 0;
80048c8: 59 60 00 08 sw (r11+8),r0
return signo;
80048cc: e0 00 00 33 bi 8004998 <sigtimedwait+0x1e0>
}
the_info->si_signo = -1;
80048d0: 34 01 ff ff mvi r1,-1
80048d4: 59 61 00 00 sw (r11+0),r1
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
80048d8: 78 01 08 01 mvhi r1,0x801
80048dc: 38 21 99 38 ori r1,r1,0x9938
80048e0: 28 24 00 00 lw r4,(r1+0)
++level;
80048e4: 34 84 00 01 addi r4,r4,1
_Thread_Dispatch_disable_level = level;
80048e8: 58 24 00 00 sw (r1+0),r4
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
the_thread->Wait.return_code = EINTR;
80048ec: 34 04 00 04 mvi r4,4
80048f0: 58 64 00 34 sw (r3+52),r4
the_thread->Wait.option = *set;
80048f4: 29 a4 00 00 lw r4,(r13+0)
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
80048f8: 78 01 08 01 mvhi r1,0x801
80048fc: 38 21 9f d4 ori r1,r1,0x9fd4
the_thread->Wait.return_code = EINTR;
the_thread->Wait.option = *set;
8004900: 58 64 00 30 sw (r3+48),r4
the_thread->Wait.return_argument = the_info;
8004904: 58 6b 00 28 sw (r3+40),r11
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
8004908: 58 61 00 44 sw (r3+68),r1
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
800490c: 34 03 00 01 mvi r3,1
8004910: 58 23 00 30 sw (r1+48),r3
the_thread->Wait.return_code = EINTR;
the_thread->Wait.option = *set;
the_thread->Wait.return_argument = the_info;
_Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue );
_ISR_Enable( level );
8004914: d0 0f 00 00 wcsr IE,r15
_Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval );
8004918: 78 01 08 01 mvhi r1,0x801
800491c: 78 03 08 00 mvhi r3,0x800
8004920: 38 21 9f d4 ori r1,r1,0x9fd4
8004924: 38 63 82 bc ori r3,r3,0x82bc
8004928: f8 00 0d 3f calli 8007e24 <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
800492c: f8 00 0b cb calli 8007858 <_Thread_Enable_dispatch>
/*
* When the thread is set free by a signal, it is need to eliminate
* the signal.
*/
_POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false );
8004930: 29 62 00 00 lw r2,(r11+0)
8004934: b9 c0 08 00 mv r1,r14
8004938: b9 60 18 00 mv r3,r11
800493c: 34 04 00 00 mvi r4,0
8004940: 34 05 00 00 mvi r5,0
8004944: f8 00 18 c3 calli 800ac50 <_POSIX_signals_Clear_signals>
/* Set errno only if return code is not EINTR or
* if EINTR was caused by a signal being caught, which
* was not in our set.
*/
if ( (_Thread_Executing->Wait.return_code != EINTR)
8004948: 78 01 08 01 mvhi r1,0x801
800494c: 38 21 9d c0 ori r1,r1,0x9dc0
8004950: 28 21 00 10 lw r1,(r1+16)
8004954: 28 22 00 34 lw r2,(r1+52)
8004958: 34 01 00 04 mvi r1,4
800495c: 5c 41 00 08 bne r2,r1,800497c <sigtimedwait+0x1c4>
|| !(*set & signo_to_mask( the_info->si_signo )) ) {
8004960: 29 6c 00 00 lw r12,(r11+0)
8004964: 34 01 00 01 mvi r1,1
8004968: 35 82 ff ff addi r2,r12,-1
800496c: f8 00 45 c3 calli 8016078 <__ashlsi3>
8004970: 29 a2 00 00 lw r2,(r13+0)
8004974: a0 22 08 00 and r1,r1,r2
8004978: 5c 20 00 08 bne r1,r0,8004998 <sigtimedwait+0x1e0>
errno = _Thread_Executing->Wait.return_code;
800497c: f8 00 25 5f calli 800def8 <__errno>
8004980: 78 02 08 01 mvhi r2,0x801
8004984: 38 42 9d c0 ori r2,r2,0x9dc0
8004988: 28 42 00 10 lw r2,(r2+16)
800498c: 28 42 00 34 lw r2,(r2+52)
8004990: 58 22 00 00 sw (r1+0),r2
return -1;
8004994: 34 0c ff ff mvi r12,-1
}
return the_info->si_signo;
}
8004998: b9 80 08 00 mv r1,r12
800499c: 2b 9d 00 04 lw ra,(sp+4)
80049a0: 2b 8b 00 18 lw r11,(sp+24)
80049a4: 2b 8c 00 14 lw r12,(sp+20)
80049a8: 2b 8d 00 10 lw r13,(sp+16)
80049ac: 2b 8e 00 0c lw r14,(sp+12)
80049b0: 2b 8f 00 08 lw r15,(sp+8)
80049b4: 37 9c 00 24 addi sp,sp,36
80049b8: c3 a0 00 00 ret
08006bb4 <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
8006bb4: 37 9c ff f8 addi sp,sp,-8
8006bb8: 5b 8b 00 08 sw (sp+8),r11
8006bbc: 5b 9d 00 04 sw (sp+4),ra
int status;
status = sigtimedwait( set, NULL, NULL );
8006bc0: 34 03 00 00 mvi r3,0
int sigwait(
const sigset_t *set,
int *sig
)
{
8006bc4: b8 40 58 00 mv r11,r2
int status;
status = sigtimedwait( set, NULL, NULL );
8006bc8: 34 02 00 00 mvi r2,0
8006bcc: fb ff ff 72 calli 8006994 <sigtimedwait>
8006bd0: b8 20 18 00 mv r3,r1
if ( status != -1 ) {
8006bd4: 34 01 ff ff mvi r1,-1
8006bd8: 44 61 00 05 be r3,r1,8006bec <sigwait+0x38>
if ( sig )
*sig = status;
return 0;
8006bdc: 34 01 00 00 mvi r1,0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
8006be0: 45 60 00 05 be r11,r0,8006bf4 <sigwait+0x40> <== NEVER TAKEN
*sig = status;
8006be4: 59 63 00 00 sw (r11+0),r3
8006be8: e0 00 00 03 bi 8006bf4 <sigwait+0x40>
return 0;
}
return errno;
8006bec: f8 00 24 09 calli 800fc10 <__errno>
8006bf0: 28 21 00 00 lw r1,(r1+0)
}
8006bf4: 2b 9d 00 04 lw ra,(sp+4)
8006bf8: 2b 8b 00 08 lw r11,(sp+8)
8006bfc: 37 9c 00 08 addi sp,sp,8
8006c00: c3 a0 00 00 ret
08003194 <sysconf>:
*/
long sysconf(
int name
)
{
8003194: 37 9c ff fc addi sp,sp,-4
8003198: 5b 9d 00 04 sw (sp+4),ra
800319c: b8 20 10 00 mv r2,r1
if ( name == _SC_CLK_TCK )
80031a0: 34 01 00 02 mvi r1,2
80031a4: 5c 41 00 09 bne r2,r1,80031c8 <sysconf+0x34>
return (TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick());
80031a8: 78 02 08 01 mvhi r2,0x801
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
return (TOD_MICROSECONDS_PER_SECOND /
80031ac: 78 03 08 01 mvhi r3,0x801
80031b0: 38 63 3b 24 ori r3,r3,0x3b24
rtems_configuration_get_microseconds_per_tick());
80031b4: 38 42 3a 94 ori r2,r2,0x3a94
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
return (TOD_MICROSECONDS_PER_SECOND /
80031b8: 28 61 00 00 lw r1,(r3+0)
80031bc: 28 42 00 0c lw r2,(r2+12)
80031c0: f8 00 3e 52 calli 8012b08 <__udivsi3>
80031c4: e0 00 00 14 bi 8003214 <sysconf+0x80>
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
80031c8: 34 01 00 04 mvi r1,4
80031cc: 5c 41 00 05 bne r2,r1,80031e0 <sysconf+0x4c>
return rtems_libio_number_iops;
80031d0: 78 01 08 01 mvhi r1,0x801
80031d4: 38 21 50 10 ori r1,r1,0x5010
80031d8: 28 21 00 00 lw r1,(r1+0)
80031dc: e0 00 00 0e bi 8003214 <sysconf+0x80>
if ( name == _SC_GETPW_R_SIZE_MAX )
80031e0: 34 03 00 33 mvi r3,51
return 1024;
80031e4: 34 01 04 00 mvi r1,1024
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
80031e8: 44 43 00 0b be r2,r3,8003214 <sysconf+0x80>
return 1024;
if ( name == _SC_PAGESIZE )
80031ec: 34 03 00 08 mvi r3,8
return PAGE_SIZE;
80031f0: 34 01 10 00 mvi r1,4096
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
return 1024;
if ( name == _SC_PAGESIZE )
80031f4: 44 43 00 08 be r2,r3,8003214 <sysconf+0x80>
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
80031f8: 34 03 00 4f mvi r3,79
return RTEMS_FILESYSTEM_SYMLOOP_MAX;
80031fc: 34 01 00 20 mvi r1,32
return 1024;
if ( name == _SC_PAGESIZE )
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
8003200: 44 43 00 05 be r2,r3,8003214 <sysconf+0x80> <== NEVER TAKEN
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
8003204: f8 00 25 45 calli 800c718 <__errno>
8003208: 34 02 00 16 mvi r2,22
800320c: 58 22 00 00 sw (r1+0),r2
8003210: 34 01 ff ff mvi r1,-1
}
8003214: 2b 9d 00 04 lw ra,(sp+4)
8003218: 37 9c 00 04 addi sp,sp,4
800321c: c3 a0 00 00 ret
08004e58 <timer_create>:
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
)
{
8004e58: 37 9c ff ec addi sp,sp,-20
8004e5c: 5b 8b 00 14 sw (sp+20),r11
8004e60: 5b 8c 00 10 sw (sp+16),r12
8004e64: 5b 8d 00 0c sw (sp+12),r13
8004e68: 5b 8e 00 08 sw (sp+8),r14
8004e6c: 5b 9d 00 04 sw (sp+4),ra
8004e70: b8 40 60 00 mv r12,r2
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
8004e74: 34 02 00 01 mvi r2,1
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
)
{
8004e78: b8 60 68 00 mv r13,r3
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
8004e7c: 5c 22 00 0c bne r1,r2,8004eac <timer_create+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !timerid )
8004e80: 44 60 00 0b be r3,r0,8004eac <timer_create+0x54>
/*
* The data of the structure evp are checked in order to verify if they
* are coherent.
*/
if (evp != NULL) {
8004e84: 45 80 00 0d be r12,r0,8004eb8 <timer_create+0x60>
/* The structure has data */
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
8004e88: 29 82 00 00 lw r2,(r12+0)
8004e8c: 34 42 ff ff addi r2,r2,-1
8004e90: 50 22 00 02 bgeu r1,r2,8004e98 <timer_create+0x40> <== ALWAYS TAKEN
8004e94: e0 00 00 06 bi 8004eac <timer_create+0x54> <== NOT EXECUTED
( evp->sigev_notify != SIGEV_SIGNAL ) ) {
/* The value of the field sigev_notify is not valid */
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !evp->sigev_signo )
8004e98: 29 81 00 04 lw r1,(r12+4)
8004e9c: 44 20 00 04 be r1,r0,8004eac <timer_create+0x54> <== NEVER TAKEN
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
8004ea0: 34 21 ff ff addi r1,r1,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(evp->sigev_signo) )
8004ea4: 34 02 00 1f mvi r2,31
8004ea8: 50 41 00 04 bgeu r2,r1,8004eb8 <timer_create+0x60> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
8004eac: f8 00 28 0d calli 800eee0 <__errno>
8004eb0: 34 02 00 16 mvi r2,22
8004eb4: e0 00 00 0e bi 8004eec <timer_create+0x94>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8004eb8: 78 01 08 02 mvhi r1,0x802
8004ebc: 38 21 43 28 ori r1,r1,0x4328
8004ec0: 28 22 00 00 lw r2,(r1+0)
++level;
8004ec4: 34 42 00 01 addi r2,r2,1
_Thread_Dispatch_disable_level = level;
8004ec8: 58 22 00 00 sw (r1+0),r2
* the inactive chain of free timer control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void )
{
return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information );
8004ecc: 78 01 08 02 mvhi r1,0x802
8004ed0: 38 21 45 a4 ori r1,r1,0x45a4
8004ed4: f8 00 08 7f calli 80070d0 <_Objects_Allocate>
8004ed8: b8 20 58 00 mv r11,r1
/*
* Allocate a timer
*/
ptimer = _POSIX_Timer_Allocate();
if ( !ptimer ) {
8004edc: 5c 20 00 07 bne r1,r0,8004ef8 <timer_create+0xa0>
_Thread_Enable_dispatch();
8004ee0: f8 00 0e 1d calli 8008754 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
8004ee4: f8 00 27 ff calli 800eee0 <__errno>
8004ee8: 34 02 00 0b mvi r2,11
8004eec: 58 22 00 00 sw (r1+0),r2
8004ef0: 34 01 ff ff mvi r1,-1
8004ef4: e0 00 00 25 bi 8004f88 <timer_create+0x130>
}
/* The data of the created timer are stored to use them later */
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
8004ef8: 34 01 00 02 mvi r1,2
8004efc: 31 61 00 3c sb (r11+60),r1
ptimer->thread_id = _Thread_Executing->Object.id;
8004f00: 78 01 08 02 mvhi r1,0x802
8004f04: 38 21 48 00 ori r1,r1,0x4800
8004f08: 28 21 00 10 lw r1,(r1+16)
8004f0c: 28 21 00 08 lw r1,(r1+8)
8004f10: 59 61 00 38 sw (r11+56),r1
if ( evp != NULL ) {
8004f14: 45 80 00 07 be r12,r0,8004f30 <timer_create+0xd8>
ptimer->inf.sigev_notify = evp->sigev_notify;
8004f18: 29 81 00 00 lw r1,(r12+0)
8004f1c: 59 61 00 40 sw (r11+64),r1
ptimer->inf.sigev_signo = evp->sigev_signo;
8004f20: 29 81 00 04 lw r1,(r12+4)
8004f24: 59 61 00 44 sw (r11+68),r1
ptimer->inf.sigev_value = evp->sigev_value;
8004f28: 29 81 00 08 lw r1,(r12+8)
8004f2c: 59 61 00 48 sw (r11+72),r1
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8004f30: 29 6c 00 08 lw r12,(r11+8)
_Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0);
*timerid = ptimer->Object.id;
_Thread_Enable_dispatch();
return 0;
}
8004f34: 78 01 08 02 mvhi r1,0x802
8004f38: 38 21 45 a4 ori r1,r1,0x45a4
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8004f3c: 28 2e 00 1c lw r14,(r1+28)
8004f40: 34 02 00 02 mvi r2,2
ptimer->inf.sigev_notify = evp->sigev_notify;
ptimer->inf.sigev_signo = evp->sigev_signo;
ptimer->inf.sigev_value = evp->sigev_value;
}
ptimer->overrun = 0;
8004f44: 59 60 00 68 sw (r11+104),r0
ptimer->timer_data.it_value.tv_sec = 0;
8004f48: 59 60 00 5c sw (r11+92),r0
ptimer->timer_data.it_value.tv_nsec = 0;
8004f4c: 59 60 00 60 sw (r11+96),r0
ptimer->timer_data.it_interval.tv_sec = 0;
8004f50: 59 60 00 54 sw (r11+84),r0
ptimer->timer_data.it_interval.tv_nsec = 0;
8004f54: 59 60 00 58 sw (r11+88),r0
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8004f58: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8004f5c: 59 60 00 2c sw (r11+44),r0
the_watchdog->id = id;
8004f60: 59 60 00 30 sw (r11+48),r0
the_watchdog->user_data = user_data;
8004f64: 59 60 00 34 sw (r11+52),r0
8004f68: 21 81 ff ff andi r1,r12,0xffff
8004f6c: fb ff ef 2c calli 8000c1c <__ashlsi3>
8004f70: b5 c1 08 00 add r1,r14,r1
8004f74: 58 2b 00 00 sw (r1+0),r11
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
8004f78: 59 60 00 0c sw (r11+12),r0
_Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL );
_Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0);
*timerid = ptimer->Object.id;
8004f7c: 59 ac 00 00 sw (r13+0),r12
_Thread_Enable_dispatch();
8004f80: f8 00 0d f5 calli 8008754 <_Thread_Enable_dispatch>
return 0;
8004f84: 34 01 00 00 mvi r1,0
}
8004f88: 2b 9d 00 04 lw ra,(sp+4)
8004f8c: 2b 8b 00 14 lw r11,(sp+20)
8004f90: 2b 8c 00 10 lw r12,(sp+16)
8004f94: 2b 8d 00 0c lw r13,(sp+12)
8004f98: 2b 8e 00 08 lw r14,(sp+8)
8004f9c: 37 9c 00 14 addi sp,sp,20
8004fa0: c3 a0 00 00 ret
08003824 <timer_settime>:
timer_t timerid,
int flags,
const struct itimerspec *value,
struct itimerspec *ovalue
)
{
8003824: 37 9c ff cc addi sp,sp,-52
8003828: 5b 8b 00 18 sw (sp+24),r11
800382c: 5b 8c 00 14 sw (sp+20),r12
8003830: 5b 8d 00 10 sw (sp+16),r13
8003834: 5b 8e 00 0c sw (sp+12),r14
8003838: 5b 8f 00 08 sw (sp+8),r15
800383c: 5b 9d 00 04 sw (sp+4),ra
8003840: b8 20 78 00 mv r15,r1
8003844: b8 40 58 00 mv r11,r2
8003848: b8 60 60 00 mv r12,r3
800384c: b8 80 68 00 mv r13,r4
Objects_Locations location;
bool activated;
uint32_t initial_period;
struct itimerspec normalize;
if ( !value )
8003850: 44 60 00 69 be r3,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
/*
* First, it verifies if the structure "value" is correct
* if the number of nanoseconds is not correct return EINVAL
*/
if ( !_Timespec_Is_valid( &(value->it_value) ) ) {
8003854: 34 61 00 08 addi r1,r3,8
8003858: f8 00 0f 53 calli 80075a4 <_Timespec_Is_valid>
800385c: 44 20 00 66 be r1,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !_Timespec_Is_valid( &(value->it_interval) ) ) {
8003860: b9 80 08 00 mv r1,r12
8003864: f8 00 0f 50 calli 80075a4 <_Timespec_Is_valid>
8003868: 44 20 00 63 be r1,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) {
800386c: 7d 62 00 00 cmpnei r2,r11,0
8003870: 7d 61 00 04 cmpnei r1,r11,4
8003874: a0 41 08 00 and r1,r2,r1
8003878: 5c 20 00 5f bne r1,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
}
normalize = *value;
800387c: 29 81 00 0c lw r1,(r12+12)
8003880: 29 84 00 00 lw r4,(r12+0)
8003884: 29 83 00 04 lw r3,(r12+4)
8003888: 29 82 00 08 lw r2,(r12+8)
800388c: 5b 81 00 28 sw (sp+40),r1
8003890: 5b 84 00 1c sw (sp+28),r4
8003894: 5b 83 00 20 sw (sp+32),r3
8003898: 5b 82 00 24 sw (sp+36),r2
/* Convert absolute to relative time */
if (flags == TIMER_ABSTIME) {
800389c: 34 01 00 04 mvi r1,4
80038a0: 5d 61 00 0d bne r11,r1,80038d4 <timer_settime+0xb0>
struct timespec now;
_TOD_Get( &now );
80038a4: 37 8b 00 2c addi r11,sp,44
80038a8: b9 60 08 00 mv r1,r11
80038ac: fb ff ff bc calli 800379c <_TOD_Get>
/* Check for seconds in the past */
if ( _Timespec_Greater_than( &now, &normalize.it_value ) )
80038b0: 37 8e 00 24 addi r14,sp,36
80038b4: b9 c0 08 00 mv r1,r14
80038b8: b9 60 10 00 mv r2,r11
80038bc: f8 00 0f 46 calli 80075d4 <_Timespec_Less_than>
80038c0: 5c 20 00 4d bne r1,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
_Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value );
80038c4: b9 60 08 00 mv r1,r11
80038c8: b9 c0 10 00 mv r2,r14
80038cc: b9 c0 18 00 mv r3,r14
80038d0: f8 00 0f 4c calli 8007600 <_Timespec_Subtract>
timer_t id,
Objects_Locations *location
)
{
return (POSIX_Timer_Control *)
_Objects_Get( &_POSIX_Timer_Information, (Objects_Id) id, location );
80038d4: 78 03 08 02 mvhi r3,0x802
80038d8: b8 60 08 00 mv r1,r3
80038dc: b9 e0 10 00 mv r2,r15
80038e0: 38 21 0b 84 ori r1,r1,0xb84
80038e4: 37 83 00 34 addi r3,sp,52
80038e8: f8 00 08 4a calli 8005a10 <_Objects_Get>
* something with the structure of times of the timer: to stop, start
* or start it again
*/
ptimer = _POSIX_Timer_Get( timerid, &location );
switch ( location ) {
80038ec: 2b 82 00 34 lw r2,(sp+52)
80038f0: b8 20 58 00 mv r11,r1
80038f4: 5c 40 00 40 bne r2,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
case OBJECTS_LOCAL:
/* First, it verifies if the timer must be stopped */
if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) {
80038f8: 2b 81 00 24 lw r1,(sp+36)
80038fc: 5c 22 00 19 bne r1,r2,8003960 <timer_settime+0x13c>
8003900: 2b 8e 00 28 lw r14,(sp+40)
8003904: 5d c1 00 17 bne r14,r1,8003960 <timer_settime+0x13c>
/* Stop the timer */
(void) _Watchdog_Remove( &ptimer->Timer );
8003908: 35 61 00 10 addi r1,r11,16
800390c: f8 00 10 69 calli 8007ab0 <_Watchdog_Remove>
/* The old data of the timer are returned */
if ( ovalue )
8003910: 45 ae 00 09 be r13,r14,8003934 <timer_settime+0x110>
*ovalue = ptimer->timer_data;
8003914: 29 64 00 54 lw r4,(r11+84)
8003918: 29 63 00 58 lw r3,(r11+88)
800391c: 29 62 00 5c lw r2,(r11+92)
8003920: 29 61 00 60 lw r1,(r11+96)
8003924: 59 a4 00 00 sw (r13+0),r4
8003928: 59 a3 00 04 sw (r13+4),r3
800392c: 59 a2 00 08 sw (r13+8),r2
8003930: 59 a1 00 0c sw (r13+12),r1
/* The new data are set */
ptimer->timer_data = normalize;
8003934: 2b 81 00 1c lw r1,(sp+28)
8003938: 59 61 00 54 sw (r11+84),r1
800393c: 2b 81 00 20 lw r1,(sp+32)
8003940: 59 61 00 58 sw (r11+88),r1
8003944: 2b 81 00 24 lw r1,(sp+36)
8003948: 59 61 00 5c sw (r11+92),r1
800394c: 2b 81 00 28 lw r1,(sp+40)
8003950: 59 61 00 60 sw (r11+96),r1
/* Indicates that the timer is created and stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
8003954: 34 01 00 04 mvi r1,4
8003958: 31 61 00 3c sb (r11+60),r1
800395c: e0 00 00 23 bi 80039e8 <timer_settime+0x1c4>
_Thread_Enable_dispatch();
return 0;
}
/* Convert from seconds and nanoseconds to ticks */
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
8003960: b9 80 08 00 mv r1,r12
8003964: f8 00 0f 39 calli 8007648 <_Timespec_To_ticks>
8003968: 59 61 00 64 sw (r11+100),r1
initial_period = _Timespec_To_ticks( &normalize.it_value );
800396c: 37 81 00 24 addi r1,sp,36
8003970: f8 00 0f 36 calli 8007648 <_Timespec_To_ticks>
activated = _POSIX_Timer_Insert_helper(
8003974: 29 63 00 08 lw r3,(r11+8)
8003978: 78 04 08 00 mvhi r4,0x800
return 0;
}
/* Convert from seconds and nanoseconds to ticks */
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
initial_period = _Timespec_To_ticks( &normalize.it_value );
800397c: b8 20 10 00 mv r2,r1
activated = _POSIX_Timer_Insert_helper(
8003980: 38 84 3a 24 ori r4,r4,0x3a24
8003984: 35 61 00 10 addi r1,r11,16
8003988: b9 60 28 00 mv r5,r11
800398c: f8 00 19 ca calli 800a0b4 <_POSIX_Timer_Insert_helper>
initial_period,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated ) {
8003990: 44 20 00 16 be r1,r0,80039e8 <timer_settime+0x1c4>
/*
* The timer has been started and is running. So we return the
* old ones in "ovalue"
*/
if ( ovalue )
8003994: 45 a0 00 09 be r13,r0,80039b8 <timer_settime+0x194>
*ovalue = ptimer->timer_data;
8003998: 29 64 00 54 lw r4,(r11+84)
800399c: 29 63 00 58 lw r3,(r11+88)
80039a0: 29 62 00 5c lw r2,(r11+92)
80039a4: 29 61 00 60 lw r1,(r11+96)
80039a8: 59 a4 00 00 sw (r13+0),r4
80039ac: 59 a3 00 04 sw (r13+4),r3
80039b0: 59 a2 00 08 sw (r13+8),r2
80039b4: 59 a1 00 0c sw (r13+12),r1
ptimer->timer_data = normalize;
80039b8: 2b 81 00 1c lw r1,(sp+28)
80039bc: 59 61 00 54 sw (r11+84),r1
80039c0: 2b 81 00 20 lw r1,(sp+32)
80039c4: 59 61 00 58 sw (r11+88),r1
80039c8: 2b 81 00 24 lw r1,(sp+36)
80039cc: 59 61 00 5c sw (r11+92),r1
80039d0: 2b 81 00 28 lw r1,(sp+40)
80039d4: 59 61 00 60 sw (r11+96),r1
/* Indicate that the time is running */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
80039d8: 34 01 00 03 mvi r1,3
80039dc: 31 61 00 3c sb (r11+60),r1
_TOD_Get( &ptimer->time );
80039e0: 35 61 00 6c addi r1,r11,108
80039e4: fb ff ff 6e calli 800379c <_TOD_Get>
_Thread_Enable_dispatch();
80039e8: f8 00 0b d3 calli 8006934 <_Thread_Enable_dispatch>
return 0;
80039ec: 34 01 00 00 mvi r1,0
80039f0: e0 00 00 05 bi 8003a04 <timer_settime+0x1e0>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EINVAL );
80039f4: f8 00 26 9b calli 800d460 <__errno>
80039f8: 34 02 00 16 mvi r2,22
80039fc: 58 22 00 00 sw (r1+0),r2
8003a00: 34 01 ff ff mvi r1,-1
}
8003a04: 2b 9d 00 04 lw ra,(sp+4)
8003a08: 2b 8b 00 18 lw r11,(sp+24)
8003a0c: 2b 8c 00 14 lw r12,(sp+20)
8003a10: 2b 8d 00 10 lw r13,(sp+16)
8003a14: 2b 8e 00 0c lw r14,(sp+12)
8003a18: 2b 8f 00 08 lw r15,(sp+8)
8003a1c: 37 9c 00 34 addi sp,sp,52
8003a20: c3 a0 00 00 ret
08003674 <ualarm>:
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
8003674: 37 9c ff e8 addi sp,sp,-24
8003678: 5b 8b 00 10 sw (sp+16),r11
800367c: 5b 8c 00 0c sw (sp+12),r12
8003680: 5b 8d 00 08 sw (sp+8),r13
8003684: 5b 9d 00 04 sw (sp+4),ra
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
8003688: 78 0b 08 01 mvhi r11,0x801
800368c: 39 6b 81 e0 ori r11,r11,0x81e0
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
8003690: b8 20 68 00 mv r13,r1
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
8003694: 29 61 00 1c lw r1,(r11+28)
8003698: 5c 20 00 09 bne r1,r0,80036bc <ualarm+0x48>
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
800369c: 78 01 08 00 mvhi r1,0x800
80036a0: 38 21 36 2c ori r1,r1,0x362c
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
80036a4: 59 60 00 08 sw (r11+8),r0
the_watchdog->routine = routine;
80036a8: 59 61 00 1c sw (r11+28),r1
the_watchdog->id = id;
80036ac: 59 60 00 20 sw (r11+32),r0
the_watchdog->user_data = user_data;
80036b0: 59 60 00 24 sw (r11+36),r0
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
80036b4: 34 0c 00 00 mvi r12,0
80036b8: e0 00 00 18 bi 8003718 <ualarm+0xa4>
if ( !the_timer->routine ) {
_Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL );
} else {
Watchdog_States state;
state = _Watchdog_Remove( the_timer );
80036bc: b9 60 08 00 mv r1,r11
80036c0: f8 00 0f b4 calli 8007590 <_Watchdog_Remove>
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
80036c4: 34 21 ff fe addi r1,r1,-2
80036c8: 34 02 00 01 mvi r2,1
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
80036cc: 34 0c 00 00 mvi r12,0
_Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL );
} else {
Watchdog_States state;
state = _Watchdog_Remove( the_timer );
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
80036d0: 54 22 00 12 bgu r1,r2,8003718 <ualarm+0xa4> <== NEVER TAKEN
* boot. Since alarm() is dealing in seconds, we must account for
* this.
*/
ticks = the_timer->initial;
ticks -= (the_timer->stop_time - the_timer->start_time);
80036d4: 29 61 00 0c lw r1,(r11+12)
80036d8: 29 62 00 14 lw r2,(r11+20)
80036dc: b4 41 10 00 add r2,r2,r1
80036e0: 29 61 00 18 lw r1,(r11+24)
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
80036e4: c8 41 08 00 sub r1,r2,r1
80036e8: 37 82 00 14 addi r2,sp,20
80036ec: f8 00 0e 3c calli 8006fdc <_Timespec_From_ticks>
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
80036f0: 78 03 08 01 mvhi r3,0x801
80036f4: 38 63 57 b4 ori r3,r3,0x57b4
80036f8: 28 62 00 00 lw r2,(r3+0)
80036fc: 2b 81 00 14 lw r1,(sp+20)
8003700: f8 00 43 82 calli 8014508 <__mulsi3>
8003704: b8 20 60 00 mv r12,r1
remaining += tp.tv_nsec / 1000;
8003708: 2b 81 00 18 lw r1,(sp+24)
800370c: 34 02 03 e8 mvi r2,1000
8003710: f8 00 43 8a calli 8014538 <__divsi3>
8003714: b4 2c 60 00 add r12,r1,r12
/*
* If useconds is non-zero, then the caller wants to schedule
* the alarm repeatedly at that interval. If the interval is
* less than a single clock tick, then fudge it to a clock tick.
*/
if ( useconds ) {
8003718: 45 a0 00 1a be r13,r0,8003780 <ualarm+0x10c>
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
800371c: 78 03 08 01 mvhi r3,0x801
8003720: 38 63 57 b4 ori r3,r3,0x57b4
8003724: 28 62 00 00 lw r2,(r3+0)
8003728: b9 a0 08 00 mv r1,r13
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
ticks = _Timespec_To_ticks( &tp );
800372c: 37 8b 00 14 addi r11,sp,20
* less than a single clock tick, then fudge it to a clock tick.
*/
if ( useconds ) {
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
8003730: f8 00 43 db calli 801469c <__udivsi3>
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
8003734: 78 03 08 01 mvhi r3,0x801
8003738: 38 63 57 b4 ori r3,r3,0x57b4
800373c: 28 62 00 00 lw r2,(r3+0)
* less than a single clock tick, then fudge it to a clock tick.
*/
if ( useconds ) {
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
8003740: 5b 81 00 14 sw (sp+20),r1
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
8003744: b9 a0 08 00 mv r1,r13
8003748: f8 00 43 e5 calli 80146dc <__umodsi3>
800374c: 34 02 03 e8 mvi r2,1000
8003750: f8 00 43 6e calli 8014508 <__mulsi3>
8003754: 5b 81 00 18 sw (sp+24),r1
ticks = _Timespec_To_ticks( &tp );
8003758: b9 60 08 00 mv r1,r11
800375c: f8 00 0e 3c calli 800704c <_Timespec_To_ticks>
if ( ticks == 0 )
ticks = 1;
_Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) );
8003760: b9 60 08 00 mv r1,r11
8003764: f8 00 0e 3a calli 800704c <_Timespec_To_ticks>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8003768: 78 02 08 01 mvhi r2,0x801
800376c: 38 42 81 e0 ori r2,r2,0x81e0
8003770: 58 41 00 0c sw (r2+12),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003774: 78 01 08 01 mvhi r1,0x801
8003778: 38 21 79 e0 ori r1,r1,0x79e0
800377c: f8 00 0f 28 calli 800741c <_Watchdog_Insert>
}
return remaining;
}
8003780: b9 80 08 00 mv r1,r12
8003784: 2b 9d 00 04 lw ra,(sp+4)
8003788: 2b 8b 00 10 lw r11,(sp+16)
800378c: 2b 8c 00 0c lw r12,(sp+12)
8003790: 2b 8d 00 08 lw r13,(sp+8)
8003794: 37 9c 00 18 addi sp,sp,24
8003798: c3 a0 00 00 ret