RTEMS 4.11Annotated Report
Fri Mar 11 11:56:43 2011
00014f60 <_CORE_message_queue_Broadcast>:
{
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
14f60: e590304c ldr r3, [r0, #76] ; 0x4c
Objects_Id id __attribute__((unused)),
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)),
#endif
uint32_t *count
)
{
14f64: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
14f68: e1520003 cmp r2, r3
Objects_Id id __attribute__((unused)),
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)),
#endif
uint32_t *count
)
{
14f6c: e1a06000 mov r6, r0
14f70: e1a0a001 mov sl, r1
14f74: e1a07002 mov r7, r2
14f78: e59d8020 ldr r8, [sp, #32]
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
14f7c: 8a000013 bhi 14fd0 <_CORE_message_queue_Broadcast+0x70>
* NOTE: This check is critical because threads can block on
* send and receive and this ensures that we are broadcasting
* the message to threads waiting to receive -- not to send.
*/
if ( the_message_queue->number_of_pending_messages != 0 ) {
14f80: e5905048 ldr r5, [r0, #72] ; 0x48
14f84: e3550000 cmp r5, #0
*count = 0;
14f88: 13a00000 movne r0, #0
14f8c: 15880000 strne r0, [r8]
* NOTE: This check is critical because threads can block on
* send and receive and this ensures that we are broadcasting
* the message to threads waiting to receive -- not to send.
*/
if ( the_message_queue->number_of_pending_messages != 0 ) {
14f90: 0a000007 beq 14fb4 <_CORE_message_queue_Broadcast+0x54>
14f94: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
14f98: e594002c ldr r0, [r4, #44] ; 0x2c
14f9c: e1a0100a mov r1, sl
14fa0: e1a02007 mov r2, r7
14fa4: eb002204 bl 1d7bc <memcpy>
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
14fa8: e5943028 ldr r3, [r4, #40] ; 0x28
14fac: e5837000 str r7, [r3]
*/
number_broadcasted = 0;
while ((the_thread =
_Thread_queue_Dequeue(&the_message_queue->Wait_queue))) {
waitp = &the_thread->Wait;
number_broadcasted += 1;
14fb0: e2855001 add r5, r5, #1
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
14fb4: e1a00006 mov r0, r6
14fb8: eb000ace bl 17af8 <_Thread_queue_Dequeue>
14fbc: e2504000 subs r4, r0, #0
14fc0: 1afffff4 bne 14f98 <_CORE_message_queue_Broadcast+0x38>
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_message_queue_mp_support) ( the_thread, id );
#endif
}
*count = number_broadcasted;
14fc4: e5885000 str r5, [r8]
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
14fc8: e1a00004 mov r0, r4
14fcc: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE;
14fd0: e3a00001 mov r0, #1 <== NOT EXECUTED
#endif
}
*count = number_broadcasted;
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
}
14fd4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
00005d3c <aio_fsync>:
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
5d3c: e3500a02 cmp r0, #8192 ; 0x2000
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
5d40: e92d4030 push {r4, r5, lr}
5d44: e1a04001 mov r4, r1
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
5d48: 13a05016 movne r5, #22
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
5d4c: 1a00000c bne 5d84 <aio_fsync+0x48>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
5d50: e5910000 ldr r0, [r1]
5d54: e3a01003 mov r1, #3
5d58: eb0019c8 bl c480 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
5d5c: e2000003 and r0, r0, #3
5d60: e2400001 sub r0, r0, #1
5d64: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
5d68: 83a05009 movhi r5, #9
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
5d6c: 8a000004 bhi 5d84 <aio_fsync+0x48>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
5d70: e3a00018 mov r0, #24
5d74: ebfff52c bl 322c <malloc>
if (req == NULL)
5d78: e2503000 subs r3, r0, #0
5d7c: 1a000007 bne 5da0 <aio_fsync+0x64>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
5d80: e3a0500b mov r5, #11 <== NOT EXECUTED
5d84: e3e03000 mvn r3, #0
5d88: e5845030 str r5, [r4, #48] ; 0x30
5d8c: e5843034 str r3, [r4, #52] ; 0x34
5d90: eb00268f bl f7d4 <__errno>
5d94: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
5d98: e3e00000 mvn r0, #0
5d9c: e8bd8030 pop {r4, r5, pc}
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
5da0: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_SYNC;
5da4: e3a03003 mov r3, #3
5da8: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
5dac: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
5db0: ea00013b b 62a4 <rtems_aio_enqueue>
000064ac <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
64ac: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
64b0: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
64b4: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
64b8: e5900000 ldr r0, [r0]
64bc: eb0017ef bl c480 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
64c0: e2000003 and r0, r0, #3
64c4: e3500002 cmp r0, #2
64c8: 13500000 cmpne r0, #0
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
64cc: 13a05009 movne r5, #9
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
64d0: 1a00000d bne 650c <aio_read+0x60>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
64d4: e5943014 ldr r3, [r4, #20]
64d8: e3530000 cmp r3, #0
64dc: 1a000007 bne 6500 <aio_read+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
64e0: e5943008 ldr r3, [r4, #8]
64e4: e3530000 cmp r3, #0
64e8: ba000004 blt 6500 <aio_read+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
64ec: e3a00018 mov r0, #24
64f0: ebfff34d bl 322c <malloc>
if (req == NULL)
64f4: e2503000 subs r3, r0, #0
64f8: 1a00000a bne 6528 <aio_read+0x7c>
64fc: ea000001 b 6508 <aio_read+0x5c> <== NOT EXECUTED
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
6500: e3a05016 mov r5, #22
6504: ea000000 b 650c <aio_read+0x60>
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
6508: e3a0500b mov r5, #11 <== NOT EXECUTED
650c: e3e03000 mvn r3, #0
6510: e5845030 str r5, [r4, #48] ; 0x30
6514: e5843034 str r3, [r4, #52] ; 0x34
6518: eb0024ad bl f7d4 <__errno>
651c: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
6520: e3e00000 mvn r0, #0
6524: e8bd8030 pop {r4, r5, pc}
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
6528: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_READ;
652c: e3a03001 mov r3, #1
6530: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
6534: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
6538: eaffff59 b 62a4 <rtems_aio_enqueue>
00006544 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
6544: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
6548: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
654c: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
6550: e5900000 ldr r0, [r0]
6554: eb0017c9 bl c480 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
6558: e2000003 and r0, r0, #3
655c: e2400001 sub r0, r0, #1
6560: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
6564: 83a05009 movhi r5, #9
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
6568: 8a00000d bhi 65a4 <aio_write+0x60>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
656c: e5943014 ldr r3, [r4, #20]
6570: e3530000 cmp r3, #0
6574: 1a000007 bne 6598 <aio_write+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
6578: e5943008 ldr r3, [r4, #8]
657c: e3530000 cmp r3, #0
6580: ba000004 blt 6598 <aio_write+0x54>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
6584: e3a00018 mov r0, #24
6588: ebfff327 bl 322c <malloc>
if (req == NULL)
658c: e2503000 subs r3, r0, #0
6590: 1a00000a bne 65c0 <aio_write+0x7c>
6594: ea000001 b 65a0 <aio_write+0x5c> <== NOT EXECUTED
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
6598: e3a05016 mov r5, #22
659c: ea000000 b 65a4 <aio_write+0x60>
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
65a0: e3a0500b mov r5, #11 <== NOT EXECUTED
65a4: e3e03000 mvn r3, #0
65a8: e5845030 str r5, [r4, #48] ; 0x30
65ac: e5843034 str r3, [r4, #52] ; 0x34
65b0: eb002487 bl f7d4 <__errno>
65b4: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
65b8: e3e00000 mvn r0, #0
65bc: e8bd8030 pop {r4, r5, pc}
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
65c0: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_WRITE;
65c4: e3a03002 mov r3, #2
65c8: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
65cc: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
65d0: eaffff33 b 62a4 <rtems_aio_enqueue>
0000a600 <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
a600: e3500000 cmp r0, #0
a604: 0a00000b beq a638 <pthread_attr_setschedpolicy+0x38>
a608: e5903000 ldr r3, [r0]
a60c: e3530000 cmp r3, #0
a610: 0a000008 beq a638 <pthread_attr_setschedpolicy+0x38>
return EINVAL;
switch ( policy ) {
a614: e3510004 cmp r1, #4
a618: 8a000008 bhi a640 <pthread_attr_setschedpolicy+0x40>
a61c: e3a03001 mov r3, #1
a620: e1a03113 lsl r3, r3, r1
a624: e3130017 tst r3, #23
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
a628: 15801014 strne r1, [r0, #20]
return 0;
a62c: 13a00000 movne r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
a630: 112fff1e bxne lr
a634: ea000001 b a640 <pthread_attr_setschedpolicy+0x40> <== NOT EXECUTED
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
a638: e3a00016 mov r0, #22
a63c: e12fff1e bx lr
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
a640: e3a00086 mov r0, #134 ; 0x86
}
}
a644: e12fff1e bx lr
00021ac4 <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
21ac4: e92d41f1 push {r0, r4, r5, r6, r7, r8, lr}
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
21ac8: e2517000 subs r7, r1, #0
21acc: 0a000002 beq 21adc <pthread_kill+0x18>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
21ad0: e2478001 sub r8, r7, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
21ad4: e358001f cmp r8, #31
21ad8: 9a000002 bls 21ae8 <pthread_kill+0x24>
rtems_set_errno_and_return_minus_one( EINVAL );
21adc: ebffc13a bl 11fcc <__errno>
21ae0: e3a03016 mov r3, #22
21ae4: ea000022 b 21b74 <pthread_kill+0xb0>
the_thread = _Thread_Get( thread, &location );
21ae8: e1a0100d mov r1, sp
21aec: ebffaae0 bl c674 <_Thread_Get>
switch ( location ) {
21af0: e59d6000 ldr r6, [sp]
21af4: e3560000 cmp r6, #0
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
the_thread = _Thread_Get( thread, &location );
21af8: e1a05000 mov r5, r0
switch ( location ) {
21afc: 1a00001a bne 21b6c <pthread_kill+0xa8>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
21b00: e59f2078 ldr r2, [pc, #120] ; 21b80 <pthread_kill+0xbc>
21b04: e3a0100c mov r1, #12
21b08: e0222791 mla r2, r1, r7, r2
21b0c: e5922008 ldr r2, [r2, #8]
21b10: e3520001 cmp r2, #1
case OBJECTS_LOCAL:
/*
* If sig == 0 then just validate arguments
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
21b14: e59030fc ldr r3, [r0, #252] ; 0xfc
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
21b18: 1a000002 bne 21b28 <pthread_kill+0x64>
_Thread_Enable_dispatch();
21b1c: ebffaacb bl c650 <_Thread_Enable_dispatch>
return 0;
21b20: e1a00006 mov r0, r6
21b24: ea000014 b 21b7c <pthread_kill+0xb8>
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
21b28: e59320d4 ldr r2, [r3, #212] ; 0xd4
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
21b2c: e3a04001 mov r4, #1
21b30: e1828814 orr r8, r2, r4, lsl r8
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
21b34: e1a01007 mov r1, r7
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
21b38: e58380d4 str r8, [r3, #212] ; 0xd4
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
21b3c: e1a02006 mov r2, r6
21b40: ebffff99 bl 219ac <_POSIX_signals_Unblock_thread>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
21b44: e59f3038 ldr r3, [pc, #56] ; 21b84 <pthread_kill+0xc0>
21b48: e5932000 ldr r2, [r3]
21b4c: e3520000 cmp r2, #0
21b50: 0a000002 beq 21b60 <pthread_kill+0x9c>
21b54: e5932004 ldr r2, [r3, #4]
21b58: e1550002 cmp r5, r2
_Thread_Dispatch_necessary = true;
21b5c: 05c34010 strbeq r4, [r3, #16]
}
_Thread_Enable_dispatch();
21b60: ebffaaba bl c650 <_Thread_Enable_dispatch>
return 0;
21b64: e3a00000 mov r0, #0
21b68: ea000003 b 21b7c <pthread_kill+0xb8>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
21b6c: ebffc116 bl 11fcc <__errno> <== NOT EXECUTED
21b70: e3a03003 mov r3, #3 <== NOT EXECUTED
21b74: e5803000 str r3, [r0]
21b78: e3e00000 mvn r0, #0
}
21b7c: e8bd81f8 pop {r3, r4, r5, r6, r7, r8, pc}
00007444 <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
7444: e3500000 cmp r0, #0
7448: 0a000007 beq 746c <pthread_mutexattr_setpshared+0x28>
744c: e5903000 ldr r3, [r0]
7450: e3530000 cmp r3, #0
7454: 0a000004 beq 746c <pthread_mutexattr_setpshared+0x28>
return EINVAL;
switch ( pshared ) {
7458: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
745c: 95801004 strls r1, [r0, #4]
return 0;
7460: 93a00000 movls r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
7464: 912fff1e bxls lr
7468: ea000001 b 7474 <pthread_mutexattr_setpshared+0x30> <== NOT EXECUTED
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
746c: e3a00016 mov r0, #22
7470: e12fff1e bx lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
7474: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
7478: e12fff1e bx lr <== NOT EXECUTED
000070b0 <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
70b0: e3500000 cmp r0, #0
70b4: 0a000007 beq 70d8 <pthread_rwlockattr_setpshared+0x28>
return EINVAL;
if ( !attr->is_initialized )
70b8: e5903000 ldr r3, [r0]
70bc: e3530000 cmp r3, #0
70c0: 0a000004 beq 70d8 <pthread_rwlockattr_setpshared+0x28>
return EINVAL;
switch ( pshared ) {
70c4: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
70c8: 95801004 strls r1, [r0, #4]
return 0;
70cc: 93a00000 movls r0, #0
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
70d0: 912fff1e bxls lr
70d4: ea000001 b 70e0 <pthread_rwlockattr_setpshared+0x30> <== NOT EXECUTED
{
if ( !attr )
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
70d8: e3a00016 mov r0, #22
70dc: e12fff1e bx lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
70e0: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
70e4: e12fff1e bx lr <== NOT EXECUTED
000062a4 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
62a4: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
62a8: e59f41ec ldr r4, [pc, #492] ; 649c <rtems_aio_enqueue+0x1f8>
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
62ac: e24dd024 sub sp, sp, #36 ; 0x24
62b0: e1a06000 mov r6, r0
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
62b4: e1a00004 mov r0, r4
62b8: eb00024d bl 6bf4 <pthread_mutex_lock>
if (result != 0) {
62bc: e2505000 subs r5, r0, #0
62c0: 0a000002 beq 62d0 <rtems_aio_enqueue+0x2c>
free (req);
62c4: e1a00006 mov r0, r6 <== NOT EXECUTED
62c8: ebfff271 bl 2c94 <free> <== NOT EXECUTED
return result;
62cc: ea00006f b 6490 <rtems_aio_enqueue+0x1ec> <== NOT EXECUTED
}
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
62d0: eb000450 bl 7418 <pthread_self>
62d4: e28d101c add r1, sp, #28
62d8: e1a0200d mov r2, sp
62dc: eb000359 bl 7048 <pthread_getschedparam>
req->caller_thread = pthread_self ();
62e0: eb00044c bl 7418 <pthread_self>
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
62e4: e5963014 ldr r3, [r6, #20]
62e8: e59d1000 ldr r1, [sp]
62ec: e5932014 ldr r2, [r3, #20]
62f0: e0622001 rsb r2, r2, r1
62f4: e586200c str r2, [r6, #12]
req->policy = policy;
62f8: e59d201c ldr r2, [sp, #28]
62fc: e5862008 str r2, [r6, #8]
req->aiocbp->error_code = EINPROGRESS;
6300: e3a02077 mov r2, #119 ; 0x77
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
6304: e5860010 str r0, [r6, #16]
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
6308: e5832030 str r2, [r3, #48] ; 0x30
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
630c: e5942068 ldr r2, [r4, #104] ; 0x68
6310: e3520000 cmp r2, #0
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
req->aiocbp->return_value = 0;
6314: e5835034 str r5, [r3, #52] ; 0x34
if ((aio_request_queue.idle_threads == 0) &&
6318: 1a00002e bne 63d8 <rtems_aio_enqueue+0x134>
631c: e5942064 ldr r2, [r4, #100] ; 0x64
6320: e3520004 cmp r2, #4
6324: ca00002b bgt 63d8 <rtems_aio_enqueue+0x134>
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
6328: e5931000 ldr r1, [r3]
632c: e2840048 add r0, r4, #72 ; 0x48
6330: e3a02001 mov r2, #1
6334: ebfffece bl 5e74 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
6338: e5903018 ldr r3, [r0, #24]
633c: e3530001 cmp r3, #1
if ((aio_request_queue.idle_threads == 0) &&
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
6340: e1a07000 mov r7, r0
6344: e2809008 add r9, r0, #8
6348: e280801c add r8, r0, #28
634c: e280a020 add sl, r0, #32
if (r_chain->new_fd == 1) {
6350: 1a000017 bne 63b4 <rtems_aio_enqueue+0x110>
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
6354: e1a01006 mov r1, r6
6358: e1a00009 mov r0, r9
635c: eb00084a bl 848c <_Chain_Insert>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
6360: e1a01005 mov r1, r5
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
if (r_chain->new_fd == 1) {
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
6364: e5875018 str r5, [r7, #24]
pthread_mutex_init (&r_chain->mutex, NULL);
6368: e1a00008 mov r0, r8
636c: eb0001ce bl 6aac <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
6370: e1a01005 mov r1, r5
6374: e1a0000a mov r0, sl
6378: eb0000e3 bl 670c <pthread_cond_init>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
637c: e1a03007 mov r3, r7
6380: e28d0020 add r0, sp, #32
6384: e2841008 add r1, r4, #8
6388: e59f2110 ldr r2, [pc, #272] ; 64a0 <rtems_aio_enqueue+0x1fc>
638c: eb000299 bl 6df8 <pthread_create>
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
6390: e2506000 subs r6, r0, #0
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
++aio_request_queue.active_threads;
6394: 05943064 ldreq r3, [r4, #100] ; 0x64
6398: 02833001 addeq r3, r3, #1
639c: 05843064 streq r3, [r4, #100] ; 0x64
pthread_cond_init (&r_chain->cond, NULL);
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
63a0: 0a000038 beq 6488 <rtems_aio_enqueue+0x1e4>
pthread_mutex_unlock (&aio_request_queue.mutex);
63a4: e1a00004 mov r0, r4 <== NOT EXECUTED
63a8: eb000230 bl 6c70 <pthread_mutex_unlock> <== NOT EXECUTED
return result;
63ac: e1a05006 mov r5, r6 <== NOT EXECUTED
63b0: ea000036 b 6490 <rtems_aio_enqueue+0x1ec> <== NOT EXECUTED
}
++aio_request_queue.active_threads;
}
else {
/* put request in the fd chain it belongs to */
pthread_mutex_lock (&r_chain->mutex);
63b4: e1a00008 mov r0, r8
63b8: eb00020d bl 6bf4 <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
63bc: e1a00009 mov r0, r9
63c0: e1a01006 mov r1, r6
63c4: ebffff76 bl 61a4 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
63c8: e1a0000a mov r0, sl
63cc: eb0000fe bl 67cc <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
63d0: e1a00008 mov r0, r8
63d4: ea00000e b 6414 <rtems_aio_enqueue+0x170>
else
{
/* the maximum number of threads has been already created
even though some of them might be idle.
The request belongs to one of the active fd chain */
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
63d8: e59f00c4 ldr r0, [pc, #196] ; 64a4 <rtems_aio_enqueue+0x200>
63dc: e5931000 ldr r1, [r3]
63e0: e3a02000 mov r2, #0
63e4: ebfffea2 bl 5e74 <rtems_aio_search_fd>
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
63e8: e2504000 subs r4, r0, #0
63ec: 0a00000a beq 641c <rtems_aio_enqueue+0x178>
{
pthread_mutex_lock (&r_chain->mutex);
63f0: e284701c add r7, r4, #28
63f4: e1a00007 mov r0, r7
63f8: eb0001fd bl 6bf4 <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
63fc: e2840008 add r0, r4, #8
6400: e1a01006 mov r1, r6
6404: ebffff66 bl 61a4 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
6408: e2840020 add r0, r4, #32
640c: eb0000ee bl 67cc <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
6410: e1a00007 mov r0, r7
6414: eb000215 bl 6c70 <pthread_mutex_unlock>
6418: ea00001a b 6488 <rtems_aio_enqueue+0x1e4>
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
641c: e5963014 ldr r3, [r6, #20]
6420: e59f0080 ldr r0, [pc, #128] ; 64a8 <rtems_aio_enqueue+0x204>
6424: e5931000 ldr r1, [r3]
6428: e3a02001 mov r2, #1
642c: ebfffe90 bl 5e74 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
6430: e5903018 ldr r3, [r0, #24]
6434: e3530001 cmp r3, #1
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
6438: e1a07000 mov r7, r0
643c: e2800008 add r0, r0, #8
if (r_chain->new_fd == 1) {
6440: 1a000009 bne 646c <rtems_aio_enqueue+0x1c8>
6444: e1a01006 mov r1, r6
6448: eb00080f bl 848c <_Chain_Insert>
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
644c: e1a01004 mov r1, r4
if (r_chain->new_fd == 1) {
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
6450: e5874018 str r4, [r7, #24]
pthread_mutex_init (&r_chain->mutex, NULL);
6454: e287001c add r0, r7, #28
6458: eb000193 bl 6aac <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
645c: e2870020 add r0, r7, #32
6460: e1a01004 mov r1, r4
6464: eb0000a8 bl 670c <pthread_cond_init>
6468: ea000001 b 6474 <rtems_aio_enqueue+0x1d0>
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
646c: e1a01006 mov r1, r6
6470: ebffff4b bl 61a4 <rtems_aio_insert_prio>
if (aio_request_queue.idle_threads > 0)
6474: e59f0020 ldr r0, [pc, #32] ; 649c <rtems_aio_enqueue+0x1f8>
6478: e5903068 ldr r3, [r0, #104] ; 0x68
647c: e3530000 cmp r3, #0
pthread_cond_signal (&aio_request_queue.new_req);
6480: c2800004 addgt r0, r0, #4
6484: cb0000d0 blgt 67cc <pthread_cond_signal>
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
6488: e59f000c ldr r0, [pc, #12] ; 649c <rtems_aio_enqueue+0x1f8>
648c: eb0001f7 bl 6c70 <pthread_mutex_unlock>
return 0;
}
6490: e1a00005 mov r0, r5
6494: e28dd024 add sp, sp, #36 ; 0x24
6498: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
00005f58 <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
5f58: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
5f5c: e59f4238 ldr r4, [pc, #568] ; 619c <rtems_aio_handle+0x244>
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
5f60: e24dd02c sub sp, sp, #44 ; 0x2c
5f64: e1a05000 mov r5, r0
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
5f68: e28d7020 add r7, sp, #32
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
5f6c: e28db004 add fp, sp, #4
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
5f70: e285a01c add sl, r5, #28
5f74: e1a0000a mov r0, sl
5f78: eb00031d bl 6bf4 <pthread_mutex_lock>
if (result != 0)
5f7c: e2509000 subs r9, r0, #0
5f80: 1a000082 bne 6190 <rtems_aio_handle+0x238>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
5f84: e5956008 ldr r6, [r5, #8]
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
5f88: e285300c add r3, r5, #12
/* If the locked chain is not empty, take the first
request extract it, unlock the chain and process
the request, in this way the user can supply more
requests to this fd chain */
if (!rtems_chain_is_empty (chain)) {
5f8c: e1560003 cmp r6, r3
5f90: 0a000035 beq 606c <rtems_aio_handle+0x114>
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
5f94: eb00051f bl 7418 <pthread_self>
5f98: e28d1028 add r1, sp, #40 ; 0x28
5f9c: e1a0200b mov r2, fp
5fa0: eb000428 bl 7048 <pthread_getschedparam>
param.sched_priority = req->priority;
5fa4: e596300c ldr r3, [r6, #12]
5fa8: e58d3004 str r3, [sp, #4]
pthread_setschedparam (pthread_self(), req->policy, ¶m);
5fac: eb000519 bl 7418 <pthread_self>
5fb0: e1a0200b mov r2, fp
5fb4: e5961008 ldr r1, [r6, #8]
5fb8: eb00051b bl 742c <pthread_setschedparam>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
5fbc: e1a00006 mov r0, r6
5fc0: eb00091c bl 8438 <_Chain_Extract>
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
5fc4: e1a0000a mov r0, sl
5fc8: eb000328 bl 6c70 <pthread_mutex_unlock>
switch (req->aiocbp->aio_lio_opcode) {
5fcc: e5962014 ldr r2, [r6, #20]
5fd0: e592302c ldr r3, [r2, #44] ; 0x2c
5fd4: e3530002 cmp r3, #2
5fd8: 0a00000b beq 600c <rtems_aio_handle+0xb4>
5fdc: e3530003 cmp r3, #3
5fe0: 0a000011 beq 602c <rtems_aio_handle+0xd4>
5fe4: e3530001 cmp r3, #1
5fe8: 1a000013 bne 603c <rtems_aio_handle+0xe4>
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
5fec: e5921008 ldr r1, [r2, #8]
5ff0: e5923004 ldr r3, [r2, #4]
5ff4: e58d1000 str r1, [sp]
5ff8: e592100c ldr r1, [r2, #12]
5ffc: e5920000 ldr r0, [r2]
6000: e5922010 ldr r2, [r2, #16]
6004: eb0028f6 bl 103e4 <pread>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
6008: ea000009 b 6034 <rtems_aio_handle+0xdc>
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
600c: e5921008 ldr r1, [r2, #8]
6010: e5923004 ldr r3, [r2, #4]
6014: e58d1000 str r1, [sp]
6018: e592100c ldr r1, [r2, #12]
601c: e5920000 ldr r0, [r2]
6020: e5922010 ldr r2, [r2, #16]
6024: eb002938 bl 1050c <pwrite>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
6028: ea000001 b 6034 <rtems_aio_handle+0xdc>
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
602c: e5920000 ldr r0, [r2] <== NOT EXECUTED
6030: eb001987 bl c654 <fsync> <== NOT EXECUTED
break;
default:
result = -1;
}
if (result == -1) {
6034: e3700001 cmn r0, #1
6038: 1a000006 bne 6058 <rtems_aio_handle+0x100>
req->aiocbp->return_value = -1;
603c: e5966014 ldr r6, [r6, #20] <== NOT EXECUTED
6040: e3e02000 mvn r2, #0 <== NOT EXECUTED
6044: e5862034 str r2, [r6, #52] ; 0x34 <== NOT EXECUTED
req->aiocbp->error_code = errno;
6048: eb0025e1 bl f7d4 <__errno> <== NOT EXECUTED
604c: e5903000 ldr r3, [r0] <== NOT EXECUTED
6050: e5863030 str r3, [r6, #48] ; 0x30 <== NOT EXECUTED
6054: eaffffc5 b 5f70 <rtems_aio_handle+0x18> <== NOT EXECUTED
} else {
req->aiocbp->return_value = result;
6058: e5963014 ldr r3, [r6, #20]
req->aiocbp->error_code = 0;
605c: e3a02000 mov r2, #0
}
if (result == -1) {
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
} else {
req->aiocbp->return_value = result;
6060: e5830034 str r0, [r3, #52] ; 0x34
req->aiocbp->error_code = 0;
6064: e5832030 str r2, [r3, #48] ; 0x30
6068: eaffffc0 b 5f70 <rtems_aio_handle+0x18>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
606c: e59f8128 ldr r8, [pc, #296] ; 619c <rtems_aio_handle+0x244>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
6070: e1a0000a mov r0, sl
6074: eb0002fd bl 6c70 <pthread_mutex_unlock>
pthread_mutex_lock (&aio_request_queue.mutex);
6078: e1a00008 mov r0, r8
607c: eb0002dc bl 6bf4 <pthread_mutex_lock>
if (rtems_chain_is_empty (chain))
6080: e5953008 ldr r3, [r5, #8]
6084: e1530006 cmp r3, r6
6088: 1a00003d bne 6184 <rtems_aio_handle+0x22c>
{
clock_gettime (CLOCK_REALTIME, &timeout);
608c: e1a01007 mov r1, r7
6090: e3a00001 mov r0, #1
6094: eb00014e bl 65d4 <clock_gettime>
timeout.tv_sec += 3;
6098: e59d3020 ldr r3, [sp, #32]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
609c: e2856020 add r6, r5, #32
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
60a0: e2833003 add r3, r3, #3
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
60a4: e1a00006 mov r0, r6
60a8: e1a01008 mov r1, r8
60ac: e1a02007 mov r2, r7
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
60b0: e58d3020 str r3, [sp, #32]
timeout.tv_nsec = 0;
60b4: e58d9024 str r9, [sp, #36] ; 0x24
result = pthread_cond_timedwait (&r_chain->cond,
60b8: eb0001da bl 6828 <pthread_cond_timedwait>
&aio_request_queue.mutex,
&timeout);
/* If no requests were added to the chain we delete the fd chain from
the queue and start working with idle fd chains */
if (result == ETIMEDOUT) {
60bc: e3500074 cmp r0, #116 ; 0x74
60c0: 1a00002f bne 6184 <rtems_aio_handle+0x22c>
60c4: e1a00005 mov r0, r5
60c8: eb0008da bl 8438 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
60cc: e1a0000a mov r0, sl
60d0: eb000229 bl 697c <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->cond);
60d4: e1a00006 mov r0, r6
60d8: eb00015b bl 664c <pthread_cond_destroy>
free (r_chain);
60dc: e1a00005 mov r0, r5
60e0: ebfff2eb bl 2c94 <free>
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
60e4: e5943054 ldr r3, [r4, #84] ; 0x54
60e8: e59f20b0 ldr r2, [pc, #176] ; 61a0 <rtems_aio_handle+0x248>
60ec: e1530002 cmp r3, r2
60f0: 1a000018 bne 6158 <rtems_aio_handle+0x200>
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
60f4: e5943068 ldr r3, [r4, #104] ; 0x68
60f8: e2833001 add r3, r3, #1
60fc: e5843068 str r3, [r4, #104] ; 0x68
--aio_request_queue.active_threads;
6100: e5943064 ldr r3, [r4, #100] ; 0x64
clock_gettime (CLOCK_REALTIME, &timeout);
6104: e1a01007 mov r1, r7
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
6108: e2433001 sub r3, r3, #1
clock_gettime (CLOCK_REALTIME, &timeout);
610c: e3a00001 mov r0, #1
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
6110: e5843064 str r3, [r4, #100] ; 0x64
clock_gettime (CLOCK_REALTIME, &timeout);
6114: eb00012e bl 65d4 <clock_gettime>
timeout.tv_sec += 3;
6118: e59d3020 ldr r3, [sp, #32]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
611c: e2880004 add r0, r8, #4
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
6120: e2833003 add r3, r3, #3
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6124: e1a01008 mov r1, r8
6128: e1a02007 mov r2, r7
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
612c: e58d3020 str r3, [sp, #32]
timeout.tv_nsec = 0;
6130: e58d9024 str r9, [sp, #36] ; 0x24
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6134: eb0001bb bl 6828 <pthread_cond_timedwait>
&aio_request_queue.mutex,
&timeout);
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
6138: e3500074 cmp r0, #116 ; 0x74
613c: 1a000005 bne 6158 <rtems_aio_handle+0x200>
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
6140: e5983068 ldr r3, [r8, #104] ; 0x68
pthread_mutex_unlock (&aio_request_queue.mutex);
6144: e1a00008 mov r0, r8
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
6148: e2433001 sub r3, r3, #1
614c: e5883068 str r3, [r8, #104] ; 0x68
pthread_mutex_unlock (&aio_request_queue.mutex);
6150: eb0002c6 bl 6c70 <pthread_mutex_unlock>
return NULL;
6154: ea00000d b 6190 <rtems_aio_handle+0x238>
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
6158: e5943068 ldr r3, [r4, #104] ; 0x68
615c: e2433001 sub r3, r3, #1
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6160: e5945054 ldr r5, [r4, #84] ; 0x54
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
6164: e5843068 str r3, [r4, #104] ; 0x68
++aio_request_queue.active_threads;
6168: e5943064 ldr r3, [r4, #100] ; 0x64
616c: e1a00005 mov r0, r5
6170: e2833001 add r3, r3, #1
6174: e5843064 str r3, [r4, #100] ; 0x64
6178: eb0008ae bl 8438 <_Chain_Extract>
node = rtems_chain_first (&aio_request_queue.idle_req);
rtems_chain_extract (node);
r_chain = (rtems_aio_request_chain *) node;
rtems_aio_move_to_work (r_chain);
617c: e1a00005 mov r0, r5
6180: ebffff65 bl 5f1c <rtems_aio_move_to_work>
}
}
/* If there was a request added in the initial fd chain then release
the mutex and process it */
pthread_mutex_unlock (&aio_request_queue.mutex);
6184: e59f0010 ldr r0, [pc, #16] ; 619c <rtems_aio_handle+0x244>
6188: eb0002b8 bl 6c70 <pthread_mutex_unlock>
618c: eaffff77 b 5f70 <rtems_aio_handle+0x18>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6190: e3a00000 mov r0, #0
6194: e28dd02c add sp, sp, #44 ; 0x2c
6198: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00005db4 <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
5db4: e92d4010 push {r4, lr}
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
5db8: e59f00a4 ldr r0, [pc, #164] ; 5e64 <rtems_aio_init+0xb0>
5dbc: eb0003ed bl 6d78 <pthread_attr_init>
if (result != 0)
5dc0: e2504000 subs r4, r0, #0
5dc4: 1a000024 bne 5e5c <rtems_aio_init+0xa8>
return result;
result =
5dc8: e59f0094 ldr r0, [pc, #148] ; 5e64 <rtems_aio_init+0xb0>
5dcc: e1a01004 mov r1, r4
5dd0: eb0003fa bl 6dc0 <pthread_attr_setdetachstate>
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
5dd4: e3500000 cmp r0, #0
pthread_attr_destroy (&aio_request_queue.attr);
5dd8: 159f0084 ldrne r0, [pc, #132] ; 5e64 <rtems_aio_init+0xb0>
5ddc: 1b0003dc blne 6d54 <pthread_attr_destroy>
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
5de0: e59f0080 ldr r0, [pc, #128] ; 5e68 <rtems_aio_init+0xb4>
5de4: e3a01000 mov r1, #0
5de8: eb00032f bl 6aac <pthread_mutex_init>
if (result != 0)
5dec: e3500000 cmp r0, #0
pthread_attr_destroy (&aio_request_queue.attr);
5df0: 159f006c ldrne r0, [pc, #108] ; 5e64 <rtems_aio_init+0xb0>
5df4: 1b0003d6 blne 6d54 <pthread_attr_destroy>
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
5df8: e59f006c ldr r0, [pc, #108] ; 5e6c <rtems_aio_init+0xb8>
5dfc: e3a01000 mov r1, #0
5e00: eb000241 bl 670c <pthread_cond_init>
if (result != 0) {
5e04: e2504000 subs r4, r0, #0
5e08: 0a000003 beq 5e1c <rtems_aio_init+0x68>
pthread_mutex_destroy (&aio_request_queue.mutex);
5e0c: e59f0054 ldr r0, [pc, #84] ; 5e68 <rtems_aio_init+0xb4> <== NOT EXECUTED
5e10: eb0002d9 bl 697c <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
5e14: e59f0048 ldr r0, [pc, #72] ; 5e64 <rtems_aio_init+0xb0> <== NOT EXECUTED
5e18: eb0003cd bl 6d54 <pthread_attr_destroy> <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
5e1c: e59f3044 ldr r3, [pc, #68] ; 5e68 <rtems_aio_init+0xb4>
5e20: e283204c add r2, r3, #76 ; 0x4c
head->previous = NULL;
tail->previous = head;
5e24: e2831048 add r1, r3, #72 ; 0x48
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
5e28: e5832048 str r2, [r3, #72] ; 0x48
head->previous = NULL;
5e2c: e3a02000 mov r2, #0
5e30: e583204c str r2, [r3, #76] ; 0x4c
tail->previous = head;
5e34: e5831050 str r1, [r3, #80] ; 0x50
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
5e38: e5832058 str r2, [r3, #88] ; 0x58
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
5e3c: e2831058 add r1, r3, #88 ; 0x58
}
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
5e40: e5832064 str r2, [r3, #100] ; 0x64
aio_request_queue.idle_threads = 0;
5e44: e5832068 str r2, [r3, #104] ; 0x68
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
5e48: e59f2020 ldr r2, [pc, #32] ; 5e70 <rtems_aio_init+0xbc>
5e4c: e5831054 str r1, [r3, #84] ; 0x54
head->previous = NULL;
tail->previous = head;
5e50: e2831054 add r1, r3, #84 ; 0x54
5e54: e583105c str r1, [r3, #92] ; 0x5c
5e58: e5832060 str r2, [r3, #96] ; 0x60
return result;
}
5e5c: e1a00004 mov r0, r4
5e60: e8bd8010 pop {r4, pc}
000061a4 <rtems_aio_insert_prio>:
61a4: e1a03000 mov r3, r0
61a8: e4932004 ldr r2, [r3], #4
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
61ac: e1520003 cmp r2, r3
* NONE
*/
void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
61b0: e1a0c001 mov ip, r1
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
61b4: 0a00000d beq 61f0 <rtems_aio_insert_prio+0x4c>
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
61b8: e5921014 ldr r1, [r2, #20]
while (req->aiocbp->aio_reqprio > prio &&
61bc: e59c0014 ldr r0, [ip, #20]
if (rtems_chain_is_empty (chain)) {
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
61c0: e5911014 ldr r1, [r1, #20]
while (req->aiocbp->aio_reqprio > prio &&
61c4: e5900014 ldr r0, [r0, #20]
61c8: ea000002 b 61d8 <rtems_aio_insert_prio+0x34>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
61cc: e5922000 ldr r2, [r2] <== NOT EXECUTED
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
!rtems_chain_is_tail (chain, node)) {
node = rtems_chain_next (node);
prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
61d0: e5921014 ldr r1, [r2, #20] <== NOT EXECUTED
61d4: e5911014 ldr r1, [r1, #20] <== NOT EXECUTED
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
61d8: e1500001 cmp r0, r1
61dc: da000001 ble 61e8 <rtems_aio_insert_prio+0x44>
61e0: e1520003 cmp r2, r3 <== NOT EXECUTED
61e4: 1afffff8 bne 61cc <rtems_aio_insert_prio+0x28> <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
61e8: e5920004 ldr r0, [r2, #4]
61ec: e1a0100c mov r1, ip
61f0: ea0008a5 b 848c <_Chain_Insert>
0000623c <rtems_aio_remove_req>:
* AIO_NOTCANCELED - if request was not canceled
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
623c: e92d4010 push {r4, lr}
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6240: e1a03000 mov r3, r0
6244: e4934004 ldr r4, [r3], #4
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
6248: e1540003 cmp r4, r3
return AIO_ALLDONE;
624c: 03a00002 moveq r0, #2
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
6250: 1a000003 bne 6264 <rtems_aio_remove_req+0x28>
6254: e8bd8010 pop {r4, pc}
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6258: e5904000 ldr r4, [r0] <== NOT EXECUTED
rtems_chain_node *node = rtems_chain_first (chain);
rtems_aio_request *current;
current = (rtems_aio_request *) node;
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
625c: e1540003 cmp r4, r3 <== NOT EXECUTED
6260: 0a00000d beq 629c <rtems_aio_remove_req+0x60> <== NOT EXECUTED
6264: e5942014 ldr r2, [r4, #20]
6268: e1520001 cmp r2, r1
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
626c: e1a00004 mov r0, r4
rtems_chain_node *node = rtems_chain_first (chain);
rtems_aio_request *current;
current = (rtems_aio_request *) node;
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
6270: 1afffff8 bne 6258 <rtems_aio_remove_req+0x1c>
6274: eb00086f bl 8438 <_Chain_Extract>
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
6278: e5943014 ldr r3, [r4, #20]
627c: e3a0208c mov r2, #140 ; 0x8c
6280: e5832030 str r2, [r3, #48] ; 0x30
current->aiocbp->return_value = -1;
6284: e3e02000 mvn r2, #0
free (current);
6288: e1a00004 mov r0, r4
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
current->aiocbp->return_value = -1;
628c: e5832034 str r2, [r3, #52] ; 0x34
free (current);
6290: ebfff27f bl 2c94 <free>
}
return AIO_CANCELED;
6294: e3a00000 mov r0, #0
6298: e8bd8010 pop {r4, pc}
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
629c: e3a00001 mov r0, #1 <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
62a0: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0000c9bc <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
c9bc: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
c9c0: e252a000 subs sl, r2, #0
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
c9c4: e1a04000 mov r4, r0
c9c8: e1a05001 mov r5, r1
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
c9cc: 03a00009 moveq r0, #9
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
c9d0: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
c9d4: e59f313c ldr r3, [pc, #316] ; cb18 <rtems_task_mode+0x15c>
c9d8: e5937004 ldr r7, [r3, #4]
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
c9dc: e5d78074 ldrb r8, [r7, #116] ; 0x74
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
c9e0: e59760f8 ldr r6, [r7, #248] ; 0xf8
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
c9e4: e597307c ldr r3, [r7, #124] ; 0x7c
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
c9e8: e3580000 cmp r8, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
c9ec: e5d69008 ldrb r9, [r6, #8]
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
c9f0: 03a08c01 moveq r8, #256 ; 0x100
c9f4: 13a08000 movne r8, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
c9f8: e3530000 cmp r3, #0
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
c9fc: 13888c02 orrne r8, r8, #512 ; 0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
ca00: e3590000 cmp r9, #0
ca04: 03a09b01 moveq r9, #1024 ; 0x400
ca08: 13a09000 movne r9, #0
old_mode |= _ISR_Get_level();
ca0c: ebfff029 bl 8ab8 <_CPU_ISR_Get_level>
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
ca10: e1899000 orr r9, r9, r0
old_mode |= _ISR_Get_level();
ca14: e1898008 orr r8, r9, r8
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
ca18: e3150c01 tst r5, #256 ; 0x100
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
old_mode |= _ISR_Get_level();
*previous_mode_set = old_mode;
ca1c: e58a8000 str r8, [sl]
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
ca20: 0a000003 beq ca34 <rtems_task_mode+0x78>
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
ca24: e3140c01 tst r4, #256 ; 0x100
ca28: 13a03000 movne r3, #0
ca2c: 03a03001 moveq r3, #1
ca30: e5c73074 strb r3, [r7, #116] ; 0x74
if ( mask & RTEMS_TIMESLICE_MASK ) {
ca34: e3150c02 tst r5, #512 ; 0x200
ca38: 0a000006 beq ca58 <rtems_task_mode+0x9c>
if ( _Modes_Is_timeslice(mode_set) ) {
ca3c: e2143c02 ands r3, r4, #512 ; 0x200
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
ca40: 13a03001 movne r3, #1
ca44: 1587307c strne r3, [r7, #124] ; 0x7c
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
ca48: 159f30cc ldrne r3, [pc, #204] ; cb1c <rtems_task_mode+0x160>
ca4c: 15933000 ldrne r3, [r3]
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
ca50: 0587307c streq r3, [r7, #124] ; 0x7c
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
ca54: 15873078 strne r3, [r7, #120] ; 0x78
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
ca58: e3150080 tst r5, #128 ; 0x80
ca5c: 0a000001 beq ca68 <rtems_task_mode+0xac>
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
ca60: e2040080 and r0, r4, #128 ; 0x80
ca64: ebfff00e bl 8aa4 <_CPU_ISR_Set_level>
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
ca68: e2150b01 ands r0, r5, #1024 ; 0x400
ca6c: 0a000013 beq cac0 <rtems_task_mode+0x104>
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
ca70: e3140b01 tst r4, #1024 ; 0x400
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
ca74: e5d62008 ldrb r2, [r6, #8]
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
ca78: 13a03000 movne r3, #0
ca7c: 03a03001 moveq r3, #1
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
ca80: e1520003 cmp r2, r3
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
ca84: 03a00000 moveq r0, #0
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
ca88: 0a00000c beq cac0 <rtems_task_mode+0x104>
asr->is_enabled = is_asr_enabled;
ca8c: e5c63008 strb r3, [r6, #8]
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
ca90: e10f3000 mrs r3, CPSR
ca94: e3832080 orr r2, r3, #128 ; 0x80
ca98: e129f002 msr CPSR_fc, r2
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
ca9c: e2861014 add r1, r6, #20
caa0: e8910006 ldm r1, {r1, r2}
information->signals_pending = information->signals_posted;
information->signals_posted = _signals;
caa4: e5862014 str r2, [r6, #20]
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
information->signals_pending = information->signals_posted;
caa8: e5861018 str r1, [r6, #24]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
caac: e129f003 msr CPSR_fc, r3
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
cab0: e5960014 ldr r0, [r6, #20]
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
cab4: e3500000 cmp r0, #0
cab8: 13a00001 movne r0, #1
cabc: 03a00000 moveq r0, #0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
cac0: e59f3058 ldr r3, [pc, #88] ; cb20 <rtems_task_mode+0x164>
cac4: e5933000 ldr r3, [r3]
cac8: e3530003 cmp r3, #3
cacc: 1a00000f bne cb10 <rtems_task_mode+0x154>
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
cad0: e59f2040 ldr r2, [pc, #64] ; cb18 <rtems_task_mode+0x15c>
if ( are_signals_pending ||
cad4: e3500000 cmp r0, #0
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
cad8: e5923004 ldr r3, [r2, #4]
if ( are_signals_pending ||
cadc: 1a000005 bne caf8 <rtems_task_mode+0x13c>
cae0: e5922008 ldr r2, [r2, #8]
cae4: e1530002 cmp r3, r2
cae8: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
caec: e5d33074 ldrb r3, [r3, #116] ; 0x74
caf0: e3530000 cmp r3, #0
caf4: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
_Thread_Dispatch_necessary = true;
caf8: e59f3018 ldr r3, [pc, #24] ; cb18 <rtems_task_mode+0x15c>
cafc: e3a02001 mov r2, #1
cb00: e5c32010 strb r2, [r3, #16]
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
cb04: ebffea83 bl 7518 <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
cb08: e3a00000 mov r0, #0
cb0c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
cb10: e3a00000 mov r0, #0 <== NOT EXECUTED
}
cb14: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
00005b34 <sigaction>:
struct sigaction *oact
)
{
ISR_Level level;
if ( oact )
5b34: e2523000 subs r3, r2, #0
*oact = _POSIX_signals_Vectors[ sig ];
5b38: 159f20b8 ldrne r2, [pc, #184] ; 5bf8 <sigaction+0xc4>
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
5b3c: e92d40f0 push {r4, r5, r6, r7, lr}
5b40: e1a05001 mov r5, r1
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
5b44: 13a0100c movne r1, #12
5b48: 10222091 mlane r2, r1, r0, r2
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
5b4c: e1a04000 mov r4, r0
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
5b50: 18920007 ldmne r2, {r0, r1, r2}
5b54: 18830007 stmne r3, {r0, r1, r2}
if ( !sig )
5b58: e3540000 cmp r4, #0
5b5c: 0a000004 beq 5b74 <sigaction+0x40>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
5b60: e2443001 sub r3, r4, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
5b64: e353001f cmp r3, #31
5b68: 8a000001 bhi 5b74 <sigaction+0x40>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
5b6c: e3540009 cmp r4, #9
5b70: 1a000004 bne 5b88 <sigaction+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
5b74: eb002141 bl e080 <__errno>
5b78: e3a03016 mov r3, #22
5b7c: e5803000 str r3, [r0]
5b80: e3e00000 mvn r0, #0
5b84: e8bd80f0 pop {r4, r5, r6, r7, pc}
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
5b88: e3550000 cmp r5, #0
5b8c: 0a000017 beq 5bf0 <sigaction+0xbc>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
5b90: e10f6000 mrs r6, CPSR
5b94: e3863080 orr r3, r6, #128 ; 0x80
5b98: e129f003 msr CPSR_fc, r3
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
5b9c: e5953008 ldr r3, [r5, #8]
5ba0: e3530000 cmp r3, #0
5ba4: e59f704c ldr r7, [pc, #76] ; 5bf8 <sigaction+0xc4>
5ba8: 1a000007 bne 5bcc <sigaction+0x98>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
5bac: e283300c add r3, r3, #12
5bb0: e0040493 mul r4, r3, r4
5bb4: e59f2040 ldr r2, [pc, #64] ; 5bfc <sigaction+0xc8>
5bb8: e0873004 add r3, r7, r4
5bbc: e0824004 add r4, r2, r4
5bc0: e8940007 ldm r4, {r0, r1, r2}
5bc4: e8830007 stm r3, {r0, r1, r2}
5bc8: ea000005 b 5be4 <sigaction+0xb0>
} else {
_POSIX_signals_Clear_process_signals( sig );
5bcc: e1a00004 mov r0, r4
5bd0: eb0015e2 bl b360 <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
5bd4: e3a0300c mov r3, #12
5bd8: e0247493 mla r4, r3, r4, r7
5bdc: e8950007 ldm r5, {r0, r1, r2}
5be0: e8840007 stm r4, {r0, r1, r2}
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
5be4: e129f006 msr CPSR_fc, r6
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
5be8: e3a00000 mov r0, #0
5bec: e8bd80f0 pop {r4, r5, r6, r7, pc}
5bf0: e1a00005 mov r0, r5 <== NOT EXECUTED
}
5bf4: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
00008130 <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
8130: e92d4010 push {r4, lr}
8134: e1a04001 mov r4, r1
int status;
status = sigtimedwait( set, NULL, NULL );
8138: e3a01000 mov r1, #0
813c: e1a02001 mov r2, r1
8140: ebffff84 bl 7f58 <sigtimedwait>
if ( status != -1 ) {
8144: e3700001 cmn r0, #1
8148: 0a000004 beq 8160 <sigwait+0x30>
if ( sig )
814c: e3540000 cmp r4, #0
*sig = status;
8150: 15840000 strne r0, [r4]
return 0;
8154: 13a00000 movne r0, #0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
8158: 18bd8010 popne {r4, pc}
815c: ea000002 b 816c <sigwait+0x3c> <== NOT EXECUTED
*sig = status;
return 0;
}
return errno;
8160: eb00206f bl 10324 <__errno>
8164: e5900000 ldr r0, [r0]
8168: e8bd8010 pop {r4, pc}
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
*sig = status;
return 0;
816c: e1a00004 mov r0, r4 <== NOT EXECUTED
}
return errno;
}
8170: e8bd8010 pop {r4, pc} <== NOT EXECUTED