RTEMS 4.11Annotated Report
Thu Dec 20 20:04:44 2012
000072fc <_Internal_error_Occurred>:
void _Internal_error_Occurred(
Internal_errors_Source the_source,
bool is_internal,
Internal_errors_t the_error
)
{
72fc: e92d4007 push {r0, r1, r2, lr}
7300: e20160ff and r6, r1, #255 ; 0xff
7304: e1a04000 mov r4, r0
Internal_errors_Source source,
bool is_internal,
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
7308: e58d0000 str r0, [sp]
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
730c: e59f1040 ldr r1, [pc, #64] ; 7354 <_Internal_error_Occurred+0x58>
7310: e1a0000d mov r0, sp
7314: e1a05002 mov r5, r2
Internal_errors_Source source,
bool is_internal,
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
7318: e58d2008 str r2, [sp, #8]
731c: e5cd6004 strb r6, [sp, #4]
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
7320: eb00076e bl 90e0 <_User_extensions_Iterate>
_User_extensions_Fatal( the_source, is_internal, the_error );
_Internal_errors_What_happened.the_source = the_source;
7324: e59f302c ldr r3, [pc, #44] ; 7358 <_Internal_error_Occurred+0x5c><== NOT EXECUTED
7328: e5834000 str r4, [r3] <== NOT EXECUTED
_Internal_errors_What_happened.is_internal = is_internal;
732c: e5c36004 strb r6, [r3, #4] <== NOT EXECUTED
_Internal_errors_What_happened.the_error = the_error;
7330: e5835008 str r5, [r3, #8] <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _System_state_Set (
System_state_Codes state
)
{
_System_state_Current = state;
7334: e59f3020 ldr r3, [pc, #32] ; 735c <_Internal_error_Occurred+0x60><== NOT EXECUTED
7338: e3a02005 mov r2, #5 <== NOT EXECUTED
733c: e5832000 str r2, [r3] <== NOT EXECUTED
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
7340: e10f2000 mrs r2, CPSR <== NOT EXECUTED
7344: e3823080 orr r3, r2, #128 ; 0x80 <== NOT EXECUTED
7348: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
_System_state_Set( SYSTEM_STATE_FAILED );
_CPU_Fatal_halt( the_error );
734c: e1a00005 mov r0, r5 <== NOT EXECUTED
7350: eafffffe b 7350 <_Internal_error_Occurred+0x54> <== NOT EXECUTED
0000d018 <_POSIX_Keys_Run_destructors>:
*/
void _POSIX_Keys_Run_destructors(
Thread_Control *thread
)
{
d018: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id );
d01c: e5906008 ldr r6, [r0, #8]
*
* 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;
d020: e59f5080 ldr r5, [pc, #128] ; d0a8 <_POSIX_Keys_Run_destructors+0x90>
d024: e1a07c26 lsr r7, r6, #24
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 ];
d028: e1a06806 lsl r6, r6, #16
d02c: e2077007 and r7, r7, #7
d030: e1a06726 lsr r6, r6, #14
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
d034: e3a04001 mov r4, #1
*
* 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;
d038: e1d5a1b0 ldrh sl, [r5, #16]
done = true;
d03c: e1a02004 mov r2, r4
if ( key != NULL && key->destructor != NULL ) {
void *value = key->Values [ thread_api ][ thread_index ];
if ( value != NULL ) {
key->Values [ thread_api ][ thread_index ] = NULL;
d040: e3a08000 mov r8, #0
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
d044: ea000012 b d094 <_POSIX_Keys_Run_destructors+0x7c>
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
d048: e595301c ldr r3, [r5, #28]
d04c: e7933104 ldr r3, [r3, r4, lsl #2]
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
d050: e3530000 cmp r3, #0
d054: 0a00000b beq d088 <_POSIX_Keys_Run_destructors+0x70>
d058: e5931010 ldr r1, [r3, #16]
d05c: e3510000 cmp r1, #0
d060: 0a000008 beq d088 <_POSIX_Keys_Run_destructors+0x70>
void *value = key->Values [ thread_api ][ thread_index ];
d064: e2871005 add r1, r7, #5
d068: e7931101 ldr r1, [r3, r1, lsl #2]
d06c: e7910006 ldr r0, [r1, r6]
if ( value != NULL ) {
d070: e3500000 cmp r0, #0
d074: 0a000003 beq d088 <_POSIX_Keys_Run_destructors+0x70>
key->Values [ thread_api ][ thread_index ] = NULL;
d078: e7818006 str r8, [r1, r6] <== NOT EXECUTED
(*key->destructor)( value );
d07c: e1a0e00f mov lr, pc <== NOT EXECUTED
d080: e593f010 ldr pc, [r3, #16] <== NOT EXECUTED
done = false;
d084: e3a02000 mov r2, #0 <== NOT EXECUTED
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
d088: e2844001 add r4, r4, #1
d08c: e1a04804 lsl r4, r4, #16
d090: e1a04824 lsr r4, r4, #16
d094: e154000a cmp r4, sl
d098: 9affffea bls d048 <_POSIX_Keys_Run_destructors+0x30>
* 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 ) {
d09c: e3520000 cmp r2, #0
d0a0: 0affffe3 beq d034 <_POSIX_Keys_Run_destructors+0x1c>
done = false;
}
}
}
}
}
d0a4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
0000ce60 <_POSIX_Semaphore_Create_support>:
POSIX_Semaphore_Control *the_semaphore;
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
ce60: e3520000 cmp r2, #0
size_t name_len,
int pshared,
unsigned int value,
POSIX_Semaphore_Control **the_sem
)
{
ce64: e92d40f0 push {r4, r5, r6, r7, lr}
ce68: e1a04000 mov r4, r0
ce6c: e1a06001 mov r6, r1
ce70: e1a07003 mov r7, r3
POSIX_Semaphore_Control *the_semaphore;
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
ce74: 0a000002 beq ce84 <_POSIX_Semaphore_Create_support+0x24>
rtems_set_errno_and_return_minus_one( ENOSYS );
ce78: eb00099c bl f4f0 <__errno>
ce7c: e3a03058 mov r3, #88 ; 0x58
ce80: ea000018 b cee8 <_POSIX_Semaphore_Create_support+0x88>
*
* 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;
ce84: e59f30d8 ldr r3, [pc, #216] ; cf64 <_POSIX_Semaphore_Create_support+0x104>
ce88: e5932000 ldr r2, [r3]
++level;
ce8c: e2822001 add r2, r2, #1
_Thread_Dispatch_disable_level = level;
ce90: e5832000 str r2, [r3]
* _POSIX_Semaphore_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
ce94: e59f00cc ldr r0, [pc, #204] ; cf68 <_POSIX_Semaphore_Create_support+0x108>
ce98: ebffeffe bl 8e98 <_Objects_Allocate>
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
ce9c: e2505000 subs r5, r0, #0
cea0: 1a000003 bne ceb4 <_POSIX_Semaphore_Create_support+0x54>
_Thread_Enable_dispatch();
cea4: ebfff4c1 bl a1b0 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSPC );
cea8: eb000990 bl f4f0 <__errno>
ceac: e3a0301c mov r3, #28
ceb0: ea00000c b cee8 <_POSIX_Semaphore_Create_support+0x88>
/*
* Make a copy of the user's string for name just in case it was
* dynamically constructed.
*/
if ( name_arg != NULL ) {
ceb4: e3540000 cmp r4, #0
ceb8: 0a00000d beq cef4 <_POSIX_Semaphore_Create_support+0x94>
name = _Workspace_String_duplicate( name_arg, name_len );
cebc: e1a00004 mov r0, r4
cec0: e1a01006 mov r1, r6
cec4: eb000431 bl df90 <_Workspace_String_duplicate>
if ( !name ) {
cec8: e2504000 subs r4, r0, #0
cecc: 1a000008 bne cef4 <_POSIX_Semaphore_Create_support+0x94>
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
ced0: e59f0090 ldr r0, [pc, #144] ; cf68 <_POSIX_Semaphore_Create_support+0x108><== NOT EXECUTED
ced4: e1a01005 mov r1, r5 <== NOT EXECUTED
ced8: ebfff0bd bl 91d4 <_Objects_Free> <== NOT EXECUTED
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
cedc: ebfff4b3 bl a1b0 <_Thread_Enable_dispatch> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
cee0: eb000982 bl f4f0 <__errno> <== NOT EXECUTED
cee4: e3a0300c mov r3, #12 <== NOT EXECUTED
cee8: e5803000 str r3, [r0]
ceec: e3e00000 mvn r0, #0
cef0: e8bd80f0 pop {r4, r5, r6, r7, pc}
}
} else {
name = NULL;
}
the_semaphore->process_shared = pshared;
cef4: e3a03000 mov r3, #0
if ( name ) {
cef8: e1540003 cmp r4, r3
}
} else {
name = NULL;
}
the_semaphore->process_shared = pshared;
cefc: e5853010 str r3, [r5, #16]
if ( name ) {
the_semaphore->named = true;
cf00: 13a03001 movne r3, #1
cf04: 15c53014 strbne r3, [r5, #20]
the_semaphore->open_count = 1;
cf08: 15853018 strne r3, [r5, #24]
the_semaphore->linked = true;
cf0c: 15c53015 strbne r3, [r5, #21]
* 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;
cf10: e3a06000 mov r6, #0
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
cf14: e3e03000 mvn r3, #0
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
cf18: e285001c add r0, r5, #28
if ( name ) {
the_semaphore->named = true;
the_semaphore->open_count = 1;
the_semaphore->linked = true;
} else {
the_semaphore->named = false;
cf1c: 05c54014 strbeq r4, [r5, #20]
the_semaphore->open_count = 0;
cf20: 05854018 streq r4, [r5, #24]
the_semaphore->linked = false;
cf24: 05c54015 strbeq r4, [r5, #21]
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
cf28: e585305c str r3, [r5, #92] ; 0x5c
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
cf2c: e285105c add r1, r5, #92 ; 0x5c
cf30: e1a02007 mov r2, r7
* 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;
cf34: e5856060 str r6, [r5, #96] ; 0x60
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
cf38: ebffee57 bl 889c <_CORE_semaphore_Initialize>
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
cf3c: e59f3024 ldr r3, [pc, #36] ; cf68 <_POSIX_Semaphore_Create_support+0x108>
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
_Objects_Set_local_object(
cf40: e1d520b8 ldrh r2, [r5, #8]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
cf44: e593301c ldr r3, [r3, #28]
cf48: e7835102 str r5, [r3, r2, lsl #2]
&_POSIX_Semaphore_Information,
&the_semaphore->Object,
name
);
*the_sem = the_semaphore;
cf4c: e59d3014 ldr r3, [sp, #20]
the_object
);
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
/* ASSERT: information->is_string */
the_object->name.name_p = name;
cf50: e585400c str r4, [r5, #12]
cf54: e5835000 str r5, [r3]
_Thread_Enable_dispatch();
cf58: ebfff494 bl a1b0 <_Thread_Enable_dispatch>
return 0;
cf5c: e1a00006 mov r0, r6
}
cf60: e8bd80f0 pop {r4, r5, r6, r7, pc}
0000ae28 <_POSIX_Threads_Delete_extension>:
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
ae28: e92d40f0 push {r4, r5, r6, r7, lr}
api = deleted->API_Extensions[ THREAD_API_POSIX ];
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
ae2c: e1a00001 mov r0, r1
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
ae30: e1a04001 mov r4, r1
Thread_Control *the_thread;
POSIX_API_Control *api;
void **value_ptr;
api = deleted->API_Extensions[ THREAD_API_POSIX ];
ae34: e59150f4 ldr r5, [r1, #244] ; 0xf4
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
ae38: eb00085f bl cfbc <_POSIX_Threads_cancel_run>
/*
* Run all the key destructors
*/
_POSIX_Keys_Run_destructors( deleted );
ae3c: e1a00004 mov r0, r4
ae40: eb000874 bl d018 <_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 )) )
ae44: e2856044 add r6, r5, #68 ; 0x44
_POSIX_Keys_Run_destructors( deleted );
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
ae48: e5947028 ldr r7, [r4, #40] ; 0x28
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
ae4c: ea000001 b ae58 <_POSIX_Threads_Delete_extension+0x30>
*(void **)the_thread->Wait.return_argument = value_ptr;
ae50: e5903028 ldr r3, [r0, #40] ; 0x28 <== NOT EXECUTED
ae54: e5837000 str r7, [r3] <== 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 )) )
ae58: e1a00006 mov r0, r6
ae5c: ebfff6c9 bl 8988 <_Thread_queue_Dequeue>
ae60: e3500000 cmp r0, #0
ae64: 1afffff9 bne ae50 <_POSIX_Threads_Delete_extension+0x28>
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
ae68: e5953084 ldr r3, [r5, #132] ; 0x84
ae6c: e3530004 cmp r3, #4
(void) _Watchdog_Remove( &api->Sporadic_timer );
ae70: 028500a8 addeq r0, r5, #168 ; 0xa8
ae74: 0bfff932 bleq 9344 <_Watchdog_Remove>
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
ae78: e3a03000 mov r3, #0
_Workspace_Free( api );
ae7c: e1a00005 mov r0, r5
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
ae80: e58430f4 str r3, [r4, #244] ; 0xf4
_Workspace_Free( api );
}
ae84: e8bd40f0 pop {r4, r5, r6, r7, lr}
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
_Workspace_Free( api );
ae88: eafff9bd b 9584 <_Workspace_Free>
000086f0 <_RBTree_Sibling>:
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
86f0: e2502000 subs r2, r0, #0
86f4: 01a00002 moveq r0, r2
86f8: 012fff1e bxeq lr
if(!(the_node->parent)) return NULL;
86fc: e5923000 ldr r3, [r2]
8700: e3530000 cmp r3, #0
8704: 0a000006 beq 8724 <_RBTree_Sibling+0x34>
if(!(the_node->parent->parent)) return NULL;
8708: e5930000 ldr r0, [r3]
870c: e3500000 cmp r0, #0
8710: 012fff1e bxeq lr
if(the_node == the_node->parent->child[RBT_LEFT])
8714: e5930004 ldr r0, [r3, #4]
8718: e1520000 cmp r2, r0
return the_node->parent->child[RBT_RIGHT];
871c: 05930008 ldreq r0, [r3, #8]
8720: e12fff1e bx lr
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
8724: e1a00003 mov r0, r3 <== NOT EXECUTED
if(the_node == the_node->parent->child[RBT_LEFT])
return the_node->parent->child[RBT_RIGHT];
else
return the_node->parent->child[RBT_LEFT];
}
8728: e12fff1e bx lr <== NOT EXECUTED
00009484 <_Scheduler_CBS_Create_server>:
)
{
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
9484: e5903004 ldr r3, [r0, #4]
9488: e3530000 cmp r3, #0
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
948c: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
9490: e1a04000 mov r4, r0
9494: e1a05001 mov r5, r1
9498: e1a0a002 mov sl, r2
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
949c: da000023 ble 9530 <_Scheduler_CBS_Create_server+0xac>
94a0: e5903000 ldr r3, [r0]
94a4: e3530000 cmp r3, #0
94a8: da000020 ble 9530 <_Scheduler_CBS_Create_server+0xac>
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++ ) {
94ac: e59f308c ldr r3, [pc, #140] ; 9540 <_Scheduler_CBS_Create_server+0xbc>
94b0: e5932000 ldr r2, [r3]
94b4: e59f3088 ldr r3, [pc, #136] ; 9544 <_Scheduler_CBS_Create_server+0xc0>
if ( !_Scheduler_CBS_Server_list[i] )
94b8: e3a06000 mov r6, #0
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++ ) {
94bc: e5933000 ldr r3, [r3]
94c0: ea00000f b 9504 <_Scheduler_CBS_Create_server+0x80>
if ( !_Scheduler_CBS_Server_list[i] )
94c4: e4937004 ldr r7, [r3], #4
94c8: e3570000 cmp r7, #0
94cc: 1a00000b bne 9500 <_Scheduler_CBS_Create_server+0x7c>
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
94d0: e59f806c ldr r8, [pc, #108] ; 9544 <_Scheduler_CBS_Create_server+0xc0>
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
94d4: e58a6000 str r6, [sl]
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
94d8: e3a00010 mov r0, #16
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
94dc: e5989000 ldr r9, [r8]
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
94e0: eb00072f bl b1a4 <_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 *)
94e4: e7890106 str r0, [r9, r6, lsl #2]
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
94e8: e59a2000 ldr r2, [sl]
94ec: e5983000 ldr r3, [r8]
94f0: e7933102 ldr r3, [r3, r2, lsl #2]
if ( !the_server )
94f4: e3530000 cmp r3, #0
94f8: 1a000005 bne 9514 <_Scheduler_CBS_Create_server+0x90>
94fc: ea00000d b 9538 <_Scheduler_CBS_Create_server+0xb4> <== NOT EXECUTED
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++ ) {
9500: e2866001 add r6, r6, #1
9504: e1560002 cmp r6, r2
9508: 1affffed bne 94c4 <_Scheduler_CBS_Create_server+0x40>
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
950c: e3e00019 mvn r0, #25
9510: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
_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;
9514: e8940003 ldm r4, {r0, r1}
the_server->task_id = -1;
9518: e3e02000 mvn r2, #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;
951c: e9830003 stmib r3, {r0, r1}
the_server->task_id = -1;
9520: e5832000 str r2, [r3]
the_server->cbs_budget_overrun = budget_overrun_callback;
9524: e583500c str r5, [r3, #12]
return SCHEDULER_CBS_OK;
9528: e1a00007 mov r0, r7
952c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
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;
9530: e3e00011 mvn r0, #17
9534: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
*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 )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
9538: e3e00010 mvn r0, #16 <== NOT EXECUTED
the_server->parameters = *params;
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
953c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
000098b0 <_Scheduler_CBS_Initialize>:
int _Scheduler_CBS_Initialize(void)
{
98b0: e92d4010 push {r4, lr}
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
98b4: e59f4050 ldr r4, [pc, #80] ; 990c <_Scheduler_CBS_Initialize+0x5c>
98b8: e5940000 ldr r0, [r4]
98bc: e1a00100 lsl r0, r0, #2
98c0: eb000637 bl b1a4 <_Workspace_Allocate>
98c4: e59f3044 ldr r3, [pc, #68] ; 9910 <_Scheduler_CBS_Initialize+0x60>
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
98c8: e3500000 cmp r0, #0
}
int _Scheduler_CBS_Initialize(void)
{
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
98cc: e5830000 str r0, [r3]
98d0: e1a00003 mov r0, r3
_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++) {
98d4: 13a03000 movne r3, #0
98d8: 15941000 ldrne r1, [r4]
98dc: 11a02003 movne r2, r3
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 )
98e0: 1a000003 bne 98f4 <_Scheduler_CBS_Initialize+0x44>
98e4: ea000006 b 9904 <_Scheduler_CBS_Initialize+0x54> <== NOT EXECUTED
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
_Scheduler_CBS_Server_list[i] = NULL;
98e8: e590c000 ldr ip, [r0]
98ec: e78c2103 str r2, [ip, r3, lsl #2]
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++) {
98f0: e2833001 add r3, r3, #1
98f4: e1530001 cmp r3, r1
98f8: 1afffffa bne 98e8 <_Scheduler_CBS_Initialize+0x38>
_Scheduler_CBS_Server_list[i] = NULL;
}
return SCHEDULER_CBS_OK;
98fc: e3a00000 mov r0, #0
9900: e8bd8010 pop {r4, pc}
{
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;
9904: e3e00010 mvn r0, #16 <== NOT EXECUTED
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
_Scheduler_CBS_Server_list[i] = NULL;
}
return SCHEDULER_CBS_OK;
}
9908: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00008b88 <_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 );
8b88: e281c03c add ip, r1, #60 ; 0x3c
head->next = tail;
8b8c: e581c038 str ip, [r1, #56] ; 0x38
head->previous = NULL;
8b90: e3a0c000 mov ip, #0
8b94: e581c03c str ip, [r1, #60] ; 0x3c
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
8b98: e591c014 ldr ip, [r1, #20]
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 );
8b9c: 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
)
{
8ba0: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
head->next = tail;
head->previous = NULL;
tail->previous = head;
8ba4: 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 ];
8ba8: e3a0500c mov r5, #12
RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number (
Priority_Control the_priority
)
{
return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
8bac: e1a0332c lsr r3, ip, #6
block_state = the_thread_queue->state;
if ( _Thread_queue_Is_reverse_search( priority ) )
8bb0: e31c0020 tst ip, #32
_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 ];
8bb4: e0250593 mla r5, r3, r5, r0
block_state = the_thread_queue->state;
8bb8: e5908038 ldr r8, [r0, #56] ; 0x38
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
8bbc: 159fa150 ldrne sl, [pc, #336] ; 8d14 <_Thread_queue_Enqueue_priority+0x18c>
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 ) )
8bc0: 1a000022 bne 8c50 <_Thread_queue_Enqueue_priority+0xc8>
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 ));
8bc4: e285a004 add sl, r5, #4
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
8bc8: e10f4000 mrs r4, CPSR
8bcc: e3843080 orr r3, r4, #128 ; 0x80
8bd0: e129f003 msr CPSR_fc, r3
8bd4: e1a06004 mov r6, r4
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
8bd8: e3e07000 mvn r7, #0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
8bdc: e5953000 ldr r3, [r5]
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
8be0: ea00000b b 8c14 <_Thread_queue_Enqueue_priority+0x8c>
search_priority = search_thread->current_priority;
8be4: e5937014 ldr r7, [r3, #20]
if ( priority <= search_priority )
8be8: e15c0007 cmp ip, r7
8bec: 9a00000a bls 8c1c <_Thread_queue_Enqueue_priority+0x94>
static inline void arm_interrupt_flash( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
8bf0: e10f9000 mrs r9, CPSR
8bf4: e129f004 msr CPSR_fc, r4
8bf8: e129f009 msr CPSR_fc, r9
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
8bfc: e5939010 ldr r9, [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) ) {
8c00: e1180009 tst r8, r9
8c04: 1a000001 bne 8c10 <_Thread_queue_Enqueue_priority+0x88>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
8c08: e129f004 msr CPSR_fc, r4
8c0c: eaffffed b 8bc8 <_Thread_queue_Enqueue_priority+0x40>
_ISR_Enable( level );
goto restart_forward_search;
}
search_thread =
8c10: 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 ) ) {
8c14: e153000a cmp r3, sl
8c18: 1afffff1 bne 8be4 <_Thread_queue_Enqueue_priority+0x5c>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
8c1c: e5905030 ldr r5, [r0, #48] ; 0x30
8c20: e3550001 cmp r5, #1
8c24: 1a000037 bne 8d08 <_Thread_queue_Enqueue_priority+0x180>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8c28: e3a02000 mov r2, #0
if ( priority == search_priority )
8c2c: e15c0007 cmp ip, r7
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8c30: e5802030 str r2, [r0, #48] ; 0x30
if ( priority == search_priority )
8c34: 0a000029 beq 8ce0 <_Thread_queue_Enqueue_priority+0x158>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
8c38: e5932004 ldr r2, [r3, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8c3c: e5813000 str r3, [r1]
the_node->previous = previous_node;
8c40: e5812004 str r2, [r1, #4]
previous_node->next = the_node;
8c44: e5821000 str r1, [r2]
search_node->previous = the_node;
8c48: e5831004 str r1, [r3, #4]
8c4c: ea000020 b 8cd4 <_Thread_queue_Enqueue_priority+0x14c>
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
8c50: e5da7000 ldrb r7, [sl]
8c54: e2877001 add r7, r7, #1
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
8c58: e10f4000 mrs r4, CPSR
8c5c: e3843080 orr r3, r4, #128 ; 0x80
8c60: e129f003 msr CPSR_fc, r3
8c64: e1a06004 mov r6, r4
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last(
Chain_Control *the_chain
)
{
return _Chain_Tail( the_chain )->previous;
8c68: e5953008 ldr r3, [r5, #8]
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_Last( header );
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
8c6c: ea00000b b 8ca0 <_Thread_queue_Enqueue_priority+0x118>
search_priority = search_thread->current_priority;
8c70: e5937014 ldr r7, [r3, #20]
if ( priority >= search_priority )
8c74: e15c0007 cmp ip, r7
8c78: 2a00000a bcs 8ca8 <_Thread_queue_Enqueue_priority+0x120>
static inline void arm_interrupt_flash( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
8c7c: e10f9000 mrs r9, CPSR
8c80: e129f004 msr CPSR_fc, r4
8c84: e129f009 msr CPSR_fc, r9
8c88: e5939010 ldr r9, [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) ) {
8c8c: e1180009 tst r8, r9
8c90: 1a000001 bne 8c9c <_Thread_queue_Enqueue_priority+0x114>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
8c94: e129f004 msr CPSR_fc, r4 <== NOT EXECUTED
8c98: eaffffec b 8c50 <_Thread_queue_Enqueue_priority+0xc8> <== NOT EXECUTED
_ISR_Enable( level );
goto restart_reverse_search;
}
search_thread = (Thread_Control *)
8c9c: 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 ) ) {
8ca0: e1530005 cmp r3, r5
8ca4: 1afffff1 bne 8c70 <_Thread_queue_Enqueue_priority+0xe8>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
8ca8: e5905030 ldr r5, [r0, #48] ; 0x30
8cac: e3550001 cmp r5, #1
8cb0: 1a000014 bne 8d08 <_Thread_queue_Enqueue_priority+0x180>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8cb4: e3a02000 mov r2, #0
if ( priority == search_priority )
8cb8: e15c0007 cmp ip, r7
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8cbc: e5802030 str r2, [r0, #48] ; 0x30
if ( priority == search_priority )
8cc0: 0a000006 beq 8ce0 <_Thread_queue_Enqueue_priority+0x158>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
8cc4: e5932000 ldr r2, [r3]
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
8cc8: e881000c stm r1, {r2, r3}
search_node->next = the_node;
8ccc: e5831000 str r1, [r3]
next_node->previous = the_node;
8cd0: e5821004 str r1, [r2, #4]
the_thread->Wait.queue = the_thread_queue;
8cd4: e5810044 str r0, [r1, #68] ; 0x44
8cd8: e129f004 msr CPSR_fc, r4
8cdc: ea000007 b 8d00 <_Thread_queue_Enqueue_priority+0x178>
_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 );
previous_node = search_node->previous;
8ce0: 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 );
8ce4: e283c03c add ip, r3, #60 ; 0x3c
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8ce8: e581c000 str ip, [r1]
the_node->previous = previous_node;
8cec: e5812004 str r2, [r1, #4]
previous_node->next = the_node;
8cf0: e5821000 str r1, [r2]
search_node->previous = the_node;
8cf4: e5831040 str r1, [r3, #64] ; 0x40
the_thread->Wait.queue = the_thread_queue;
8cf8: e5810044 str r0, [r1, #68] ; 0x44
8cfc: e129f006 msr CPSR_fc, r6
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
8d00: e3a00001 mov r0, #1
8d04: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, 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;
8d08: e5826000 str r6, [r2]
return the_thread_queue->sync_state;
8d0c: e5900030 ldr r0, [r0, #48] ; 0x30
}
8d10: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
00014f84 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
14f84: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
14f88: e24dd01c sub sp, sp, #28
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
14f8c: e28d8004 add r8, sp, #4
14f90: e28d5010 add r5, sp, #16
head->previous = NULL;
14f94: e3a03000 mov r3, #0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
14f98: e2889004 add r9, r8, #4
14f9c: e2856004 add r6, r5, #4
14fa0: e58d9004 str r9, [sp, #4]
head->previous = NULL;
14fa4: e58d3008 str r3, [sp, #8]
tail->previous = head;
14fa8: e58d800c str r8, [sp, #12]
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
14fac: e58d6010 str r6, [sp, #16]
head->previous = NULL;
14fb0: e58d3014 str r3, [sp, #20]
tail->previous = head;
14fb4: e58d5018 str r5, [sp, #24]
14fb8: 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;
14fbc: e5848078 str r8, [r4, #120] ; 0x78
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
14fc0: e59f7174 ldr r7, [pc, #372] ; 1513c <_Timer_server_Body+0x1b8>
14fc4: e5973000 ldr r3, [r7]
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
14fc8: e594103c ldr r1, [r4, #60] ; 0x3c
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
14fcc: e2840030 add r0, r4, #48 ; 0x30
14fd0: e0611003 rsb r1, r1, r3
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
14fd4: e584303c str r3, [r4, #60] ; 0x3c
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
14fd8: e1a02005 mov r2, r5
14fdc: eb0010d5 bl 19338 <_Watchdog_Adjust_to_chain>
14fe0: e59f3158 ldr r3, [pc, #344] ; 15140 <_Timer_server_Body+0x1bc>
14fe4: e59f2158 ldr r2, [pc, #344] ; 15144 <_Timer_server_Body+0x1c0>
14fe8: e8930003 ldm r3, {r0, r1}
14fec: e3a03000 mov r3, #0
14ff0: eb004ee7 bl 28b94 <__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;
14ff4: 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 ) {
14ff8: e1500002 cmp r0, r2
14ffc: e1a0a000 mov sl, r0
15000: 9a000004 bls 15018 <_Timer_server_Body+0x94>
/*
* 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 );
15004: e062100a rsb r1, r2, sl
15008: e2840068 add r0, r4, #104 ; 0x68
1500c: e1a02005 mov r2, r5
15010: eb0010c8 bl 19338 <_Watchdog_Adjust_to_chain>
15014: ea000003 b 15028 <_Timer_server_Body+0xa4>
/*
* 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 );
15018: 32840068 addcc r0, r4, #104 ; 0x68
1501c: 33a01001 movcc r1, #1
15020: 306a2002 rsbcc r2, sl, r2
15024: 3b00109b blcc 19298 <_Watchdog_Adjust>
}
watchdogs->last_snapshot = snapshot;
15028: e584a074 str sl, [r4, #116] ; 0x74
)
{
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 ) {
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
1502c: e284b068 add fp, r4, #104 ; 0x68
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
15030: e284a030 add sl, r4, #48 ; 0x30
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
15034: e5940078 ldr r0, [r4, #120] ; 0x78
15038: eb0002bd bl 15b34 <_Chain_Get>
if ( timer == NULL ) {
1503c: e2501000 subs r1, r0, #0
15040: 0a000009 beq 1506c <_Timer_server_Body+0xe8>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
15044: e5913038 ldr r3, [r1, #56] ; 0x38
15048: e3530001 cmp r3, #1
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
1504c: 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 ) {
15050: 0a000002 beq 15060 <_Timer_server_Body+0xdc>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
15054: e3530003 cmp r3, #3
15058: 1afffff5 bne 15034 <_Timer_server_Body+0xb0>
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
1505c: e1a0000b mov r0, fp
15060: e2811010 add r1, r1, #16
15064: eb0010d8 bl 193cc <_Watchdog_Insert>
15068: eafffff1 b 15034 <_Timer_server_Body+0xb0>
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
1506c: e58d1000 str r1, [sp]
15070: ebffff97 bl 14ed4 <arm_interrupt_disable>
if ( _Chain_Is_empty( insert_chain ) ) {
15074: e59d3004 ldr r3, [sp, #4]
15078: e1530009 cmp r3, r9
1507c: e59d1000 ldr r1, [sp]
15080: 1a000006 bne 150a0 <_Timer_server_Body+0x11c>
ts->insert_chain = NULL;
15084: e5841078 str r1, [r4, #120] ; 0x78
15088: 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 ) ) {
1508c: e59d3010 ldr r3, [sp, #16]
15090: e1530006 cmp r3, r6
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
15094: 13a07000 movne r7, #0
_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 ) ) {
15098: 1a000002 bne 150a8 <_Timer_server_Body+0x124>
1509c: ea000011 b 150e8 <_Timer_server_Body+0x164>
150a0: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED
150a4: eaffffc6 b 14fc4 <_Timer_server_Body+0x40> <== 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 );
150a8: ebffff89 bl 14ed4 <arm_interrupt_disable>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
150ac: e59d3010 ldr r3, [sp, #16]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
150b0: e1530006 cmp r3, r6
150b4: 0a000009 beq 150e0 <_Timer_server_Body+0x15c>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
150b8: e5932000 ldr r2, [r3]
head->next = new_first;
new_first->previous = head;
150bc: e5825004 str r5, [r2, #4]
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
150c0: e58d2010 str r2, [sp, #16]
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
150c4: e5837008 str r7, [r3, #8]
150c8: 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 );
150cc: e2830020 add r0, r3, #32
150d0: e8900003 ldm r0, {r0, r1}
150d4: e1a0e00f mov lr, pc
150d8: e593f01c ldr pc, [r3, #28]
}
150dc: eafffff1 b 150a8 <_Timer_server_Body+0x124>
150e0: e129f000 msr CPSR_fc, r0
150e4: eaffffb4 b 14fbc <_Timer_server_Body+0x38>
} else {
ts->active = false;
150e8: e3a03000 mov r3, #0
150ec: e5c4307c strb r3, [r4, #124] ; 0x7c
*
* 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;
150f0: e59f3050 ldr r3, [pc, #80] ; 15148 <_Timer_server_Body+0x1c4>
150f4: e5932000 ldr r2, [r3]
++level;
150f8: e2822001 add r2, r2, #1
_Thread_Dispatch_disable_level = level;
150fc: e5832000 str r2, [r3]
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
15100: e3a01008 mov r1, #8
15104: e5940000 ldr r0, [r4]
15108: eb000f88 bl 18f30 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
1510c: e1a00004 mov r0, r4
15110: ebffff73 bl 14ee4 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
15114: e1a00004 mov r0, r4
15118: ebffff85 bl 14f34 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
1511c: eb000d54 bl 18674 <_Thread_Enable_dispatch>
ts->active = true;
15120: e3a03001 mov r3, #1
15124: 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 );
15128: e2840008 add r0, r4, #8
1512c: eb0010fd bl 19528 <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
15130: e2840040 add r0, r4, #64 ; 0x40
15134: eb0010fb bl 19528 <_Watchdog_Remove>
15138: eaffff9f b 14fbc <_Timer_server_Body+0x38>
000062c0 <aio_fsync>:
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
62c0: e3500a02 cmp r0, #8192 ; 0x2000
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
62c4: e92d4030 push {r4, r5, lr}
62c8: e1a04001 mov r4, r1
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
62cc: 13a05016 movne r5, #22
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
62d0: 1a00000c bne 6308 <aio_fsync+0x48>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
62d4: e5910000 ldr r0, [r1]
62d8: e3a01003 mov r1, #3
62dc: eb0018bf bl c5e0 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
62e0: e2000003 and r0, r0, #3
62e4: e2400001 sub r0, r0, #1
62e8: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
62ec: 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)))
62f0: 8a000004 bhi 6308 <aio_fsync+0x48>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
62f4: e3a00018 mov r0, #24
62f8: ebfff289 bl 2d24 <malloc>
if (req == NULL)
62fc: e2503000 subs r3, r0, #0
6300: 1a000007 bne 6324 <aio_fsync+0x64>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
6304: e3a0500b mov r5, #11 <== NOT EXECUTED
6308: e3e03000 mvn r3, #0
630c: e5845030 str r5, [r4, #48] ; 0x30
6310: e5843034 str r3, [r4, #52] ; 0x34
6314: eb002574 bl f8ec <__errno>
6318: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
631c: e3e00000 mvn r0, #0
6320: 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;
6324: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_SYNC;
6328: e3a03003 mov r3, #3
632c: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
6330: 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);
6334: ea000135 b 6810 <rtems_aio_enqueue>
00006a10 <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
6a10: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
6a14: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
6a18: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
6a1c: e5900000 ldr r0, [r0]
6a20: eb0016ee bl c5e0 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
6a24: e2000003 and r0, r0, #3
6a28: e3500002 cmp r0, #2
6a2c: 13500000 cmpne r0, #0
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
6a30: 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)))
6a34: 1a00000d bne 6a70 <aio_read+0x60>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
6a38: e5943014 ldr r3, [r4, #20]
6a3c: e3530000 cmp r3, #0
6a40: 1a000003 bne 6a54 <aio_read+0x44>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
6a44: e994000c ldmib r4, {r2, r3}
6a48: e3520000 cmp r2, #0
6a4c: e2d31000 sbcs r1, r3, #0
6a50: aa000001 bge 6a5c <aio_read+0x4c>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
6a54: e3a05016 mov r5, #22
6a58: ea000004 b 6a70 <aio_read+0x60>
req = malloc (sizeof (rtems_aio_request));
6a5c: e3a00018 mov r0, #24
6a60: ebfff0af bl 2d24 <malloc>
if (req == NULL)
6a64: e2503000 subs r3, r0, #0
6a68: 1a000007 bne 6a8c <aio_read+0x7c>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
6a6c: e3a0500b mov r5, #11 <== NOT EXECUTED
6a70: e3e03000 mvn r3, #0
6a74: e5845030 str r5, [r4, #48] ; 0x30
6a78: e5843034 str r3, [r4, #52] ; 0x34
6a7c: eb00239a bl f8ec <__errno>
6a80: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
6a84: e3e00000 mvn r0, #0
6a88: 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;
6a8c: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_READ;
6a90: e3a03001 mov r3, #1
6a94: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
6a98: 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);
6a9c: eaffff5b b 6810 <rtems_aio_enqueue>
00006aa8 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
6aa8: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
6aac: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
6ab0: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
6ab4: e5900000 ldr r0, [r0]
6ab8: eb0016c8 bl c5e0 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
6abc: e2000003 and r0, r0, #3
6ac0: e2400001 sub r0, r0, #1
6ac4: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
6ac8: 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)))
6acc: 8a00000d bhi 6b08 <aio_write+0x60>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
6ad0: e5943014 ldr r3, [r4, #20]
6ad4: e3530000 cmp r3, #0
6ad8: 1a000003 bne 6aec <aio_write+0x44>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
6adc: e994000c ldmib r4, {r2, r3}
6ae0: e3520000 cmp r2, #0
6ae4: e2d31000 sbcs r1, r3, #0
6ae8: aa000001 bge 6af4 <aio_write+0x4c>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
6aec: e3a05016 mov r5, #22
6af0: ea000004 b 6b08 <aio_write+0x60>
req = malloc (sizeof (rtems_aio_request));
6af4: e3a00018 mov r0, #24
6af8: ebfff089 bl 2d24 <malloc>
if (req == NULL)
6afc: e2503000 subs r3, r0, #0
6b00: 1a000007 bne 6b24 <aio_write+0x7c>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
6b04: e3a0500b mov r5, #11 <== NOT EXECUTED
6b08: e3e03000 mvn r3, #0
6b0c: e5845030 str r5, [r4, #48] ; 0x30
6b10: e5843034 str r3, [r4, #52] ; 0x34
6b14: eb002374 bl f8ec <__errno>
6b18: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
6b1c: e3e00000 mvn r0, #0
6b20: 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;
6b24: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_WRITE;
6b28: e3a03002 mov r3, #2
6b2c: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
6b30: 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);
6b34: eaffff35 b 6810 <rtems_aio_enqueue>
0000a594 <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
a594: e3500000 cmp r0, #0
a598: 0a00000b beq a5cc <pthread_attr_setschedpolicy+0x38>
a59c: e5903000 ldr r3, [r0]
a5a0: e3530000 cmp r3, #0
a5a4: 0a000008 beq a5cc <pthread_attr_setschedpolicy+0x38>
return EINVAL;
switch ( policy ) {
a5a8: e3510004 cmp r1, #4
a5ac: 8a000008 bhi a5d4 <pthread_attr_setschedpolicy+0x40>
a5b0: e3a03001 mov r3, #1
a5b4: e1a03113 lsl r3, r3, r1
a5b8: e3130017 tst r3, #23
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
a5bc: 15801014 strne r1, [r0, #20]
return 0;
a5c0: 13a00000 movne r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
a5c4: 112fff1e bxne lr
a5c8: ea000001 b a5d4 <pthread_attr_setschedpolicy+0x40> <== NOT EXECUTED
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
a5cc: e3a00016 mov r0, #22
a5d0: e12fff1e bx lr
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
a5d4: e3a00086 mov r0, #134 ; 0x86
}
}
a5d8: e12fff1e bx lr
00018f20 <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
18f20: e92d41f1 push {r0, r4, r5, r6, r7, r8, lr}
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
18f24: e2517000 subs r7, r1, #0
18f28: 0a000002 beq 18f38 <pthread_kill+0x18>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
18f2c: e2478001 sub r8, r7, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
18f30: e358001f cmp r8, #31
18f34: 9a000002 bls 18f44 <pthread_kill+0x24>
rtems_set_errno_and_return_minus_one( EINVAL );
18f38: ebffd1fd bl d734 <__errno>
18f3c: e3a03016 mov r3, #22
18f40: ea000025 b 18fdc <pthread_kill+0xbc>
the_thread = _Thread_Get( thread, &location );
18f44: e1a0100d mov r1, sp
18f48: ebffbdc2 bl 8658 <_Thread_Get>
switch ( location ) {
18f4c: e59d6000 ldr r6, [sp]
18f50: 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 );
18f54: e1a04000 mov r4, r0
switch ( location ) {
18f58: 1a00001d bne 18fd4 <pthread_kill+0xb4>
18f5c: e59f0084 ldr r0, [pc, #132] ; 18fe8 <pthread_kill+0xc8>
18f60: ebffb645 bl 687c <_API_extensions_Add_post_switch>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
18f64: e59f2080 ldr r2, [pc, #128] ; 18fec <pthread_kill+0xcc>
18f68: e3a0100c mov r1, #12
18f6c: e0222791 mla r2, r1, r7, r2
18f70: e5922008 ldr r2, [r2, #8]
18f74: e3520001 cmp r2, #1
* If sig == 0 then just validate arguments
*/
_POSIX_signals_Add_post_switch_extension();
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
18f78: e59430f4 ldr r3, [r4, #244] ; 0xf4
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
18f7c: 1a000002 bne 18f8c <pthread_kill+0x6c>
_Thread_Enable_dispatch();
18f80: ebffbdac bl 8638 <_Thread_Enable_dispatch>
return 0;
18f84: e1a00006 mov r0, r6
18f88: ea000015 b 18fe4 <pthread_kill+0xc4>
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
18f8c: e59320d4 ldr r2, [r3, #212] ; 0xd4
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
18f90: e3a05001 mov r5, #1
18f94: e1828815 orr r8, r2, r5, lsl r8
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
18f98: e1a00004 mov r0, r4
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
18f9c: e58380d4 str r8, [r3, #212] ; 0xd4
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
18fa0: e1a02006 mov r2, r6
18fa4: e1a01007 mov r1, r7
18fa8: ebffff97 bl 18e0c <_POSIX_signals_Unblock_thread>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
18fac: e59f303c ldr r3, [pc, #60] ; 18ff0 <pthread_kill+0xd0>
18fb0: e5932000 ldr r2, [r3]
18fb4: e3520000 cmp r2, #0
18fb8: 0a000002 beq 18fc8 <pthread_kill+0xa8>
18fbc: e5932008 ldr r2, [r3, #8]
18fc0: e1540002 cmp r4, r2
_Thread_Dispatch_necessary = true;
18fc4: 05c35004 strbeq r5, [r3, #4]
}
_Thread_Enable_dispatch();
18fc8: ebffbd9a bl 8638 <_Thread_Enable_dispatch>
return 0;
18fcc: e3a00000 mov r0, #0
18fd0: ea000003 b 18fe4 <pthread_kill+0xc4>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
18fd4: ebffd1d6 bl d734 <__errno> <== NOT EXECUTED
18fd8: e3a03003 mov r3, #3 <== NOT EXECUTED
18fdc: e5803000 str r3, [r0]
18fe0: e3e00000 mvn r0, #0
}
18fe4: e8bd81f8 pop {r3, r4, r5, r6, r7, r8, pc}
0000584c <pthread_mutexattr_gettype>:
int pthread_mutexattr_gettype(
const pthread_mutexattr_t *attr,
int *type
)
{
if ( !attr )
584c: e3500000 cmp r0, #0
5850: 0a000008 beq 5878 <pthread_mutexattr_gettype+0x2c>
return EINVAL;
if ( !attr->is_initialized )
5854: e5903000 ldr r3, [r0]
5858: e3530000 cmp r3, #0
585c: 0a000005 beq 5878 <pthread_mutexattr_gettype+0x2c>
return EINVAL;
if ( !type )
5860: e3510000 cmp r1, #0
return EINVAL;
*type = attr->type;
5864: 15903010 ldrne r3, [r0, #16]
return 0;
5868: 13a00000 movne r0, #0
return EINVAL;
if ( !type )
return EINVAL;
*type = attr->type;
586c: 15813000 strne r3, [r1]
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
if ( !type )
5870: 112fff1e bxne lr
5874: ea000001 b 5880 <pthread_mutexattr_gettype+0x34> <== NOT EXECUTED
{
if ( !attr )
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
5878: e3a00016 mov r0, #22
587c: e12fff1e bx lr
if ( !type )
return EINVAL;
5880: e3a00016 mov r0, #22 <== NOT EXECUTED
*type = attr->type;
return 0;
}
5884: e12fff1e bx lr <== NOT EXECUTED
00007d80 <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
7d80: e3500000 cmp r0, #0
7d84: 0a000007 beq 7da8 <pthread_mutexattr_setpshared+0x28>
7d88: e5903000 ldr r3, [r0]
7d8c: e3530000 cmp r3, #0
7d90: 0a000004 beq 7da8 <pthread_mutexattr_setpshared+0x28>
return EINVAL;
switch ( pshared ) {
7d94: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
7d98: 95801004 strls r1, [r0, #4]
return 0;
7d9c: 93a00000 movls r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
7da0: 912fff1e bxls lr
7da4: ea000001 b 7db0 <pthread_mutexattr_setpshared+0x30> <== NOT EXECUTED
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
7da8: e3a00016 mov r0, #22
7dac: e12fff1e bx lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
7db0: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
7db4: e12fff1e bx lr <== NOT EXECUTED
00007a8c <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
7a8c: e3500000 cmp r0, #0
7a90: 0a000007 beq 7ab4 <pthread_rwlockattr_setpshared+0x28>
return EINVAL;
if ( !attr->is_initialized )
7a94: e5903000 ldr r3, [r0]
7a98: e3530000 cmp r3, #0
7a9c: 0a000004 beq 7ab4 <pthread_rwlockattr_setpshared+0x28>
return EINVAL;
switch ( pshared ) {
7aa0: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
7aa4: 95801004 strls r1, [r0, #4]
return 0;
7aa8: 93a00000 movls r0, #0
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
7aac: 912fff1e bxls lr
7ab0: ea000001 b 7abc <pthread_rwlockattr_setpshared+0x30> <== NOT EXECUTED
{
if ( !attr )
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
7ab4: e3a00016 mov r0, #22
7ab8: e12fff1e bx lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
7abc: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
7ac0: e12fff1e bx lr <== NOT EXECUTED
00006810 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
6810: e92d41f0 push {r4, r5, r6, r7, r8, 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);
6814: e59f41e4 ldr r4, [pc, #484] ; 6a00 <rtems_aio_enqueue+0x1f0>
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
6818: e24dd024 sub sp, sp, #36 ; 0x24
681c: 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);
6820: e1a00004 mov r0, r4
6824: eb000255 bl 7180 <pthread_mutex_lock>
if (result != 0) {
6828: e2505000 subs r5, r0, #0
682c: 0a000002 beq 683c <rtems_aio_enqueue+0x2c>
free (req);
6830: e1a00006 mov r0, r6 <== NOT EXECUTED
6834: ebfff02a bl 28e4 <free> <== NOT EXECUTED
return result;
6838: ea00006d b 69f4 <rtems_aio_enqueue+0x1e4> <== 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);
683c: eb000464 bl 79d4 <pthread_self>
6840: e28d1020 add r1, sp, #32
6844: e1a0200d mov r2, sp
6848: eb000370 bl 7610 <pthread_getschedparam>
req->caller_thread = pthread_self ();
684c: eb000460 bl 79d4 <pthread_self>
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
6850: e5963014 ldr r3, [r6, #20]
6854: e59d1000 ldr r1, [sp]
6858: e5932014 ldr r2, [r3, #20]
685c: e0622001 rsb r2, r2, r1
6860: e586200c str r2, [r6, #12]
req->policy = policy;
6864: e59d2020 ldr r2, [sp, #32]
6868: e5862008 str r2, [r6, #8]
req->aiocbp->error_code = EINPROGRESS;
686c: 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 ();
6870: e5860010 str r0, [r6, #16]
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
6874: e5832030 str r2, [r3, #48] ; 0x30
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
6878: e5942068 ldr r2, [r4, #104] ; 0x68
687c: 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;
6880: e5835034 str r5, [r3, #52] ; 0x34
if ((aio_request_queue.idle_threads == 0) &&
6884: 1a00002d bne 6940 <rtems_aio_enqueue+0x130>
6888: e5942064 ldr r2, [r4, #100] ; 0x64
688c: e3520004 cmp r2, #4
6890: ca00002a bgt 6940 <rtems_aio_enqueue+0x130>
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);
6894: e5931000 ldr r1, [r3]
6898: e2840048 add r0, r4, #72 ; 0x48
689c: e3a02001 mov r2, #1
68a0: ebffff83 bl 66b4 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
68a4: e5903018 ldr r3, [r0, #24]
68a8: 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);
68ac: e1a07000 mov r7, r0
68b0: e2808008 add r8, r0, #8
if (r_chain->new_fd == 1) {
68b4: 1a000017 bne 6918 <rtems_aio_enqueue+0x108>
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
68b8: e1a01006 mov r1, r6
68bc: e1a00008 mov r0, r8
68c0: eb000890 bl 8b08 <_Chain_Insert>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
68c4: 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;
68c8: e5875018 str r5, [r7, #24]
pthread_mutex_init (&r_chain->mutex, NULL);
68cc: e287001c add r0, r7, #28
68d0: eb0001d9 bl 703c <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
68d4: e1a01005 mov r1, r5
68d8: e2870020 add r0, r7, #32
68dc: eb0000ef bl 6ca0 <pthread_cond_init>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
68e0: e1a03007 mov r3, r7
68e4: e28d001c add r0, sp, #28
68e8: e2841008 add r1, r4, #8
68ec: e59f2110 ldr r2, [pc, #272] ; 6a04 <rtems_aio_enqueue+0x1f4>
68f0: eb0002b1 bl 73bc <pthread_create>
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
68f4: e2506000 subs r6, r0, #0
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
++aio_request_queue.active_threads;
68f8: 05943064 ldreq r3, [r4, #100] ; 0x64
68fc: 02833001 addeq r3, r3, #1
6900: 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) {
6904: 0a000038 beq 69ec <rtems_aio_enqueue+0x1dc>
pthread_mutex_unlock (&aio_request_queue.mutex);
6908: e1a00004 mov r0, r4 <== NOT EXECUTED
690c: eb00023a bl 71fc <pthread_mutex_unlock> <== NOT EXECUTED
return result;
6910: e1a05006 mov r5, r6 <== NOT EXECUTED
6914: ea000036 b 69f4 <rtems_aio_enqueue+0x1e4> <== NOT EXECUTED
}
++aio_request_queue.active_threads;
}
else {
/* put request in the fd chain it belongs to */
pthread_mutex_lock (&r_chain->mutex);
6918: e280401c add r4, r0, #28
691c: e1a00004 mov r0, r4
6920: eb000216 bl 7180 <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
6924: e1a00008 mov r0, r8
6928: e1a01006 mov r1, r6
692c: ebffff1c bl 65a4 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
6930: e2870020 add r0, r7, #32
6934: eb000109 bl 6d60 <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
6938: e1a00004 mov r0, r4
693c: ea00000e b 697c <rtems_aio_enqueue+0x16c>
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,
6940: e59f00c0 ldr r0, [pc, #192] ; 6a08 <rtems_aio_enqueue+0x1f8>
6944: e5931000 ldr r1, [r3]
6948: e3a02000 mov r2, #0
694c: ebffff58 bl 66b4 <rtems_aio_search_fd>
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
6950: e2504000 subs r4, r0, #0
6954: 0a00000a beq 6984 <rtems_aio_enqueue+0x174>
{
pthread_mutex_lock (&r_chain->mutex);
6958: e284701c add r7, r4, #28
695c: e1a00007 mov r0, r7
6960: eb000206 bl 7180 <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
6964: e2840008 add r0, r4, #8
6968: e1a01006 mov r1, r6
696c: ebffff0c bl 65a4 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
6970: e2840020 add r0, r4, #32
6974: eb0000f9 bl 6d60 <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
6978: e1a00007 mov r0, r7
697c: eb00021e bl 71fc <pthread_mutex_unlock>
6980: ea000019 b 69ec <rtems_aio_enqueue+0x1dc>
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
6984: e5963014 ldr r3, [r6, #20]
6988: e59f007c ldr r0, [pc, #124] ; 6a0c <rtems_aio_enqueue+0x1fc>
698c: e5931000 ldr r1, [r3]
6990: e3a02001 mov r2, #1
6994: ebffff46 bl 66b4 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
6998: e5903018 ldr r3, [r0, #24]
699c: 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);
69a0: e1a07000 mov r7, r0
69a4: e1a01006 mov r1, r6
69a8: e2800008 add r0, r0, #8
if (r_chain->new_fd == 1) {
69ac: 1a000008 bne 69d4 <rtems_aio_enqueue+0x1c4>
69b0: eb000854 bl 8b08 <_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);
69b4: 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;
69b8: e5874018 str r4, [r7, #24]
pthread_mutex_init (&r_chain->mutex, NULL);
69bc: e287001c add r0, r7, #28
69c0: eb00019d bl 703c <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
69c4: e2870020 add r0, r7, #32
69c8: e1a01004 mov r1, r4
69cc: eb0000b3 bl 6ca0 <pthread_cond_init>
69d0: ea000000 b 69d8 <rtems_aio_enqueue+0x1c8>
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
69d4: ebfffef2 bl 65a4 <rtems_aio_insert_prio>
if (aio_request_queue.idle_threads > 0)
69d8: e59f0020 ldr r0, [pc, #32] ; 6a00 <rtems_aio_enqueue+0x1f0>
69dc: e5903068 ldr r3, [r0, #104] ; 0x68
69e0: e3530000 cmp r3, #0
pthread_cond_signal (&aio_request_queue.new_req);
69e4: c2800004 addgt r0, r0, #4
69e8: cb0000dc blgt 6d60 <pthread_cond_signal>
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
69ec: e59f000c ldr r0, [pc, #12] ; 6a00 <rtems_aio_enqueue+0x1f0>
69f0: eb000201 bl 71fc <pthread_mutex_unlock>
return 0;
}
69f4: e1a00005 mov r0, r5
69f8: e28dd024 add sp, sp, #36 ; 0x24
69fc: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
00006338 <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
6338: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, 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);
633c: e59f425c ldr r4, [pc, #604] ; 65a0 <rtems_aio_handle+0x268>
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
6340: e24dd02c sub sp, sp, #44 ; 0x2c
6344: e1a05000 mov r5, r0
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 &&
6348: e284904c add r9, r4, #76 ; 0x4c
/* 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);
634c: e285801c add r8, r5, #28
6350: e1a00008 mov r0, r8
6354: eb000389 bl 7180 <pthread_mutex_lock>
if (result != 0)
6358: e250a000 subs sl, r0, #0
635c: 1a00008c bne 6594 <rtems_aio_handle+0x25c>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
6360: 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 );
6364: 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)) {
6368: e1560003 cmp r6, r3
636c: 0a000035 beq 6448 <rtems_aio_handle+0x110>
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);
6370: eb000597 bl 79d4 <pthread_self>
6374: e28d1028 add r1, sp, #40 ; 0x28
6378: e28d2004 add r2, sp, #4
637c: eb0004a3 bl 7610 <pthread_getschedparam>
param.sched_priority = req->priority;
6380: e596300c ldr r3, [r6, #12]
6384: e58d3004 str r3, [sp, #4]
pthread_setschedparam (pthread_self(), req->policy, ¶m);
6388: eb000591 bl 79d4 <pthread_self>
638c: e28d2004 add r2, sp, #4
6390: e5961008 ldr r1, [r6, #8]
6394: eb000593 bl 79e8 <pthread_setschedparam>
6398: e1a00006 mov r0, r6
639c: eb0009c4 bl 8ab4 <_Chain_Extract>
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
63a0: e1a00008 mov r0, r8
63a4: eb000394 bl 71fc <pthread_mutex_unlock>
switch (req->aiocbp->aio_lio_opcode) {
63a8: e5962014 ldr r2, [r6, #20]
63ac: e592302c ldr r3, [r2, #44] ; 0x2c
63b0: e3530002 cmp r3, #2
63b4: 0a00000b beq 63e8 <rtems_aio_handle+0xb0>
63b8: e3530003 cmp r3, #3
63bc: 0a000011 beq 6408 <rtems_aio_handle+0xd0>
63c0: e3530001 cmp r3, #1
63c4: 1a000013 bne 6418 <rtems_aio_handle+0xe0>
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
63c8: e5921008 ldr r1, [r2, #8]
63cc: e5923004 ldr r3, [r2, #4]
63d0: e58d1000 str r1, [sp]
63d4: e282100c add r1, r2, #12
63d8: e5920000 ldr r0, [r2]
63dc: e8910006 ldm r1, {r1, r2}
63e0: eb00281b bl 10454 <pread>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
63e4: ea000009 b 6410 <rtems_aio_handle+0xd8>
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
63e8: e5921008 ldr r1, [r2, #8]
63ec: e5923004 ldr r3, [r2, #4]
63f0: e58d1000 str r1, [sp]
63f4: e282100c add r1, r2, #12
63f8: e5920000 ldr r0, [r2]
63fc: e8910006 ldm r1, {r1, r2}
6400: eb002856 bl 10560 <pwrite>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
6404: ea000001 b 6410 <rtems_aio_handle+0xd8>
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
6408: e5920000 ldr r0, [r2] <== NOT EXECUTED
640c: eb001907 bl c830 <fsync> <== NOT EXECUTED
break;
default:
result = -1;
}
if (result == -1) {
6410: e3700001 cmn r0, #1
6414: 1a000006 bne 6434 <rtems_aio_handle+0xfc>
req->aiocbp->return_value = -1;
6418: e5966014 ldr r6, [r6, #20] <== NOT EXECUTED
641c: e3e03000 mvn r3, #0 <== NOT EXECUTED
6420: e5863034 str r3, [r6, #52] ; 0x34 <== NOT EXECUTED
req->aiocbp->error_code = errno;
6424: eb002530 bl f8ec <__errno> <== NOT EXECUTED
6428: e5903000 ldr r3, [r0] <== NOT EXECUTED
642c: e5863030 str r3, [r6, #48] ; 0x30 <== NOT EXECUTED
6430: eaffffc5 b 634c <rtems_aio_handle+0x14> <== NOT EXECUTED
} else {
req->aiocbp->return_value = result;
6434: e5963014 ldr r3, [r6, #20]
req->aiocbp->error_code = 0;
6438: e3a02000 mov r2, #0
}
if (result == -1) {
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
} else {
req->aiocbp->return_value = result;
643c: e5830034 str r0, [r3, #52] ; 0x34
req->aiocbp->error_code = 0;
6440: e5832030 str r2, [r3, #48] ; 0x30
6444: eaffffc0 b 634c <rtems_aio_handle+0x14>
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);
6448: e59f7150 ldr r7, [pc, #336] ; 65a0 <rtems_aio_handle+0x268>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
644c: e1a00008 mov r0, r8
6450: eb000369 bl 71fc <pthread_mutex_unlock>
pthread_mutex_lock (&aio_request_queue.mutex);
6454: e1a00007 mov r0, r7
6458: eb000348 bl 7180 <pthread_mutex_lock>
if (rtems_chain_is_empty (chain))
645c: e5953008 ldr r3, [r5, #8]
6460: e1530006 cmp r3, r6
6464: 1a000047 bne 6588 <rtems_aio_handle+0x250>
{
clock_gettime (CLOCK_REALTIME, &timeout);
6468: e28d1020 add r1, sp, #32
646c: e3a00001 mov r0, #1
6470: eb0001b0 bl 6b38 <clock_gettime>
timeout.tv_sec += 3;
6474: e59d3020 ldr r3, [sp, #32]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
6478: 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;
647c: e2833003 add r3, r3, #3
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
6480: e1a00006 mov r0, r6
6484: e1a01007 mov r1, r7
6488: e28d2020 add r2, sp, #32
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
648c: e58d3020 str r3, [sp, #32]
timeout.tv_nsec = 0;
6490: e58da024 str sl, [sp, #36] ; 0x24
result = pthread_cond_timedwait (&r_chain->cond,
6494: eb000248 bl 6dbc <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) {
6498: e3500074 cmp r0, #116 ; 0x74
649c: 1a000039 bne 6588 <rtems_aio_handle+0x250>
64a0: e1a00005 mov r0, r5
64a4: eb000982 bl 8ab4 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
64a8: e1a00008 mov r0, r8
64ac: eb000296 bl 6f0c <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->cond);
64b0: e1a00006 mov r0, r6
64b4: eb0001c9 bl 6be0 <pthread_cond_destroy>
free (r_chain);
64b8: e1a00005 mov r0, r5
64bc: ebfff108 bl 28e4 <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)) {
64c0: e5942054 ldr r2, [r4, #84] ; 0x54
64c4: e2873058 add r3, r7, #88 ; 0x58
64c8: e1520003 cmp r2, r3
64cc: 1a000018 bne 6534 <rtems_aio_handle+0x1fc>
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
64d0: e5943068 ldr r3, [r4, #104] ; 0x68
64d4: e2833001 add r3, r3, #1
64d8: e5843068 str r3, [r4, #104] ; 0x68
--aio_request_queue.active_threads;
64dc: e5943064 ldr r3, [r4, #100] ; 0x64
clock_gettime (CLOCK_REALTIME, &timeout);
64e0: e28d1020 add r1, sp, #32
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;
64e4: e2433001 sub r3, r3, #1
clock_gettime (CLOCK_REALTIME, &timeout);
64e8: 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;
64ec: e5843064 str r3, [r4, #100] ; 0x64
clock_gettime (CLOCK_REALTIME, &timeout);
64f0: eb000190 bl 6b38 <clock_gettime>
timeout.tv_sec += 3;
64f4: e59d3020 ldr r3, [sp, #32]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
64f8: e2870004 add r0, r7, #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;
64fc: e2833003 add r3, r3, #3
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6500: e1a01007 mov r1, r7
6504: e28d2020 add r2, sp, #32
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;
6508: e58d3020 str r3, [sp, #32]
timeout.tv_nsec = 0;
650c: e58da024 str sl, [sp, #36] ; 0x24
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6510: eb000229 bl 6dbc <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) {
6514: e3500074 cmp r0, #116 ; 0x74
6518: 1a000005 bne 6534 <rtems_aio_handle+0x1fc>
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
651c: e5973068 ldr r3, [r7, #104] ; 0x68
pthread_mutex_unlock (&aio_request_queue.mutex);
6520: e1a00007 mov r0, r7
/* 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;
6524: e2433001 sub r3, r3, #1
6528: e5873068 str r3, [r7, #104] ; 0x68
pthread_mutex_unlock (&aio_request_queue.mutex);
652c: eb000332 bl 71fc <pthread_mutex_unlock>
return NULL;
6530: ea000017 b 6594 <rtems_aio_handle+0x25c>
}
}
/* 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;
6534: e5943068 ldr r3, [r4, #104] ; 0x68
6538: e2433001 sub r3, r3, #1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
653c: e5945054 ldr r5, [r4, #84] ; 0x54
6540: e5843068 str r3, [r4, #104] ; 0x68
++aio_request_queue.active_threads;
6544: e5943064 ldr r3, [r4, #100] ; 0x64
6548: e1a00005 mov r0, r5
654c: e2833001 add r3, r3, #1
6550: e5843064 str r3, [r4, #100] ; 0x64
6554: eb000956 bl 8ab4 <_Chain_Extract>
6558: e5943048 ldr r3, [r4, #72] ; 0x48
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 &&
655c: e5952014 ldr r2, [r5, #20]
6560: ea000000 b 6568 <rtems_aio_handle+0x230>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
6564: e5933000 ldr r3, [r3]
6568: e5931014 ldr r1, [r3, #20]
656c: e1510002 cmp r1, r2
6570: aa000001 bge 657c <rtems_aio_handle+0x244>
6574: e1530009 cmp r3, r9
6578: 1afffff9 bne 6564 <rtems_aio_handle+0x22c>
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
657c: e5930004 ldr r0, [r3, #4]
6580: e1a01005 mov r1, r5
6584: eb00095f bl 8b08 <_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);
6588: e59f0010 ldr r0, [pc, #16] ; 65a0 <rtems_aio_handle+0x268>
658c: eb00031a bl 71fc <pthread_mutex_unlock>
6590: eaffff6d b 634c <rtems_aio_handle+0x14>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6594: e3a00000 mov r0, #0
6598: e28dd02c add sp, sp, #44 ; 0x2c
659c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
000065f4 <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
65f4: e92d4010 push {r4, lr}
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
65f8: e59f00a4 ldr r0, [pc, #164] ; 66a4 <rtems_aio_init+0xb0>
65fc: eb00034f bl 7340 <pthread_attr_init>
if (result != 0)
6600: e2504000 subs r4, r0, #0
6604: 1a000024 bne 669c <rtems_aio_init+0xa8>
return result;
result =
6608: e59f0094 ldr r0, [pc, #148] ; 66a4 <rtems_aio_init+0xb0>
660c: e1a01004 mov r1, r4
6610: eb00035b bl 7384 <pthread_attr_setdetachstate>
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
6614: e3500000 cmp r0, #0
pthread_attr_destroy (&aio_request_queue.attr);
6618: 159f0084 ldrne r0, [pc, #132] ; 66a4 <rtems_aio_init+0xb0>
661c: 1b00033e blne 731c <pthread_attr_destroy>
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
6620: e59f0080 ldr r0, [pc, #128] ; 66a8 <rtems_aio_init+0xb4>
6624: e3a01000 mov r1, #0
6628: eb000283 bl 703c <pthread_mutex_init>
if (result != 0)
662c: e3500000 cmp r0, #0
pthread_attr_destroy (&aio_request_queue.attr);
6630: 159f006c ldrne r0, [pc, #108] ; 66a4 <rtems_aio_init+0xb0>
6634: 1b000338 blne 731c <pthread_attr_destroy>
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
6638: e59f006c ldr r0, [pc, #108] ; 66ac <rtems_aio_init+0xb8>
663c: e3a01000 mov r1, #0
6640: eb000196 bl 6ca0 <pthread_cond_init>
if (result != 0) {
6644: e2504000 subs r4, r0, #0
6648: 0a000003 beq 665c <rtems_aio_init+0x68>
pthread_mutex_destroy (&aio_request_queue.mutex);
664c: e59f0054 ldr r0, [pc, #84] ; 66a8 <rtems_aio_init+0xb4> <== NOT EXECUTED
6650: eb00022d bl 6f0c <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
6654: e59f0048 ldr r0, [pc, #72] ; 66a4 <rtems_aio_init+0xb0> <== NOT EXECUTED
6658: eb00032f bl 731c <pthread_attr_destroy> <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
665c: e59f3044 ldr r3, [pc, #68] ; 66a8 <rtems_aio_init+0xb4>
6660: e283204c add r2, r3, #76 ; 0x4c
head->previous = NULL;
tail->previous = head;
6664: e2831048 add r1, r3, #72 ; 0x48
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
6668: e5832048 str r2, [r3, #72] ; 0x48
head->previous = NULL;
666c: e3a02000 mov r2, #0
6670: e583204c str r2, [r3, #76] ; 0x4c
tail->previous = head;
6674: 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;
6678: e5832058 str r2, [r3, #88] ; 0x58
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
667c: 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;
6680: e5832064 str r2, [r3, #100] ; 0x64
aio_request_queue.idle_threads = 0;
6684: e5832068 str r2, [r3, #104] ; 0x68
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
6688: e59f2020 ldr r2, [pc, #32] ; 66b0 <rtems_aio_init+0xbc>
668c: e5831054 str r1, [r3, #84] ; 0x54
head->previous = NULL;
tail->previous = head;
6690: e2831054 add r1, r3, #84 ; 0x54
6694: e583105c str r1, [r3, #92] ; 0x5c
6698: e5832060 str r2, [r3, #96] ; 0x60
return result;
}
669c: e1a00004 mov r0, r4
66a0: e8bd8010 pop {r4, pc}
000065a4 <rtems_aio_insert_prio>:
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
65a4: e1a02000 mov r2, r0
65a8: e4923004 ldr r3, [r2], #4
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
65ac: e1530002 cmp r3, r2
* NONE
*/
static void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
65b0: e1a0c001 mov ip, r1
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
65b4: 0a00000d beq 65f0 <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;
65b8: e5931014 ldr r1, [r3, #20]
while (req->aiocbp->aio_reqprio > prio &&
65bc: 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;
65c0: e5911014 ldr r1, [r1, #20]
while (req->aiocbp->aio_reqprio > prio &&
65c4: e5900014 ldr r0, [r0, #20]
65c8: ea000002 b 65d8 <rtems_aio_insert_prio+0x34>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
65cc: e5933000 ldr r3, [r3] <== NOT EXECUTED
!rtems_chain_is_tail (chain, node)) {
node = rtems_chain_next (node);
prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
65d0: e5931014 ldr r1, [r3, #20] <== NOT EXECUTED
65d4: 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 &&
65d8: e1500001 cmp r0, r1
65dc: da000001 ble 65e8 <rtems_aio_insert_prio+0x44>
65e0: e1530002 cmp r3, r2 <== NOT EXECUTED
65e4: 1afffff8 bne 65cc <rtems_aio_insert_prio+0x28> <== NOT EXECUTED
65e8: e5930004 ldr r0, [r3, #4]
65ec: e1a0100c mov r1, ip
65f0: ea000944 b 8b08 <_Chain_Insert>
000067a8 <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)
{
67a8: e92d4010 push {r4, lr}
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
67ac: e4904004 ldr r4, [r0], #4
if (rtems_chain_is_empty (chain))
67b0: e1540000 cmp r4, r0
67b4: 1a000005 bne 67d0 <rtems_aio_remove_req+0x28>
67b8: ea000012 b 6808 <rtems_aio_remove_req+0x60>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
67bc: e5944000 ldr r4, [r4] <== 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) {
67c0: e1540000 cmp r4, r0 <== NOT EXECUTED
67c4: 1a000001 bne 67d0 <rtems_aio_remove_req+0x28> <== NOT EXECUTED
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
67c8: e3a00001 mov r0, #1 <== NOT EXECUTED
67cc: e8bd8010 pop {r4, pc} <== 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) {
67d0: e5943014 ldr r3, [r4, #20]
67d4: e1530001 cmp r3, r1
67d8: 1afffff7 bne 67bc <rtems_aio_remove_req+0x14>
67dc: e1a00004 mov r0, r4
67e0: eb0008b3 bl 8ab4 <_Chain_Extract>
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
67e4: e5943014 ldr r3, [r4, #20]
67e8: e3a0208c mov r2, #140 ; 0x8c
67ec: e5832030 str r2, [r3, #48] ; 0x30
current->aiocbp->return_value = -1;
67f0: e3e02000 mvn r2, #0
free (current);
67f4: e1a00004 mov r0, r4
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
current->aiocbp->return_value = -1;
67f8: e5832034 str r2, [r3, #52] ; 0x34
free (current);
67fc: ebfff038 bl 28e4 <free>
}
return AIO_CANCELED;
6800: e3a00000 mov r0, #0
6804: e8bd8010 pop {r4, pc}
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
return AIO_ALLDONE;
6808: e3a00002 mov r0, #2
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
680c: e8bd8010 pop {r4, pc}
000070b0 <rtems_rbheap_allocate>:
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
70b0: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
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;
70b4: e5906030 ldr r6, [r0, #48] ; 0x30
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
70b8: e1a05001 mov r5, r1
70bc: e1a04000 mov r4, r0
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
70c0: e1a00001 mov r0, r1
70c4: e1a01006 mov r1, r6
70c8: eb00424f bl 17a0c <__umodsi3>
if (excess > 0) {
70cc: e3500000 cmp r0, #0
value += alignment - excess;
70d0: 10856006 addne r6, r5, r6
70d4: 10606006 rsbne r6, r0, r6
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
if (excess > 0) {
70d8: 01a06005 moveq r6, r5
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) {
70dc: e1550006 cmp r5, r6
70e0: 83a00000 movhi r0, #0
70e4: 93a00001 movls r0, #1
70e8: e3550000 cmp r5, #0
70ec: 03a00000 moveq r0, #0
70f0: e3500000 cmp r0, #0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
70f4: 11a02004 movne r2, r4
70f8: 14923004 ldrne r3, [r2], #4
size_t size
)
{
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;
70fc: 13a07000 movne r7, #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) {
7100: 1a000005 bne 711c <rtems_rbheap_allocate+0x6c>
7104: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
rtems_rbheap_chunk *big_enough = NULL;
while (current != tail && big_enough == NULL) {
rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current;
if (free_chunk->size >= size) {
7108: e593701c ldr r7, [r3, #28]
710c: e1570006 cmp r7, r6
7110: 21a07003 movcs r7, r3
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
7114: e5933000 ldr r3, [r3]
7118: 33a07000 movcc r7, #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) {
711c: e2778001 rsbs r8, r7, #1
7120: 33a08000 movcc r8, #0
7124: e1530002 cmp r3, r2
7128: 03a08000 moveq r8, #0
712c: e3580000 cmp r8, #0
7130: 1afffff4 bne 7108 <rtems_rbheap_allocate+0x58>
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) {
7134: e3570000 cmp r7, #0
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
7138: 01a00007 moveq r0, r7
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) {
713c: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
uintptr_t free_size = free_chunk->size;
7140: e597901c ldr r9, [r7, #28]
if (free_size > aligned_size) {
7144: e1590006 cmp r9, r6
7148: 9a00001f bls 71cc <rtems_rbheap_allocate+0x11c>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
714c: e1a0a004 mov sl, r4
7150: e5ba500c ldr r5, [sl, #12]!
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
7154: e2843010 add r3, r4, #16
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
7158: e1550003 cmp r5, r3
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
715c: 15953000 ldrne r3, [r5]
head->next = new_first;
7160: 1584300c strne r3, [r4, #12]
new_first->previous = head;
7164: 1583a004 strne sl, [r3, #4]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
7168: 1a000009 bne 7194 <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);
716c: e1a00004 mov r0, r4 <== NOT EXECUTED
7170: e1a0e00f mov lr, pc <== NOT EXECUTED
7174: e594f034 ldr pc, [r4, #52] ; 0x34 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
7178: e594300c ldr r3, [r4, #12] <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
717c: e1530005 cmp r3, r5 <== NOT EXECUTED
7180: 0a000018 beq 71e8 <rtems_rbheap_allocate+0x138> <== 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;
7184: e5932000 ldr r2, [r3] <== NOT EXECUTED
head->next = new_first;
7188: e584200c str r2, [r4, #12] <== NOT EXECUTED
new_first->previous = head;
718c: e582a004 str sl, [r2, #4] <== NOT EXECUTED
7190: e1a05003 mov r5, r3 <== NOT EXECUTED
if (new_chunk != NULL) {
uintptr_t new_free_size = free_size - aligned_size;
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
7194: e5973018 ldr r3, [r7, #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;
7198: e0669009 rsb r9, r6, r9
free_chunk->size = new_free_size;
719c: e587901c str r9, [r7, #28]
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
71a0: e1a01005 mov r1, r5
new_chunk->begin = free_chunk->begin + new_free_size;
71a4: e0899003 add r9, r9, r3
71a8: e3a03000 mov r3, #0
71ac: e5859018 str r9, [r5, #24]
new_chunk->size = aligned_size;
71b0: e585601c str r6, [r5, #28]
71b4: e5853004 str r3, [r5, #4]
71b8: e4813008 str r3, [r1], #8
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
71bc: e2840018 add r0, r4, #24
71c0: eb000650 bl 8b08 <_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;
71c4: e5950018 ldr r0, [r5, #24]
71c8: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
71cc: e897000c ldm r7, {r2, r3}
}
} else {
rtems_chain_extract_unprotected(&free_chunk->chain_node);
rtems_chain_set_off_chain(&free_chunk->chain_node);
ptr = (void *) free_chunk->begin;
71d0: e5970018 ldr r0, [r7, #24]
next->previous = previous;
71d4: e5823004 str r3, [r2, #4]
previous->next = next;
71d8: e5832000 str r2, [r3]
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
71dc: e5878004 str r8, [r7, #4]
71e0: e5878000 str r8, [r7]
71e4: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
71e8: e1a00008 mov r0, r8 <== NOT EXECUTED
}
}
}
return ptr;
}
71ec: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
00007374 <rtems_rbheap_extend_descriptors_with_malloc>:
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
7374: e92d4010 push {r4, lr} <== NOT EXECUTED
7378: e1a04000 mov r4, r0 <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
737c: e3a00020 mov r0, #32 <== NOT EXECUTED
7380: ebffee8e bl 2dc0 <malloc> <== NOT EXECUTED
if (chunk != NULL) {
7384: e3500000 cmp r0, #0 <== NOT EXECUTED
7388: 08bd8010 popeq {r4, pc} <== 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);
738c: e284300c add r3, r4, #12 <== NOT EXECUTED
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
7390: e5803004 str r3, [r0, #4] <== NOT EXECUTED
before_node = after_node->next;
7394: e594300c ldr r3, [r4, #12] <== NOT EXECUTED
after_node->next = the_node;
7398: e584000c str r0, [r4, #12] <== NOT EXECUTED
the_node->next = before_node;
before_node->previous = the_node;
739c: e5830004 str r0, [r3, #4] <== NOT EXECUTED
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
73a0: e5803000 str r3, [r0] <== NOT EXECUTED
73a4: e8bd8010 pop {r4, pc} <== NOT EXECUTED
000071f0 <rtems_rbheap_free>:
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
71f0: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
71f4: e2516000 subs r6, r1, #0
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
71f8: e24dd020 sub sp, sp, #32
71fc: e1a05000 mov r5, r0
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
7200: 0a000057 beq 7364 <rtems_rbheap_free+0x174>
#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 };
7204: e1a0000d mov r0, sp
7208: e3a01000 mov r1, #0
720c: e3a02020 mov r2, #32
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
7210: e3a04000 mov r4, #0
7214: eb002035 bl f2f0 <memset>
return rtems_rbheap_chunk_of_node(
7218: e08d3004 add r3, sp, r4
#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 };
721c: e58d6018 str r6, [sp, #24]
return rtems_rbheap_chunk_of_node(
7220: e2837008 add r7, r3, #8
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
7224: e595601c ldr r6, [r5, #28]
7228: ea00000d b 7264 <rtems_rbheap_free+0x74>
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
722c: e1a00007 mov r0, r7
7230: e1a01006 mov r1, r6
7234: e1a0e00f mov lr, pc
7238: e595f028 ldr pc, [r5, #40] ; 0x28
if ( _RBTree_Is_equal( compare_result ) ) {
723c: e3500000 cmp r0, #0
7240: 1a000003 bne 7254 <rtems_rbheap_free+0x64>
found = iter_node;
if ( the_rbtree->is_unique )
7244: e5d5302c ldrb r3, [r5, #44] ; 0x2c
7248: e3530000 cmp r3, #0
724c: 1a000007 bne 7270 <rtems_rbheap_free+0x80>
7250: e1a04006 mov r4, r6 <== NOT EXECUTED
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
7254: e3500000 cmp r0, #0
7258: c3a00008 movgt r0, #8
725c: d3a00004 movle r0, #4
7260: e7906006 ldr r6, [r0, r6]
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
7264: e3560000 cmp r6, #0
7268: 1affffef bne 722c <rtems_rbheap_free+0x3c>
726c: e1a06004 mov r6, r4
7270: e2464008 sub r4, r6, #8
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) {
7274: e3740008 cmn r4, #8
check_and_merge(free_chain, chunk_tree, chunk, pred);
} else {
sc = RTEMS_INCORRECT_STATE;
}
} else {
sc = RTEMS_INVALID_ID;
7278: 03a06004 moveq r6, #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) {
727c: 0a000038 beq 7364 <rtems_rbheap_free+0x174>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
7280: e5163008 ldr r3, [r6, #-8]
7284: e3530000 cmp r3, #0
7288: 13a0a000 movne sl, #0
728c: 1a000002 bne 729c <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)
7290: e594a004 ldr sl, [r4, #4]
7294: e27aa001 rsbs sl, sl, #1
7298: 33a0a000 movcc sl, #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)) {
729c: e23aa001 eors sl, sl, #1
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;
72a0: 13a0600e movne r6, #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)) {
72a4: 1a00002e bne 7364 <rtems_rbheap_free+0x174>
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
72a8: e2849008 add r9, r4, #8
72ac: e1a0100a mov r1, sl
72b0: e1a00009 mov r0, r9
72b4: eb000698 bl 8d1c <_RBTree_Next_unprotected>
72b8: e3a01001 mov r1, #1
72bc: e1a06000 mov r6, r0
72c0: e2408008 sub r8, r0, #8
72c4: e1a00009 mov r0, r9
72c8: eb000693 bl 8d1c <_RBTree_Next_unprotected>
72cc: e2403008 sub r3, r0, #8
rtems_rbtree_control *chunk_tree,
rtems_rbheap_chunk *a,
rtems_rbheap_chunk *b
)
{
if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) {
72d0: e3730008 cmn r3, #8
{
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;
72d4: e2857018 add r7, r5, #24
rtems_rbtree_control *chunk_tree,
rtems_rbheap_chunk *a,
rtems_rbheap_chunk *b
)
{
if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) {
72d8: 0a00000a beq 7308 <rtems_rbheap_free+0x118>
72dc: e5102008 ldr r2, [r0, #-8]
72e0: e3520000 cmp r2, #0
72e4: 1a000002 bne 72f4 <rtems_rbheap_free+0x104>
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)
72e8: e510a004 ldr sl, [r0, #-4]
72ec: e27aa001 rsbs sl, sl, #1
72f0: 33a0a000 movcc sl, #0
rtems_rbtree_control *chunk_tree,
rtems_rbheap_chunk *a,
rtems_rbheap_chunk *b
)
{
if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) {
72f4: e35a0000 cmp sl, #0
72f8: 01a00005 moveq r0, r5
72fc: 01a01007 moveq r1, r7
7300: 01a02004 moveq r2, r4
7304: 0bffff08 bleq 6f2c <check_and_merge.part.1>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
7308: e5953000 ldr r3, [r5]
730c: e3780008 cmn r8, #8
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
7310: e5845004 str r5, [r4, #4]
before_node = after_node->next;
after_node->next = the_node;
7314: e5854000 str r4, [r5]
the_node->next = before_node;
before_node->previous = the_node;
7318: e5834004 str r4, [r3, #4]
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
731c: e5843000 str r3, [r4]
7320: 0a00000e beq 7360 <rtems_rbheap_free+0x170>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
7324: e5163008 ldr r3, [r6, #-8]
7328: e3530000 cmp r3, #0
732c: 13a06000 movne r6, #0
7330: 1a000002 bne 7340 <rtems_rbheap_free+0x150>
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)
7334: e5166004 ldr r6, [r6, #-4]
7338: e2766001 rsbs r6, r6, #1
733c: 33a06000 movcc r6, #0
rtems_rbtree_control *chunk_tree,
rtems_rbheap_chunk *a,
rtems_rbheap_chunk *b
)
{
if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) {
7340: e21660ff ands r6, r6, #255 ; 0xff
7344: 1a000005 bne 7360 <rtems_rbheap_free+0x170>
7348: e1a00005 mov r0, r5
734c: e1a01007 mov r1, r7
7350: e1a02004 mov r2, r4
7354: e1a03008 mov r3, r8
7358: ebfffef3 bl 6f2c <check_and_merge.part.1>
735c: ea000000 b 7364 <rtems_rbheap_free+0x174>
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
7360: e3a06000 mov r6, #0
sc = RTEMS_INVALID_ID;
}
}
return sc;
}
7364: e1a00006 mov r0, r6
7368: e28dd020 add sp, sp, #32
736c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
00006620 <sigaction>:
struct sigaction *oact
)
{
ISR_Level level;
if ( oact )
6620: e2523000 subs r3, r2, #0
*oact = _POSIX_signals_Vectors[ sig ];
6624: 159f20b4 ldrne r2, [pc, #180] ; 66e0 <sigaction+0xc0>
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
6628: e92d41f0 push {r4, r5, r6, r7, r8, lr}
662c: e1a05001 mov r5, r1
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
6630: 13a0100c movne r1, #12
6634: 10222091 mlane r2, r1, r0, r2
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
6638: e1a04000 mov r4, r0
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
663c: 18920007 ldmne r2, {r0, r1, r2}
6640: 18830007 stmne r3, {r0, r1, r2}
if ( !sig )
6644: e3540000 cmp r4, #0
6648: 0a000004 beq 6660 <sigaction+0x40>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
664c: e2443001 sub r3, r4, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
6650: e353001f cmp r3, #31
6654: 8a000001 bhi 6660 <sigaction+0x40>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
6658: e3540009 cmp r4, #9
665c: 1a000004 bne 6674 <sigaction+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
6660: eb002032 bl e730 <__errno>
6664: e3a03016 mov r3, #22
6668: e5803000 str r3, [r0]
666c: e3e00000 mvn r0, #0
6670: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
6674: e3550000 cmp r5, #0
6678: 0a000016 beq 66d8 <sigaction+0xb8>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
667c: e10f6000 mrs r6, CPSR
6680: e3863080 orr r3, r6, #128 ; 0x80
6684: 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 ) {
6688: e5953008 ldr r3, [r5, #8]
668c: e3530000 cmp r3, #0
6690: e59f7048 ldr r7, [pc, #72] ; 66e0 <sigaction+0xc0>
6694: e3a0800c mov r8, #12
6698: 1a000006 bne 66b8 <sigaction+0x98>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
669c: e0040498 mul r4, r8, r4
66a0: e59f803c ldr r8, [pc, #60] ; 66e4 <sigaction+0xc4>
66a4: e0873004 add r3, r7, r4
66a8: e0884004 add r4, r8, r4
66ac: e8940007 ldm r4, {r0, r1, r2}
66b0: e8830007 stm r3, {r0, r1, r2}
66b4: ea000004 b 66cc <sigaction+0xac>
} else {
_POSIX_signals_Clear_process_signals( sig );
66b8: e1a00004 mov r0, r4
_POSIX_signals_Vectors[ sig ] = *act;
66bc: e0247498 mla r4, r8, r4, r7
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
} else {
_POSIX_signals_Clear_process_signals( sig );
66c0: eb00156f bl bc84 <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
66c4: e8950007 ldm r5, {r0, r1, r2}
66c8: e8840007 stm r4, {r0, r1, r2}
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
66cc: 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;
66d0: e3a00000 mov r0, #0
66d4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
66d8: e1a00005 mov r0, r5 <== NOT EXECUTED
}
66dc: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
00008a28 <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
8a28: e92d4010 push {r4, lr}
8a2c: e1a04001 mov r4, r1
int status;
status = sigtimedwait( set, NULL, NULL );
8a30: e3a01000 mov r1, #0
8a34: e1a02001 mov r2, r1
8a38: ebffff86 bl 8858 <sigtimedwait>
if ( status != -1 ) {
8a3c: e3700001 cmn r0, #1
8a40: 0a000004 beq 8a58 <sigwait+0x30>
if ( sig )
8a44: e3540000 cmp r4, #0
*sig = status;
8a48: 15840000 strne r0, [r4]
return 0;
8a4c: 13a00000 movne r0, #0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
8a50: 18bd8010 popne {r4, pc}
8a54: ea000002 b 8a64 <sigwait+0x3c> <== NOT EXECUTED
*sig = status;
return 0;
}
return errno;
8a58: eb001f78 bl 10840 <__errno>
8a5c: e5900000 ldr r0, [r0]
8a60: e8bd8010 pop {r4, pc}
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
*sig = status;
return 0;
8a64: e1a00004 mov r0, r4 <== NOT EXECUTED
}
return errno;
}
8a68: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0000594c <sysconf>:
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
594c: e3500002 cmp r0, #2
*/
long sysconf(
int name
)
{
5950: e52de004 push {lr} ; (str lr, [sp, #-4]!)
if ( name == _SC_CLK_TCK )
5954: 1a000004 bne 596c <sysconf+0x20>
return (TOD_MICROSECONDS_PER_SECOND /
5958: e59f3058 ldr r3, [pc, #88] ; 59b8 <sysconf+0x6c>
595c: e59f0058 ldr r0, [pc, #88] ; 59bc <sysconf+0x70>
5960: e593100c ldr r1, [r3, #12]
5964: eb00442b bl 16a18 <__aeabi_uidiv>
5968: e49df004 pop {pc} ; (ldr pc, [sp], #4)
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
596c: e3500004 cmp r0, #4
return rtems_libio_number_iops;
5970: 059f3048 ldreq r3, [pc, #72] ; 59c0 <sysconf+0x74>
5974: 05930000 ldreq r0, [r3]
{
if ( name == _SC_CLK_TCK )
return (TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
5978: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
597c: e3500033 cmp r0, #51 ; 0x33
return 1024;
5980: 03a00b01 moveq r0, #1024 ; 0x400
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
5984: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
return 1024;
if ( name == _SC_PAGESIZE )
5988: e3500008 cmp r0, #8
return PAGE_SIZE;
598c: 03a00a01 moveq r0, #4096 ; 0x1000
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
return 1024;
if ( name == _SC_PAGESIZE )
5990: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
5994: e350004f cmp r0, #79 ; 0x4f
5998: 0a000004 beq 59b0 <sysconf+0x64>
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
599c: eb00202c bl da54 <__errno>
59a0: e3a03016 mov r3, #22
59a4: e5803000 str r3, [r0]
59a8: e3e00000 mvn r0, #0
59ac: e49df004 pop {pc} ; (ldr pc, [sp], #4)
if ( name == _SC_PAGESIZE )
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
return RTEMS_FILESYSTEM_SYMLOOP_MAX;
59b0: e3a00020 mov r0, #32 <== NOT EXECUTED
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
}
59b4: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED