RTEMS 4.11Annotated Report
Fri Mar 18 22:18:29 2011
00007b5c <_Thread_queue_Enqueue_priority>:
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 );
7b5c: e281303c add r3, r1, #60 ; 0x3c
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
7b60: e591c014 ldr ip, [r1, #20]
head->next = tail;
7b64: e5813038 str r3, [r1, #56] ; 0x38
head->previous = NULL;
7b68: e3a03000 mov r3, #0
7b6c: e581303c str r3, [r1, #60] ; 0x3c
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 ) )
7b70: e31c0020 tst ip, #32
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
7b74: e2813038 add r3, r1, #56 ; 0x38
Thread_blocking_operation_States _Thread_queue_Enqueue_priority (
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
ISR_Level *level_p
)
{
7b78: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
7b7c: e5813040 str r3, [r1, #64] ; 0x40
_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;
7b80: e5907038 ldr r7, [r0, #56] ; 0x38
RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number (
Priority_Control the_priority
)
{
return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
7b84: e1a0332c lsr r3, ip, #6
if ( _Thread_queue_Is_reverse_search( priority ) )
7b88: 1a000026 bne 7c28 <_Thread_queue_Enqueue_priority+0xcc>
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
7b8c: e3a0600c mov r6, #12
7b90: e0030396 mul r3, r6, r3
7b94: e0808003 add r8, r0, r3
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Tail(the_chain));
7b98: e2833004 add r3, r3, #4
7b9c: e0806003 add r6, r0, r3
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
7ba0: e10f4000 mrs r4, CPSR
7ba4: e3843080 orr r3, r4, #128 ; 0x80
7ba8: e129f003 msr CPSR_fc, r3
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
7bac: e3e05000 mvn r5, #0
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
7bb0: e5983000 ldr r3, [r8]
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
7bb4: ea00000b b 7be8 <_Thread_queue_Enqueue_priority+0x8c>
search_priority = search_thread->current_priority;
7bb8: e5935014 ldr r5, [r3, #20]
if ( priority <= search_priority )
7bbc: e15c0005 cmp ip, r5
7bc0: 9a00000a bls 7bf0 <_Thread_queue_Enqueue_priority+0x94>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
__asm__ volatile (
7bc4: e10fa000 mrs sl, CPSR
7bc8: e129f004 msr CPSR_fc, r4
7bcc: e129f00a msr CPSR_fc, sl
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
7bd0: e593a010 ldr sl, [r3, #16]
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
7bd4: e117000a tst r7, sl
7bd8: 1a000001 bne 7be4 <_Thread_queue_Enqueue_priority+0x88>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
7bdc: e129f004 msr CPSR_fc, r4
7be0: eaffffee b 7ba0 <_Thread_queue_Enqueue_priority+0x44>
_ISR_Enable( level );
goto restart_forward_search;
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
7be4: e5933000 ldr r3, [r3]
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 ) ) {
7be8: e1530006 cmp r3, r6
7bec: 1afffff1 bne 7bb8 <_Thread_queue_Enqueue_priority+0x5c>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
7bf0: e5906030 ldr r6, [r0, #48] ; 0x30
7bf4: e3560001 cmp r6, #1
7bf8: 1a000039 bne 7ce4 <_Thread_queue_Enqueue_priority+0x188>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
7bfc: e3a02000 mov r2, #0
if ( priority == search_priority )
7c00: e15c0005 cmp ip, r5
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
7c04: e5802030 str r2, [r0, #48] ; 0x30
if ( priority == search_priority )
7c08: 0a00002b beq 7cbc <_Thread_queue_Enqueue_priority+0x160>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
7c0c: e5932004 ldr r2, [r3, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
7c10: e5813000 str r3, [r1]
the_node->previous = previous_node;
7c14: e5812004 str r2, [r1, #4]
previous_node->next = the_node;
7c18: e5821000 str r1, [r2]
search_node->previous = the_node;
7c1c: e5831004 str r1, [r3, #4]
the_thread->Wait.queue = the_thread_queue;
7c20: e5810044 str r0, [r1, #68] ; 0x44
_ISR_Enable( level );
7c24: ea00002b b 7cd8 <_Thread_queue_Enqueue_priority+0x17c>
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
7c28: e3a0600c mov r6, #12
7c2c: e0260693 mla r6, r3, r6, r0
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
7c30: e59f80b8 ldr r8, [pc, #184] ; 7cf0 <_Thread_queue_Enqueue_priority+0x194>
7c34: e5d85000 ldrb r5, [r8]
7c38: e2855001 add r5, r5, #1
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
7c3c: e10f4000 mrs r4, CPSR
7c40: e3843080 orr r3, r4, #128 ; 0x80
7c44: e129f003 msr CPSR_fc, r3
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_Last( header );
7c48: e5963008 ldr r3, [r6, #8]
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
7c4c: ea00000b b 7c80 <_Thread_queue_Enqueue_priority+0x124>
search_priority = search_thread->current_priority;
7c50: e5935014 ldr r5, [r3, #20]
if ( priority >= search_priority )
7c54: e15c0005 cmp ip, r5
7c58: 2a00000a bcs 7c88 <_Thread_queue_Enqueue_priority+0x12c>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
__asm__ volatile (
7c5c: e10fa000 mrs sl, CPSR
7c60: e129f004 msr CPSR_fc, r4
7c64: e129f00a msr CPSR_fc, sl
7c68: e593a010 ldr sl, [r3, #16]
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
7c6c: e117000a tst r7, sl
7c70: 1a000001 bne 7c7c <_Thread_queue_Enqueue_priority+0x120>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
7c74: e129f004 msr CPSR_fc, r4 <== NOT EXECUTED
7c78: eaffffed b 7c34 <_Thread_queue_Enqueue_priority+0xd8> <== NOT EXECUTED
_ISR_Enable( level );
goto restart_reverse_search;
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
7c7c: e5933004 ldr r3, [r3, #4]
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 ) ) {
7c80: e1530006 cmp r3, r6
7c84: 1afffff1 bne 7c50 <_Thread_queue_Enqueue_priority+0xf4>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
7c88: e5906030 ldr r6, [r0, #48] ; 0x30
7c8c: e3560001 cmp r6, #1
7c90: 1a000013 bne 7ce4 <_Thread_queue_Enqueue_priority+0x188>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
7c94: e3a02000 mov r2, #0
if ( priority == search_priority )
7c98: e15c0005 cmp ip, r5
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
7c9c: e5802030 str r2, [r0, #48] ; 0x30
if ( priority == search_priority )
7ca0: 0a000005 beq 7cbc <_Thread_queue_Enqueue_priority+0x160>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
7ca4: e5932000 ldr r2, [r3]
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
7ca8: e881000c stm r1, {r2, r3}
search_node->next = the_node;
next_node->previous = the_node;
7cac: e5821004 str r1, [r2, #4]
next_node = search_node->next;
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
search_node->next = the_node;
7cb0: e5831000 str r1, [r3]
next_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
7cb4: e5810044 str r0, [r1, #68] ; 0x44
_ISR_Enable( level );
7cb8: ea000006 b 7cd8 <_Thread_queue_Enqueue_priority+0x17c>
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
previous_node = search_node->previous;
7cbc: e5932040 ldr r2, [r3, #64] ; 0x40
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 );
7cc0: e283c03c add ip, r3, #60 ; 0x3c
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
7cc4: e581c000 str ip, [r1]
the_node->previous = previous_node;
7cc8: e5812004 str r2, [r1, #4]
previous_node->next = the_node;
7ccc: e5821000 str r1, [r2]
search_node->previous = the_node;
7cd0: e5831040 str r1, [r3, #64] ; 0x40
the_thread->Wait.queue = the_thread_queue;
7cd4: e5810044 str r0, [r1, #68] ; 0x44
7cd8: e129f004 msr CPSR_fc, r4
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7cdc: e3a00001 mov r0, #1
7ce0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
* 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;
7ce4: e5824000 str r4, [r2]
return the_thread_queue->sync_state;
7ce8: e5900030 ldr r0, [r0, #48] ; 0x30
}
7cec: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
00014488 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
14488: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1448c: e24dd01c sub sp, sp, #28
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
14490: e28d9010 add r9, sp, #16
14494: e28d6004 add r6, sp, #4
14498: e2893004 add r3, r9, #4
head->previous = NULL;
1449c: e3a02000 mov r2, #0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
144a0: e2868004 add r8, r6, #4
144a4: e58d3010 str r3, [sp, #16]
head->previous = NULL;
144a8: e58d2014 str r2, [sp, #20]
tail->previous = head;
144ac: e58d9018 str r9, [sp, #24]
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
144b0: e58d8004 str r8, [sp, #4]
head->previous = NULL;
144b4: e58d2008 str r2, [sp, #8]
tail->previous = head;
144b8: e58d600c str r6, [sp, #12]
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
144bc: e59fb168 ldr fp, [pc, #360] ; 1462c <_Timer_server_Body+0x1a4>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
144c0: e58d3000 str r3, [sp]
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
144c4: e1a04000 mov r4, r0
{
/*
* 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;
144c8: e5849078 str r9, [r4, #120] ; 0x78
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
144cc: e284a030 add sl, r4, #48 ; 0x30
/*
* 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 );
144d0: e2847068 add r7, r4, #104 ; 0x68
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
144d4: e59b3000 ldr r3, [fp]
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
144d8: e594103c ldr r1, [r4, #60] ; 0x3c
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
144dc: e1a02006 mov r2, r6
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
144e0: e584303c str r3, [r4, #60] ; 0x3c
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
144e4: e1a0000a mov r0, sl
144e8: e0611003 rsb r1, r1, r3
144ec: eb0010c3 bl 18800 <_Watchdog_Adjust_to_chain>
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
144f0: e59f2138 ldr r2, [pc, #312] ; 14630 <_Timer_server_Body+0x1a8>
144f4: e5925000 ldr r5, [r2]
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
144f8: e5942074 ldr r2, [r4, #116] ; 0x74
/*
* 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 ) {
144fc: e1550002 cmp r5, r2
14500: 9a000004 bls 14518 <_Timer_server_Body+0x90>
/*
* 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 );
14504: e0621005 rsb r1, r2, r5
14508: e1a00007 mov r0, r7
1450c: e1a02006 mov r2, r6
14510: eb0010ba bl 18800 <_Watchdog_Adjust_to_chain>
14514: ea000003 b 14528 <_Timer_server_Body+0xa0>
/*
* 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 );
14518: 31a00007 movcc r0, r7
1451c: 33a01001 movcc r1, #1
14520: 30652002 rsbcc r2, r5, r2
14524: 3b00108d blcc 18760 <_Watchdog_Adjust>
}
watchdogs->last_snapshot = snapshot;
14528: e5845074 str r5, [r4, #116] ; 0x74
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
1452c: e5940078 ldr r0, [r4, #120] ; 0x78
14530: eb00029b bl 14fa4 <_Chain_Get>
if ( timer == NULL ) {
14534: e2505000 subs r5, r0, #0
14538: 0a000009 beq 14564 <_Timer_server_Body+0xdc>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
1453c: e5953038 ldr r3, [r5, #56] ; 0x38
14540: e3530001 cmp r3, #1
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
14544: 01a0000a moveq r0, sl
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
14548: 0a000002 beq 14558 <_Timer_server_Body+0xd0>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
1454c: e3530003 cmp r3, #3
14550: 1afffff5 bne 1452c <_Timer_server_Body+0xa4>
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
14554: e1a00007 mov r0, r7
14558: e2851010 add r1, r5, #16
1455c: eb0010d2 bl 188ac <_Watchdog_Insert>
14560: eafffff1 b 1452c <_Timer_server_Body+0xa4>
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
14564: ebffff95 bl 143c0 <arm_interrupt_disable>
if ( _Chain_Is_empty( insert_chain ) ) {
14568: e59d3010 ldr r3, [sp, #16]
1456c: e59d2000 ldr r2, [sp]
14570: e1530002 cmp r3, r2
14574: 1a000006 bne 14594 <_Timer_server_Body+0x10c>
ts->insert_chain = NULL;
14578: e5845078 str r5, [r4, #120] ; 0x78
1457c: e129f000 msr CPSR_fc, r0
_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 ) ) {
14580: e59d3004 ldr r3, [sp, #4]
14584: e1530008 cmp r3, r8
)
{
if ( !_Chain_Is_empty(the_chain))
return _Chain_Get_first_unprotected(the_chain);
else
return NULL;
14588: 13a05000 movne r5, #0
1458c: 1a000002 bne 1459c <_Timer_server_Body+0x114>
14590: ea000013 b 145e4 <_Timer_server_Body+0x15c>
14594: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED
14598: eaffffcd b 144d4 <_Timer_server_Body+0x4c> <== 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 );
1459c: ebffff87 bl 143c0 <arm_interrupt_disable>
initialized = false;
}
#endif
return status;
}
145a0: e59d3004 ldr r3, [sp, #4]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
145a4: e1530008 cmp r3, r8
145a8: 0a00000b beq 145dc <_Timer_server_Body+0x154>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
145ac: e5932000 ldr r2, [r3]
* 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 ) {
145b0: e3530000 cmp r3, #0
head->next = new_first;
145b4: e58d2004 str r2, [sp, #4]
new_first->previous = head;
145b8: e5826004 str r6, [r2, #4]
145bc: 0a000006 beq 145dc <_Timer_server_Body+0x154>
watchdog->state = WATCHDOG_INACTIVE;
145c0: e5835008 str r5, [r3, #8]
145c4: e129f000 msr CPSR_fc, r0
/*
* 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 );
145c8: e2830020 add r0, r3, #32
145cc: e8900003 ldm r0, {r0, r1}
145d0: e1a0e00f mov lr, pc
145d4: e593f01c ldr pc, [r3, #28]
}
145d8: eaffffef b 1459c <_Timer_server_Body+0x114>
145dc: e129f000 msr CPSR_fc, r0
145e0: eaffffb8 b 144c8 <_Timer_server_Body+0x40>
} else {
ts->active = false;
145e4: e3a03000 mov r3, #0
145e8: e5c4307c strb r3, [r4, #124] ; 0x7c
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
145ec: ebffff77 bl 143d0 <_Thread_Disable_dispatch>
_Thread_Set_state( ts->thread, STATES_DELAYING );
145f0: e3a01008 mov r1, #8
145f4: e5940000 ldr r0, [r4]
145f8: eb000ecc bl 18130 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
145fc: e1a00004 mov r0, r4
14600: ebffff78 bl 143e8 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
14604: e1a00004 mov r0, r4
14608: ebffff8a bl 14438 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
1460c: eb000c9d bl 17888 <_Thread_Enable_dispatch>
ts->active = true;
14610: e3a03001 mov r3, #1
14614: e5c4307c strb r3, [r4, #124] ; 0x7c
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
14618: e2840008 add r0, r4, #8
1461c: eb0010fa bl 18a0c <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
14620: e2840040 add r0, r4, #64 ; 0x40
14624: eb0010f8 bl 18a0c <_Watchdog_Remove>
14628: eaffffa6 b 144c8 <_Timer_server_Body+0x40>
00005d3c <aio_fsync>:
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
5d3c: e3500a02 cmp r0, #8192 ; 0x2000
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
5d40: e92d4030 push {r4, r5, lr}
5d44: e1a04001 mov r4, r1
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
5d48: 13a05016 movne r5, #22
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
5d4c: 1a00000c bne 5d84 <aio_fsync+0x48>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
5d50: e5910000 ldr r0, [r1]
5d54: e3a01003 mov r1, #3
5d58: eb0019c8 bl c480 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
5d5c: e2000003 and r0, r0, #3
5d60: e2400001 sub r0, r0, #1
5d64: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
5d68: 83a05009 movhi r5, #9
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
5d6c: 8a000004 bhi 5d84 <aio_fsync+0x48>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
5d70: e3a00018 mov r0, #24
5d74: ebfff52c bl 322c <malloc>
if (req == NULL)
5d78: e2503000 subs r3, r0, #0
5d7c: 1a000007 bne 5da0 <aio_fsync+0x64>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
5d80: e3a0500b mov r5, #11 <== NOT EXECUTED
5d84: e3e03000 mvn r3, #0
5d88: e5845030 str r5, [r4, #48] ; 0x30
5d8c: e5843034 str r3, [r4, #52] ; 0x34
5d90: eb00268f bl f7d4 <__errno>
5d94: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
5d98: e3e00000 mvn r0, #0
5d9c: e8bd8030 pop {r4, r5, pc}
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
5da0: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_SYNC;
5da4: e3a03003 mov r3, #3
5da8: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
5dac: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
5db0: ea00013b b 62a4 <rtems_aio_enqueue>
000064ac <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
64ac: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
64b0: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
64b4: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
64b8: e5900000 ldr r0, [r0]
64bc: eb0017ef bl c480 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
64c0: e2000003 and r0, r0, #3
64c4: e3500002 cmp r0, #2
64c8: 13500000 cmpne r0, #0
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
64cc: 13a05009 movne r5, #9
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
64d0: 1a00000d bne 650c <aio_read+0x60>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
64d4: e5943014 ldr r3, [r4, #20]
64d8: e3530000 cmp r3, #0
64dc: 1a000007 bne 6500 <aio_read+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
64e0: e5943008 ldr r3, [r4, #8]
64e4: e3530000 cmp r3, #0
64e8: ba000004 blt 6500 <aio_read+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
64ec: e3a00018 mov r0, #24
64f0: ebfff34d bl 322c <malloc>
if (req == NULL)
64f4: e2503000 subs r3, r0, #0
64f8: 1a00000a bne 6528 <aio_read+0x7c>
64fc: ea000001 b 6508 <aio_read+0x5c> <== NOT EXECUTED
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
6500: e3a05016 mov r5, #22
6504: ea000000 b 650c <aio_read+0x60>
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
6508: e3a0500b mov r5, #11 <== NOT EXECUTED
650c: e3e03000 mvn r3, #0
6510: e5845030 str r5, [r4, #48] ; 0x30
6514: e5843034 str r3, [r4, #52] ; 0x34
6518: eb0024ad bl f7d4 <__errno>
651c: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
6520: e3e00000 mvn r0, #0
6524: e8bd8030 pop {r4, r5, pc}
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
6528: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_READ;
652c: e3a03001 mov r3, #1
6530: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
6534: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
6538: eaffff59 b 62a4 <rtems_aio_enqueue>
00006544 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
6544: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
6548: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
654c: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
6550: e5900000 ldr r0, [r0]
6554: eb0017c9 bl c480 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
6558: e2000003 and r0, r0, #3
655c: e2400001 sub r0, r0, #1
6560: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
6564: 83a05009 movhi r5, #9
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
6568: 8a00000d bhi 65a4 <aio_write+0x60>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
656c: e5943014 ldr r3, [r4, #20]
6570: e3530000 cmp r3, #0
6574: 1a000007 bne 6598 <aio_write+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
6578: e5943008 ldr r3, [r4, #8]
657c: e3530000 cmp r3, #0
6580: ba000004 blt 6598 <aio_write+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
6584: e3a00018 mov r0, #24
6588: ebfff327 bl 322c <malloc>
if (req == NULL)
658c: e2503000 subs r3, r0, #0
6590: 1a00000a bne 65c0 <aio_write+0x7c>
6594: ea000001 b 65a0 <aio_write+0x5c> <== NOT EXECUTED
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
6598: e3a05016 mov r5, #22
659c: ea000000 b 65a4 <aio_write+0x60>
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
65a0: e3a0500b mov r5, #11 <== NOT EXECUTED
65a4: e3e03000 mvn r3, #0
65a8: e5845030 str r5, [r4, #48] ; 0x30
65ac: e5843034 str r3, [r4, #52] ; 0x34
65b0: eb002487 bl f7d4 <__errno>
65b4: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
65b8: e3e00000 mvn r0, #0
65bc: e8bd8030 pop {r4, r5, pc}
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
65c0: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_WRITE;
65c4: e3a03002 mov r3, #2
65c8: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
65cc: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
65d0: eaffff33 b 62a4 <rtems_aio_enqueue>
0000a600 <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
a600: e3500000 cmp r0, #0
a604: 0a00000b beq a638 <pthread_attr_setschedpolicy+0x38>
a608: e5903000 ldr r3, [r0]
a60c: e3530000 cmp r3, #0
a610: 0a000008 beq a638 <pthread_attr_setschedpolicy+0x38>
return EINVAL;
switch ( policy ) {
a614: e3510004 cmp r1, #4
a618: 8a000008 bhi a640 <pthread_attr_setschedpolicy+0x40>
a61c: e3a03001 mov r3, #1
a620: e1a03113 lsl r3, r3, r1
a624: e3130017 tst r3, #23
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
a628: 15801014 strne r1, [r0, #20]
return 0;
a62c: 13a00000 movne r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
a630: 112fff1e bxne lr
a634: ea000001 b a640 <pthread_attr_setschedpolicy+0x40> <== NOT EXECUTED
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
a638: e3a00016 mov r0, #22
a63c: e12fff1e bx lr
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
a640: e3a00086 mov r0, #134 ; 0x86
}
}
a644: e12fff1e bx lr
00021ac4 <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
21ac4: e92d41f1 push {r0, r4, r5, r6, r7, r8, lr}
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
21ac8: e2517000 subs r7, r1, #0
21acc: 0a000002 beq 21adc <pthread_kill+0x18>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
21ad0: e2478001 sub r8, r7, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
21ad4: e358001f cmp r8, #31
21ad8: 9a000002 bls 21ae8 <pthread_kill+0x24>
rtems_set_errno_and_return_minus_one( EINVAL );
21adc: ebffc13a bl 11fcc <__errno>
21ae0: e3a03016 mov r3, #22
21ae4: ea000022 b 21b74 <pthread_kill+0xb0>
the_thread = _Thread_Get( thread, &location );
21ae8: e1a0100d mov r1, sp
21aec: ebffaae0 bl c674 <_Thread_Get>
switch ( location ) {
21af0: e59d6000 ldr r6, [sp]
21af4: e3560000 cmp r6, #0
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
the_thread = _Thread_Get( thread, &location );
21af8: e1a05000 mov r5, r0
switch ( location ) {
21afc: 1a00001a bne 21b6c <pthread_kill+0xa8>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
21b00: e59f2078 ldr r2, [pc, #120] ; 21b80 <pthread_kill+0xbc>
21b04: e3a0100c mov r1, #12
21b08: e0222791 mla r2, r1, r7, r2
21b0c: e5922008 ldr r2, [r2, #8]
21b10: e3520001 cmp r2, #1
case OBJECTS_LOCAL:
/*
* If sig == 0 then just validate arguments
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
21b14: e59030fc ldr r3, [r0, #252] ; 0xfc
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
21b18: 1a000002 bne 21b28 <pthread_kill+0x64>
_Thread_Enable_dispatch();
21b1c: ebffaacb bl c650 <_Thread_Enable_dispatch>
return 0;
21b20: e1a00006 mov r0, r6
21b24: ea000014 b 21b7c <pthread_kill+0xb8>
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
21b28: e59320d4 ldr r2, [r3, #212] ; 0xd4
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
21b2c: e3a04001 mov r4, #1
21b30: e1828814 orr r8, r2, r4, lsl r8
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
21b34: e1a01007 mov r1, r7
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
21b38: e58380d4 str r8, [r3, #212] ; 0xd4
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
21b3c: e1a02006 mov r2, r6
21b40: ebffff99 bl 219ac <_POSIX_signals_Unblock_thread>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
21b44: e59f3038 ldr r3, [pc, #56] ; 21b84 <pthread_kill+0xc0>
21b48: e5932000 ldr r2, [r3]
21b4c: e3520000 cmp r2, #0
21b50: 0a000002 beq 21b60 <pthread_kill+0x9c>
21b54: e5932004 ldr r2, [r3, #4]
21b58: e1550002 cmp r5, r2
_Thread_Dispatch_necessary = true;
21b5c: 05c34010 strbeq r4, [r3, #16]
}
_Thread_Enable_dispatch();
21b60: ebffaaba bl c650 <_Thread_Enable_dispatch>
return 0;
21b64: e3a00000 mov r0, #0
21b68: ea000003 b 21b7c <pthread_kill+0xb8>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
21b6c: ebffc116 bl 11fcc <__errno> <== NOT EXECUTED
21b70: e3a03003 mov r3, #3 <== NOT EXECUTED
21b74: e5803000 str r3, [r0]
21b78: e3e00000 mvn r0, #0
}
21b7c: e8bd81f8 pop {r3, r4, r5, r6, r7, r8, pc}
00007444 <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
7444: e3500000 cmp r0, #0
7448: 0a000007 beq 746c <pthread_mutexattr_setpshared+0x28>
744c: e5903000 ldr r3, [r0]
7450: e3530000 cmp r3, #0
7454: 0a000004 beq 746c <pthread_mutexattr_setpshared+0x28>
return EINVAL;
switch ( pshared ) {
7458: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
745c: 95801004 strls r1, [r0, #4]
return 0;
7460: 93a00000 movls r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
7464: 912fff1e bxls lr
7468: ea000001 b 7474 <pthread_mutexattr_setpshared+0x30> <== NOT EXECUTED
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
746c: e3a00016 mov r0, #22
7470: e12fff1e bx lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
7474: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
7478: e12fff1e bx lr <== NOT EXECUTED
000070b0 <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
70b0: e3500000 cmp r0, #0
70b4: 0a000007 beq 70d8 <pthread_rwlockattr_setpshared+0x28>
return EINVAL;
if ( !attr->is_initialized )
70b8: e5903000 ldr r3, [r0]
70bc: e3530000 cmp r3, #0
70c0: 0a000004 beq 70d8 <pthread_rwlockattr_setpshared+0x28>
return EINVAL;
switch ( pshared ) {
70c4: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
70c8: 95801004 strls r1, [r0, #4]
return 0;
70cc: 93a00000 movls r0, #0
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
70d0: 912fff1e bxls lr
70d4: ea000001 b 70e0 <pthread_rwlockattr_setpshared+0x30> <== NOT EXECUTED
{
if ( !attr )
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
70d8: e3a00016 mov r0, #22
70dc: e12fff1e bx lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
70e0: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
70e4: e12fff1e bx lr <== NOT EXECUTED
000062a4 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
62a4: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
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);
62a8: e59f41ec ldr r4, [pc, #492] ; 649c <rtems_aio_enqueue+0x1f8>
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
62ac: e24dd024 sub sp, sp, #36 ; 0x24
62b0: e1a06000 mov r6, r0
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);
62b4: e1a00004 mov r0, r4
62b8: eb00024d bl 6bf4 <pthread_mutex_lock>
if (result != 0) {
62bc: e2505000 subs r5, r0, #0
62c0: 0a000002 beq 62d0 <rtems_aio_enqueue+0x2c>
free (req);
62c4: e1a00006 mov r0, r6 <== NOT EXECUTED
62c8: ebfff271 bl 2c94 <free> <== NOT EXECUTED
return result;
62cc: ea00006f b 6490 <rtems_aio_enqueue+0x1ec> <== 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);
62d0: eb000450 bl 7418 <pthread_self>
62d4: e28d101c add r1, sp, #28
62d8: e1a0200d mov r2, sp
62dc: eb000359 bl 7048 <pthread_getschedparam>
req->caller_thread = pthread_self ();
62e0: eb00044c bl 7418 <pthread_self>
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
62e4: e5963014 ldr r3, [r6, #20]
62e8: e59d1000 ldr r1, [sp]
62ec: e5932014 ldr r2, [r3, #20]
62f0: e0622001 rsb r2, r2, r1
62f4: e586200c str r2, [r6, #12]
req->policy = policy;
62f8: e59d201c ldr r2, [sp, #28]
62fc: e5862008 str r2, [r6, #8]
req->aiocbp->error_code = EINPROGRESS;
6300: e3a02077 mov r2, #119 ; 0x77
/* _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 ();
6304: e5860010 str r0, [r6, #16]
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
6308: e5832030 str r2, [r3, #48] ; 0x30
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
630c: e5942068 ldr r2, [r4, #104] ; 0x68
6310: e3520000 cmp r2, #0
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;
6314: e5835034 str r5, [r3, #52] ; 0x34
if ((aio_request_queue.idle_threads == 0) &&
6318: 1a00002e bne 63d8 <rtems_aio_enqueue+0x134>
631c: e5942064 ldr r2, [r4, #100] ; 0x64
6320: e3520004 cmp r2, #4
6324: ca00002b bgt 63d8 <rtems_aio_enqueue+0x134>
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);
6328: e5931000 ldr r1, [r3]
632c: e2840048 add r0, r4, #72 ; 0x48
6330: e3a02001 mov r2, #1
6334: ebfffece bl 5e74 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
6338: e5903018 ldr r3, [r0, #24]
633c: e3530001 cmp r3, #1
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);
6340: e1a07000 mov r7, r0
6344: e2809008 add r9, r0, #8
6348: e280801c add r8, r0, #28
634c: e280a020 add sl, r0, #32
if (r_chain->new_fd == 1) {
6350: 1a000017 bne 63b4 <rtems_aio_enqueue+0x110>
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
6354: e1a01006 mov r1, r6
6358: e1a00009 mov r0, r9
635c: eb00084a bl 848c <_Chain_Insert>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
6360: e1a01005 mov r1, r5
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;
6364: e5875018 str r5, [r7, #24]
pthread_mutex_init (&r_chain->mutex, NULL);
6368: e1a00008 mov r0, r8
636c: eb0001ce bl 6aac <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
6370: e1a01005 mov r1, r5
6374: e1a0000a mov r0, sl
6378: eb0000e3 bl 670c <pthread_cond_init>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
637c: e1a03007 mov r3, r7
6380: e28d0020 add r0, sp, #32
6384: e2841008 add r1, r4, #8
6388: e59f2110 ldr r2, [pc, #272] ; 64a0 <rtems_aio_enqueue+0x1fc>
638c: eb000299 bl 6df8 <pthread_create>
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
6390: e2506000 subs r6, r0, #0
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
++aio_request_queue.active_threads;
6394: 05943064 ldreq r3, [r4, #100] ; 0x64
6398: 02833001 addeq r3, r3, #1
639c: 05843064 streq r3, [r4, #100] ; 0x64
pthread_cond_init (&r_chain->cond, NULL);
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
63a0: 0a000038 beq 6488 <rtems_aio_enqueue+0x1e4>
pthread_mutex_unlock (&aio_request_queue.mutex);
63a4: e1a00004 mov r0, r4 <== NOT EXECUTED
63a8: eb000230 bl 6c70 <pthread_mutex_unlock> <== NOT EXECUTED
return result;
63ac: e1a05006 mov r5, r6 <== NOT EXECUTED
63b0: ea000036 b 6490 <rtems_aio_enqueue+0x1ec> <== NOT EXECUTED
}
++aio_request_queue.active_threads;
}
else {
/* put request in the fd chain it belongs to */
pthread_mutex_lock (&r_chain->mutex);
63b4: e1a00008 mov r0, r8
63b8: eb00020d bl 6bf4 <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
63bc: e1a00009 mov r0, r9
63c0: e1a01006 mov r1, r6
63c4: ebffff76 bl 61a4 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
63c8: e1a0000a mov r0, sl
63cc: eb0000fe bl 67cc <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
63d0: e1a00008 mov r0, r8
63d4: ea00000e b 6414 <rtems_aio_enqueue+0x170>
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,
63d8: e59f00c4 ldr r0, [pc, #196] ; 64a4 <rtems_aio_enqueue+0x200>
63dc: e5931000 ldr r1, [r3]
63e0: e3a02000 mov r2, #0
63e4: ebfffea2 bl 5e74 <rtems_aio_search_fd>
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
63e8: e2504000 subs r4, r0, #0
63ec: 0a00000a beq 641c <rtems_aio_enqueue+0x178>
{
pthread_mutex_lock (&r_chain->mutex);
63f0: e284701c add r7, r4, #28
63f4: e1a00007 mov r0, r7
63f8: eb0001fd bl 6bf4 <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
63fc: e2840008 add r0, r4, #8
6400: e1a01006 mov r1, r6
6404: ebffff66 bl 61a4 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
6408: e2840020 add r0, r4, #32
640c: eb0000ee bl 67cc <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
6410: e1a00007 mov r0, r7
6414: eb000215 bl 6c70 <pthread_mutex_unlock>
6418: ea00001a b 6488 <rtems_aio_enqueue+0x1e4>
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
641c: e5963014 ldr r3, [r6, #20]
6420: e59f0080 ldr r0, [pc, #128] ; 64a8 <rtems_aio_enqueue+0x204>
6424: e5931000 ldr r1, [r3]
6428: e3a02001 mov r2, #1
642c: ebfffe90 bl 5e74 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
6430: e5903018 ldr r3, [r0, #24]
6434: e3530001 cmp r3, #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);
6438: e1a07000 mov r7, r0
643c: e2800008 add r0, r0, #8
if (r_chain->new_fd == 1) {
6440: 1a000009 bne 646c <rtems_aio_enqueue+0x1c8>
6444: e1a01006 mov r1, r6
6448: eb00080f bl 848c <_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);
644c: e1a01004 mov r1, r4
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;
6450: e5874018 str r4, [r7, #24]
pthread_mutex_init (&r_chain->mutex, NULL);
6454: e287001c add r0, r7, #28
6458: eb000193 bl 6aac <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
645c: e2870020 add r0, r7, #32
6460: e1a01004 mov r1, r4
6464: eb0000a8 bl 670c <pthread_cond_init>
6468: ea000001 b 6474 <rtems_aio_enqueue+0x1d0>
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
646c: e1a01006 mov r1, r6
6470: ebffff4b bl 61a4 <rtems_aio_insert_prio>
if (aio_request_queue.idle_threads > 0)
6474: e59f0020 ldr r0, [pc, #32] ; 649c <rtems_aio_enqueue+0x1f8>
6478: e5903068 ldr r3, [r0, #104] ; 0x68
647c: e3530000 cmp r3, #0
pthread_cond_signal (&aio_request_queue.new_req);
6480: c2800004 addgt r0, r0, #4
6484: cb0000d0 blgt 67cc <pthread_cond_signal>
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
6488: e59f000c ldr r0, [pc, #12] ; 649c <rtems_aio_enqueue+0x1f8>
648c: eb0001f7 bl 6c70 <pthread_mutex_unlock>
return 0;
}
6490: e1a00005 mov r0, r5
6494: e28dd024 add sp, sp, #36 ; 0x24
6498: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
00005f58 <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
5f58: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
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);
5f5c: e59f4238 ldr r4, [pc, #568] ; 619c <rtems_aio_handle+0x244>
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
5f60: e24dd02c sub sp, sp, #44 ; 0x2c
5f64: e1a05000 mov r5, r0
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
5f68: e28d7020 add r7, sp, #32
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);
5f6c: e28db004 add fp, sp, #4
/* 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);
5f70: e285a01c add sl, r5, #28
5f74: e1a0000a mov r0, sl
5f78: eb00031d bl 6bf4 <pthread_mutex_lock>
if (result != 0)
5f7c: e2509000 subs r9, r0, #0
5f80: 1a000082 bne 6190 <rtems_aio_handle+0x238>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
5f84: e5956008 ldr r6, [r5, #8]
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
5f88: e285300c add r3, r5, #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)) {
5f8c: e1560003 cmp r6, r3
5f90: 0a000035 beq 606c <rtems_aio_handle+0x114>
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);
5f94: eb00051f bl 7418 <pthread_self>
5f98: e28d1028 add r1, sp, #40 ; 0x28
5f9c: e1a0200b mov r2, fp
5fa0: eb000428 bl 7048 <pthread_getschedparam>
param.sched_priority = req->priority;
5fa4: e596300c ldr r3, [r6, #12]
5fa8: e58d3004 str r3, [sp, #4]
pthread_setschedparam (pthread_self(), req->policy, ¶m);
5fac: eb000519 bl 7418 <pthread_self>
5fb0: e1a0200b mov r2, fp
5fb4: e5961008 ldr r1, [r6, #8]
5fb8: eb00051b bl 742c <pthread_setschedparam>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
5fbc: e1a00006 mov r0, r6
5fc0: eb00091c bl 8438 <_Chain_Extract>
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
5fc4: e1a0000a mov r0, sl
5fc8: eb000328 bl 6c70 <pthread_mutex_unlock>
switch (req->aiocbp->aio_lio_opcode) {
5fcc: e5962014 ldr r2, [r6, #20]
5fd0: e592302c ldr r3, [r2, #44] ; 0x2c
5fd4: e3530002 cmp r3, #2
5fd8: 0a00000b beq 600c <rtems_aio_handle+0xb4>
5fdc: e3530003 cmp r3, #3
5fe0: 0a000011 beq 602c <rtems_aio_handle+0xd4>
5fe4: e3530001 cmp r3, #1
5fe8: 1a000013 bne 603c <rtems_aio_handle+0xe4>
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
5fec: e5921008 ldr r1, [r2, #8]
5ff0: e5923004 ldr r3, [r2, #4]
5ff4: e58d1000 str r1, [sp]
5ff8: e592100c ldr r1, [r2, #12]
5ffc: e5920000 ldr r0, [r2]
6000: e5922010 ldr r2, [r2, #16]
6004: eb0028f6 bl 103e4 <pread>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
6008: ea000009 b 6034 <rtems_aio_handle+0xdc>
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
600c: e5921008 ldr r1, [r2, #8]
6010: e5923004 ldr r3, [r2, #4]
6014: e58d1000 str r1, [sp]
6018: e592100c ldr r1, [r2, #12]
601c: e5920000 ldr r0, [r2]
6020: e5922010 ldr r2, [r2, #16]
6024: eb002938 bl 1050c <pwrite>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
6028: ea000001 b 6034 <rtems_aio_handle+0xdc>
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
602c: e5920000 ldr r0, [r2] <== NOT EXECUTED
6030: eb001987 bl c654 <fsync> <== NOT EXECUTED
break;
default:
result = -1;
}
if (result == -1) {
6034: e3700001 cmn r0, #1
6038: 1a000006 bne 6058 <rtems_aio_handle+0x100>
req->aiocbp->return_value = -1;
603c: e5966014 ldr r6, [r6, #20] <== NOT EXECUTED
6040: e3e02000 mvn r2, #0 <== NOT EXECUTED
6044: e5862034 str r2, [r6, #52] ; 0x34 <== NOT EXECUTED
req->aiocbp->error_code = errno;
6048: eb0025e1 bl f7d4 <__errno> <== NOT EXECUTED
604c: e5903000 ldr r3, [r0] <== NOT EXECUTED
6050: e5863030 str r3, [r6, #48] ; 0x30 <== NOT EXECUTED
6054: eaffffc5 b 5f70 <rtems_aio_handle+0x18> <== NOT EXECUTED
} else {
req->aiocbp->return_value = result;
6058: e5963014 ldr r3, [r6, #20]
req->aiocbp->error_code = 0;
605c: e3a02000 mov r2, #0
}
if (result == -1) {
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
} else {
req->aiocbp->return_value = result;
6060: e5830034 str r0, [r3, #52] ; 0x34
req->aiocbp->error_code = 0;
6064: e5832030 str r2, [r3, #48] ; 0x30
6068: eaffffc0 b 5f70 <rtems_aio_handle+0x18>
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);
606c: e59f8128 ldr r8, [pc, #296] ; 619c <rtems_aio_handle+0x244>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
6070: e1a0000a mov r0, sl
6074: eb0002fd bl 6c70 <pthread_mutex_unlock>
pthread_mutex_lock (&aio_request_queue.mutex);
6078: e1a00008 mov r0, r8
607c: eb0002dc bl 6bf4 <pthread_mutex_lock>
if (rtems_chain_is_empty (chain))
6080: e5953008 ldr r3, [r5, #8]
6084: e1530006 cmp r3, r6
6088: 1a00003d bne 6184 <rtems_aio_handle+0x22c>
{
clock_gettime (CLOCK_REALTIME, &timeout);
608c: e1a01007 mov r1, r7
6090: e3a00001 mov r0, #1
6094: eb00014e bl 65d4 <clock_gettime>
timeout.tv_sec += 3;
6098: e59d3020 ldr r3, [sp, #32]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
609c: e2856020 add r6, r5, #32
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
60a0: e2833003 add r3, r3, #3
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
60a4: e1a00006 mov r0, r6
60a8: e1a01008 mov r1, r8
60ac: e1a02007 mov r2, r7
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
60b0: e58d3020 str r3, [sp, #32]
timeout.tv_nsec = 0;
60b4: e58d9024 str r9, [sp, #36] ; 0x24
result = pthread_cond_timedwait (&r_chain->cond,
60b8: eb0001da bl 6828 <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) {
60bc: e3500074 cmp r0, #116 ; 0x74
60c0: 1a00002f bne 6184 <rtems_aio_handle+0x22c>
60c4: e1a00005 mov r0, r5
60c8: eb0008da bl 8438 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
60cc: e1a0000a mov r0, sl
60d0: eb000229 bl 697c <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->cond);
60d4: e1a00006 mov r0, r6
60d8: eb00015b bl 664c <pthread_cond_destroy>
free (r_chain);
60dc: e1a00005 mov r0, r5
60e0: ebfff2eb bl 2c94 <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)) {
60e4: e5943054 ldr r3, [r4, #84] ; 0x54
60e8: e59f20b0 ldr r2, [pc, #176] ; 61a0 <rtems_aio_handle+0x248>
60ec: e1530002 cmp r3, r2
60f0: 1a000018 bne 6158 <rtems_aio_handle+0x200>
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
60f4: e5943068 ldr r3, [r4, #104] ; 0x68
60f8: e2833001 add r3, r3, #1
60fc: e5843068 str r3, [r4, #104] ; 0x68
--aio_request_queue.active_threads;
6100: e5943064 ldr r3, [r4, #100] ; 0x64
clock_gettime (CLOCK_REALTIME, &timeout);
6104: e1a01007 mov r1, r7
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;
--aio_request_queue.active_threads;
6108: e2433001 sub r3, r3, #1
clock_gettime (CLOCK_REALTIME, &timeout);
610c: e3a00001 mov r0, #1
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;
--aio_request_queue.active_threads;
6110: e5843064 str r3, [r4, #100] ; 0x64
clock_gettime (CLOCK_REALTIME, &timeout);
6114: eb00012e bl 65d4 <clock_gettime>
timeout.tv_sec += 3;
6118: e59d3020 ldr r3, [sp, #32]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
611c: e2880004 add r0, r8, #4
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;
6120: e2833003 add r3, r3, #3
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6124: e1a01008 mov r1, r8
6128: e1a02007 mov r2, r7
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;
612c: e58d3020 str r3, [sp, #32]
timeout.tv_nsec = 0;
6130: e58d9024 str r9, [sp, #36] ; 0x24
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6134: eb0001bb bl 6828 <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) {
6138: e3500074 cmp r0, #116 ; 0x74
613c: 1a000005 bne 6158 <rtems_aio_handle+0x200>
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
6140: e5983068 ldr r3, [r8, #104] ; 0x68
pthread_mutex_unlock (&aio_request_queue.mutex);
6144: e1a00008 mov r0, r8
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
6148: e2433001 sub r3, r3, #1
614c: e5883068 str r3, [r8, #104] ; 0x68
pthread_mutex_unlock (&aio_request_queue.mutex);
6150: eb0002c6 bl 6c70 <pthread_mutex_unlock>
return NULL;
6154: ea00000d b 6190 <rtems_aio_handle+0x238>
}
}
/* 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;
6158: e5943068 ldr r3, [r4, #104] ; 0x68
615c: e2433001 sub r3, r3, #1
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6160: e5945054 ldr r5, [r4, #84] ; 0x54
}
}
/* 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;
6164: e5843068 str r3, [r4, #104] ; 0x68
++aio_request_queue.active_threads;
6168: e5943064 ldr r3, [r4, #100] ; 0x64
616c: e1a00005 mov r0, r5
6170: e2833001 add r3, r3, #1
6174: e5843064 str r3, [r4, #100] ; 0x64
6178: eb0008ae bl 8438 <_Chain_Extract>
node = rtems_chain_first (&aio_request_queue.idle_req);
rtems_chain_extract (node);
r_chain = (rtems_aio_request_chain *) node;
rtems_aio_move_to_work (r_chain);
617c: e1a00005 mov r0, r5
6180: ebffff65 bl 5f1c <rtems_aio_move_to_work>
}
}
/* If there was a request added in the initial fd chain then release
the mutex and process it */
pthread_mutex_unlock (&aio_request_queue.mutex);
6184: e59f0010 ldr r0, [pc, #16] ; 619c <rtems_aio_handle+0x244>
6188: eb0002b8 bl 6c70 <pthread_mutex_unlock>
618c: eaffff77 b 5f70 <rtems_aio_handle+0x18>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6190: e3a00000 mov r0, #0
6194: e28dd02c add sp, sp, #44 ; 0x2c
6198: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00005db4 <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
5db4: e92d4010 push {r4, lr}
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
5db8: e59f00a4 ldr r0, [pc, #164] ; 5e64 <rtems_aio_init+0xb0>
5dbc: eb0003ed bl 6d78 <pthread_attr_init>
if (result != 0)
5dc0: e2504000 subs r4, r0, #0
5dc4: 1a000024 bne 5e5c <rtems_aio_init+0xa8>
return result;
result =
5dc8: e59f0094 ldr r0, [pc, #148] ; 5e64 <rtems_aio_init+0xb0>
5dcc: e1a01004 mov r1, r4
5dd0: eb0003fa bl 6dc0 <pthread_attr_setdetachstate>
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
5dd4: e3500000 cmp r0, #0
pthread_attr_destroy (&aio_request_queue.attr);
5dd8: 159f0084 ldrne r0, [pc, #132] ; 5e64 <rtems_aio_init+0xb0>
5ddc: 1b0003dc blne 6d54 <pthread_attr_destroy>
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
5de0: e59f0080 ldr r0, [pc, #128] ; 5e68 <rtems_aio_init+0xb4>
5de4: e3a01000 mov r1, #0
5de8: eb00032f bl 6aac <pthread_mutex_init>
if (result != 0)
5dec: e3500000 cmp r0, #0
pthread_attr_destroy (&aio_request_queue.attr);
5df0: 159f006c ldrne r0, [pc, #108] ; 5e64 <rtems_aio_init+0xb0>
5df4: 1b0003d6 blne 6d54 <pthread_attr_destroy>
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
5df8: e59f006c ldr r0, [pc, #108] ; 5e6c <rtems_aio_init+0xb8>
5dfc: e3a01000 mov r1, #0
5e00: eb000241 bl 670c <pthread_cond_init>
if (result != 0) {
5e04: e2504000 subs r4, r0, #0
5e08: 0a000003 beq 5e1c <rtems_aio_init+0x68>
pthread_mutex_destroy (&aio_request_queue.mutex);
5e0c: e59f0054 ldr r0, [pc, #84] ; 5e68 <rtems_aio_init+0xb4> <== NOT EXECUTED
5e10: eb0002d9 bl 697c <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
5e14: e59f0048 ldr r0, [pc, #72] ; 5e64 <rtems_aio_init+0xb0> <== NOT EXECUTED
5e18: eb0003cd bl 6d54 <pthread_attr_destroy> <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
5e1c: e59f3044 ldr r3, [pc, #68] ; 5e68 <rtems_aio_init+0xb4>
5e20: e283204c add r2, r3, #76 ; 0x4c
head->previous = NULL;
tail->previous = head;
5e24: e2831048 add r1, r3, #72 ; 0x48
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
5e28: e5832048 str r2, [r3, #72] ; 0x48
head->previous = NULL;
5e2c: e3a02000 mov r2, #0
5e30: e583204c str r2, [r3, #76] ; 0x4c
tail->previous = head;
5e34: e5831050 str r1, [r3, #80] ; 0x50
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
5e38: e5832058 str r2, [r3, #88] ; 0x58
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
5e3c: e2831058 add r1, r3, #88 ; 0x58
}
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
5e40: e5832064 str r2, [r3, #100] ; 0x64
aio_request_queue.idle_threads = 0;
5e44: e5832068 str r2, [r3, #104] ; 0x68
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
5e48: e59f2020 ldr r2, [pc, #32] ; 5e70 <rtems_aio_init+0xbc>
5e4c: e5831054 str r1, [r3, #84] ; 0x54
head->previous = NULL;
tail->previous = head;
5e50: e2831054 add r1, r3, #84 ; 0x54
5e54: e583105c str r1, [r3, #92] ; 0x5c
5e58: e5832060 str r2, [r3, #96] ; 0x60
return result;
}
5e5c: e1a00004 mov r0, r4
5e60: e8bd8010 pop {r4, pc}
000061a4 <rtems_aio_insert_prio>:
61a4: e1a03000 mov r3, r0
61a8: e4932004 ldr r2, [r3], #4
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
61ac: e1520003 cmp r2, r3
* NONE
*/
void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
61b0: e1a0c001 mov ip, r1
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
61b4: 0a00000d beq 61f0 <rtems_aio_insert_prio+0x4c>
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;
61b8: e5921014 ldr r1, [r2, #20]
while (req->aiocbp->aio_reqprio > prio &&
61bc: e59c0014 ldr r0, [ip, #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;
61c0: e5911014 ldr r1, [r1, #20]
while (req->aiocbp->aio_reqprio > prio &&
61c4: e5900014 ldr r0, [r0, #20]
61c8: ea000002 b 61d8 <rtems_aio_insert_prio+0x34>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
61cc: e5922000 ldr r2, [r2] <== 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;
61d0: e5921014 ldr r1, [r2, #20] <== NOT EXECUTED
61d4: e5911014 ldr r1, [r1, #20] <== 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 &&
61d8: e1500001 cmp r0, r1
61dc: da000001 ble 61e8 <rtems_aio_insert_prio+0x44>
61e0: e1520003 cmp r2, r3 <== NOT EXECUTED
61e4: 1afffff8 bne 61cc <rtems_aio_insert_prio+0x28> <== 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 );
61e8: e5920004 ldr r0, [r2, #4]
61ec: e1a0100c mov r1, ip
61f0: ea0008a5 b 848c <_Chain_Insert>
0000623c <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)
{
623c: e92d4010 push {r4, lr}
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6240: e1a03000 mov r3, r0
6244: e4934004 ldr r4, [r3], #4
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
6248: e1540003 cmp r4, r3
return AIO_ALLDONE;
624c: 03a00002 moveq r0, #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))
6250: 1a000003 bne 6264 <rtems_aio_remove_req+0x28>
6254: e8bd8010 pop {r4, pc}
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6258: e5904000 ldr r4, [r0] <== 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) {
625c: e1540003 cmp r4, r3 <== NOT EXECUTED
6260: 0a00000d beq 629c <rtems_aio_remove_req+0x60> <== NOT EXECUTED
6264: e5942014 ldr r2, [r4, #20]
6268: e1520001 cmp r2, r1
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
626c: e1a00004 mov r0, r4
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) {
6270: 1afffff8 bne 6258 <rtems_aio_remove_req+0x1c>
6274: eb00086f bl 8438 <_Chain_Extract>
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
6278: e5943014 ldr r3, [r4, #20]
627c: e3a0208c mov r2, #140 ; 0x8c
6280: e5832030 str r2, [r3, #48] ; 0x30
current->aiocbp->return_value = -1;
6284: e3e02000 mvn r2, #0
free (current);
6288: e1a00004 mov r0, r4
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
current->aiocbp->return_value = -1;
628c: e5832034 str r2, [r3, #52] ; 0x34
free (current);
6290: ebfff27f bl 2c94 <free>
}
return AIO_CANCELED;
6294: e3a00000 mov r0, #0
6298: e8bd8010 pop {r4, pc}
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
629c: e3a00001 mov r0, #1 <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
62a0: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00005b34 <sigaction>:
struct sigaction *oact
)
{
ISR_Level level;
if ( oact )
5b34: e2523000 subs r3, r2, #0
*oact = _POSIX_signals_Vectors[ sig ];
5b38: 159f20b8 ldrne r2, [pc, #184] ; 5bf8 <sigaction+0xc4>
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
5b3c: e92d40f0 push {r4, r5, r6, r7, lr}
5b40: e1a05001 mov r5, r1
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
5b44: 13a0100c movne r1, #12
5b48: 10222091 mlane r2, r1, r0, r2
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
5b4c: e1a04000 mov r4, r0
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
5b50: 18920007 ldmne r2, {r0, r1, r2}
5b54: 18830007 stmne r3, {r0, r1, r2}
if ( !sig )
5b58: e3540000 cmp r4, #0
5b5c: 0a000004 beq 5b74 <sigaction+0x40>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
5b60: e2443001 sub r3, r4, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
5b64: e353001f cmp r3, #31
5b68: 8a000001 bhi 5b74 <sigaction+0x40>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
5b6c: e3540009 cmp r4, #9
5b70: 1a000004 bne 5b88 <sigaction+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
5b74: eb002141 bl e080 <__errno>
5b78: e3a03016 mov r3, #22
5b7c: e5803000 str r3, [r0]
5b80: e3e00000 mvn r0, #0
5b84: e8bd80f0 pop {r4, r5, r6, r7, pc}
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
5b88: e3550000 cmp r5, #0
5b8c: 0a000017 beq 5bf0 <sigaction+0xbc>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
5b90: e10f6000 mrs r6, CPSR
5b94: e3863080 orr r3, r6, #128 ; 0x80
5b98: e129f003 msr CPSR_fc, r3
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
5b9c: e5953008 ldr r3, [r5, #8]
5ba0: e3530000 cmp r3, #0
5ba4: e59f704c ldr r7, [pc, #76] ; 5bf8 <sigaction+0xc4>
5ba8: 1a000007 bne 5bcc <sigaction+0x98>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
5bac: e283300c add r3, r3, #12
5bb0: e0040493 mul r4, r3, r4
5bb4: e59f2040 ldr r2, [pc, #64] ; 5bfc <sigaction+0xc8>
5bb8: e0873004 add r3, r7, r4
5bbc: e0824004 add r4, r2, r4
5bc0: e8940007 ldm r4, {r0, r1, r2}
5bc4: e8830007 stm r3, {r0, r1, r2}
5bc8: ea000005 b 5be4 <sigaction+0xb0>
} else {
_POSIX_signals_Clear_process_signals( sig );
5bcc: e1a00004 mov r0, r4
5bd0: eb0015e2 bl b360 <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
5bd4: e3a0300c mov r3, #12
5bd8: e0247493 mla r4, r3, r4, r7
5bdc: e8950007 ldm r5, {r0, r1, r2}
5be0: e8840007 stm r4, {r0, r1, r2}
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
5be4: e129f006 msr CPSR_fc, r6
* 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;
5be8: e3a00000 mov r0, #0
5bec: e8bd80f0 pop {r4, r5, r6, r7, pc}
5bf0: e1a00005 mov r0, r5 <== NOT EXECUTED
}
5bf4: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
00008130 <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
8130: e92d4010 push {r4, lr}
8134: e1a04001 mov r4, r1
int status;
status = sigtimedwait( set, NULL, NULL );
8138: e3a01000 mov r1, #0
813c: e1a02001 mov r2, r1
8140: ebffff84 bl 7f58 <sigtimedwait>
if ( status != -1 ) {
8144: e3700001 cmn r0, #1
8148: 0a000004 beq 8160 <sigwait+0x30>
if ( sig )
814c: e3540000 cmp r4, #0
*sig = status;
8150: 15840000 strne r0, [r4]
return 0;
8154: 13a00000 movne r0, #0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
8158: 18bd8010 popne {r4, pc}
815c: ea000002 b 816c <sigwait+0x3c> <== NOT EXECUTED
*sig = status;
return 0;
}
return errno;
8160: eb00206f bl 10324 <__errno>
8164: e5900000 ldr r0, [r0]
8168: e8bd8010 pop {r4, pc}
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
*sig = status;
return 0;
816c: e1a00004 mov r0, r4 <== NOT EXECUTED
}
return errno;
}
8170: e8bd8010 pop {r4, pc} <== NOT EXECUTED