RTEMS-6
Annotated Report
posix
Sun Feb 28 12:25:19 2021
40004934 <_POSIX_Condition_variables_Wait_support>:
int _POSIX_Condition_variables_Wait_support(
pthread_cond_t *cond,
pthread_mutex_t *mutex,
const struct timespec *abstime
)
{
40004934: fb010113 addi sp,sp,-80
40004938: 04112623 sw ra,76(sp)
4000493c: 04812423 sw s0,72(sp)
40004940: 04912223 sw s1,68(sp)
40004944: 05212023 sw s2,64(sp)
40004948: 03312e23 sw s3,60(sp)
Thread_queue_Context queue_context;
int error;
Thread_Control *executing;
the_cond = _POSIX_Condition_variables_Get( cond );
POSIX_CONDITION_VARIABLES_VALIDATE_OBJECT( the_cond, flags );
4000494c: 0e050063 beqz a0,40004a2c <_POSIX_Condition_variables_Wait_support+0xf8>
40004950: 00052903 lw s2,0(a0)
40004954: 18dfb7b7 lui a5,0x18dfb
40004958: 1fe78793 addi a5,a5,510 # 18dfb1fe <RamSize+0x17dfb1fe>
4000495c: 01254733 xor a4,a0,s2
40004960: ffe77713 andi a4,a4,-2
40004964: 00050413 mv s0,a0
40004968: 00058993 mv s3,a1
4000496c: 00060493 mv s1,a2
40004970: 0af71a63 bne a4,a5,40004a24 <_POSIX_Condition_variables_Wait_support+0xf0>
_Thread_queue_Context_initialize( &queue_context );
if ( abstime != NULL ) {
40004974: 10048463 beqz s1,40004a7c <_POSIX_Condition_variables_Wait_support+0x148>
queue_context->Timeout.arg = arg;
40004978: 00912c23 sw s1,24(sp)
RTEMS_INLINE_ROUTINE clockid_t _POSIX_Condition_variables_Get_clock(
unsigned long flags
)
{
if ( ( flags & POSIX_CONDITION_VARIABLES_CLOCK_MONOTONIC ) != 0 ) {
4000497c: 00197913 andi s2,s2,1
40004980: 10091663 bnez s2,40004a8c <_POSIX_Condition_variables_Wait_support+0x158><== NEVER TAKEN
queue_context->enqueue_callout = enqueue_callout;
40004984: 400057b7 lui a5,0x40005
40004988: 84078793 addi a5,a5,-1984 # 40004840 <_POSIX_Condition_variables_Enqueue_with_timeout_realtime>
4000498c: 00f12a23 sw a5,20(sp)
__asm__ volatile (
40004990: 300477f3 csrrci a5,mstatus,8
}
executing = _POSIX_Condition_variables_Acquire( the_cond, &queue_context );
if (
the_cond->mutex != POSIX_CONDITION_VARIABLES_NO_MUTEX
40004994: 01842703 lw a4,24(s0)
return mstatus & RISCV_MSTATUS_MIE;
40004998: 0087f793 andi a5,a5,8
4000499c: 00f12623 sw a5,12(sp)
if (
400049a0: 00070463 beqz a4,400049a8 <_POSIX_Condition_variables_Wait_support+0x74>
&& the_cond->mutex != mutex
400049a4: 0b371663 bne a4,s3,40004a50 <_POSIX_Condition_variables_Wait_support+0x11c>
static inline struct _Thread_Control *_Per_CPU_Get_executing(
const Per_CPU_Control *cpu
)
{
return cpu->executing;
400049a8: 400167b7 lui a5,0x40016
400049ac: 3787a483 lw s1,888(a5) # 40016378 <_Per_CPU_Information+0x38>
_Thread_queue_Context_set_thread_state(
&queue_context,
STATES_WAITING_FOR_CONDITION_VARIABLE
);
_Thread_queue_Enqueue(
400049b0: 400125b7 lui a1,0x40012
queue_context->thread_state = thread_state;
400049b4: 02000793 li a5,32
the_cond->mutex = mutex;
400049b8: 01342c23 sw s3,24(s0)
_Thread_queue_Enqueue(
400049bc: 00c40513 addi a0,s0,12
400049c0: 00c10693 addi a3,sp,12
400049c4: 00048613 mv a2,s1
400049c8: 57458593 addi a1,a1,1396 # 40012574 <_Thread_queue_Operations_FIFO>
400049cc: 00f12823 sw a5,16(sp)
400049d0: 01c030ef jal ra,400079ec <_Thread_queue_Enqueue>
return _POSIX_Get_by_name_error_table[ error ];
}
RTEMS_INLINE_ROUTINE int _POSIX_Get_error( Status_Control status )
{
return STATUS_GET_POSIX( status );
400049d4: 04c4a783 lw a5,76(s1)
* according to the POSIX standard. It means that pthread_cond_wait
* returns a success status, except for the fact that it was not
* woken up a pthread_cond_signal() or a pthread_cond_broadcast().
*/
if ( error == EINTR ) {
400049d8: 00400713 li a4,4
400049dc: 41f7d413 srai s0,a5,0x1f
400049e0: 0ff47413 andi s0,s0,255
400049e4: 00f40433 add s0,s0,a5
400049e8: 40845413 srai s0,s0,0x8
400049ec: 0ae40863 beq s0,a4,40004a9c <_POSIX_Condition_variables_Wait_support+0x168>
/*
* When we get here the dispatch disable level is 0.
*/
if ( error != EPERM ) {
400049f0: 00100793 li a5,1
400049f4: 00f40863 beq s0,a5,40004a04 <_POSIX_Condition_variables_Wait_support+0xd0>
int mutex_error;
mutex_error = pthread_mutex_lock( mutex );
400049f8: 00098513 mv a0,s3
400049fc: 274000ef jal ra,40004c70 <pthread_mutex_lock>
if ( mutex_error != 0 ) {
40004a00: 02051663 bnez a0,40004a2c <_POSIX_Condition_variables_Wait_support+0xf8>
error = EINVAL;
}
}
return error;
}
40004a04: 04c12083 lw ra,76(sp)
40004a08: 00040513 mv a0,s0
40004a0c: 04812403 lw s0,72(sp)
40004a10: 04412483 lw s1,68(sp)
40004a14: 04012903 lw s2,64(sp)
40004a18: 03c12983 lw s3,60(sp)
40004a1c: 05010113 addi sp,sp,80
40004a20: 00008067 ret
POSIX_CONDITION_VARIABLES_VALIDATE_OBJECT( the_cond, flags );
40004a24: d9dff0ef jal ra,400047c0 <_POSIX_Condition_variables_Auto_initialization>
40004a28: f40516e3 bnez a0,40004974 <_POSIX_Condition_variables_Wait_support+0x40>
error = EINVAL;
40004a2c: 01600413 li s0,22
}
40004a30: 04c12083 lw ra,76(sp)
40004a34: 00040513 mv a0,s0
40004a38: 04812403 lw s0,72(sp)
40004a3c: 04412483 lw s1,68(sp)
40004a40: 04012903 lw s2,64(sp)
40004a44: 03c12983 lw s3,60(sp)
40004a48: 05010113 addi sp,sp,80
40004a4c: 00008067 ret
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004a50: 00c12783 lw a5,12(sp)
40004a54: 3007a073 csrs mstatus,a5
return EINVAL;
40004a58: 01600413 li s0,22
}
40004a5c: 04c12083 lw ra,76(sp)
40004a60: 00040513 mv a0,s0
40004a64: 04812403 lw s0,72(sp)
40004a68: 04412483 lw s1,68(sp)
40004a6c: 04012903 lw s2,64(sp)
40004a70: 03c12983 lw s3,60(sp)
40004a74: 05010113 addi sp,sp,80
40004a78: 00008067 ret
queue_context->enqueue_callout = enqueue_callout;
40004a7c: 400057b7 lui a5,0x40005
40004a80: 89878793 addi a5,a5,-1896 # 40004898 <_POSIX_Condition_variables_Enqueue_no_timeout>
40004a84: 00f12a23 sw a5,20(sp)
}
40004a88: f09ff06f j 40004990 <_POSIX_Condition_variables_Wait_support+0x5c>
queue_context->enqueue_callout = enqueue_callout;
40004a8c: 400057b7 lui a5,0x40005 <== NOT EXECUTED
40004a90: 8dc78793 addi a5,a5,-1828 # 400048dc <_POSIX_Condition_variables_Enqueue_with_timeout_monotonic><== NOT EXECUTED
40004a94: 00f12a23 sw a5,20(sp) <== NOT EXECUTED
}
40004a98: ef9ff06f j 40004990 <_POSIX_Condition_variables_Wait_support+0x5c><== NOT EXECUTED
error = 0;
40004a9c: 00000413 li s0,0 <== NOT EXECUTED
40004aa0: f59ff06f j 400049f8 <_POSIX_Condition_variables_Wait_support+0xc4><== NOT EXECUTED
40004be8 <_POSIX_Message_queue_Receive_support>:
size_t msg_len,
unsigned int *msg_prio,
const struct timespec *abstime,
Thread_queue_Enqueue_callout enqueue_callout
)
{
40004be8: fb010113 addi sp,sp,-80
40004bec: 03312e23 sw s3,60(sp)
40004bf0: 00060993 mv s3,a2
return (POSIX_Message_queue_Control *) _Objects_Get(
40004bf4: 40016637 lui a2,0x40016
40004bf8: 03412c23 sw s4,56(sp)
40004bfc: da860613 addi a2,a2,-600 # 40015da8 <_POSIX_Message_queue_Information>
40004c00: 00058a13 mv s4,a1
40004c04: 00c10593 addi a1,sp,12
40004c08: 04812423 sw s0,72(sp)
40004c0c: 04912223 sw s1,68(sp)
40004c10: 05212023 sw s2,64(sp)
40004c14: 04112623 sw ra,76(sp)
40004c18: 00068413 mv s0,a3
40004c1c: 00070913 mv s2,a4
40004c20: 00078493 mv s1,a5
40004c24: 1d4030ef jal ra,40007df8 <_Objects_Get>
Thread_Control *executing;
Status_Control status;
the_mq = _POSIX_Message_queue_Get( mqdes, &queue_context );
if ( the_mq == NULL ) {
40004c28: 0a050663 beqz a0,40004cd4 <_POSIX_Message_queue_Receive_support+0xec>
rtems_set_errno_and_return_minus_one( EBADF );
}
if ( ( the_mq->oflag & O_ACCMODE ) == O_WRONLY ) {
40004c2c: 06c52803 lw a6,108(a0)
40004c30: 00100793 li a5,1
40004c34: 00387713 andi a4,a6,3
40004c38: 08f70a63 beq a4,a5,40004ccc <_POSIX_Message_queue_Receive_support+0xe4>
_ISR_lock_ISR_enable( &queue_context.Lock_context.Lock_context );
rtems_set_errno_and_return_minus_one( EBADF );
}
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
40004c3c: 02852783 lw a5,40(a0)
40004c40: 0af9e463 bltu s3,a5,40004ce8 <_POSIX_Message_queue_Receive_support+0x100>
_CORE_message_queue_Acquire_critical(
&the_mq->Message_queue,
&queue_context
);
if ( the_mq->open_count == 0 ) {
40004c44: 05452783 lw a5,84(a0)
length_out = -1;
40004c48: fff00713 li a4,-1
queue_context->enqueue_callout = enqueue_callout;
40004c4c: 00912a23 sw s1,20(sp)
queue_context->Timeout.arg = arg;
40004c50: 01212c23 sw s2,24(sp)
40004c54: 00e12423 sw a4,8(sp)
_CORE_message_queue_Acquire_critical(
40004c58: 01050513 addi a0,a0,16
if ( the_mq->open_count == 0 ) {
40004c5c: 06078863 beqz a5,40004ccc <_POSIX_Message_queue_Receive_support+0xe4>
40004c60: 400187b7 lui a5,0x40018
40004c64: 0f87a903 lw s2,248(a5) # 400180f8 <_Per_CPU_Information+0x38>
/*
* Now perform the actual message receive
*/
executing = _Thread_Executing;
status = _CORE_message_queue_Seize(
40004c68: 00e85713 srli a4,a6,0xe
40004c6c: 00174713 xori a4,a4,1
40004c70: 00c10793 addi a5,sp,12
40004c74: 00177713 andi a4,a4,1
40004c78: 00810693 addi a3,sp,8
40004c7c: 000a0613 mv a2,s4
40004c80: 00090593 mv a1,s2
40004c84: 038020ef jal ra,40006cbc <_CORE_message_queue_Seize>
40004c88: 00050493 mv s1,a0
&length_out,
( the_mq->oflag & O_NONBLOCK ) == 0,
&queue_context
);
if ( status != STATUS_SUCCESSFUL ) {
40004c8c: 06051c63 bnez a0,40004d04 <_POSIX_Message_queue_Receive_support+0x11c>
rtems_set_errno_and_return_minus_one( _POSIX_Get_error( status ) );
}
if ( msg_prio != NULL ) {
40004c90: 00040c63 beqz s0,40004ca8 <_POSIX_Message_queue_Receive_support+0xc0><== NEVER TAKEN
return (unsigned int) ((priority >= 0) ? priority : -priority);
40004c94: 03c92783 lw a5,60(s2)
40004c98: 41f7d713 srai a4,a5,0x1f
40004c9c: 00f747b3 xor a5,a4,a5
40004ca0: 40e787b3 sub a5,a5,a4
*msg_prio = _POSIX_Message_queue_Priority_from_core(
40004ca4: 00f42023 sw a5,0(s0)
executing->Wait.count
);
}
return length_out;
40004ca8: 00812503 lw a0,8(sp)
}
40004cac: 04c12083 lw ra,76(sp)
40004cb0: 04812403 lw s0,72(sp)
40004cb4: 04412483 lw s1,68(sp)
40004cb8: 04012903 lw s2,64(sp)
40004cbc: 03c12983 lw s3,60(sp)
40004cc0: 03812a03 lw s4,56(sp)
40004cc4: 05010113 addi sp,sp,80
40004cc8: 00008067 ret
40004ccc: 00c12783 lw a5,12(sp)
40004cd0: 3007a073 csrs mstatus,a5
rtems_set_errno_and_return_minus_one( EBADF );
40004cd4: 0890d0ef jal ra,4001255c <__errno>
40004cd8: 00900793 li a5,9
40004cdc: 00f52023 sw a5,0(a0)
40004ce0: fff00513 li a0,-1
40004ce4: fc9ff06f j 40004cac <_POSIX_Message_queue_Receive_support+0xc4>
40004ce8: 00c12783 lw a5,12(sp)
40004cec: 3007a073 csrs mstatus,a5
rtems_set_errno_and_return_minus_one( EMSGSIZE );
40004cf0: 06d0d0ef jal ra,4001255c <__errno>
40004cf4: 07a00793 li a5,122
40004cf8: 00f52023 sw a5,0(a0)
40004cfc: fff00513 li a0,-1
40004d00: fadff06f j 40004cac <_POSIX_Message_queue_Receive_support+0xc4>
rtems_set_errno_and_return_minus_one( _POSIX_Get_error( status ) );
40004d04: 0590d0ef jal ra,4001255c <__errno>
return STATUS_GET_POSIX( status );
40004d08: 41f4d793 srai a5,s1,0x1f
40004d0c: 0ff7f793 andi a5,a5,255
40004d10: 009787b3 add a5,a5,s1
40004d14: 4087d793 srai a5,a5,0x8
40004d18: 00f52023 sw a5,0(a0)
40004d1c: fff00513 li a0,-1
40004d20: f8dff06f j 40004cac <_POSIX_Message_queue_Receive_support+0xc4>
40004d34 <_POSIX_Message_queue_Send_support>:
size_t msg_len,
unsigned int msg_prio,
const struct timespec *abstime,
Thread_queue_Enqueue_callout enqueue_callout
)
{
40004d34: fb010113 addi sp,sp,-80
40004d38: 04812423 sw s0,72(sp)
40004d3c: 04112623 sw ra,76(sp)
40004d40: 00068413 mv s0,a3
40004d44: 04912223 sw s1,68(sp)
40004d48: 05212023 sw s2,64(sp)
40004d4c: 03312e23 sw s3,60(sp)
40004d50: 03412c23 sw s4,56(sp)
/*
* Validate the priority.
* XXX - Do not validate msg_prio is not less than 0.
*/
if ( msg_prio > MQ_PRIO_MAX ) {
40004d54: 02000693 li a3,32
40004d58: 0c86ec63 bltu a3,s0,40004e30 <_POSIX_Message_queue_Send_support+0xfc>
40004d5c: 00060a13 mv s4,a2
return (POSIX_Message_queue_Control *) _Objects_Get(
40004d60: 40016637 lui a2,0x40016
40004d64: 00058993 mv s3,a1
40004d68: da860613 addi a2,a2,-600 # 40015da8 <_POSIX_Message_queue_Information>
40004d6c: 00c10593 addi a1,sp,12
40004d70: 00070493 mv s1,a4
40004d74: 00078913 mv s2,a5
40004d78: 080030ef jal ra,40007df8 <_Objects_Get>
rtems_set_errno_and_return_minus_one( EINVAL );
}
the_mq = _POSIX_Message_queue_Get( mqdes, &queue_context );
if ( the_mq == NULL ) {
40004d7c: 0a050063 beqz a0,40004e1c <_POSIX_Message_queue_Send_support+0xe8><== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EBADF );
}
if ( ( the_mq->oflag & O_ACCMODE ) == O_RDONLY ) {
40004d80: 06c52803 lw a6,108(a0)
40004d84: 00387793 andi a5,a6,3
40004d88: 08078663 beqz a5,40004e14 <_POSIX_Message_queue_Send_support+0xe0>
_CORE_message_queue_Acquire_critical(
&the_mq->Message_queue,
&queue_context
);
if ( the_mq->open_count == 0 ) {
40004d8c: 05452783 lw a5,84(a0)
queue_context->enqueue_callout = enqueue_callout;
40004d90: 01212a23 sw s2,20(sp)
queue_context->Timeout.arg = arg;
40004d94: 00912c23 sw s1,24(sp)
_CORE_message_queue_Acquire_critical(
40004d98: 01050513 addi a0,a0,16
if ( the_mq->open_count == 0 ) {
40004d9c: 06078c63 beqz a5,40004e14 <_POSIX_Message_queue_Send_support+0xe0>
/*
* Now perform the actual message receive
*/
executing = _Thread_Executing;
status = _CORE_message_queue_Submit(
40004da0: 40018737 lui a4,0x40018
40004da4: 0f872583 lw a1,248(a4) # 400180f8 <_Per_CPU_Information+0x38>
40004da8: 00e85793 srli a5,a6,0xe
40004dac: 0017c793 xori a5,a5,1
40004db0: 40800733 neg a4,s0
40004db4: 00c10813 addi a6,sp,12
40004db8: 0017f793 andi a5,a5,1
40004dbc: 000a0693 mv a3,s4
40004dc0: 00098613 mv a2,s3
40004dc4: 04c020ef jal ra,40006e10 <_CORE_message_queue_Submit>
40004dc8: 00050413 mv s0,a0
RTEMS_INLINE_ROUTINE int _POSIX_Zero_or_minus_one_plus_errno(
Status_Control status
)
{
if ( status == STATUS_SUCCESSFUL ) {
40004dcc: 02051463 bnez a0,40004df4 <_POSIX_Message_queue_Send_support+0xc0>
_POSIX_Message_queue_Priority_to_core( msg_prio ),
( the_mq->oflag & O_NONBLOCK ) == 0,
&queue_context
);
return _POSIX_Zero_or_minus_one_plus_errno( status );
}
40004dd0: 04c12083 lw ra,76(sp)
40004dd4: 00040513 mv a0,s0
40004dd8: 04812403 lw s0,72(sp)
40004ddc: 04412483 lw s1,68(sp)
40004de0: 04012903 lw s2,64(sp)
40004de4: 03c12983 lw s3,60(sp)
40004de8: 03812a03 lw s4,56(sp)
40004dec: 05010113 addi sp,sp,80
40004df0: 00008067 ret
return 0;
}
rtems_set_errno_and_return_minus_one( _POSIX_Get_error( status ) );
40004df4: 7680d0ef jal ra,4001255c <__errno>
return STATUS_GET_POSIX( status );
40004df8: 41f45793 srai a5,s0,0x1f
40004dfc: 0ff7f793 andi a5,a5,255
40004e00: 00878433 add s0,a5,s0
40004e04: 40845413 srai s0,s0,0x8
rtems_set_errno_and_return_minus_one( _POSIX_Get_error( status ) );
40004e08: 00852023 sw s0,0(a0)
40004e0c: fff00413 li s0,-1
40004e10: fc1ff06f j 40004dd0 <_POSIX_Message_queue_Send_support+0x9c>
40004e14: 00c12783 lw a5,12(sp)
40004e18: 3007a073 csrs mstatus,a5
rtems_set_errno_and_return_minus_one( EBADF );
40004e1c: 7400d0ef jal ra,4001255c <__errno>
40004e20: 00900793 li a5,9
40004e24: 00f52023 sw a5,0(a0)
40004e28: fff00413 li s0,-1
40004e2c: fa5ff06f j 40004dd0 <_POSIX_Message_queue_Send_support+0x9c>
rtems_set_errno_and_return_minus_one( EINVAL );
40004e30: 72c0d0ef jal ra,4001255c <__errno>
40004e34: 01600793 li a5,22
40004e38: 00f52023 sw a5,0(a0)
40004e3c: fff00413 li s0,-1
40004e40: f91ff06f j 40004dd0 <_POSIX_Message_queue_Send_support+0x9c>
40006aa8 <_POSIX_Mutex_Lock_support>:
Thread_queue_Context queue_context;
Thread_Control *executing;
Status_Control status;
the_mutex = _POSIX_Mutex_Get( mutex );
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
40006aa8: 1e050863 beqz a0,40006c98 <_POSIX_Mutex_Lock_support+0x1f0>
{
40006aac: fb010113 addi sp,sp,-80
40006ab0: 03312e23 sw s3,60(sp)
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
40006ab4: 00052983 lw s3,0(a0)
40006ab8: 961c17b7 lui a5,0x961c1
{
40006abc: 04812423 sw s0,72(sp)
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
40006ac0: 01354733 xor a4,a0,s3
{
40006ac4: 04912223 sw s1,68(sp)
40006ac8: 05212023 sw s2,64(sp)
40006acc: 04112623 sw ra,76(sp)
40006ad0: 03412c23 sw s4,56(sp)
40006ad4: 03512a23 sw s5,52(sp)
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
40006ad8: 3b878793 addi a5,a5,952 # 961c13b8 <RamEnd+0x551c13b8>
40006adc: ff877713 andi a4,a4,-8
40006ae0: 00050413 mv s0,a0
40006ae4: 00058493 mv s1,a1
40006ae8: 00060913 mv s2,a2
40006aec: 10f71263 bne a4,a5,40006bf0 <_POSIX_Mutex_Lock_support+0x148>
__asm__ volatile (
40006af0: 300477f3 csrrci a5,mstatus,8
static inline struct _Thread_Control *_Per_CPU_Get_executing(
const Per_CPU_Control *cpu
)
{
return cpu->executing;
40006af4: 4001eab7 lui s5,0x4001e
return mstatus & RISCV_MSTATUS_MIE;
40006af8: 0087f793 andi a5,a5,8
40006afc: bc0a8a13 addi s4,s5,-1088 # 4001dbc0 <_Per_CPU_Information>
)
{
#if defined( RTEMS_SMP )
context->Lock_context.isr_level = level;
#else
context->isr_level = level;
40006b00: 00f12623 sw a5,12(sp)
queue_context->enqueue_callout = enqueue_callout;
40006b04: 01212a23 sw s2,20(sp)
queue_context->Timeout.arg = arg;
40006b08: 00912c23 sw s1,24(sp)
40006b0c: 0039f793 andi a5,s3,3
40006b10: 038a2903 lw s2,56(s4)
executing = _POSIX_Mutex_Acquire( the_mutex, &queue_context );
_Thread_queue_Context_set_enqueue_callout( &queue_context, enqueue_callout);
_Thread_queue_Context_set_timeout_argument( &queue_context, abstime );
switch ( _POSIX_Mutex_Get_protocol( flags ) ) {
40006b14: 08078463 beqz a5,40006b9c <_POSIX_Mutex_Lock_support+0xf4>
40006b18: 00200713 li a4,2
40006b1c: 02e78663 beq a5,a4,40006b48 <_POSIX_Mutex_Lock_support+0xa0>
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Mutex_Get_owner(
const POSIX_Mutex_Control *the_mutex
)
{
return the_mutex->Recursive.Mutex.Queue.Queue.owner;
40006b20: 01042783 lw a5,16(s0)
{
Thread_Control *owner;
owner = _POSIX_Mutex_Get_owner( the_mutex );
if ( owner == NULL ) {
40006b24: 10078463 beqz a5,40006c2c <_POSIX_Mutex_Lock_support+0x184>
_Thread_Resource_count_increment( executing );
_POSIX_Mutex_Release( the_mutex, queue_context );
return STATUS_SUCCESSFUL;
}
if ( owner == executing ) {
40006b28: 08f90063 beq s2,a5,40006ba8 <_POSIX_Mutex_Lock_support+0x100>
if ( (uintptr_t) abstime != POSIX_MUTEX_ABSTIME_TRY_LOCK ) {
40006b2c: 00100793 li a5,1
40006b30: 0ef48663 beq s1,a5,40006c1c <_POSIX_Mutex_Lock_support+0x174>
_Thread_queue_Enqueue(
40006b34: 400195b7 lui a1,0x40019
40006b38: 00c10693 addi a3,sp,12
40006b3c: 00090613 mv a2,s2
40006b40: 6c858593 addi a1,a1,1736 # 400196c8 <_Thread_queue_Operations_priority_inherit>
40006b44: 0280006f j 40006b6c <_POSIX_Mutex_Lock_support+0xc4>
return the_mutex->Recursive.Mutex.Queue.Queue.owner;
40006b48: 01042783 lw a5,16(s0)
{
Thread_Control *owner;
owner = _POSIX_Mutex_Get_owner( the_mutex );
if ( owner == NULL ) {
40006b4c: 0e078a63 beqz a5,40006c40 <_POSIX_Mutex_Lock_support+0x198>
executing,
queue_context
);
}
if ( owner == executing ) {
40006b50: 04f90c63 beq s2,a5,40006ba8 <_POSIX_Mutex_Lock_support+0x100>
if ( (uintptr_t) abstime != POSIX_MUTEX_ABSTIME_TRY_LOCK ) {
40006b54: 00100793 li a5,1
40006b58: 0cf48263 beq s1,a5,40006c1c <_POSIX_Mutex_Lock_support+0x174>
_Thread_queue_Enqueue(
40006b5c: 400195b7 lui a1,0x40019
40006b60: 00c10693 addi a3,sp,12
40006b64: 00090613 mv a2,s2
40006b68: 6b458593 addi a1,a1,1716 # 400196b4 <_Thread_queue_Operations_priority>
queue_context->thread_state = thread_state;
40006b6c: 00f12823 sw a5,16(sp)
queue_context->deadlock_callout = deadlock_callout;
40006b70: 4000a7b7 lui a5,0x4000a
40006b74: 29478793 addi a5,a5,660 # 4000a294 <_Thread_queue_Deadlock_status>
40006b78: 00c40513 addi a0,s0,12
40006b7c: 02f12623 sw a5,44(sp)
40006b80: 734030ef jal ra,4000a2b4 <_Thread_queue_Enqueue>
return _POSIX_Get_by_name_error_table[ error ];
}
RTEMS_INLINE_ROUTINE int _POSIX_Get_error( Status_Control status )
{
return STATUS_GET_POSIX( status );
40006b84: 04c92783 lw a5,76(s2)
40006b88: 41f7d513 srai a0,a5,0x1f
40006b8c: 0ff57513 andi a0,a0,255
40006b90: 00f50533 add a0,a0,a5
40006b94: 40855513 srai a0,a0,0x8
40006b98: 0340006f j 40006bcc <_POSIX_Mutex_Lock_support+0x124>
return the_mutex->Recursive.Mutex.Queue.Queue.owner;
40006b9c: 01042783 lw a5,16(s0)
if ( owner == NULL ) {
40006ba0: 08078663 beqz a5,40006c2c <_POSIX_Mutex_Lock_support+0x184>
if ( owner == executing ) {
40006ba4: 04f91e63 bne s2,a5,40006c00 <_POSIX_Mutex_Lock_support+0x158>
return ( flags & POSIX_MUTEX_RECURSIVE ) != 0;
40006ba8: 0049f993 andi s3,s3,4
40006bac: 02d00513 li a0,45
if ( _POSIX_Mutex_Is_recursive( flags ) ) {
40006bb0: 00098a63 beqz s3,40006bc4 <_POSIX_Mutex_Lock_support+0x11c> <== ALWAYS TAKEN
++the_mutex->Recursive.nest_level;
40006bb4: 01842783 lw a5,24(s0) <== NOT EXECUTED
return STATUS_SUCCESSFUL;
40006bb8: 00000513 li a0,0 <== NOT EXECUTED
++the_mutex->Recursive.nest_level;
40006bbc: 00178793 addi a5,a5,1 <== NOT EXECUTED
40006bc0: 00f42c23 sw a5,24(s0) <== NOT EXECUTED
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40006bc4: 00c12783 lw a5,12(sp)
40006bc8: 3007a073 csrs mstatus,a5
);
break;
}
return _POSIX_Get_error( status );
}
40006bcc: 04c12083 lw ra,76(sp)
40006bd0: 04812403 lw s0,72(sp)
40006bd4: 04412483 lw s1,68(sp)
40006bd8: 04012903 lw s2,64(sp)
40006bdc: 03c12983 lw s3,60(sp)
40006be0: 03812a03 lw s4,56(sp)
40006be4: 03412a83 lw s5,52(sp)
40006be8: 05010113 addi sp,sp,80
40006bec: 00008067 ret
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
40006bf0: 240000ef jal ra,40006e30 <_POSIX_Mutex_Auto_initialization>
40006bf4: ee051ee3 bnez a0,40006af0 <_POSIX_Mutex_Lock_support+0x48>
return STATUS_MUTEX_CEILING_VIOLATED;
40006bf8: 01600513 li a0,22
40006bfc: fd1ff06f j 40006bcc <_POSIX_Mutex_Lock_support+0x124>
if ( (uintptr_t) abstime != POSIX_MUTEX_ABSTIME_TRY_LOCK ) {
40006c00: 00100793 li a5,1
40006c04: 00f48c63 beq s1,a5,40006c1c <_POSIX_Mutex_Lock_support+0x174>
_Thread_queue_Enqueue(
40006c08: 400195b7 lui a1,0x40019
40006c0c: 00c10693 addi a3,sp,12
40006c10: 00090613 mv a2,s2
40006c14: 68c58593 addi a1,a1,1676 # 4001968c <_Thread_queue_Operations_FIFO>
40006c18: f55ff06f j 40006b6c <_POSIX_Mutex_Lock_support+0xc4>
40006c1c: 00c12783 lw a5,12(sp)
40006c20: 3007a073 csrs mstatus,a5
return STATUS_UNAVAILABLE;
40006c24: 01000513 li a0,16
return _POSIX_Get_error( status );
40006c28: fa5ff06f j 40006bcc <_POSIX_Mutex_Lock_support+0x124>
the_mutex->Recursive.Mutex.Queue.Queue.owner = owner;
40006c2c: 01242823 sw s2,16(s0)
40006c30: 00c12783 lw a5,12(sp)
40006c34: 3007a073 csrs mstatus,a5
return STATUS_SUCCESSFUL;
40006c38: 00000513 li a0,0
40006c3c: f91ff06f j 40006bcc <_POSIX_Mutex_Lock_support+0x124>
*/
RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_priority(
const Priority_Aggregation *aggregation
)
{
return aggregation->Node.priority;
40006c40: 03892683 lw a3,56(s2)
if (
40006c44: 03442703 lw a4,52(s0)
queue_context->Priority.update_count = 0;
40006c48: 02012023 sw zero,32(sp)
40006c4c: 01c6a783 lw a5,28(a3) # 401c <bsp_section_rodata_size+0xee8>
40006c50: 04e7ee63 bltu a5,a4,40006cac <_POSIX_Mutex_Lock_support+0x204>
40006c54: 04f70663 beq a4,a5,40006ca0 <_POSIX_Mutex_Lock_support+0x1f8>
the_mutex->Recursive.Mutex.Queue.Queue.owner = owner;
40006c58: 01242823 sw s2,16(s0)
_Thread_Priority_add(
40006c5c: 00c10613 addi a2,sp,12
40006c60: 02040593 addi a1,s0,32
40006c64: 00090513 mv a0,s2
40006c68: 561020ef jal ra,400099c8 <_Thread_Priority_add>
const ISR_lock_Context *lock_context
)
{
uint32_t disable_level;
disable_level = cpu_self->thread_dispatch_disable_level;
40006c6c: 030a2783 lw a5,48(s4)
_Profiling_Thread_dispatch_disable_critical(
cpu_self,
disable_level,
lock_context
);
cpu_self->thread_dispatch_disable_level = disable_level + 1;
40006c70: 00178793 addi a5,a5,1
40006c74: 02fa2823 sw a5,48(s4)
40006c78: 00c12783 lw a5,12(sp)
40006c7c: 3007a073 csrs mstatus,a5
_Thread_Priority_update( queue_context );
40006c80: 00c10513 addi a0,sp,12
40006c84: 719020ef jal ra,40009b9c <_Thread_Priority_update>
_Thread_Dispatch_enable( cpu_self );
40006c88: bc0a8513 addi a0,s5,-1088
40006c8c: 1d0030ef jal ra,40009e5c <_Thread_Dispatch_enable>
return STATUS_SUCCESSFUL;
40006c90: 00000513 li a0,0
40006c94: f39ff06f j 40006bcc <_POSIX_Mutex_Lock_support+0x124>
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
40006c98: 01600513 li a0,22
}
40006c9c: 00008067 ret
if (
40006ca0: 03042703 lw a4,48(s0)
40006ca4: 0186a783 lw a5,24(a3)
40006ca8: fae7f8e3 bgeu a5,a4,40006c58 <_POSIX_Mutex_Lock_support+0x1b0>
40006cac: 00c12783 lw a5,12(sp)
40006cb0: 3007a073 csrs mstatus,a5
return STATUS_MUTEX_CEILING_VIOLATED;
40006cb4: 01600513 li a0,22
40006cb8: f15ff06f j 40006bcc <_POSIX_Mutex_Lock_support+0x124>
40005a4c <_POSIX_RWLock_Auto_initialization>:
#include <rtems/posix/posixapi.h>
#include <string.h>
bool _POSIX_RWLock_Auto_initialization( POSIX_RWLock_Control *the_rwlock )
{
40005a4c: fd010113 addi sp,sp,-48 <== NOT EXECUTED
POSIX_RWLock_Control zero;
memset( &zero, 0, sizeof( zero ) );
if ( memcmp( the_rwlock, &zero, sizeof( *the_rwlock ) ) != 0 ) {
40005a50: 02000613 li a2,32 <== NOT EXECUTED
40005a54: 00010593 mv a1,sp <== NOT EXECUTED
{
40005a58: 02812423 sw s0,40(sp) <== NOT EXECUTED
40005a5c: 02112623 sw ra,44(sp) <== NOT EXECUTED
40005a60: 00050413 mv s0,a0 <== NOT EXECUTED
memset( &zero, 0, sizeof( zero ) );
40005a64: 00012023 sw zero,0(sp) <== NOT EXECUTED
40005a68: 00012223 sw zero,4(sp) <== NOT EXECUTED
40005a6c: 00012423 sw zero,8(sp) <== NOT EXECUTED
40005a70: 00012623 sw zero,12(sp) <== NOT EXECUTED
40005a74: 00012823 sw zero,16(sp) <== NOT EXECUTED
40005a78: 00012a23 sw zero,20(sp) <== NOT EXECUTED
40005a7c: 00012c23 sw zero,24(sp) <== NOT EXECUTED
40005a80: 00012e23 sw zero,28(sp) <== NOT EXECUTED
if ( memcmp( the_rwlock, &zero, sizeof( *the_rwlock ) ) != 0 ) {
40005a84: 38d0c0ef jal ra,40012610 <memcmp> <== NOT EXECUTED
40005a88: 02051463 bnez a0,40005ab0 <_POSIX_RWLock_Auto_initialization+0x64><== NOT EXECUTED
return false;
}
the_rwlock->flags = (uintptr_t) the_rwlock ^ POSIX_RWLOCK_MAGIC;
40005a8c: 9621e7b7 lui a5,0x9621e <== NOT EXECUTED
40005a90: abd78793 addi a5,a5,-1347 # 9621dabd <RamEnd+0x5521dabd> <== NOT EXECUTED
40005a94: 00f447b3 xor a5,s0,a5 <== NOT EXECUTED
return true;
}
40005a98: 02c12083 lw ra,44(sp) <== NOT EXECUTED
the_rwlock->flags = (uintptr_t) the_rwlock ^ POSIX_RWLOCK_MAGIC;
40005a9c: 00f42023 sw a5,0(s0) <== NOT EXECUTED
}
40005aa0: 02812403 lw s0,40(sp) <== NOT EXECUTED
return true;
40005aa4: 00100513 li a0,1 <== NOT EXECUTED
}
40005aa8: 03010113 addi sp,sp,48 <== NOT EXECUTED
40005aac: 00008067 ret <== NOT EXECUTED
40005ab0: 02c12083 lw ra,44(sp) <== NOT EXECUTED
40005ab4: 02812403 lw s0,40(sp) <== NOT EXECUTED
return false;
40005ab8: 00000513 li a0,0 <== NOT EXECUTED
}
40005abc: 03010113 addi sp,sp,48 <== NOT EXECUTED
40005ac0: 00008067 ret <== NOT EXECUTED
40003fcc <_POSIX_Shm_Object_create_from_heap>:
int _POSIX_Shm_Object_create_from_heap(
POSIX_Shm_Object *shm_obj,
size_t size
)
{
40003fcc: ff010113 addi sp,sp,-16 <== NOT EXECUTED
40003fd0: 00812423 sw s0,8(sp) <== NOT EXECUTED
40003fd4: 00050413 mv s0,a0 <== NOT EXECUTED
void *p = calloc( 1, size ); /* get zero'd memory */
40003fd8: 00100513 li a0,1 <== NOT EXECUTED
{
40003fdc: 00912223 sw s1,4(sp) <== NOT EXECUTED
40003fe0: 00112623 sw ra,12(sp) <== NOT EXECUTED
40003fe4: 00058493 mv s1,a1 <== NOT EXECUTED
void *p = calloc( 1, size ); /* get zero'd memory */
40003fe8: 7a5030ef jal ra,40007f8c <calloc> <== NOT EXECUTED
if ( p != NULL ) {
40003fec: 02050263 beqz a0,40004010 <_POSIX_Shm_Object_create_from_heap+0x44><== NOT EXECUTED
shm_obj->handle = p;
40003ff0: 00a42023 sw a0,0(s0) <== NOT EXECUTED
shm_obj->size = size;
40003ff4: 00942223 sw s1,4(s0) <== NOT EXECUTED
} else {
errno = EIO;
}
return 0;
}
40003ff8: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40003ffc: 00812403 lw s0,8(sp) <== NOT EXECUTED
40004000: 00412483 lw s1,4(sp) <== NOT EXECUTED
40004004: 00000513 li a0,0 <== NOT EXECUTED
40004008: 01010113 addi sp,sp,16 <== NOT EXECUTED
4000400c: 00008067 ret <== NOT EXECUTED
errno = EIO;
40004010: 2110b0ef jal ra,4000fa20 <__errno> <== NOT EXECUTED
40004014: 00500793 li a5,5 <== NOT EXECUTED
40004018: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000401c: fddff06f j 40003ff8 <_POSIX_Shm_Object_create_from_heap+0x2c> <== NOT EXECUTED
40005178 <_POSIX_Shm_Object_create_from_workspace>:
int _POSIX_Shm_Object_create_from_workspace(
POSIX_Shm_Object *shm_obj,
size_t size
)
{
40005178: ff010113 addi sp,sp,-16 <== NOT EXECUTED
4000517c: 00912223 sw s1,4(sp) <== NOT EXECUTED
40005180: 00050493 mv s1,a0 <== NOT EXECUTED
shm_obj->handle = _Workspace_Allocate( size );
40005184: 00058513 mv a0,a1 <== NOT EXECUTED
{
40005188: 00812423 sw s0,8(sp) <== NOT EXECUTED
4000518c: 00112623 sw ra,12(sp) <== NOT EXECUTED
40005190: 00058413 mv s0,a1 <== NOT EXECUTED
shm_obj->handle = _Workspace_Allocate( size );
40005194: 4e4030ef jal ra,40008678 <_Workspace_Allocate> <== NOT EXECUTED
40005198: 00a4a023 sw a0,0(s1) <== NOT EXECUTED
if ( shm_obj->handle == NULL ) {
4000519c: 02050663 beqz a0,400051c8 <_POSIX_Shm_Object_create_from_workspace+0x50><== NOT EXECUTED
return ENOMEM;
}
memset( shm_obj->handle, 0, size );
400051a0: 00040613 mv a2,s0 <== NOT EXECUTED
400051a4: 00000593 li a1,0 <== NOT EXECUTED
400051a8: 5e40b0ef jal ra,4001078c <memset> <== NOT EXECUTED
shm_obj->size = size;
return 0;
}
400051ac: 00c12083 lw ra,12(sp) <== NOT EXECUTED
shm_obj->size = size;
400051b0: 0084a223 sw s0,4(s1) <== NOT EXECUTED
}
400051b4: 00812403 lw s0,8(sp) <== NOT EXECUTED
400051b8: 00412483 lw s1,4(sp) <== NOT EXECUTED
return 0;
400051bc: 00000513 li a0,0 <== NOT EXECUTED
}
400051c0: 01010113 addi sp,sp,16 <== NOT EXECUTED
400051c4: 00008067 ret <== NOT EXECUTED
400051c8: 00c12083 lw ra,12(sp) <== NOT EXECUTED
400051cc: 00812403 lw s0,8(sp) <== NOT EXECUTED
400051d0: 00412483 lw s1,4(sp) <== NOT EXECUTED
return ENOMEM;
400051d4: 00c00513 li a0,12 <== NOT EXECUTED
}
400051d8: 01010113 addi sp,sp,16 <== NOT EXECUTED
400051dc: 00008067 ret <== NOT EXECUTED
4000414c <_POSIX_Shm_Object_mmap_from_heap>:
POSIX_Shm_Object *shm_obj,
size_t len,
int prot,
off_t off
)
{
4000414c: 00050793 mv a5,a0
if ( shm_obj == NULL || shm_obj->handle == NULL )
40004150: 02050863 beqz a0,40004180 <_POSIX_Shm_Object_mmap_from_heap+0x34><== NEVER TAKEN
40004154: 00052503 lw a0,0(a0)
40004158: 02050663 beqz a0,40004184 <_POSIX_Shm_Object_mmap_from_heap+0x38><== NEVER TAKEN
return 0;
/* This is already checked by mmap. Maybe make it a debug assert? */
if ( shm_obj->size < len + off ) {
4000415c: 00d58633 add a2,a1,a3
40004160: 00b635b3 sltu a1,a2,a1
40004164: 00e585b3 add a1,a1,a4
40004168: 0047a783 lw a5,4(a5)
4000416c: 00b04a63 bgtz a1,40004180 <_POSIX_Shm_Object_mmap_from_heap+0x34><== NEVER TAKEN
40004170: 00058663 beqz a1,4000417c <_POSIX_Shm_Object_mmap_from_heap+0x30><== ALWAYS TAKEN
return NULL;
}
return (char*)shm_obj->handle + off;
40004174: 00d50533 add a0,a0,a3
40004178: 00008067 ret
if ( shm_obj->size < len + off ) {
4000417c: fec7fce3 bgeu a5,a2,40004174 <_POSIX_Shm_Object_mmap_from_heap+0x28>
return 0;
40004180: 00000513 li a0,0 <== NOT EXECUTED
}
40004184: 00008067 ret <== NOT EXECUTED
4000533c <_POSIX_Shm_Object_mmap_from_workspace>:
POSIX_Shm_Object *shm_obj,
size_t len,
int prot,
off_t off
)
{
4000533c: 00050793 mv a5,a0
if ( shm_obj == NULL || shm_obj->handle == NULL )
40005340: 02050863 beqz a0,40005370 <_POSIX_Shm_Object_mmap_from_workspace+0x34><== NEVER TAKEN
40005344: 00052503 lw a0,0(a0)
40005348: 02050663 beqz a0,40005374 <_POSIX_Shm_Object_mmap_from_workspace+0x38><== NEVER TAKEN
return 0;
/* This is already checked by mmap. Maybe make it a debug assert? */
if ( shm_obj->size < len + off ) {
4000534c: 00d58633 add a2,a1,a3
40005350: 00b635b3 sltu a1,a2,a1
40005354: 00e585b3 add a1,a1,a4
40005358: 0047a783 lw a5,4(a5)
4000535c: 00b04a63 bgtz a1,40005370 <_POSIX_Shm_Object_mmap_from_workspace+0x34><== NEVER TAKEN
40005360: 00058663 beqz a1,4000536c <_POSIX_Shm_Object_mmap_from_workspace+0x30><== ALWAYS TAKEN
return NULL;
}
return (char*)shm_obj->handle + off;
40005364: 00d50533 add a0,a0,a3
40005368: 00008067 ret
if ( shm_obj->size < len + off ) {
4000536c: fec7fce3 bgeu a5,a2,40005364 <_POSIX_Shm_Object_mmap_from_workspace+0x28>
return 0;
40005370: 00000513 li a0,0 <== NOT EXECUTED
}
40005374: 00008067 ret <== NOT EXECUTED
400040ec <_POSIX_Shm_Object_read_from_heap>:
POSIX_Shm_Object *shm_obj,
void *buf,
size_t count
)
{
if ( shm_obj == NULL || shm_obj->handle == NULL )
400040ec: 04050c63 beqz a0,40004144 <_POSIX_Shm_Object_read_from_heap+0x58><== NOT EXECUTED
400040f0: 00058713 mv a4,a1 <== NOT EXECUTED
400040f4: 00052583 lw a1,0(a0) <== NOT EXECUTED
400040f8: 00050793 mv a5,a0 <== NOT EXECUTED
return 0;
400040fc: 00000513 li a0,0 <== NOT EXECUTED
if ( shm_obj == NULL || shm_obj->handle == NULL )
40004100: 04058063 beqz a1,40004140 <_POSIX_Shm_Object_read_from_heap+0x54><== NOT EXECUTED
{
40004104: ff010113 addi sp,sp,-16 <== NOT EXECUTED
40004108: 00812423 sw s0,8(sp) <== NOT EXECUTED
4000410c: 0047a403 lw s0,4(a5) <== NOT EXECUTED
40004110: 00112623 sw ra,12(sp) <== NOT EXECUTED
40004114: 02866263 bltu a2,s0,40004138 <_POSIX_Shm_Object_read_from_heap+0x4c><== NOT EXECUTED
if ( shm_obj->size < count ) {
count = shm_obj->size;
}
memcpy( buf, shm_obj->handle, count );
40004118: 00040613 mv a2,s0 <== NOT EXECUTED
4000411c: 00070513 mv a0,a4 <== NOT EXECUTED
40004120: 22d0b0ef jal ra,4000fb4c <memcpy> <== NOT EXECUTED
return count;
}
40004124: 00c12083 lw ra,12(sp) <== NOT EXECUTED
return count;
40004128: 00040513 mv a0,s0 <== NOT EXECUTED
}
4000412c: 00812403 lw s0,8(sp) <== NOT EXECUTED
40004130: 01010113 addi sp,sp,16 <== NOT EXECUTED
40004134: 00008067 ret <== NOT EXECUTED
40004138: 00060413 mv s0,a2 <== NOT EXECUTED
4000413c: fddff06f j 40004118 <_POSIX_Shm_Object_read_from_heap+0x2c> <== NOT EXECUTED
40004140: 00008067 ret <== NOT EXECUTED
return 0;
40004144: 00000513 li a0,0 <== NOT EXECUTED
40004148: 00008067 ret <== NOT EXECUTED
400052dc <_POSIX_Shm_Object_read_from_workspace>:
POSIX_Shm_Object *shm_obj,
void *buf,
size_t count
)
{
if ( shm_obj == NULL || shm_obj->handle == NULL )
400052dc: 04050c63 beqz a0,40005334 <_POSIX_Shm_Object_read_from_workspace+0x58><== NEVER TAKEN
400052e0: 00058713 mv a4,a1
400052e4: 00052583 lw a1,0(a0)
400052e8: 00050793 mv a5,a0
return 0;
400052ec: 00000513 li a0,0
if ( shm_obj == NULL || shm_obj->handle == NULL )
400052f0: 04058063 beqz a1,40005330 <_POSIX_Shm_Object_read_from_workspace+0x54><== NEVER TAKEN
{
400052f4: ff010113 addi sp,sp,-16
400052f8: 00812423 sw s0,8(sp)
400052fc: 0047a403 lw s0,4(a5)
40005300: 00112623 sw ra,12(sp)
40005304: 02866263 bltu a2,s0,40005328 <_POSIX_Shm_Object_read_from_workspace+0x4c>
if ( shm_obj->size < count ) {
count = shm_obj->size;
}
memcpy( buf, shm_obj->handle, count );
40005308: 00040613 mv a2,s0
4000530c: 00070513 mv a0,a4
40005310: 3540b0ef jal ra,40010664 <memcpy>
return count;
}
40005314: 00c12083 lw ra,12(sp)
return count;
40005318: 00040513 mv a0,s0
}
4000531c: 00812403 lw s0,8(sp)
40005320: 01010113 addi sp,sp,16
40005324: 00008067 ret
40005328: 00060413 mv s0,a2 <== NOT EXECUTED
4000532c: fddff06f j 40005308 <_POSIX_Shm_Object_read_from_workspace+0x2c> <== NOT EXECUTED
40005330: 00008067 ret <== NOT EXECUTED
return 0;
40005334: 00000513 li a0,0 <== NOT EXECUTED
40005338: 00008067 ret <== NOT EXECUTED
40004064 <_POSIX_Shm_Object_resize_from_heap>:
)
{
void *p;
int err = 0;
if ( size < shm_obj->size ) {
40004064: 00452603 lw a2,4(a0)
{
40004068: ff010113 addi sp,sp,-16
4000406c: 00812423 sw s0,8(sp)
40004070: 00912223 sw s1,4(sp)
40004074: 00112623 sw ra,12(sp)
40004078: 00050413 mv s0,a0
4000407c: 00058493 mv s1,a1
/* zero out if shrinking */
p = (void*)((uintptr_t)shm_obj->handle + (uintptr_t)size);
40004080: 00052503 lw a0,0(a0)
if ( size < shm_obj->size ) {
40004084: 02c5ec63 bltu a1,a2,400040bc <_POSIX_Shm_Object_resize_from_heap+0x58>
memset( p, 0, shm_obj->size - size );
}
p = realloc( shm_obj->handle, size );
40004088: 00048593 mv a1,s1
4000408c: 149040ef jal ra,400089d4 <realloc>
if ( p != NULL ) {
40004090: 04050a63 beqz a0,400040e4 <_POSIX_Shm_Object_resize_from_heap+0x80><== NEVER TAKEN
shm_obj->handle = p;
if ( size > shm_obj->size ) {
40004094: 00442603 lw a2,4(s0)
shm_obj->handle = p;
40004098: 00a42023 sw a0,0(s0)
if ( size > shm_obj->size ) {
4000409c: 02966c63 bltu a2,s1,400040d4 <_POSIX_Shm_Object_resize_from_heap+0x70>
/* initialize added memory */
memset( p, 0, size - shm_obj->size );
}
shm_obj->size = size;
400040a0: 00942223 sw s1,4(s0)
int err = 0;
400040a4: 00000513 li a0,0
} else {
err = EIO;
}
return err;
}
400040a8: 00c12083 lw ra,12(sp)
400040ac: 00812403 lw s0,8(sp)
400040b0: 00412483 lw s1,4(sp)
400040b4: 01010113 addi sp,sp,16
400040b8: 00008067 ret
memset( p, 0, shm_obj->size - size );
400040bc: 00b50533 add a0,a0,a1 <== NOT EXECUTED
400040c0: 40b60633 sub a2,a2,a1 <== NOT EXECUTED
400040c4: 00000593 li a1,0 <== NOT EXECUTED
400040c8: 3ad0b0ef jal ra,4000fc74 <memset> <== NOT EXECUTED
p = realloc( shm_obj->handle, size );
400040cc: 00042503 lw a0,0(s0) <== NOT EXECUTED
400040d0: fb9ff06f j 40004088 <_POSIX_Shm_Object_resize_from_heap+0x24> <== NOT EXECUTED
memset( p, 0, size - shm_obj->size );
400040d4: 40c48633 sub a2,s1,a2
400040d8: 00000593 li a1,0
400040dc: 3990b0ef jal ra,4000fc74 <memset>
400040e0: fc1ff06f j 400040a0 <_POSIX_Shm_Object_resize_from_heap+0x3c>
err = EIO;
400040e4: 00500513 li a0,5 <== NOT EXECUTED
return err;
400040e8: fc1ff06f j 400040a8 <_POSIX_Shm_Object_resize_from_heap+0x44> <== NOT EXECUTED
40005224 <_POSIX_Shm_Object_resize_from_workspace>:
int _POSIX_Shm_Object_resize_from_workspace(
POSIX_Shm_Object *shm_obj,
size_t size
)
{
40005224: ff010113 addi sp,sp,-16
40005228: 00812423 sw s0,8(sp)
4000522c: 00112623 sw ra,12(sp)
40005230: 00912223 sw s1,4(sp)
memset( shm_obj->handle, 0, shm_obj->size );
40005234: 00052783 lw a5,0(a0)
{
40005238: 00050413 mv s0,a0
int err;
if ( size == 0 ) {
4000523c: 06058263 beqz a1,400052a0 <_POSIX_Shm_Object_resize_from_workspace+0x7c><== NEVER TAKEN
err = _POSIX_Shm_Object_delete_from_workspace( shm_obj );
} else if ( shm_obj->handle == NULL && shm_obj->size == 0 ) {
err = _POSIX_Shm_Object_create_from_workspace( shm_obj, size );
} else {
/* Refuse to resize a workspace object. */
err = EIO;
40005240: 00500513 li a0,5
} else if ( shm_obj->handle == NULL && shm_obj->size == 0 ) {
40005244: 00078c63 beqz a5,4000525c <_POSIX_Shm_Object_resize_from_workspace+0x38><== ALWAYS TAKEN
}
return err;
}
40005248: 00c12083 lw ra,12(sp) <== NOT EXECUTED
4000524c: 00812403 lw s0,8(sp) <== NOT EXECUTED
40005250: 00412483 lw s1,4(sp) <== NOT EXECUTED
40005254: 01010113 addi sp,sp,16 <== NOT EXECUTED
40005258: 00008067 ret <== NOT EXECUTED
} else if ( shm_obj->handle == NULL && shm_obj->size == 0 ) {
4000525c: 00442783 lw a5,4(s0)
40005260: fe0794e3 bnez a5,40005248 <_POSIX_Shm_Object_resize_from_workspace+0x24><== NEVER TAKEN
shm_obj->handle = _Workspace_Allocate( size );
40005264: 00058513 mv a0,a1
40005268: 00058493 mv s1,a1
4000526c: 40c030ef jal ra,40008678 <_Workspace_Allocate>
40005270: 00a42023 sw a0,0(s0)
if ( shm_obj->handle == NULL ) {
40005274: 06050063 beqz a0,400052d4 <_POSIX_Shm_Object_resize_from_workspace+0xb0><== NEVER TAKEN
memset( shm_obj->handle, 0, size );
40005278: 00048613 mv a2,s1
4000527c: 00000593 li a1,0
40005280: 50c0b0ef jal ra,4001078c <memset>
}
40005284: 00c12083 lw ra,12(sp)
shm_obj->size = size;
40005288: 00942223 sw s1,4(s0)
}
4000528c: 00812403 lw s0,8(sp)
40005290: 00412483 lw s1,4(sp)
return 0;
40005294: 00000513 li a0,0
}
40005298: 01010113 addi sp,sp,16
4000529c: 00008067 ret
memset( shm_obj->handle, 0, shm_obj->size );
400052a0: 00452603 lw a2,4(a0) <== NOT EXECUTED
400052a4: 00078513 mv a0,a5 <== NOT EXECUTED
400052a8: 4e40b0ef jal ra,4001078c <memset> <== NOT EXECUTED
_Workspace_Free( shm_obj->handle );
400052ac: 00042503 lw a0,0(s0) <== NOT EXECUTED
400052b0: 3e0030ef jal ra,40008690 <_Workspace_Free> <== NOT EXECUTED
}
400052b4: 00c12083 lw ra,12(sp) <== NOT EXECUTED
shm_obj->handle = NULL;
400052b8: 00042023 sw zero,0(s0) <== NOT EXECUTED
shm_obj->size = 0;
400052bc: 00042223 sw zero,4(s0) <== NOT EXECUTED
}
400052c0: 00812403 lw s0,8(sp) <== NOT EXECUTED
400052c4: 00412483 lw s1,4(sp) <== NOT EXECUTED
err = _POSIX_Shm_Object_delete_from_workspace( shm_obj );
400052c8: 00000513 li a0,0 <== NOT EXECUTED
}
400052cc: 01010113 addi sp,sp,16 <== NOT EXECUTED
400052d0: 00008067 ret <== NOT EXECUTED
return ENOMEM;
400052d4: 00c00513 li a0,12 <== NOT EXECUTED
return err;
400052d8: f71ff06f j 40005248 <_POSIX_Shm_Object_resize_from_workspace+0x24><== NOT EXECUTED
4000b734 <_POSIX_Timer_TSR>:
/*
* This is the operation that is run when a timer expires
*/
void _POSIX_Timer_TSR( Watchdog_Control *the_watchdog )
{
4000b734: ff010113 addi sp,sp,-16
4000b738: 00812423 sw s0,8(sp)
4000b73c: 00112623 sw ra,12(sp)
4000b740: 00912223 sw s1,4(sp)
4000b744: 01212023 sw s2,0(sp)
POSIX_Timer_Control *ptimer;
ISR_lock_Context lock_context;
Per_CPU_Control *cpu;
ptimer = RTEMS_CONTAINER_OF( the_watchdog, POSIX_Timer_Control, Timer );
4000b748: ff050413 addi s0,a0,-16
__asm__ volatile (
4000b74c: 300474f3 csrrci s1,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
4000b750: 0084f493 andi s1,s1,8
_ISR_lock_ISR_disable( &lock_context );
cpu = _POSIX_Timer_Acquire_critical( ptimer, &lock_context );
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
4000b754: 07442703 lw a4,116(s0)
/* The timer must be reprogrammed */
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
4000b758: 05042783 lw a5,80(s0)
4000b75c: 05442683 lw a3,84(s0)
ptimer->overrun = ptimer->overrun + 1;
4000b760: 00170713 addi a4,a4,1
4000b764: 06e42a23 sw a4,116(s0)
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
4000b768: 00d7e7b3 or a5,a5,a3
4000b76c: 00079663 bnez a5,4000b778 <_POSIX_Timer_TSR+0x44>
4000b770: 05842783 lw a5,88(s0)
4000b774: 06078863 beqz a5,4000b7e4 <_POSIX_Timer_TSR+0xb0> <== NEVER TAKEN
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
4000b778: 00300793 li a5,3
_Timecounter_Nanotime( tod );
4000b77c: 07840513 addi a0,s0,120
4000b780: 02f40a23 sb a5,52(s0)
( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) {
_POSIX_Timer_Insert( ptimer, cpu, ptimer->ticks );
4000b784: 07042903 lw s2,112(s0)
4000b788: 8c1fb0ef jal ra,40007048 <_Timecounter_Nanotime>
cpu->Watchdog.ticks + ticks
4000b78c: 400267b7 lui a5,0x40026
4000b790: 6c078793 addi a5,a5,1728 # 400266c0 <_Per_CPU_Information>
_Watchdog_Insert(
4000b794: 0487a603 lw a2,72(a5)
4000b798: 04c7a683 lw a3,76(a5)
4000b79c: 40026537 lui a0,0x40026
4000b7a0: 00c90633 add a2,s2,a2
4000b7a4: 01263933 sltu s2,a2,s2
4000b7a8: 00d906b3 add a3,s2,a3
4000b7ac: 01040593 addi a1,s0,16
4000b7b0: 71050513 addi a0,a0,1808 # 40026710 <_Per_CPU_Information+0x50>
4000b7b4: d20ff0ef jal ra,4000acd4 <_Watchdog_Insert>
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4000b7b8: 3004a073 csrs mstatus,s1
/*
* The sending of the signal to the process running the handling function
* specified for that signal is simulated
*/
if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) {
4000b7bc: 03c42583 lw a1,60(s0)
4000b7c0: 03042503 lw a0,48(s0)
4000b7c4: 484020ef jal ra,4000dc48 <pthread_kill>
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
}
4000b7c8: 00c12083 lw ra,12(sp)
ptimer->overrun = 0;
4000b7cc: 06042a23 sw zero,116(s0)
}
4000b7d0: 00812403 lw s0,8(sp)
4000b7d4: 00412483 lw s1,4(sp)
4000b7d8: 00012903 lw s2,0(sp)
4000b7dc: 01010113 addi sp,sp,16
4000b7e0: 00008067 ret
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
4000b7e4: 00400793 li a5,4 <== NOT EXECUTED
4000b7e8: 02f40a23 sb a5,52(s0) <== NOT EXECUTED
4000b7ec: fcdff06f j 4000b7b8 <_POSIX_Timer_TSR+0x84> <== NOT EXECUTED
40022a60 <_POSIX_signals_Clear_process_signals>:
_Assert( _ISR_Get_level() != 0 );
clear_signal = true;
mask = signo_to_mask( signo );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
40022a60: 00151793 slli a5,a0,0x1
40022a64: 00a787b3 add a5,a5,a0
40022a68: 4002d737 lui a4,0x4002d
40022a6c: 00279793 slli a5,a5,0x2
40022a70: 8a470713 addi a4,a4,-1884 # 4002c8a4 <_POSIX_signals_Vectors>
40022a74: 00f70733 add a4,a4,a5
40022a78: 00072603 lw a2,0(a4)
40022a7c: fff50513 addi a0,a0,-1
40022a80: 00100713 li a4,1
40022a84: 00200693 li a3,2
40022a88: 00a71533 sll a0,a4,a0
40022a8c: 00d60c63 beq a2,a3,40022aa4 <_POSIX_signals_Clear_process_signals+0x44>
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
40022a90: 9dc1a703 lw a4,-1572(gp) # 40027b04 <_POSIX_signals_Pending>
40022a94: fff54513 not a0,a0
40022a98: 00e57533 and a0,a0,a4
40022a9c: 9ca1ae23 sw a0,-1572(gp) # 40027b04 <_POSIX_signals_Pending>
}
}
40022aa0: 00008067 ret
return _Chain_Immutable_head( the_chain )->next;
40022aa4: 4002c737 lui a4,0x4002c
40022aa8: 72470713 addi a4,a4,1828 # 4002c724 <_POSIX_signals_Siginfo>
40022aac: 00e786b3 add a3,a5,a4
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
40022ab0: 0006a683 lw a3,0(a3)
return &the_chain->Tail.Node;
40022ab4: 00478793 addi a5,a5,4
40022ab8: 00e787b3 add a5,a5,a4
40022abc: fcf68ae3 beq a3,a5,40022a90 <_POSIX_signals_Clear_process_signals+0x30>
}
40022ac0: 00008067 ret <== NOT EXECUTED
40022030 <_POSIX_signals_Send>:
int _POSIX_signals_Send(
pid_t pid,
int sig,
const union sigval *value
)
{
40022030: fd010113 addi sp,sp,-48
40022034: 02812423 sw s0,40(sp)
40022038: 02912223 sw s1,36(sp)
4002203c: 03212023 sw s2,32(sp)
40022040: 02112623 sw ra,44(sp)
40022044: 01312e23 sw s3,28(sp)
40022048: 01412c23 sw s4,24(sp)
4002204c: 00050493 mv s1,a0
40022050: 00058413 mv s0,a1
40022054: 00060913 mv s2,a2
Per_CPU_Control *cpu_self;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
40022058: d9dff0ef jal ra,40021df4 <getpid>
4002205c: 2e951c63 bne a0,s1,40022354 <_POSIX_signals_Send+0x324>
rtems_set_errno_and_return_minus_one( ESRCH );
/*
* Validate the signal passed.
*/
if ( !sig )
40022060: 2e040063 beqz s0,40022340 <_POSIX_signals_Send+0x310>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
40022064: fff40713 addi a4,s0,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
40022068: 01f00793 li a5,31
4002206c: 2ce7ea63 bltu a5,a4,40022340 <_POSIX_signals_Send+0x310>
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
40022070: 00141a13 slli s4,s0,0x1
40022074: 008a07b3 add a5,s4,s0
40022078: 4002d9b7 lui s3,0x4002d
4002207c: 8a498993 addi s3,s3,-1884 # 4002c8a4 <_POSIX_signals_Vectors>
40022080: 00279793 slli a5,a5,0x2
40022084: 00f987b3 add a5,s3,a5
40022088: 0087a783 lw a5,8(a5)
4002208c: 00100493 li s1,1
40022090: 24978c63 beq a5,s1,400222e8 <_POSIX_signals_Send+0x2b8>
/*
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
40022094: ffc40793 addi a5,s0,-4
40022098: ffb7f793 andi a5,a5,-5
4002209c: 20078463 beqz a5,400222a4 <_POSIX_signals_Send+0x274>
400220a0: 00b00793 li a5,11
400220a4: 20f40063 beq s0,a5,400222a4 <_POSIX_signals_Send+0x274>
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
400220a8: 00912423 sw s1,8(sp)
siginfo->si_signo = sig;
400220ac: 00812223 sw s0,4(sp)
return 1u << (sig - 1);
400220b0: 00e494b3 sll s1,s1,a4
if ( !value ) {
400220b4: 24090c63 beqz s2,4002230c <_POSIX_signals_Send+0x2dc>
siginfo->si_value.sival_int = 0;
} else {
siginfo->si_value = *value;
400220b8: 00092783 lw a5,0(s2)
400220bc: 00f12623 sw a5,12(sp)
disable_level = cpu_self->thread_dispatch_disable_level;
400220c0: 4002c937 lui s2,0x4002c
400220c4: ac090793 addi a5,s2,-1344 # 4002bac0 <_Per_CPU_Information>
400220c8: 0387a503 lw a0,56(a5)
400220cc: 0307a703 lw a4,48(a5)
* get it an execute it as soon as the dispatcher executes.
*/
the_thread = _Per_CPU_Get_executing( cpu_self );
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
400220d0: 19852683 lw a3,408(a0)
cpu_self->thread_dispatch_disable_level = disable_level + 1;
400220d4: 00170713 addi a4,a4,1
400220d8: 02e7a823 sw a4,48(a5)
400220dc: 0686a783 lw a5,104(a3)
400220e0: 00f4f7b3 and a5,s1,a5
400220e4: 0c079463 bnez a5,400221ac <_POSIX_signals_Send+0x17c>
* There is no requirement on the order of threads pending on a sigwait().
*/
/* XXX violation of visibility -- need to define thread queue support */
heads = _POSIX_signals_Wait_queue.Queue.heads;
400220e8: 400287b7 lui a5,0x40028
400220ec: 91c7a603 lw a2,-1764(a5) # 4002791c <_POSIX_signals_Wait_queue>
if ( heads != NULL ) {
400220f0: 00060863 beqz a2,40022100 <_POSIX_signals_Send+0xd0>
return _Chain_Immutable_head( the_chain )->next;
400220f4: 00062783 lw a5,0(a2)
return &the_chain->Tail.Node;
400220f8: 00460613 addi a2,a2,4
Chain_Control *the_chain = &heads->Heads.Fifo;
for ( the_node = _Chain_First( the_chain );
400220fc: 18c79863 bne a5,a2,4002228c <_POSIX_signals_Send+0x25c>
40022100: 40025337 lui t1,0x40025
40022104: aac30313 addi t1,t1,-1364 # 40024aac <_Objects_Information_table>
40022108: 00010eb7 lui t4,0x10
4002210c: 00830f13 addi t5,t1,8
{
40022110: fff00e13 li t3,-1
40022114: fff00593 li a1,-1
40022118: 00000513 li a0,0
4002211c: fffe8e93 addi t4,t4,-1 # ffff <bsp_section_bss_size+0xb02b>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal (
States_Control the_states
)
{
return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL);
40022120: 10000fb7 lui t6,0x10000
interested = NULL;
interested_priority = UINT64_MAX;
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
_Assert( _Objects_Information_table[ the_api ] != NULL );
the_info = _Objects_Information_table[ the_api ][ 1 ];
40022124: 00832783 lw a5,8(t1)
40022128: 0047a783 lw a5,4(a5)
if ( !the_info )
4002212c: 06078a63 beqz a5,400221a0 <_POSIX_signals_Send+0x170>
return
40022130: 0007a803 lw a6,0(a5)
continue;
maximum = _Objects_Get_maximum_index( the_info );
object_table = the_info->local_table;
40022134: 0047a783 lw a5,4(a5)
40022138: 01d87833 and a6,a6,t4
for ( index = 0 ; index < maximum ; ++index ) {
4002213c: 06080263 beqz a6,400221a0 <_POSIX_signals_Send+0x170> <== NEVER TAKEN
40022140: 00281813 slli a6,a6,0x2
40022144: 01078833 add a6,a5,a6
the_thread = (Thread_Control *) object_table[ index ];
40022148: 0007a703 lw a4,0(a5)
if ( !the_thread )
4002214c: 04070663 beqz a4,40022198 <_POSIX_signals_Send+0x168>
return aggregation->Node.priority;
40022150: 03872603 lw a2,56(a4)
40022154: 01c62683 lw a3,28(a2)
40022158: 01862883 lw a7,24(a2)
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( _Thread_Get_priority( the_thread ) > interested_priority )
4002215c: 02d5ee63 bltu a1,a3,40022198 <_POSIX_signals_Send+0x168>
40022160: 18b68063 beq a3,a1,400222e0 <_POSIX_signals_Send+0x2b0>
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
40022164: 19872603 lw a2,408(a4)
40022168: 06862603 lw a2,104(a2)
4002216c: 00c4f633 and a2,s1,a2
40022170: 02060463 beqz a2,40022198 <_POSIX_signals_Send+0x168>
*
* NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1
* so we never have to worry about deferencing a NULL
* interested thread.
*/
if ( _Thread_Get_priority( the_thread ) < interested_priority ) {
40022174: 14b6ee63 bltu a3,a1,400222d0 <_POSIX_signals_Send+0x2a0>
40022178: 14d58a63 beq a1,a3,400222cc <_POSIX_signals_Send+0x29c>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
4002217c: 00050e63 beqz a0,40022198 <_POSIX_signals_Send+0x168> <== NEVER TAKEN
40022180: 01c52603 lw a2,28(a0)
40022184: 00060a63 beqz a2,40022198 <_POSIX_signals_Send+0x168>
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
40022188: 01c72283 lw t0,28(a4)
4002218c: 14028263 beqz t0,400222d0 <_POSIX_signals_Send+0x2a0>
40022190: 01f67633 and a2,a2,t6
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
40022194: 18060063 beqz a2,40022314 <_POSIX_signals_Send+0x2e4>
for ( index = 0 ; index < maximum ; ++index ) {
40022198: 00478793 addi a5,a5,4
4002219c: faf816e3 bne a6,a5,40022148 <_POSIX_signals_Send+0x118>
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
400221a0: 00430313 addi t1,t1,4
400221a4: f9e310e3 bne t1,t5,40022124 <_POSIX_signals_Send+0xf4>
}
}
}
}
if ( interested ) {
400221a8: 00050a63 beqz a0,400221bc <_POSIX_signals_Send+0x18c>
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
400221ac: 00410613 addi a2,sp,4
400221b0: 00040593 mv a1,s0
400221b4: 440000ef jal ra,400225f4 <_POSIX_signals_Unblock_thread>
400221b8: 08051a63 bnez a0,4002224c <_POSIX_signals_Send+0x21c>
/*
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
400221bc: 00048513 mv a0,s1
400221c0: 254000ef jal ra,40022414 <_POSIX_signals_Set_process_signals>
__asm__ volatile (
400221c4: 30047773 csrrci a4,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
400221c8: 00877713 andi a4,a4,8
_Thread_queue_Context_initialize( &queue_context );
_POSIX_signals_Acquire( &queue_context );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
400221cc: 008a0433 add s0,s4,s0
400221d0: 00241413 slli s0,s0,0x2
400221d4: 008989b3 add s3,s3,s0
400221d8: 0009a683 lw a3,0(s3)
400221dc: 00200793 li a5,2
400221e0: 06f69463 bne a3,a5,40022248 <_POSIX_signals_Send+0x218>
return _Chain_Immutable_head( the_chain )->next;
400221e4: 4002c6b7 lui a3,0x4002c
400221e8: 71868693 addi a3,a3,1816 # 4002c718 <_POSIX_signals_Inactive_siginfo>
400221ec: 0006a783 lw a5,0(a3)
if ( !_Chain_Is_empty(the_chain))
400221f0: 4002c637 lui a2,0x4002c
400221f4: 71c60613 addi a2,a2,1820 # 4002c71c <_POSIX_signals_Inactive_siginfo+0x4>
400221f8: 12c78463 beq a5,a2,40022320 <_POSIX_signals_Send+0x2f0>
new_first = old_first->next;
400221fc: 0007a803 lw a6,0(a5)
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
_Chain_Append_unprotected(
40022200: 4002c637 lui a2,0x4002c
psiginfo->Info = *siginfo;
40022204: 00c12883 lw a7,12(sp)
40022208: 00812303 lw t1,8(sp)
4002220c: 00412e03 lw t3,4(sp)
_Chain_Append_unprotected(
40022210: 72460613 addi a2,a2,1828 # 4002c724 <_POSIX_signals_Siginfo>
new_first->previous = head;
40022214: 00d82223 sw a3,4(a6)
40022218: 00c40533 add a0,s0,a2
return &the_chain->Tail.Node;
4002221c: 00440413 addi s0,s0,4
old_last = tail->previous;
40022220: 00852583 lw a1,8(a0)
head->next = new_first;
40022224: 0106a023 sw a6,0(a3)
return &the_chain->Tail.Node;
40022228: 00c40433 add s0,s0,a2
psiginfo->Info = *siginfo;
4002222c: 01c7a423 sw t3,8(a5)
40022230: 0067a623 sw t1,12(a5)
40022234: 0117a823 sw a7,16(a5)
the_node->next = tail;
40022238: 0087a023 sw s0,0(a5)
tail->previous = the_node;
4002223c: 00f52423 sw a5,8(a0)
old_last->next = the_node;
40022240: 00f5a023 sw a5,0(a1)
the_node->previous = old_last;
40022244: 00b7a223 sw a1,4(a5)
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40022248: 30072073 csrs mstatus,a4
);
}
_POSIX_signals_Release( &queue_context );
DEBUG_STEP("\n");
_Thread_Dispatch_enable( cpu_self );
4002224c: ac090513 addi a0,s2,-1344
40022250: ca8e50ef jal ra,400076f8 <_Thread_Dispatch_enable>
return 0;
40022254: 00000513 li a0,0
}
40022258: 02c12083 lw ra,44(sp)
4002225c: 02812403 lw s0,40(sp)
40022260: 02412483 lw s1,36(sp)
40022264: 02012903 lw s2,32(sp)
40022268: 01c12983 lw s3,28(sp)
4002226c: 01812a03 lw s4,24(sp)
40022270: 03010113 addi sp,sp,48
40022274: 00008067 ret
if (api->signals_unblocked & mask)
40022278: 0686a703 lw a4,104(a3)
4002227c: 00e4f733 and a4,s1,a4
40022280: f20716e3 bnez a4,400221ac <_POSIX_signals_Send+0x17c>
the_node = the_node->next ) {
40022284: 0007a783 lw a5,0(a5)
for ( the_node = _Chain_First( the_chain );
40022288: e6c78ce3 beq a5,a2,40022100 <_POSIX_signals_Send+0xd0>
return node->owner;
4002228c: ff87a503 lw a0,-8(a5)
if (the_thread->Wait.option & mask)
40022290: 04852703 lw a4,72(a0)
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
40022294: 19852683 lw a3,408(a0)
if (the_thread->Wait.option & mask)
40022298: 00e4f733 and a4,s1,a4
4002229c: fc070ee3 beqz a4,40022278 <_POSIX_signals_Send+0x248>
400222a0: f0dff06f j 400221ac <_POSIX_signals_Send+0x17c>
return pthread_kill( pthread_self(), sig );
400222a4: 604000ef jal ra,400228a8 <pthread_self>
400222a8: 00040593 mv a1,s0
}
400222ac: 02812403 lw s0,40(sp)
400222b0: 02c12083 lw ra,44(sp)
400222b4: 02412483 lw s1,36(sp)
400222b8: 02012903 lw s2,32(sp)
400222bc: 01c12983 lw s3,28(sp)
400222c0: 01812a03 lw s4,24(sp)
400222c4: 03010113 addi sp,sp,48
return pthread_kill( pthread_self(), sig );
400222c8: 4e40006f j 400227ac <pthread_kill>
if ( _Thread_Get_priority( the_thread ) < interested_priority ) {
400222cc: ebc8f8e3 bgeu a7,t3,4002217c <_POSIX_signals_Send+0x14c>
400222d0: 00088e13 mv t3,a7
400222d4: 00068593 mv a1,a3
400222d8: 00070513 mv a0,a4
400222dc: ebdff06f j 40022198 <_POSIX_signals_Send+0x168>
if ( _Thread_Get_priority( the_thread ) > interested_priority )
400222e0: e91e72e3 bgeu t3,a7,40022164 <_POSIX_signals_Send+0x134>
400222e4: eb5ff06f j 40022198 <_POSIX_signals_Send+0x168>
}
400222e8: 02c12083 lw ra,44(sp)
400222ec: 02812403 lw s0,40(sp)
400222f0: 02412483 lw s1,36(sp)
400222f4: 02012903 lw s2,32(sp)
400222f8: 01c12983 lw s3,28(sp)
400222fc: 01812a03 lw s4,24(sp)
return 0;
40022300: 00000513 li a0,0
}
40022304: 03010113 addi sp,sp,48
40022308: 00008067 ret
siginfo->si_value.sival_int = 0;
4002230c: 00012623 sw zero,12(sp)
40022310: db1ff06f j 400220c0 <_POSIX_signals_Send+0x90>
40022314: 01f2f2b3 and t0,t0,t6
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
40022318: e80280e3 beqz t0,40022198 <_POSIX_signals_Send+0x168>
4002231c: fb5ff06f j 400222d0 <_POSIX_signals_Send+0x2a0>
40022320: 30072073 csrs mstatus,a4
_Thread_Dispatch_enable( cpu_self );
40022324: ac090513 addi a0,s2,-1344
40022328: bd0e50ef jal ra,400076f8 <_Thread_Dispatch_enable>
rtems_set_errno_and_return_minus_one( EAGAIN );
4002232c: d80f30ef jal ra,400158ac <__errno>
40022330: 00b00793 li a5,11
40022334: 00f52023 sw a5,0(a0)
40022338: fff00513 li a0,-1
4002233c: f1dff06f j 40022258 <_POSIX_signals_Send+0x228>
rtems_set_errno_and_return_minus_one( EINVAL );
40022340: d6cf30ef jal ra,400158ac <__errno>
40022344: 01600793 li a5,22
40022348: 00f52023 sw a5,0(a0)
4002234c: fff00513 li a0,-1
40022350: f09ff06f j 40022258 <_POSIX_signals_Send+0x228>
rtems_set_errno_and_return_minus_one( ESRCH );
40022354: d58f30ef jal ra,400158ac <__errno>
40022358: 00300793 li a5,3
4002235c: 00f52023 sw a5,0(a0)
40022360: fff00513 li a0,-1
40022364: ef5ff06f j 40022258 <_POSIX_signals_Send+0x228>
400225f4 <_POSIX_signals_Unblock_thread>:
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
400225f4: ff010113 addi sp,sp,-16
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
400225f8: 01c52683 lw a3,28(a0)
{
400225fc: 00912223 sw s1,4(sp)
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
40022600: 10000837 lui a6,0x10000
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
40022604: 19852483 lw s1,408(a0)
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
40022608: 40080713 addi a4,a6,1024 # 10000400 <RamSize+0xf000400>
{
4002260c: 00812423 sw s0,8(sp)
40022610: 01212023 sw s2,0(sp)
40022614: fff58793 addi a5,a1,-1
40022618: 00100893 li a7,1
4002261c: 00112623 sw ra,12(sp)
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
40022620: 00e6f333 and t1,a3,a4
{
40022624: 00050413 mv s0,a0
40022628: 00f897b3 sll a5,a7,a5
_Chain_Append_if_is_off_chain_unprotected(
4002262c: 07048913 addi s2,s1,112
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
40022630: 06e30263 beq t1,a4,40022694 <_POSIX_signals_Unblock_thread+0xa0>
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( api->signals_unblocked & mask ) {
40022634: 0684a703 lw a4,104(s1)
40022638: 00e7f7b3 and a5,a5,a4
4002263c: 00078663 beqz a5,40022648 <_POSIX_signals_Unblock_thread+0x54>
40022640: 0106f6b3 and a3,a3,a6
* it is not blocked, THEN
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
40022644: 12069463 bnez a3,4002276c <_POSIX_signals_Unblock_thread+0x178>
__asm__ volatile (
40022648: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
4002264c: 0087f793 andi a5,a5,8
action->handler = handler;
40022650: 40022737 lui a4,0x40022
40022654: 4e470713 addi a4,a4,1252 # 400224e4 <_POSIX_signals_Action_handler>
40022658: 06e4ac23 sw a4,120(s1)
if ( _Chain_Is_node_off_chain( the_node ) ) {
4002265c: 0704a683 lw a3,112(s1)
cpu_self->dispatch_necessary = true;
40022660: 4002c737 lui a4,0x4002c
40022664: ac070713 addi a4,a4,-1344 # 4002bac0 <_Per_CPU_Information>
40022668: 00100613 li a2,1
4002266c: 02c70a23 sb a2,52(a4)
40022670: 06068263 beqz a3,400226d4 <_POSIX_signals_Unblock_thread+0xe0>
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40022674: 3007a073 csrs mstatus,a5
the_thread->Wait.return_code = STATUS_INTERRUPTED;
_Thread_queue_Extract_with_proxy( the_thread );
}
}
return _POSIX_signals_Unblock_thread_done( the_thread, api, false );
}
40022678: 00c12083 lw ra,12(sp)
4002267c: 00812403 lw s0,8(sp)
40022680: 00412483 lw s1,4(sp)
40022684: 00012903 lw s2,0(sp)
return _POSIX_signals_Unblock_thread_done( the_thread, api, false );
40022688: 00000513 li a0,0
}
4002268c: 01010113 addi sp,sp,16
40022690: 00008067 ret
if ( (the_thread->Wait.option & mask) || (api->signals_unblocked & mask) ) {
40022694: 04852703 lw a4,72(a0)
40022698: 00e7f733 and a4,a5,a4
4002269c: 04071a63 bnez a4,400226f0 <_POSIX_signals_Unblock_thread+0xfc>
400226a0: 0684a703 lw a4,104(s1)
400226a4: 00e7f7b3 and a5,a5,a4
400226a8: 04079463 bnez a5,400226f0 <_POSIX_signals_Unblock_thread+0xfc>
__asm__ volatile (
400226ac: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
400226b0: 0087f793 andi a5,a5,8
400226b4: 40022737 lui a4,0x40022
400226b8: 4e470713 addi a4,a4,1252 # 400224e4 <_POSIX_signals_Action_handler>
400226bc: 06e4ac23 sw a4,120(s1)
400226c0: 0704a683 lw a3,112(s1)
400226c4: 4002c737 lui a4,0x4002c
400226c8: ac070713 addi a4,a4,-1344 # 4002bac0 <_Per_CPU_Information>
400226cc: 03170a23 sb a7,52(a4)
400226d0: fa0692e3 bnez a3,40022674 <_POSIX_signals_Unblock_thread+0x80> <== NEVER TAKEN
old_last = tail->previous;
400226d4: 0e042703 lw a4,224(s0)
return &the_chain->Tail.Node;
400226d8: 0dc40693 addi a3,s0,220
the_node->next = tail;
400226dc: 06d4a823 sw a3,112(s1)
tail->previous = the_node;
400226e0: 0f242023 sw s2,224(s0)
old_last->next = the_node;
400226e4: 01272023 sw s2,0(a4)
the_node->previous = old_last;
400226e8: 06e4aa23 sw a4,116(s1)
}
400226ec: f89ff06f j 40022674 <_POSIX_signals_Unblock_thread+0x80>
the_thread->Wait.return_code = STATUS_INTERRUPTED;
400226f0: 40d00793 li a5,1037
400226f4: 04f42623 sw a5,76(s0)
the_info = (siginfo_t *) the_thread->Wait.return_argument;
400226f8: 04042783 lw a5,64(s0)
if ( !info ) {
400226fc: 08060063 beqz a2,4002277c <_POSIX_signals_Unblock_thread+0x188>
*the_info = *info;
40022700: 00062703 lw a4,0(a2)
40022704: 00e7a023 sw a4,0(a5)
40022708: 00462703 lw a4,4(a2)
4002270c: 00e7a223 sw a4,4(a5)
40022710: 00862703 lw a4,8(a2)
40022714: 00e7a423 sw a4,8(a5)
_Thread_queue_Extract_with_proxy( the_thread );
40022718: 00040513 mv a0,s0
4002271c: ff4eb0ef jal ra,4000df10 <_Thread_queue_Extract_with_proxy>
__asm__ volatile (
40022720: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40022724: 0087f793 andi a5,a5,8
40022728: 40022737 lui a4,0x40022
4002272c: 4e470713 addi a4,a4,1252 # 400224e4 <_POSIX_signals_Action_handler>
40022730: 06e4ac23 sw a4,120(s1)
if ( _Chain_Is_node_off_chain( the_node ) ) {
40022734: 0704a683 lw a3,112(s1)
40022738: 4002c737 lui a4,0x4002c
4002273c: ac070713 addi a4,a4,-1344 # 4002bac0 <_Per_CPU_Information>
40022740: 00100613 li a2,1
40022744: 02c70a23 sb a2,52(a4)
40022748: 04068463 beqz a3,40022790 <_POSIX_signals_Unblock_thread+0x19c> <== ALWAYS TAKEN
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4002274c: 3007a073 csrs mstatus,a5
}
40022750: 00c12083 lw ra,12(sp)
40022754: 00812403 lw s0,8(sp)
40022758: 00412483 lw s1,4(sp)
4002275c: 00012903 lw s2,0(sp)
return _POSIX_signals_Unblock_thread_done( the_thread, api, true );
40022760: 00100513 li a0,1
}
40022764: 01010113 addi sp,sp,16
40022768: 00008067 ret
the_thread->Wait.return_code = STATUS_INTERRUPTED;
4002276c: 40d00793 li a5,1037
40022770: 04f52623 sw a5,76(a0)
_Thread_queue_Extract_with_proxy( the_thread );
40022774: f9ceb0ef jal ra,4000df10 <_Thread_queue_Extract_with_proxy>
40022778: ed1ff06f j 40022648 <_POSIX_signals_Unblock_thread+0x54>
the_info->si_code = SI_USER;
4002277c: 00100713 li a4,1
the_info->si_signo = signo;
40022780: 00b7a023 sw a1,0(a5)
the_info->si_code = SI_USER;
40022784: 00e7a223 sw a4,4(a5)
the_info->si_value.sival_int = 0;
40022788: 0007a423 sw zero,8(a5)
4002278c: f8dff06f j 40022718 <_POSIX_signals_Unblock_thread+0x124>
old_last = tail->previous;
40022790: 0e042703 lw a4,224(s0)
return &the_chain->Tail.Node;
40022794: 0dc40693 addi a3,s0,220
the_node->next = tail;
40022798: 06d4a823 sw a3,112(s1)
tail->previous = the_node;
4002279c: 0f242023 sw s2,224(s0)
old_last->next = the_node;
400227a0: 01272023 sw s2,0(a4)
the_node->previous = old_last;
400227a4: 06e4aa23 sw a4,116(s1)
}
400227a8: fa5ff06f j 4002274c <_POSIX_signals_Unblock_thread+0x158>
4000828c <aio_fsync>:
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
4000828c: ff010113 addi sp,sp,-16
40008290: 00812423 sw s0,8(sp)
40008294: 00912223 sw s1,4(sp)
40008298: 00112623 sw ra,12(sp)
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
4000829c: 000027b7 lui a5,0x2
{
400082a0: 00058413 mv s0,a1
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
400082a4: 01600493 li s1,22
if (op != O_SYNC)
400082a8: 04f51a63 bne a0,a5,400082fc <aio_fsync+0x70>
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
400082ac: 0005a503 lw a0,0(a1)
400082b0: 00300593 li a1,3
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
400082b4: 00900493 li s1,9
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
400082b8: 44d000ef jal ra,40008f04 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
400082bc: 00357513 andi a0,a0,3
400082c0: fff50513 addi a0,a0,-1
400082c4: 00100793 li a5,1
400082c8: 02a7ea63 bltu a5,a0,400082fc <aio_fsync+0x70>
req = malloc (sizeof (rtems_aio_request));
400082cc: 01800513 li a0,24
400082d0: 989f80ef jal ra,40000c58 <malloc>
if (req == NULL)
400082d4: 02050263 beqz a0,400082f8 <aio_fsync+0x6c> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
400082d8: 00300713 li a4,3
400082dc: 02e42823 sw a4,48(s0)
req->aiocbp = aiocbp;
400082e0: 00852a23 sw s0,20(a0)
return rtems_aio_enqueue (req);
}
400082e4: 00812403 lw s0,8(sp)
400082e8: 00c12083 lw ra,12(sp)
400082ec: 00412483 lw s1,4(sp)
400082f0: 01010113 addi sp,sp,16
return rtems_aio_enqueue (req);
400082f4: 6cc0006f j 400089c0 <rtems_aio_enqueue>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
400082f8: 00b00493 li s1,11 <== NOT EXECUTED
400082fc: fff00793 li a5,-1
40008300: 02942a23 sw s1,52(s0)
40008304: 02f42c23 sw a5,56(s0)
40008308: 431080ef jal ra,40010f38 <__errno>
}
4000830c: 00c12083 lw ra,12(sp)
40008310: 00812403 lw s0,8(sp)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
40008314: 00952023 sw s1,0(a0)
}
40008318: 00412483 lw s1,4(sp)
4000831c: fff00513 li a0,-1
40008320: 01010113 addi sp,sp,16
40008324: 00008067 ret
40008bcc <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
40008bcc: ff010113 addi sp,sp,-16
40008bd0: 00812423 sw s0,8(sp)
40008bd4: 00050413 mv s0,a0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
40008bd8: 00052503 lw a0,0(a0)
40008bdc: 00300593 li a1,3
{
40008be0: 00912223 sw s1,4(sp)
40008be4: 00112623 sw ra,12(sp)
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
40008be8: 31c000ef jal ra,40008f04 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
40008bec: 00157513 andi a0,a0,1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
40008bf0: 00900493 li s1,9
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
40008bf4: 02050863 beqz a0,40008c24 <aio_read+0x58>
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
40008bf8: fff00793 li a5,-1
40008bfc: 02942a23 sw s1,52(s0)
40008c00: 02f42c23 sw a5,56(s0)
40008c04: 334080ef jal ra,40010f38 <__errno>
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
40008c08: 00c12083 lw ra,12(sp)
40008c0c: 00812403 lw s0,8(sp)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
40008c10: 00952023 sw s1,0(a0)
}
40008c14: 00412483 lw s1,4(sp)
40008c18: fff00513 li a0,-1
40008c1c: 01010113 addi sp,sp,16
40008c20: 00008067 ret
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
40008c24: 01842783 lw a5,24(s0)
40008c28: 02079c63 bnez a5,40008c60 <aio_read+0x94>
if (aiocbp->aio_offset < 0)
40008c2c: 00c42783 lw a5,12(s0)
40008c30: 0207c863 bltz a5,40008c60 <aio_read+0x94>
req = malloc (sizeof (rtems_aio_request));
40008c34: 01800513 li a0,24
40008c38: 820f80ef jal ra,40000c58 <malloc>
if (req == NULL)
40008c3c: 02050663 beqz a0,40008c68 <aio_read+0x9c> <== NEVER TAKEN
req->aiocbp->aio_lio_opcode = LIO_READ;
40008c40: 00100713 li a4,1
40008c44: 02e42823 sw a4,48(s0)
req->aiocbp = aiocbp;
40008c48: 00852a23 sw s0,20(a0)
}
40008c4c: 00812403 lw s0,8(sp)
40008c50: 00c12083 lw ra,12(sp)
40008c54: 00412483 lw s1,4(sp)
40008c58: 01010113 addi sp,sp,16
return rtems_aio_enqueue (req);
40008c5c: d65ff06f j 400089c0 <rtems_aio_enqueue>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
40008c60: 01600493 li s1,22
40008c64: f95ff06f j 40008bf8 <aio_read+0x2c>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
40008c68: 00b00493 li s1,11 <== NOT EXECUTED
40008c6c: f8dff06f j 40008bf8 <aio_read+0x2c> <== NOT EXECUTED
40008c78 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
40008c78: ff010113 addi sp,sp,-16
40008c7c: 00812423 sw s0,8(sp)
40008c80: 00050413 mv s0,a0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
40008c84: 00052503 lw a0,0(a0)
40008c88: 00300593 li a1,3
{
40008c8c: 00912223 sw s1,4(sp)
40008c90: 00112623 sw ra,12(sp)
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
40008c94: 270000ef jal ra,40008f04 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
40008c98: 00357513 andi a0,a0,3
40008c9c: fff50513 addi a0,a0,-1
40008ca0: 00100793 li a5,1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
40008ca4: 00900493 li s1,9
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
40008ca8: 04a7e263 bltu a5,a0,40008cec <aio_write+0x74>
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
40008cac: 01842783 lw a5,24(s0)
40008cb0: 02079c63 bnez a5,40008ce8 <aio_write+0x70>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
40008cb4: 00c42783 lw a5,12(s0)
40008cb8: 0207c863 bltz a5,40008ce8 <aio_write+0x70>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
40008cbc: 01800513 li a0,24
40008cc0: f99f70ef jal ra,40000c58 <malloc>
if (req == NULL)
40008cc4: 04050a63 beqz a0,40008d18 <aio_write+0xa0> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
40008cc8: 00200713 li a4,2
40008ccc: 02e42823 sw a4,48(s0)
req->aiocbp = aiocbp;
40008cd0: 00852a23 sw s0,20(a0)
return rtems_aio_enqueue (req);
}
40008cd4: 00812403 lw s0,8(sp)
40008cd8: 00c12083 lw ra,12(sp)
40008cdc: 00412483 lw s1,4(sp)
40008ce0: 01010113 addi sp,sp,16
return rtems_aio_enqueue (req);
40008ce4: cddff06f j 400089c0 <rtems_aio_enqueue>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
40008ce8: 01600493 li s1,22
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
40008cec: fff00793 li a5,-1
40008cf0: 02942a23 sw s1,52(s0)
40008cf4: 02f42c23 sw a5,56(s0)
40008cf8: 240080ef jal ra,40010f38 <__errno>
}
40008cfc: 00c12083 lw ra,12(sp)
40008d00: 00812403 lw s0,8(sp)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
40008d04: 00952023 sw s1,0(a0)
}
40008d08: 00412483 lw s1,4(sp)
40008d0c: fff00513 li a0,-1
40008d10: 01010113 addi sp,sp,16
40008d14: 00008067 ret
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
40008d18: 00b00493 li s1,11 <== NOT EXECUTED
40008d1c: fd1ff06f j 40008cec <aio_write+0x74> <== NOT EXECUTED
4000fe2c <clock_nanosleep>:
clockid_t clock_id,
int flags,
const struct timespec *rqtp,
struct timespec *rmtp
)
{
4000fe2c: f9010113 addi sp,sp,-112
4000fe30: 07212023 sw s2,96(sp)
4000fe34: 05312e23 sw s3,92(sp)
4000fe38: 06112623 sw ra,108(sp)
4000fe3c: 06812423 sw s0,104(sp)
4000fe40: 06912223 sw s1,100(sp)
struct timespec uptime;
const struct timespec *end;
Thread_Control *executing;
int eno;
if ( clock_id != CLOCK_REALTIME && clock_id != CLOCK_MONOTONIC ) {
4000fe44: 00100793 li a5,1
{
4000fe48: 00060913 mv s2,a2
4000fe4c: 00068993 mv s3,a3
if ( clock_id != CLOCK_REALTIME && clock_id != CLOCK_MONOTONIC ) {
4000fe50: 0cf50c63 beq a0,a5,4000ff28 <clock_nanosleep+0xfc>
4000fe54: 00400793 li a5,4 <== NOT EXECUTED
return ENOTSUP;
4000fe58: 08600413 li s0,134 <== NOT EXECUTED
if ( clock_id != CLOCK_REALTIME && clock_id != CLOCK_MONOTONIC ) {
4000fe5c: 0af51663 bne a0,a5,4000ff08 <clock_nanosleep+0xdc> <== NOT EXECUTED
queue_context->thread_state = thread_state;
4000fe60: 100007b7 lui a5,0x10000 <== NOT EXECUTED
4000fe64: 10078793 addi a5,a5,256 # 10000100 <RamSize+0xf000100> <== NOT EXECUTED
4000fe68: 02f12823 sw a5,48(sp) <== NOT EXECUTED
_Thread_queue_Context_set_thread_state(
&queue_context,
STATES_WAITING_FOR_TIME | STATES_INTERRUPTIBLE_BY_SIGNAL
);
if ( ( flags & TIMER_ABSTIME ) != 0 ) {
4000fe6c: 0045f493 andi s1,a1,4 <== NOT EXECUTED
4000fe70: 0e048063 beqz s1,4000ff50 <clock_nanosleep+0x124> <== NOT EXECUTED
queue_context->enqueue_callout =
4000fe74: 400097b7 lui a5,0x40009 <== NOT EXECUTED
4000fe78: 8cc78793 addi a5,a5,-1844 # 400088cc <_Thread_queue_Add_timeout_monotonic_timespec><== NOT EXECUTED
queue_context->Timeout.arg = abstime;
4000fe7c: 03212c23 sw s2,56(sp) <== NOT EXECUTED
queue_context->enqueue_callout =
4000fe80: 02f12a23 sw a5,52(sp) <== NOT EXECUTED
__asm__ volatile (
4000fe84: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
4000fe88: 0087f793 andi a5,a5,8
_ISR_lock_ISR_disable( &queue_context->Lock_context.Lock_context );
4000fe8c: 02f12623 sw a5,44(sp)
4000fe90: 400177b7 lui a5,0x40017
4000fe94: 8387a403 lw s0,-1992(a5) # 40016838 <_Per_CPU_Information+0x38>
);
}
_Thread_queue_Acquire( &_Nanosleep_Pseudo_queue, &queue_context );
executing = _Thread_Executing;
_Thread_queue_Enqueue(
4000fe98: 400115b7 lui a1,0x40011
4000fe9c: 40012537 lui a0,0x40012
4000fea0: 00040613 mv a2,s0
4000fea4: 02c10693 addi a3,sp,44
4000fea8: c9c58593 addi a1,a1,-868 # 40010c9c <_Thread_queue_Operations_FIFO>
4000feac: 0e050513 addi a0,a0,224 # 400120e0 <_Nanosleep_Pseudo_queue>
4000feb0: bb5f70ef jal ra,40007a64 <_Thread_queue_Enqueue>
return _POSIX_Get_by_name_error_table[ error ];
}
RTEMS_INLINE_ROUTINE int _POSIX_Get_error( Status_Control status )
{
return STATUS_GET_POSIX( status );
4000feb4: 04c42783 lw a5,76(s0)
executing,
&queue_context
);
eno = _POSIX_Get_error_after_wait( executing );
if ( eno == ETIMEDOUT ) {
4000feb8: 07400713 li a4,116
4000febc: 41f7d413 srai s0,a5,0x1f
4000fec0: 0ff47413 andi s0,s0,255
4000fec4: 00f40433 add s0,s0,a5
4000fec8: 40845413 srai s0,s0,0x8
4000fecc: 10e40463 beq s0,a4,4000ffd4 <clock_nanosleep+0x1a8>
eno = 0;
}
if ( rmtp != NULL && ( flags & TIMER_ABSTIME ) == 0 ) {
4000fed0: 02098c63 beqz s3,4000ff08 <clock_nanosleep+0xdc>
4000fed4: 02049a63 bnez s1,4000ff08 <clock_nanosleep+0xdc> <== NEVER TAKEN
if ( eno == EINTR ) {
4000fed8: 00400793 li a5,4
4000fedc: 10f41263 bne s0,a5,4000ffe0 <clock_nanosleep+0x1b4>
struct timespec actual_end;
_Timecounter_Nanouptime( &actual_end );
4000fee0: 01810513 addi a0,sp,24
4000fee4: acdf60ef jal ra,400069b0 <_Timecounter_Nanouptime>
if ( _Timespec_Less_than( &actual_end, end ) ) {
4000fee8: 00090593 mv a1,s2
4000feec: 01810513 addi a0,sp,24
4000fef0: 1b0000ef jal ra,400100a0 <_Timespec_Less_than>
4000fef4: 0e050663 beqz a0,4000ffe0 <clock_nanosleep+0x1b4> <== NEVER TAKEN
_Timespec_Subtract( &actual_end, end, rmtp );
4000fef8: 00098613 mv a2,s3
4000fefc: 00090593 mv a1,s2
4000ff00: 01810513 addi a0,sp,24
4000ff04: 1e4000ef jal ra,400100e8 <_Timespec_Subtract>
_Timespec_Set_to_zero( rmtp );
}
}
return eno;
}
4000ff08: 06c12083 lw ra,108(sp)
4000ff0c: 00040513 mv a0,s0
4000ff10: 06812403 lw s0,104(sp)
4000ff14: 06412483 lw s1,100(sp)
4000ff18: 06012903 lw s2,96(sp)
4000ff1c: 05c12983 lw s3,92(sp)
4000ff20: 07010113 addi sp,sp,112
4000ff24: 00008067 ret
queue_context->thread_state = thread_state;
4000ff28: 100007b7 lui a5,0x10000
4000ff2c: 10078793 addi a5,a5,256 # 10000100 <RamSize+0xf000100>
4000ff30: 02f12823 sw a5,48(sp)
if ( ( flags & TIMER_ABSTIME ) != 0 ) {
4000ff34: 0045f493 andi s1,a1,4
4000ff38: 00048c63 beqz s1,4000ff50 <clock_nanosleep+0x124>
queue_context->enqueue_callout = _Thread_queue_Add_timeout_realtime_timespec;
4000ff3c: 400097b7 lui a5,0x40009
4000ff40: 92078793 addi a5,a5,-1760 # 40008920 <_Thread_queue_Add_timeout_realtime_timespec>
queue_context->Timeout.arg = abstime;
4000ff44: 03212c23 sw s2,56(sp)
queue_context->enqueue_callout = _Thread_queue_Add_timeout_realtime_timespec;
4000ff48: 02f12a23 sw a5,52(sp)
}
4000ff4c: f39ff06f j 4000fe84 <clock_nanosleep+0x58>
_Timecounter_Nanouptime( &uptime );
4000ff50: 00810513 addi a0,sp,8
4000ff54: a5df60ef jal ra,400069b0 <_Timecounter_Nanouptime>
&& (unsigned long) ts->tv_nsec < WATCHDOG_NANOSECONDS_PER_SECOND;
4000ff58: 06090263 beqz s2,4000ffbc <clock_nanosleep+0x190>
4000ff5c: 00892683 lw a3,8(s2)
4000ff60: 3b9ad637 lui a2,0x3b9ad
4000ff64: 9ff60613 addi a2,a2,-1537 # 3b9ac9ff <RamSize+0x3a9ac9ff>
4000ff68: 0ad66663 bltu a2,a3,40010014 <clock_nanosleep+0x1e8>
return _Watchdog_Is_valid_timespec( ts ) && ts->tv_sec >= 0;
4000ff6c: 00492583 lw a1,4(s2)
4000ff70: 00092783 lw a5,0(s2)
4000ff74: 0a05c063 bltz a1,40010014 <clock_nanosleep+0x1e8>
sec += (uint64_t) delta->tv_sec;
4000ff78: 00c12503 lw a0,12(sp)
4000ff7c: 00812703 lw a4,8(sp)
4000ff80: 00a585b3 add a1,a1,a0
now->tv_nsec += delta->tv_nsec;
4000ff84: 01012503 lw a0,16(sp)
sec += (uint64_t) delta->tv_sec;
4000ff88: 00e78733 add a4,a5,a4
4000ff8c: 00f737b3 sltu a5,a4,a5
now->tv_nsec += delta->tv_nsec;
4000ff90: 00a686b3 add a3,a3,a0
sec += (uint64_t) delta->tv_sec;
4000ff94: 00b787b3 add a5,a5,a1
if ( now->tv_nsec >= WATCHDOG_NANOSECONDS_PER_SECOND ) {
4000ff98: 08d64c63 blt a2,a3,40010030 <clock_nanosleep+0x204>
now->tv_nsec += delta->tv_nsec;
4000ff9c: 00d12823 sw a3,16(sp)
if ( sec <= INT64_MAX ) {
4000ffa0: 0007d863 bgez a5,4000ffb0 <clock_nanosleep+0x184>
now->tv_sec = INT64_MAX;
4000ffa4: 800007b7 lui a5,0x80000
4000ffa8: fff00713 li a4,-1
4000ffac: fff7c793 not a5,a5
4000ffb0: 00e12423 sw a4,8(sp)
4000ffb4: 00f12623 sw a5,12(sp)
return now;
4000ffb8: 00810913 addi s2,sp,8
queue_context->enqueue_callout =
4000ffbc: 400097b7 lui a5,0x40009
4000ffc0: 8cc78793 addi a5,a5,-1844 # 400088cc <_Thread_queue_Add_timeout_monotonic_timespec>
queue_context->Timeout.arg = abstime;
4000ffc4: 03212c23 sw s2,56(sp)
queue_context->enqueue_callout =
4000ffc8: 02f12a23 sw a5,52(sp)
}
4000ffcc: 00000493 li s1,0
4000ffd0: eb5ff06f j 4000fe84 <clock_nanosleep+0x58>
eno = 0;
4000ffd4: 00000413 li s0,0
if ( rmtp != NULL && ( flags & TIMER_ABSTIME ) == 0 ) {
4000ffd8: f20988e3 beqz s3,4000ff08 <clock_nanosleep+0xdc>
4000ffdc: f20496e3 bnez s1,4000ff08 <clock_nanosleep+0xdc> <== NEVER TAKEN
}
4000ffe0: 06c12083 lw ra,108(sp)
4000ffe4: 00040513 mv a0,s0
4000ffe8: 06812403 lw s0,104(sp)
_Timespec_Set_to_zero( rmtp );
4000ffec: 00000793 li a5,0
4000fff0: 00000813 li a6,0
4000fff4: 00f9a023 sw a5,0(s3)
4000fff8: 0109a223 sw a6,4(s3)
4000fffc: 0009a423 sw zero,8(s3)
}
40010000: 06412483 lw s1,100(sp)
40010004: 06012903 lw s2,96(sp)
40010008: 05c12983 lw s3,92(sp)
4001000c: 07010113 addi sp,sp,112
40010010: 00008067 ret
queue_context->enqueue_callout =
40010014: 400097b7 lui a5,0x40009
return NULL;
40010018: 00000913 li s2,0
4001001c: 8cc78793 addi a5,a5,-1844 # 400088cc <_Thread_queue_Add_timeout_monotonic_timespec>
queue_context->Timeout.arg = abstime;
40010020: 03212c23 sw s2,56(sp)
queue_context->enqueue_callout =
40010024: 02f12a23 sw a5,52(sp)
}
40010028: 00000493 li s1,0
4001002c: e59ff06f j 4000fe84 <clock_nanosleep+0x58>
++sec;
40010030: 00170613 addi a2,a4,1
40010034: 00e635b3 sltu a1,a2,a4
now->tv_nsec -= WATCHDOG_NANOSECONDS_PER_SECOND;
40010038: c4653737 lui a4,0xc4653
4001003c: 60070713 addi a4,a4,1536 # c4653600 <RamEnd+0x83653600>
40010040: 00e686b3 add a3,a3,a4
40010044: 00d12823 sw a3,16(sp)
++sec;
40010048: 00060713 mv a4,a2
4001004c: 00f587b3 add a5,a1,a5
40010050: f51ff06f j 4000ffa0 <clock_nanosleep+0x174>
400038ac <clock_settime>:
int clock_settime(
clockid_t clock_id,
const struct timespec *tp
)
{
400038ac: fe010113 addi sp,sp,-32
400038b0: 00112e23 sw ra,28(sp)
400038b4: 00812c23 sw s0,24(sp)
Status_Control status;
if ( !tp )
400038b8: 00058e63 beqz a1,400038d4 <clock_settime+0x28> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
400038bc: 00100793 li a5,1
400038c0: 04f50e63 beq a0,a5,4000391c <clock_settime+0x70>
if ( status != STATUS_SUCCESSFUL ) {
rtems_set_errno_and_return_minus_one( STATUS_GET_POSIX( status ) );
}
}
#ifdef _POSIX_CPUTIME
else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
400038c4: 00200793 li a5,2
400038c8: 02f50863 beq a0,a5,400038f8 <clock_settime+0x4c>
rtems_set_errno_and_return_minus_one( ENOSYS );
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) {
400038cc: 00300793 li a5,3
400038d0: 02f50463 beq a0,a5,400038f8 <clock_settime+0x4c>
rtems_set_errno_and_return_minus_one( ENOSYS );
}
#endif
else {
rtems_set_errno_and_return_minus_one( EINVAL );
400038d4: 5600c0ef jal ra,4000fe34 <__errno>
400038d8: 01600793 li a5,22
400038dc: 00f52023 sw a5,0(a0)
400038e0: fff00413 li s0,-1
}
return 0;
}
400038e4: 01c12083 lw ra,28(sp)
400038e8: 00040513 mv a0,s0
400038ec: 01812403 lw s0,24(sp)
400038f0: 02010113 addi sp,sp,32
400038f4: 00008067 ret
rtems_set_errno_and_return_minus_one( ENOSYS );
400038f8: 53c0c0ef jal ra,4000fe34 <__errno>
400038fc: fff00413 li s0,-1
40003900: 05800793 li a5,88
}
40003904: 01c12083 lw ra,28(sp)
rtems_set_errno_and_return_minus_one( ENOSYS );
40003908: 00f52023 sw a5,0(a0)
}
4000390c: 00040513 mv a0,s0
40003910: 01812403 lw s0,24(sp)
40003914: 02010113 addi sp,sp,32
40003918: 00008067 ret
_TOD_Lock();
4000391c: 00058413 mv s0,a1
40003920: 5a5000ef jal ra,400046c4 <_TOD_Lock>
__asm__ volatile (
40003924: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40003928: 0087f793 andi a5,a5,8
_Timecounter_Acquire( lock_context );
4000392c: 00f12623 sw a5,12(sp)
status = _TOD_Set( tp, &lock_context );
40003930: 00040513 mv a0,s0
40003934: 00c10593 addi a1,sp,12
40003938: 5a5000ef jal ra,400046dc <_TOD_Set>
4000393c: 00050413 mv s0,a0
_TOD_Unlock();
40003940: 591000ef jal ra,400046d0 <_TOD_Unlock>
if ( status != STATUS_SUCCESSFUL ) {
40003944: fa0400e3 beqz s0,400038e4 <clock_settime+0x38>
rtems_set_errno_and_return_minus_one( STATUS_GET_POSIX( status ) );
40003948: 4ec0c0ef jal ra,4000fe34 <__errno>
4000394c: 41f45793 srai a5,s0,0x1f
40003950: 0ff7f793 andi a5,a5,255
40003954: 008787b3 add a5,a5,s0
40003958: 4087d793 srai a5,a5,0x8
4000395c: 00f52023 sw a5,0(a0)
40003960: fff00413 li s0,-1
40003964: f81ff06f j 400038e4 <clock_settime+0x38>
40004470 <mmap>:
CHAIN_DEFINE_EMPTY( mmap_mappings );
void *mmap(
void *addr, size_t len, int prot, int flags, int fildes, off_t off
)
{
40004470: f4010113 addi sp,sp,-192
40004474: 0a812c23 sw s0,184(sp)
40004478: 0b212823 sw s2,176(sp)
4000447c: 0b312623 sw s3,172(sp)
40004480: 0b412423 sw s4,168(sp)
40004484: 0b512223 sw s5,164(sp)
40004488: 0b612023 sw s6,160(sp)
4000448c: 09712e23 sw s7,156(sp)
40004490: 0a112e23 sw ra,188(sp)
40004494: 0a912a23 sw s1,180(sp)
40004498: 09812c23 sw s8,152(sp)
4000449c: 09912a23 sw s9,148(sp)
400044a0: 09a12823 sw s10,144(sp)
400044a4: 09b12623 sw s11,140(sp)
400044a8: 00050a13 mv s4,a0
400044ac: 00058993 mv s3,a1
400044b0: 00060913 mv s2,a2
400044b4: 00068413 mv s0,a3
400044b8: 00070a93 mv s5,a4
400044bc: 00078b93 mv s7,a5
400044c0: 00080b13 mv s6,a6
map_anonymous = (flags & MAP_ANON) == MAP_ANON;
map_shared = (flags & MAP_SHARED) == MAP_SHARED;
map_private = (flags & MAP_PRIVATE) == MAP_PRIVATE;
/* Clear errno. */
errno = 0;
400044c4: 5390b0ef jal ra,400101fc <__errno>
400044c8: 00052023 sw zero,0(a0)
iop = NULL;
if ( len == 0 ) {
400044cc: 18098c63 beqz s3,40004664 <mmap+0x1f4> <== NEVER TAKEN
/*
* We can provide read, write and execute because the memory in RTEMS does
* not normally have protections but we cannot hide access to memory.
*/
if ( prot == PROT_NONE ) {
400044d0: 1e090263 beqz s2,400046b4 <mmap+0x244> <== NEVER TAKEN
/*
* We can not normally provide restriction of write access. Reject any
* attempt to map without write permission, since we are not able to
* prevent a write from succeeding.
*/
if ( PROT_WRITE != (prot & PROT_WRITE) ) {
400044d4: 00297793 andi a5,s2,2
400044d8: 1c078e63 beqz a5,400046b4 <mmap+0x244>
map_anonymous = (flags & MAP_ANON) == MAP_ANON;
400044dc: 000014b7 lui s1,0x1
400044e0: 009474b3 and s1,s0,s1
map_fixed = (flags & MAP_FIXED) == MAP_FIXED;
400044e4: 01047d93 andi s11,s0,16
map_shared = (flags & MAP_SHARED) == MAP_SHARED;
400044e8: 00147c13 andi s8,s0,1
map_private = (flags & MAP_PRIVATE) == MAP_PRIVATE;
400044ec: 00247693 andi a3,s0,2
/*
* Anonymous mappings must have file descriptor set to -1 and the offset
* set to 0. Shared mappings are not supported with Anonymous mappings at
* this time
*/
if ( map_anonymous && (fildes != -1 || off != 0 || map_shared) ) {
400044f0: 16049663 bnez s1,4000465c <mmap+0x1ec>
flags |= MAP_PRIVATE;
map_private = true;
}
/* Check for supported flags */
if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_ANON)) != 0) {
400044f4: fffff7b7 lui a5,0xfffff
400044f8: fec78793 addi a5,a5,-20 # ffffefec <RamEnd+0xbeffefec>
400044fc: 00f477b3 and a5,s0,a5
40004500: 16079263 bnez a5,40004664 <mmap+0x1f4> <== NEVER TAKEN
errno = EINVAL;
return MAP_FAILED;
}
/* Either MAP_SHARED or MAP_PRIVATE must be defined, but not both */
if ( map_shared ) {
40004504: 360c0063 beqz s8,40004864 <mmap+0x3f4>
if ( map_private ) {
40004508: 14069e63 bnez a3,40004664 <mmap+0x1f4>
errno = EINVAL;
return MAP_FAILED;
}
/* Check for illegal addresses. Watch out for address wrap. */
if ( map_fixed ) {
4000450c: 00012423 sw zero,8(sp)
40004510: 1e0d9463 bnez s11,400046f8 <mmap+0x288> <== NEVER TAKEN
* Get a stat of the file to get the dev + inode number and to make sure the
* fd is ok. The normal libio calls cannot be used because we need to return
* MAP_FAILED on error and they return -1 directly without coming back to
* here.
*/
if ( fstat( fildes, &sb ) < 0 ) {
40004514: 01810593 addi a1,sp,24
40004518: 000a8513 mv a0,s5
4000451c: 0a1040ef jal ra,40008dbc <fstat>
40004520: 42054463 bltz a0,40004948 <mmap+0x4d8> <== NEVER TAKEN
/* fstat ensures we have a good file descriptor. Hold on to iop. */
iop = rtems_libio_iop( fildes );
/* Check the type of file we have and make sure it is supported. */
if ( S_ISDIR( sb.st_mode ) || S_ISLNK( sb.st_mode )) {
40004524: 02812783 lw a5,40(sp)
40004528: 0000f637 lui a2,0xf
4000452c: 000046b7 lui a3,0x4
40004530: 00f677b3 and a5,a2,a5
40004534: 2ad78c63 beq a5,a3,400047ec <mmap+0x37c>
40004538: 0000a6b7 lui a3,0xa
4000453c: 2ad78863 beq a5,a3,400047ec <mmap+0x37c>
errno = ENODEV;
return MAP_FAILED;
}
/* Check to see if the mapping is valid for a regular file. */
if ( S_ISREG( sb.st_mode )
40004540: 000086b7 lui a3,0x8
40004544: 36d78663 beq a5,a3,400048b0 <mmap+0x440>
errno = EOVERFLOW;
return MAP_FAILED;
}
/* Check to see if the mapping is valid for other file/object types. */
if ( !S_ISCHR( sb.st_mode ) && sb.st_size < off + len ) {
40004548: 000026b7 lui a3,0x2
4000454c: 2ad78a63 beq a5,a3,40004800 <mmap+0x390>
&& (( off >= sb.st_size ) || (( off + len ) >= sb.st_size ))) {
40004550: 017985b3 add a1,s3,s7
if ( !S_ISCHR( sb.st_mode ) && sb.st_size < off + len ) {
40004554: 04412603 lw a2,68(sp)
&& (( off >= sb.st_size ) || (( off + len ) >= sb.st_size ))) {
40004558: 0135b6b3 sltu a3,a1,s3
4000455c: 016686b3 add a3,a3,s6
if ( !S_ISCHR( sb.st_mode ) && sb.st_size < off + len ) {
40004560: 3cd64a63 blt a2,a3,40004934 <mmap+0x4c4>
40004564: 42d60263 beq a2,a3,40004988 <mmap+0x518>
errno = ENXIO;
return MAP_FAILED;
}
/* Do not seek on character devices, pipes, sockets, or memory objects. */
if ( S_ISREG( sb.st_mode ) || S_ISBLK( sb.st_mode ) ) {
40004568: ffffa6b7 lui a3,0xffffa
4000456c: 00d786b3 add a3,a5,a3
40004570: ffffd637 lui a2,0xffffd
40004574: 00c6f6b3 and a3,a3,a2
40004578: 30068663 beqz a3,40004884 <mmap+0x414> <== NEVER TAKEN
return &rtems_libio_iops[ fd ];
4000457c: 001a9c93 slli s9,s5,0x1
40004580: 015c8cb3 add s9,s9,s5
40004584: 4001c6b7 lui a3,0x4001c
40004588: 004c9c93 slli s9,s9,0x4
4000458c: b9868693 addi a3,a3,-1128 # 4001bb98 <rtems_libio_iops>
return MAP_FAILED;
}
}
/* cdevs do not provide private mappings of any kind. */
if ( S_ISCHR( sb.st_mode ) && map_private ) {
40004590: 00002637 lui a2,0x2
40004594: 00dc8cb3 add s9,s9,a3
40004598: 28c78063 beq a5,a2,40004818 <mmap+0x3a8>
return MAP_FAILED;
}
}
/* Create the mapping */
mapping = malloc( sizeof( mmap_mapping ));
4000459c: 00100593 li a1,1
400045a0: 01800513 li a0,24
400045a4: 00f12623 sw a5,12(sp)
400045a8: 628040ef jal ra,40008bd0 <calloc>
if ( !mapping ) {
400045ac: 00c12783 lw a5,12(sp)
mapping = malloc( sizeof( mmap_mapping ));
400045b0: 00050d13 mv s10,a0
if ( !mapping ) {
400045b4: 22050263 beqz a0,400047d8 <mmap+0x368> <== NEVER TAKEN
errno = ENOMEM;
return MAP_FAILED;
}
memset( mapping, 0, sizeof( mmap_mapping ));
mapping->len = len;
400045b8: 013d2623 sw s3,12(s10)
mapping->flags = flags;
400045bc: 008d2823 sw s0,16(s10)
* HACK: We should have a better generic way to distinguish between
* shm objects and other mmap'd files. We need to know at munmap time
* if the mapping is to a shared memory object in order to refcnt shms.
* We could do this by providing mmap in the file operations if needed.
*/
if ( S_ISREG( sb.st_mode ) || S_ISBLK( sb.st_mode ) ||
400045c0: 000086b7 lui a3,0x8
400045c4: 2ad78463 beq a5,a3,4000486c <mmap+0x3fc>
400045c8: 000066b7 lui a3,0x6
400045cc: 2ad78063 beq a5,a3,4000486c <mmap+0x3fc>
S_ISCHR( sb.st_mode ) || S_ISFIFO( sb.st_mode ) ||
400045d0: 000016b7 lui a3,0x1
400045d4: 28d78c63 beq a5,a3,4000486c <mmap+0x3fc>
400045d8: 0000c6b7 lui a3,0xc
400045dc: 28d78863 beq a5,a3,4000486c <mmap+0x3fc>
}
} else {
is_shared_shm = false;
}
if ( map_fixed ) {
400045e0: 0c0d9863 bnez s11,400046b0 <mmap+0x240> <== NEVER TAKEN
is_shared_shm = true;
400045e4: 00100413 li s0,1
mapping->addr = addr;
} else if ( map_private ) {
400045e8: 00812783 lw a5,8(sp)
400045ec: 1c079863 bnez a5,400047bc <mmap+0x34c>
extern rtems_chain_control mmap_mappings;
static inline void mmap_mappings_lock_obtain( void )
{
rtems_libio_lock();
400045f0: 87dfc0ef jal ra,40000e6c <rtems_libio_lock>
return MAP_FAILED;
}
} else if ( !map_fixed ) {
memset( mapping->addr, 0, len );
}
} else if ( map_shared ) {
400045f4: 020c0c63 beqz s8,4000462c <mmap+0x1bc> <== NEVER TAKEN
if ( is_shared_shm ) {
400045f8: 00040663 beqz s0,40004604 <mmap+0x194> <== NEVER TAKEN
/* FIXME: This use of implementation details is a hack. */
mapping->shm = iop_to_shm( iop );
400045fc: 02cca783 lw a5,44(s9)
40004600: 00fd2a23 sw a5,20(s10)
}
err = (*iop->pathinfo.handlers->mmap_h)(
40004604: 020ca683 lw a3,32(s9)
40004608: 000b8713 mv a4,s7
4000460c: 000b0793 mv a5,s6
40004610: 03c6a803 lw a6,60(a3) # c03c <bsp_section_bss_size+0x8df4>
40004614: 00098613 mv a2,s3
40004618: 00090693 mv a3,s2
4000461c: 008d0593 addi a1,s10,8
40004620: 000c8513 mv a0,s9
40004624: 000800e7 jalr a6 # 4000 <bsp_section_bss_size+0xdb8>
iop, &mapping->addr, len, prot, off );
if ( err != 0 ) {
40004628: 34051063 bnez a0,40004968 <mmap+0x4f8>
4000462c: 4001a5b7 lui a1,0x4001a
40004630: 4001a6b7 lui a3,0x4001a
40004634: fb058593 addi a1,a1,-80 # 40019fb0 <mmap_mappings>
40004638: fb468693 addi a3,a3,-76 # 40019fb4 <mmap_mappings+0x4>
old_last = tail->previous;
4000463c: 0085a783 lw a5,8(a1)
the_node->next = tail;
40004640: 00dd2023 sw a3,0(s10)
tail->previous = the_node;
40004644: 01a5a423 sw s10,8(a1)
old_last->next = the_node;
40004648: 01a7a023 sw s10,0(a5)
the_node->previous = old_last;
4000464c: 00fd2223 sw a5,4(s10)
}
static inline void mmap_mappings_lock_release( void )
{
rtems_libio_unlock();
40004650: 829fc0ef jal ra,40000e78 <rtems_libio_unlock>
rtems_chain_append_unprotected( &mmap_mappings, &mapping->node );
mmap_mappings_lock_release( );
return mapping->addr;
40004654: 008d2503 lw a0,8(s10)
40004658: 01c0006f j 40004674 <mmap+0x204>
if ( map_anonymous && (fildes != -1 || off != 0 || map_shared) ) {
4000465c: fff00793 li a5,-1
40004660: 06fa8463 beq s5,a5,400046c8 <mmap+0x258>
errno = EINVAL;
40004664: 3990b0ef jal ra,400101fc <__errno>
40004668: 01600793 li a5,22
4000466c: 00f52023 sw a5,0(a0)
return MAP_FAILED;
40004670: fff00513 li a0,-1
}
40004674: 0bc12083 lw ra,188(sp)
40004678: 0b812403 lw s0,184(sp)
4000467c: 0b412483 lw s1,180(sp)
40004680: 0b012903 lw s2,176(sp)
40004684: 0ac12983 lw s3,172(sp)
40004688: 0a812a03 lw s4,168(sp)
4000468c: 0a412a83 lw s5,164(sp)
40004690: 0a012b03 lw s6,160(sp)
40004694: 09c12b83 lw s7,156(sp)
40004698: 09812c03 lw s8,152(sp)
4000469c: 09412c83 lw s9,148(sp)
400046a0: 09012d03 lw s10,144(sp)
400046a4: 08c12d83 lw s11,140(sp)
400046a8: 0c010113 addi sp,sp,192
400046ac: 00008067 ret
free( mapping );
400046b0: 5c4040ef jal ra,40008c74 <free> <== NOT EXECUTED
errno = ENOTSUP;
400046b4: 3490b0ef jal ra,400101fc <__errno>
400046b8: 08600793 li a5,134
400046bc: 00f52023 sw a5,0(a0)
return MAP_FAILED;
400046c0: fff00513 li a0,-1
400046c4: fb1ff06f j 40004674 <mmap+0x204>
if ( map_anonymous && (fildes != -1 || off != 0 || map_shared) ) {
400046c8: 016be7b3 or a5,s7,s6
400046cc: f8079ce3 bnez a5,40004664 <mmap+0x1f4> <== NEVER TAKEN
400046d0: f80c1ae3 bnez s8,40004664 <mmap+0x1f4>
if ( map_anonymous && !map_private && !map_shared ) {
400046d4: fffff7b7 lui a5,0xfffff
400046d8: fec78793 addi a5,a5,-20 # ffffefec <RamEnd+0xbeffefec>
400046dc: 00f477b3 and a5,s0,a5
400046e0: 0a069663 bnez a3,4000478c <mmap+0x31c>
flags |= MAP_PRIVATE;
400046e4: 00246413 ori s0,s0,2
if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_ANON)) != 0) {
400046e8: f6079ee3 bnez a5,40004664 <mmap+0x1f4>
if ( map_fixed ) {
400046ec: 0a0d8a63 beqz s11,400047a0 <mmap+0x330> <== ALWAYS TAKEN
map_private = true;
400046f0: 00100793 li a5,1 <== NOT EXECUTED
400046f4: 00f12423 sw a5,8(sp) <== NOT EXECUTED
if ((uintptr_t)addr & PAGE_MASK) {
400046f8: 014a1793 slli a5,s4,0x14
400046fc: f60794e3 bnez a5,40004664 <mmap+0x1f4>
if ( addr == NULL ) {
40004700: f60a02e3 beqz s4,40004664 <mmap+0x1f4>
if (addr + len < addr) {
40004704: f609c0e3 bltz s3,40004664 <mmap+0x1f4> <== NEVER TAKEN
if ( !map_anonymous ) {
40004708: e00486e3 beqz s1,40004514 <mmap+0xa4>
mapping = malloc( sizeof( mmap_mapping ));
4000470c: 00100593 li a1,1
40004710: 01800513 li a0,24
40004714: 4bc040ef jal ra,40008bd0 <calloc>
40004718: 00050d13 mv s10,a0
if ( !mapping ) {
4000471c: 0a050e63 beqz a0,400047d8 <mmap+0x368> <== NEVER TAKEN
mapping->len = len;
40004720: 013d2623 sw s3,12(s10)
mapping->flags = flags;
40004724: 008d2823 sw s0,16(s10)
if ( map_fixed ) {
40004728: 140d8863 beqz s11,40004878 <mmap+0x408>
mapping->addr = addr;
4000472c: 014d2423 sw s4,8(s10)
iop = NULL;
40004730: 00000c93 li s9,0
rtems_libio_lock();
40004734: f38fc0ef jal ra,40000e6c <rtems_libio_lock>
return _Chain_Immutable_head( the_chain )->next;
40004738: 4001a5b7 lui a1,0x4001a
4000473c: fb058593 addi a1,a1,-80 # 40019fb0 <mmap_mappings>
40004740: 0005a883 lw a7,0(a1)
while ( !rtems_chain_is_tail( &mmap_mappings, node )) {
40004744: 00458693 addi a3,a1,4
40004748: 02d88063 beq a7,a3,40004768 <mmap+0x2f8>
if ( ( addr >= current_mapping->addr ) &&
4000474c: 0088a783 lw a5,8(a7)
40004750: 00fa6863 bltu s4,a5,40004760 <mmap+0x2f0>
( addr < ( current_mapping->addr + current_mapping->len )) ) {
40004754: 00c8a603 lw a2,12(a7)
40004758: 00c787b3 add a5,a5,a2
if ( ( addr >= current_mapping->addr ) &&
4000475c: 18fa6663 bltu s4,a5,400048e8 <mmap+0x478>
return the_node->next;
40004760: 0008a883 lw a7,0(a7)
while ( !rtems_chain_is_tail( &mmap_mappings, node )) {
40004764: fed894e3 bne a7,a3,4000474c <mmap+0x2dc>
if ( map_private ) {
40004768: 00812783 lw a5,8(sp)
4000476c: 0e078863 beqz a5,4000485c <mmap+0x3ec> <== NEVER TAKEN
if ( !map_anonymous ) {
40004770: 1a048063 beqz s1,40004910 <mmap+0x4a0>
} else if ( !map_fixed ) {
40004774: ea0d9ce3 bnez s11,4000462c <mmap+0x1bc>
memset( mapping->addr, 0, len );
40004778: 008d2503 lw a0,8(s10)
4000477c: 00098613 mv a2,s3
40004780: 00000593 li a1,0
40004784: 0080c0ef jal ra,4001078c <memset>
40004788: ea5ff06f j 4000462c <mmap+0x1bc>
if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_ANON)) != 0) {
4000478c: ec079ce3 bnez a5,40004664 <mmap+0x1f4> <== NEVER TAKEN
if ( map_fixed ) {
40004790: 00100793 li a5,1
40004794: 00f12423 sw a5,8(sp)
40004798: f60d88e3 beqz s11,40004708 <mmap+0x298>
4000479c: f5dff06f j 400046f8 <mmap+0x288>
mapping = malloc( sizeof( mmap_mapping ));
400047a0: 00100593 li a1,1
400047a4: 01800513 li a0,24
400047a8: 428040ef jal ra,40008bd0 <calloc>
400047ac: 00050d13 mv s10,a0
if ( !mapping ) {
400047b0: 02050463 beqz a0,400047d8 <mmap+0x368> <== NEVER TAKEN
mapping->len = len;
400047b4: 013d2623 sw s3,12(s10)
mapping->flags = flags;
400047b8: 008d2823 sw s0,16(s10)
err = posix_memalign( &mapping->addr, PAGE_SIZE, len );
400047bc: 00098613 mv a2,s3
400047c0: 000015b7 lui a1,0x1
400047c4: 008d0513 addi a0,s10,8
400047c8: 2a1040ef jal ra,40009268 <posix_memalign>
400047cc: 12050e63 beqz a0,40004908 <mmap+0x498> <== ALWAYS TAKEN
free( mapping );
400047d0: 000d0513 mv a0,s10 <== NOT EXECUTED
400047d4: 4a0040ef jal ra,40008c74 <free> <== NOT EXECUTED
errno = ENOMEM;
400047d8: 2250b0ef jal ra,400101fc <__errno> <== NOT EXECUTED
400047dc: 00c00793 li a5,12 <== NOT EXECUTED
400047e0: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return MAP_FAILED;
400047e4: fff00513 li a0,-1 <== NOT EXECUTED
400047e8: e8dff06f j 40004674 <mmap+0x204> <== NOT EXECUTED
errno = ENODEV;
400047ec: 2110b0ef jal ra,400101fc <__errno> <== NOT EXECUTED
400047f0: 01300793 li a5,19 <== NOT EXECUTED
400047f4: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return MAP_FAILED;
400047f8: fff00513 li a0,-1 <== NOT EXECUTED
400047fc: e79ff06f j 40004674 <mmap+0x204> <== NOT EXECUTED
40004800: 001a9c93 slli s9,s5,0x1
40004804: 015c8cb3 add s9,s9,s5
40004808: 4001c7b7 lui a5,0x4001c
4000480c: 004c9c93 slli s9,s9,0x4
40004810: b9878793 addi a5,a5,-1128 # 4001bb98 <rtems_libio_iops>
40004814: 00fc8cb3 add s9,s9,a5
if ( S_ISCHR( sb.st_mode ) && map_private ) {
40004818: 00812783 lw a5,8(sp)
4000481c: e40794e3 bnez a5,40004664 <mmap+0x1f4>
mapping = malloc( sizeof( mmap_mapping ));
40004820: 00100593 li a1,1
40004824: 01800513 li a0,24
40004828: 3a8040ef jal ra,40008bd0 <calloc>
4000482c: 00050d13 mv s10,a0
if ( !mapping ) {
40004830: fa0504e3 beqz a0,400047d8 <mmap+0x368> <== NEVER TAKEN
mapping->len = len;
40004834: 013d2623 sw s3,12(s10)
mapping->flags = flags;
40004838: 008d2823 sw s0,16(s10)
if ( map_fixed ) {
4000483c: 120d8063 beqz s11,4000495c <mmap+0x4ec> <== ALWAYS TAKEN
mapping->addr = addr;
40004840: 014d2423 sw s4,8(s10) <== NOT EXECUTED
40004844: e28fc0ef jal ra,40000e6c <rtems_libio_lock> <== NOT EXECUTED
return _Chain_Immutable_head( the_chain )->next;
40004848: 4001a5b7 lui a1,0x4001a <== NOT EXECUTED
4000484c: fb058593 addi a1,a1,-80 # 40019fb0 <mmap_mappings> <== NOT EXECUTED
40004850: 0005a883 lw a7,0(a1) <== NOT EXECUTED
while ( !rtems_chain_is_tail( &mmap_mappings, node )) {
40004854: 00458693 addi a3,a1,4 <== NOT EXECUTED
40004858: eed89ae3 bne a7,a3,4000474c <mmap+0x2dc> <== NOT EXECUTED
} else if ( map_shared ) {
4000485c: da0c14e3 bnez s8,40004604 <mmap+0x194> <== NOT EXECUTED
40004860: dddff06f j 4000463c <mmap+0x1cc> <== NOT EXECUTED
} else if ( !map_private ) {
40004864: e00680e3 beqz a3,40004664 <mmap+0x1f4>
40004868: f29ff06f j 40004790 <mmap+0x320>
if ( map_fixed ) {
4000486c: 000d8863 beqz s11,4000487c <mmap+0x40c> <== NOT EXECUTED
mapping->addr = addr;
40004870: 014d2423 sw s4,8(s10) <== NOT EXECUTED
if ( map_fixed && is_shared_shm ) {
40004874: ec1ff06f j 40004734 <mmap+0x2c4> <== NOT EXECUTED
iop = NULL;
40004878: 00000c93 li s9,0
is_shared_shm = false;
4000487c: 00000413 li s0,0
40004880: d69ff06f j 400045e8 <mmap+0x178>
if ( lseek( fildes, off, SEEK_SET ) < 0 ) {
40004884: 00000693 li a3,0 <== NOT EXECUTED
40004888: 000b8593 mv a1,s7 <== NOT EXECUTED
4000488c: 000b0613 mv a2,s6 <== NOT EXECUTED
40004890: 000a8513 mv a0,s5 <== NOT EXECUTED
40004894: 704040ef jal ra,40008f98 <lseek> <== NOT EXECUTED
return MAP_FAILED;
40004898: fff00513 li a0,-1 <== NOT EXECUTED
if ( lseek( fildes, off, SEEK_SET ) < 0 ) {
4000489c: dc05cce3 bltz a1,40004674 <mmap+0x204> <== NOT EXECUTED
if ( S_ISCHR( sb.st_mode ) && map_private ) {
400048a0: 02812783 lw a5,40(sp) <== NOT EXECUTED
400048a4: 0000f6b7 lui a3,0xf <== NOT EXECUTED
400048a8: 00f6f7b3 and a5,a3,a5 <== NOT EXECUTED
400048ac: cd1ff06f j 4000457c <mmap+0x10c> <== NOT EXECUTED
&& (( off >= sb.st_size ) || (( off + len ) >= sb.st_size ))) {
400048b0: 04412683 lw a3,68(sp) <== NOT EXECUTED
400048b4: 04012583 lw a1,64(sp) <== NOT EXECUTED
400048b8: 0cdb5263 bge s6,a3,4000497c <mmap+0x50c> <== NOT EXECUTED
400048bc: 01798633 add a2,s3,s7 <== NOT EXECUTED
400048c0: 013637b3 sltu a5,a2,s3 <== NOT EXECUTED
400048c4: 016787b3 add a5,a5,s6 <== NOT EXECUTED
400048c8: fad7cee3 blt a5,a3,40004884 <mmap+0x414> <== NOT EXECUTED
400048cc: 00f69463 bne a3,a5,400048d4 <mmap+0x464> <== NOT EXECUTED
400048d0: fab66ae3 bltu a2,a1,40004884 <mmap+0x414> <== NOT EXECUTED
errno = EOVERFLOW;
400048d4: 1290b0ef jal ra,400101fc <__errno> <== NOT EXECUTED
400048d8: 08b00793 li a5,139 <== NOT EXECUTED
400048dc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return MAP_FAILED;
400048e0: fff00513 li a0,-1 <== NOT EXECUTED
400048e4: d91ff06f j 40004674 <mmap+0x204> <== NOT EXECUTED
free( mapping );
400048e8: 000d0513 mv a0,s10 <== NOT EXECUTED
400048ec: 388040ef jal ra,40008c74 <free> <== NOT EXECUTED
rtems_libio_unlock();
400048f0: d88fc0ef jal ra,40000e78 <rtems_libio_unlock> <== NOT EXECUTED
errno = ENXIO;
400048f4: 1090b0ef jal ra,400101fc <__errno> <== NOT EXECUTED
400048f8: 00600793 li a5,6 <== NOT EXECUTED
400048fc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return MAP_FAILED;
40004900: fff00513 li a0,-1 <== NOT EXECUTED
40004904: d71ff06f j 40004674 <mmap+0x204> <== NOT EXECUTED
rtems_libio_lock();
40004908: d64fc0ef jal ra,40000e6c <rtems_libio_lock>
if ( map_private ) {
4000490c: e65ff06f j 40004770 <mmap+0x300>
r = read( fildes, mapping->addr, len );
40004910: 008d2583 lw a1,8(s10)
40004914: 00098613 mv a2,s3
40004918: 000a8513 mv a0,s5
4000491c: 225040ef jal ra,40009340 <read>
if ( r != len ) {
40004920: d13506e3 beq a0,s3,4000462c <mmap+0x1bc>
rtems_libio_unlock();
40004924: d54fc0ef jal ra,40000e78 <rtems_libio_unlock> <== NOT EXECUTED
if ( !map_fixed ) {
40004928: 060d8663 beqz s11,40004994 <mmap+0x524> <== NOT EXECUTED
free( mapping );
4000492c: 000d0513 mv a0,s10 <== NOT EXECUTED
40004930: 344040ef jal ra,40008c74 <free> <== NOT EXECUTED
errno = ENXIO;
40004934: 0c90b0ef jal ra,400101fc <__errno> <== NOT EXECUTED
40004938: 00600793 li a5,6 <== NOT EXECUTED
4000493c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return MAP_FAILED;
40004940: fff00513 li a0,-1 <== NOT EXECUTED
40004944: d31ff06f j 40004674 <mmap+0x204> <== NOT EXECUTED
errno = EBADF;
40004948: 0b50b0ef jal ra,400101fc <__errno> <== NOT EXECUTED
4000494c: 00900793 li a5,9 <== NOT EXECUTED
40004950: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return MAP_FAILED;
40004954: fff00513 li a0,-1 <== NOT EXECUTED
40004958: d1dff06f j 40004674 <mmap+0x204> <== NOT EXECUTED
rtems_libio_lock();
4000495c: d10fc0ef jal ra,40000e6c <rtems_libio_lock>
} else if ( map_shared ) {
40004960: ca0c12e3 bnez s8,40004604 <mmap+0x194> <== ALWAYS TAKEN
40004964: cc9ff06f j 4000462c <mmap+0x1bc> <== NOT EXECUTED
rtems_libio_unlock();
40004968: d10fc0ef jal ra,40000e78 <rtems_libio_unlock>
free( mapping );
4000496c: 000d0513 mv a0,s10
40004970: 304040ef jal ra,40008c74 <free>
return MAP_FAILED;
40004974: fff00513 li a0,-1
40004978: cfdff06f j 40004674 <mmap+0x204>
&& (( off >= sb.st_size ) || (( off + len ) >= sb.st_size ))) {
4000497c: f5669ce3 bne a3,s6,400048d4 <mmap+0x464> <== NOT EXECUTED
40004980: f2bbeee3 bltu s7,a1,400048bc <mmap+0x44c> <== NOT EXECUTED
40004984: f51ff06f j 400048d4 <mmap+0x464> <== NOT EXECUTED
if ( !S_ISCHR( sb.st_mode ) && sb.st_size < off + len ) {
40004988: 04012683 lw a3,64(sp)
4000498c: bcb6fee3 bgeu a3,a1,40004568 <mmap+0xf8>
40004990: fa5ff06f j 40004934 <mmap+0x4c4> <== NOT EXECUTED
free( mapping->addr );
40004994: 008d2503 lw a0,8(s10) <== NOT EXECUTED
40004998: 2dc040ef jal ra,40008c74 <free> <== NOT EXECUTED
4000499c: f91ff06f j 4000492c <mmap+0x4bc> <== NOT EXECUTED
400048a4 <mq_close>:
*/
int mq_close(
mqd_t mqdes
)
{
400048a4: fc010113 addi sp,sp,-64
400048a8: 02812c23 sw s0,56(sp)
400048ac: 02112e23 sw ra,60(sp)
400048b0: 00050413 mv s0,a0
*
* @see _Objects_Allocator_unlock() and _Objects_Allocate().
*/
RTEMS_INLINE_ROUTINE void _Objects_Allocator_lock( void )
{
_RTEMS_Lock_allocator();
400048b4: 158020ef jal ra,40006a0c <_RTEMS_Lock_allocator>
Objects_Id id,
Thread_queue_Context *queue_context
)
{
_Thread_queue_Context_initialize( queue_context );
return (POSIX_Message_queue_Control *) _Objects_Get(
400048b8: 40016637 lui a2,0x40016
400048bc: da860613 addi a2,a2,-600 # 40015da8 <_POSIX_Message_queue_Information>
400048c0: 00c10593 addi a1,sp,12
400048c4: 00040513 mv a0,s0
400048c8: 530030ef jal ra,40007df8 <_Objects_Get>
Thread_queue_Context queue_context;
_Objects_Allocator_lock();
the_mq = _POSIX_Message_queue_Get( mqdes, &queue_context );
if ( the_mq == NULL ) {
400048cc: 02050e63 beqz a0,40004908 <mq_close+0x64> <== NEVER TAKEN
_CORE_message_queue_Acquire_critical(
&the_mq->Message_queue,
&queue_context
);
if ( the_mq->open_count == 0 ) {
400048d0: 05452703 lw a4,84(a0)
400048d4: 02070663 beqz a4,40004900 <mq_close+0x5c>
_CORE_message_queue_Release( &the_mq->Message_queue, &queue_context );
_Objects_Allocator_unlock();
rtems_set_errno_and_return_minus_one( EBADF );
}
the_mq->open_count -= 1;
400048d8: fff70713 addi a4,a4,-1
400048dc: 04e52a23 sw a4,84(a0)
_POSIX_Message_queue_Delete( the_mq, &queue_context );
400048e0: 00c10593 addi a1,sp,12
400048e4: 03c000ef jal ra,40004920 <_POSIX_Message_queue_Delete>
* previous thread life protection state and thus may not return if the
* executing thread was restarted or deleted in the mean-time.
*/
RTEMS_INLINE_ROUTINE void _Objects_Allocator_unlock( void )
{
_RTEMS_Unlock_allocator();
400048e8: 130020ef jal ra,40006a18 <_RTEMS_Unlock_allocator>
_Objects_Allocator_unlock();
return 0;
400048ec: 00000513 li a0,0
}
400048f0: 03c12083 lw ra,60(sp)
400048f4: 03812403 lw s0,56(sp)
400048f8: 04010113 addi sp,sp,64
400048fc: 00008067 ret
40004900: 00c12783 lw a5,12(sp)
40004904: 3007a073 csrs mstatus,a5
40004908: 110020ef jal ra,40006a18 <_RTEMS_Unlock_allocator>
rtems_set_errno_and_return_minus_one( EBADF );
4000490c: 4510d0ef jal ra,4001255c <__errno>
40004910: 00900793 li a5,9
40004914: 00f52023 sw a5,0(a0)
40004918: fff00513 li a0,-1
4000491c: fd5ff06f j 400048f0 <mq_close+0x4c>
40008274 <mq_getattr>:
int mq_getattr(
mqd_t mqdes,
struct mq_attr *mqstat
)
{
40008274: fc010113 addi sp,sp,-64
40008278: 02112e23 sw ra,60(sp)
4000827c: 02812c23 sw s0,56(sp)
POSIX_Message_queue_Control *the_mq;
Thread_queue_Context queue_context;
if ( mqstat == NULL ) {
40008280: 06058e63 beqz a1,400082fc <mq_getattr+0x88>
40008284: 40026637 lui a2,0x40026
40008288: 00058413 mv s0,a1
4000828c: fb460613 addi a2,a2,-76 # 40025fb4 <_POSIX_Message_queue_Information>
40008290: 00c10593 addi a1,sp,12
40008294: 338020ef jal ra,4000a5cc <_Objects_Get>
rtems_set_errno_and_return_minus_one( EINVAL );
}
the_mq = _POSIX_Message_queue_Get( mqdes, &queue_context );
if ( the_mq == NULL ) {
40008298: 04050863 beqz a0,400082e8 <mq_getattr+0x74> <== NEVER TAKEN
_CORE_message_queue_Acquire_critical(
&the_mq->Message_queue,
&queue_context
);
if ( the_mq->open_count == 0 ) {
4000829c: 05452783 lw a5,84(a0)
400082a0: 04078063 beqz a5,400082e0 <mq_getattr+0x6c>
}
/*
* Return the old values.
*/
mqstat->mq_flags = the_mq->oflag;
400082a4: 06c52603 lw a2,108(a0)
mqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size;
400082a8: 02852683 lw a3,40(a0)
mqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages;
400082ac: 02052703 lw a4,32(a0)
mqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages;
400082b0: 02452783 lw a5,36(a0)
mqstat->mq_flags = the_mq->oflag;
400082b4: 00c42023 sw a2,0(s0)
mqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size;
400082b8: 00d42423 sw a3,8(s0)
mqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages;
400082bc: 00e42223 sw a4,4(s0)
mqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages;
400082c0: 00f42623 sw a5,12(s0)
400082c4: 00c12783 lw a5,12(sp)
400082c8: 3007a073 csrs mstatus,a5
_CORE_message_queue_Release( &the_mq->Message_queue, &queue_context );
return 0;
400082cc: 00000513 li a0,0
}
400082d0: 03c12083 lw ra,60(sp)
400082d4: 03812403 lw s0,56(sp)
400082d8: 04010113 addi sp,sp,64
400082dc: 00008067 ret
400082e0: 00c12783 lw a5,12(sp)
400082e4: 3007a073 csrs mstatus,a5
rtems_set_errno_and_return_minus_one( EBADF );
400082e8: 0350d0ef jal ra,40015b1c <__errno>
400082ec: 00900793 li a5,9
400082f0: 00f52023 sw a5,0(a0)
400082f4: fff00513 li a0,-1
400082f8: fd9ff06f j 400082d0 <mq_getattr+0x5c>
rtems_set_errno_and_return_minus_one( EINVAL );
400082fc: 0210d0ef jal ra,40015b1c <__errno>
40008300: 01600793 li a5,22
40008304: 00f52023 sw a5,0(a0)
40008308: fff00513 li a0,-1
4000830c: fc5ff06f j 400082d0 <mq_getattr+0x5c>
4000e2d8 <mq_notify>:
int mq_notify(
mqd_t mqdes,
const struct sigevent *notification
)
{
4000e2d8: fc010113 addi sp,sp,-64
return (POSIX_Message_queue_Control *) _Objects_Get(
4000e2dc: 40026637 lui a2,0x40026
4000e2e0: 02812c23 sw s0,56(sp)
4000e2e4: fb460613 addi a2,a2,-76 # 40025fb4 <_POSIX_Message_queue_Information>
4000e2e8: 00058413 mv s0,a1
4000e2ec: 00c10593 addi a1,sp,12
4000e2f0: 02112e23 sw ra,60(sp)
4000e2f4: ad8fc0ef jal ra,4000a5cc <_Objects_Get>
POSIX_Message_queue_Control *the_mq;
Thread_queue_Context queue_context;
the_mq = _POSIX_Message_queue_Get( mqdes, &queue_context );
if ( the_mq == NULL ) {
4000e2f8: 08050a63 beqz a0,4000e38c <mq_notify+0xb4> <== NEVER TAKEN
_CORE_message_queue_Acquire_critical(
&the_mq->Message_queue,
&queue_context
);
if ( the_mq->open_count == 0 ) {
4000e2fc: 05452783 lw a5,84(a0)
4000e300: 08078263 beqz a5,4000e384 <mq_notify+0xac>
_CORE_message_queue_Release( &the_mq->Message_queue, &queue_context );
rtems_set_errno_and_return_minus_one( EBADF );
}
if ( notification != NULL ) {
4000e304: 04040e63 beqz s0,4000e360 <mq_notify+0x88>
if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) {
4000e308: 04052783 lw a5,64(a0)
4000e30c: 04079e63 bnez a5,4000e368 <mq_notify+0x90>
_CORE_message_queue_Release( &the_mq->Message_queue, &queue_context );
rtems_set_errno_and_return_minus_one( EBUSY );
}
the_mq->notification = *notification;
4000e310: 01042783 lw a5,16(s0)
4000e314: 00042583 lw a1,0(s0)
4000e318: 00442603 lw a2,4(s0)
4000e31c: 00842683 lw a3,8(s0)
4000e320: 00c42703 lw a4,12(s0)
4000e324: 06f52423 sw a5,104(a0)
4000e328: 4000e7b7 lui a5,0x4000e
4000e32c: 2a478793 addi a5,a5,676 # 4000e2a4 <_POSIX_Message_queue_Notify_handler>
4000e330: 04b52c23 sw a1,88(a0)
4000e334: 04c52e23 sw a2,92(a0)
4000e338: 06d52023 sw a3,96(a0)
4000e33c: 06e52223 sw a4,100(a0)
4000e340: 04f52023 sw a5,64(a0)
4000e344: 00c12783 lw a5,12(sp)
4000e348: 3007a073 csrs mstatus,a5
} else {
_CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL );
}
_CORE_message_queue_Release( &the_mq->Message_queue, &queue_context );
return 0;
4000e34c: 00000513 li a0,0
}
4000e350: 03c12083 lw ra,60(sp)
4000e354: 03812403 lw s0,56(sp)
4000e358: 04010113 addi sp,sp,64
4000e35c: 00008067 ret
4000e360: 04052023 sw zero,64(a0)
}
4000e364: fe1ff06f j 4000e344 <mq_notify+0x6c>
4000e368: 00c12783 lw a5,12(sp)
4000e36c: 3007a073 csrs mstatus,a5
rtems_set_errno_and_return_minus_one( EBUSY );
4000e370: 7ac070ef jal ra,40015b1c <__errno>
4000e374: 01000793 li a5,16
4000e378: 00f52023 sw a5,0(a0)
4000e37c: fff00513 li a0,-1
4000e380: fd1ff06f j 4000e350 <mq_notify+0x78>
4000e384: 00c12783 lw a5,12(sp)
4000e388: 3007a073 csrs mstatus,a5
rtems_set_errno_and_return_minus_one( EBADF );
4000e38c: 790070ef jal ra,40015b1c <__errno>
4000e390: 00900793 li a5,9
4000e394: 00f52023 sw a5,0(a0)
4000e398: fff00513 li a0,-1
4000e39c: fb5ff06f j 4000e350 <mq_notify+0x78>
400087c4 <mq_setattr>:
int mq_setattr(
mqd_t mqdes,
const struct mq_attr *__restrict mqstat,
struct mq_attr *__restrict omqstat
)
{
400087c4: fc010113 addi sp,sp,-64
400087c8: 02112e23 sw ra,60(sp)
400087cc: 02812c23 sw s0,56(sp)
400087d0: 02912a23 sw s1,52(sp)
POSIX_Message_queue_Control *the_mq;
Thread_queue_Context queue_context;
if ( mqstat == NULL ) {
400087d4: 08058863 beqz a1,40008864 <mq_setattr+0xa0>
400087d8: 00060413 mv s0,a2
400087dc: 40026637 lui a2,0x40026
400087e0: 00058493 mv s1,a1
400087e4: fb460613 addi a2,a2,-76 # 40025fb4 <_POSIX_Message_queue_Information>
400087e8: 00c10593 addi a1,sp,12
400087ec: 5e1010ef jal ra,4000a5cc <_Objects_Get>
rtems_set_errno_and_return_minus_one( EINVAL );
}
the_mq = _POSIX_Message_queue_Get( mqdes, &queue_context );
if ( the_mq == NULL ) {
400087f0: 06050063 beqz a0,40008850 <mq_setattr+0x8c> <== NEVER TAKEN
_CORE_message_queue_Acquire_critical(
&the_mq->Message_queue,
&queue_context
);
if ( the_mq->open_count == 0 ) {
400087f4: 05452783 lw a5,84(a0)
400087f8: 04078863 beqz a5,40008848 <mq_setattr+0x84>
/*
* Return the old values.
*/
if ( omqstat != NULL ) {
400087fc: 02040263 beqz s0,40008820 <mq_setattr+0x5c>
omqstat->mq_flags = the_mq->oflag;
40008800: 06c52603 lw a2,108(a0)
omqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size;
40008804: 02852683 lw a3,40(a0)
omqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages;
40008808: 02052703 lw a4,32(a0)
omqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages;
4000880c: 02452783 lw a5,36(a0)
omqstat->mq_flags = the_mq->oflag;
40008810: 00c42023 sw a2,0(s0)
omqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size;
40008814: 00d42423 sw a3,8(s0)
omqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages;
40008818: 00e42223 sw a4,4(s0)
omqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages;
4000881c: 00f42623 sw a5,12(s0)
}
the_mq->oflag = mqstat->mq_flags;
40008820: 0004a783 lw a5,0(s1)
40008824: 06f52623 sw a5,108(a0)
40008828: 00c12783 lw a5,12(sp)
4000882c: 3007a073 csrs mstatus,a5
_CORE_message_queue_Release( &the_mq->Message_queue, &queue_context );
return 0;
40008830: 00000513 li a0,0
}
40008834: 03c12083 lw ra,60(sp)
40008838: 03812403 lw s0,56(sp)
4000883c: 03412483 lw s1,52(sp)
40008840: 04010113 addi sp,sp,64
40008844: 00008067 ret
40008848: 00c12783 lw a5,12(sp)
4000884c: 3007a073 csrs mstatus,a5
rtems_set_errno_and_return_minus_one( EBADF );
40008850: 2cc0d0ef jal ra,40015b1c <__errno>
40008854: 00900793 li a5,9
40008858: 00f52023 sw a5,0(a0)
4000885c: fff00513 li a0,-1
40008860: fd5ff06f j 40008834 <mq_setattr+0x70>
rtems_set_errno_and_return_minus_one( EINVAL );
40008864: 2b80d0ef jal ra,40015b1c <__errno>
40008868: 01600793 li a5,22
4000886c: 00f52023 sw a5,0(a0)
40008870: fff00513 li a0,-1
40008874: fc1ff06f j 40008834 <mq_setattr+0x70>
400049a0 <munmap>:
#include <rtems/posix/mmanimpl.h>
#include <rtems/posix/shmimpl.h>
int munmap(void *addr, size_t len)
{
400049a0: fe010113 addi sp,sp,-32
400049a4: 00812c23 sw s0,24(sp)
400049a8: 00912a23 sw s1,20(sp)
400049ac: 00112e23 sw ra,28(sp)
400049b0: 01212823 sw s2,16(sp)
400049b4: 00050493 mv s1,a0
400049b8: 00058413 mv s0,a1
rtems_chain_node *node;
/*
* Clear errno.
*/
errno = 0;
400049bc: 0410b0ef jal ra,400101fc <__errno>
400049c0: 00052023 sw zero,0(a0)
/*
* Length cannot be 0.
*/
if ( len == 0 ) {
400049c4: 0e040c63 beqz s0,40004abc <munmap+0x11c> <== NEVER TAKEN
errno = EINVAL;
return -1;
}
/* Check for illegal addresses. Watch out for address wrap. */
if (addr + len < addr) {
400049c8: 0e044a63 bltz s0,40004abc <munmap+0x11c> <== NEVER TAKEN
rtems_libio_lock();
400049cc: ca0fc0ef jal ra,40000e6c <rtems_libio_lock>
400049d0: 4001a7b7 lui a5,0x4001a
400049d4: fb07a403 lw s0,-80(a5) # 40019fb0 <mmap_mappings>
}
mmap_mappings_lock_obtain();
node = rtems_chain_first (&mmap_mappings);
while ( !rtems_chain_is_tail( &mmap_mappings, node )) {
400049d8: 4001a737 lui a4,0x4001a
400049dc: fb470713 addi a4,a4,-76 # 40019fb4 <mmap_mappings+0x4>
400049e0: 02e40063 beq s0,a4,40004a00 <munmap+0x60>
mapping = (mmap_mapping*) node;
if ( ( addr >= mapping->addr ) &&
400049e4: 00842783 lw a5,8(s0)
400049e8: 00f4e863 bltu s1,a5,400049f8 <munmap+0x58>
( addr < ( mapping->addr + mapping->len )) ) {
400049ec: 00c42683 lw a3,12(s0)
400049f0: 00d787b3 add a5,a5,a3
if ( ( addr >= mapping->addr ) &&
400049f4: 02f4e663 bltu s1,a5,40004a20 <munmap+0x80>
return the_node->next;
400049f8: 00042403 lw s0,0(s0)
while ( !rtems_chain_is_tail( &mmap_mappings, node )) {
400049fc: fee414e3 bne s0,a4,400049e4 <munmap+0x44>
rtems_libio_unlock();
40004a00: c78fc0ef jal ra,40000e78 <rtems_libio_unlock>
}
node = rtems_chain_next( node );
}
mmap_mappings_lock_release( );
return 0;
40004a04: 00000513 li a0,0
}
40004a08: 01c12083 lw ra,28(sp)
40004a0c: 01812403 lw s0,24(sp)
40004a10: 01412483 lw s1,20(sp)
40004a14: 01012903 lw s2,16(sp)
40004a18: 02010113 addi sp,sp,32
40004a1c: 00008067 ret
next = the_node->next;
40004a20: 00042703 lw a4,0(s0)
previous = the_node->previous;
40004a24: 00442783 lw a5,4(s0)
if ( mapping->shm != NULL ) {
40004a28: 01442483 lw s1,20(s0)
next->previous = previous;
40004a2c: 00f72223 sw a5,4(a4)
previous->next = next;
40004a30: 00e7a023 sw a4,0(a5)
40004a34: 04048663 beqz s1,40004a80 <munmap+0xe0>
*
* @see _Objects_Allocator_unlock() and _Objects_Allocate().
*/
RTEMS_INLINE_ROUTINE void _Objects_Allocator_lock( void )
{
_RTEMS_Lock_allocator();
40004a38: 305000ef jal ra,4000553c <_RTEMS_Lock_allocator>
int err;
err = 0;
_Objects_Allocator_lock();
--shm->reference_count;
40004a3c: 01c4a783 lw a5,28(s1) # 101c <_ISR_Stack_size+0x1c>
40004a40: fff78793 addi a5,a5,-1
40004a44: 00f4ae23 sw a5,28(s1)
if ( shm->reference_count == 0 ) {
40004a48: 00079a63 bnez a5,40004a5c <munmap+0xbc> <== ALWAYS TAKEN
if ( (*shm->shm_object.ops->object_delete)( &shm->shm_object ) != 0 ) {
40004a4c: 0284a783 lw a5,40(s1) <== NOT EXECUTED
40004a50: 02048513 addi a0,s1,32 <== NOT EXECUTED
40004a54: 0087a783 lw a5,8(a5) <== NOT EXECUTED
40004a58: 000780e7 jalr a5 <== NOT EXECUTED
err = EIO;
}
}
/* check if the object has been unlinked yet. */
obj = _Objects_Get( shm->Object.id, &lock_ctx, &_POSIX_Shm_Information );
40004a5c: 0084a503 lw a0,8(s1)
40004a60: 4001a937 lui s2,0x4001a
40004a64: de890613 addi a2,s2,-536 # 40019de8 <_POSIX_Shm_Information>
40004a68: 00c10593 addi a1,sp,12
40004a6c: 3b4010ef jal ra,40005e20 <_Objects_Get>
if ( obj == NULL ) {
40004a70: 02050a63 beqz a0,40004aa4 <munmap+0x104> <== NEVER TAKEN
40004a74: 00c12783 lw a5,12(sp)
40004a78: 3007a073 csrs mstatus,a5
* previous thread life protection state and thus may not return if the
* executing thread was restarted or deleted in the mean-time.
*/
RTEMS_INLINE_ROUTINE void _Objects_Allocator_unlock( void )
{
_RTEMS_Unlock_allocator();
40004a7c: 2cd000ef jal ra,40005548 <_RTEMS_Unlock_allocator>
if (( mapping->flags & MAP_SHARED ) != MAP_SHARED ) {
40004a80: 01042783 lw a5,16(s0)
40004a84: 0117f793 andi a5,a5,17
40004a88: 00078863 beqz a5,40004a98 <munmap+0xf8>
free( mapping );
40004a8c: 00040513 mv a0,s0
40004a90: 1e4040ef jal ra,40008c74 <free>
break;
40004a94: f6dff06f j 40004a00 <munmap+0x60>
free( mapping->addr );
40004a98: 00842503 lw a0,8(s0)
40004a9c: 1d8040ef jal ra,40008c74 <free>
40004aa0: fedff06f j 40004a8c <munmap+0xec>
Objects_Control *the_object
)
{
_Assert( _Objects_Allocator_is_owner() );
_Assert( information->deallocate != NULL );
( *information->deallocate )( information, the_object );
40004aa4: de890793 addi a5,s2,-536 <== NOT EXECUTED
40004aa8: 00c7a783 lw a5,12(a5) <== NOT EXECUTED
40004aac: 00048593 mv a1,s1 <== NOT EXECUTED
40004ab0: de890513 addi a0,s2,-536 <== NOT EXECUTED
40004ab4: 000780e7 jalr a5 <== NOT EXECUTED
}
40004ab8: fc5ff06f j 40004a7c <munmap+0xdc> <== NOT EXECUTED
errno = EINVAL;
40004abc: 7400b0ef jal ra,400101fc <__errno> <== NOT EXECUTED
40004ac0: 01600793 li a5,22 <== NOT EXECUTED
40004ac4: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return -1;
40004ac8: fff00513 li a0,-1 <== NOT EXECUTED
40004acc: f3dff06f j 40004a08 <munmap+0x68> <== NOT EXECUTED
40003b58 <pthread_attr_getaffinity_np>:
int pthread_attr_getaffinity_np(
const pthread_attr_t *attr,
size_t cpusetsize,
cpu_set_t *cpuset
)
{
40003b58: 00050793 mv a5,a0
if ( attr == NULL || !attr->is_initialized ) {
40003b5c: 02050863 beqz a0,40003b8c <pthread_attr_getaffinity_np+0x34> <== NEVER TAKEN
40003b60: 00052703 lw a4,0(a0)
return EINVAL;
40003b64: 01600513 li a0,22
if ( attr == NULL || !attr->is_initialized ) {
40003b68: 02070463 beqz a4,40003b90 <pthread_attr_getaffinity_np+0x38> <== NEVER TAKEN
}
if ( cpuset == NULL || cpusetsize != attr->affinitysetsize ) {
40003b6c: 02060263 beqz a2,40003b90 <pthread_attr_getaffinity_np+0x38> <== NEVER TAKEN
40003b70: 0547a703 lw a4,84(a5)
40003b74: 00b71e63 bne a4,a1,40003b90 <pthread_attr_getaffinity_np+0x38>
return CPU_ISSET_S(cpu, sizeof(*set), set);
}
static __inline void CPU_COPY(const cpu_set_t *src, cpu_set_t *dest)
{
BIT_COPY(_cpu_set_bits(setsize), src, dest);
40003b78: 0587a783 lw a5,88(a5)
return EINVAL;
}
CPU_COPY( attr->affinityset, cpuset );
return 0;
40003b7c: 00000513 li a0,0
40003b80: 0007a783 lw a5,0(a5)
40003b84: 00f62023 sw a5,0(a2)
40003b88: 00008067 ret
return EINVAL;
40003b8c: 01600513 li a0,22 <== NOT EXECUTED
}
40003b90: 00008067 ret <== NOT EXECUTED
40003d2c <pthread_attr_setaffinity_np>:
int pthread_attr_setaffinity_np(
pthread_attr_t *attr,
size_t cpusetsize,
const cpu_set_t *cpuset
)
{
40003d2c: 00050793 mv a5,a0
if ( attr == NULL || !attr->is_initialized ) {
40003d30: 02050863 beqz a0,40003d60 <pthread_attr_setaffinity_np+0x34> <== NEVER TAKEN
40003d34: 00052703 lw a4,0(a0)
return EINVAL;
40003d38: 01600513 li a0,22
if ( attr == NULL || !attr->is_initialized ) {
40003d3c: 02070463 beqz a4,40003d64 <pthread_attr_setaffinity_np+0x38> <== NEVER TAKEN
}
if ( cpuset == NULL || cpusetsize != attr->affinitysetsize ) {
40003d40: 02060263 beqz a2,40003d64 <pthread_attr_setaffinity_np+0x38> <== NEVER TAKEN
40003d44: 0547a703 lw a4,84(a5)
40003d48: 00b71e63 bne a4,a1,40003d64 <pthread_attr_setaffinity_np+0x38>
40003d4c: 0587a783 lw a5,88(a5)
40003d50: 00062703 lw a4,0(a2)
return EINVAL;
}
CPU_COPY( cpuset, attr->affinityset );
return 0;
40003d54: 00000513 li a0,0
40003d58: 00e7a023 sw a4,0(a5)
40003d5c: 00008067 ret
return EINVAL;
40003d60: 01600513 li a0,22 <== NOT EXECUTED
}
40003d64: 00008067 ret <== NOT EXECUTED
40004314 <pthread_cancel>:
/*
* 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181
*/
int pthread_cancel( pthread_t thread )
{
40004314: fe010113 addi sp,sp,-32
40004318: 00812c23 sw s0,24(sp)
4000431c: 00112e23 sw ra,28(sp)
40004320: 00050413 mv s0,a0
/*
* Don't even think about deleting a resource from an ISR.
*/
if ( _ISR_Is_in_progress() ) {
40004324: 25c010ef jal ra,40005580 <_ISR_Is_in_progress>
40004328: 04051e63 bnez a0,40004384 <pthread_cancel+0x70>
return EPROTO;
}
the_thread = _Thread_Get( thread, &lock_context );
4000432c: 00c10593 addi a1,sp,12
40004330: 00040513 mv a0,s0
40004334: 745020ef jal ra,40007278 <_Thread_Get>
if ( the_thread == NULL ) {
40004338: 06050663 beqz a0,400043a4 <pthread_cancel+0x90>
const ISR_lock_Context *lock_context
)
{
uint32_t disable_level;
disable_level = cpu_self->thread_dispatch_disable_level;
4000433c: 40017437 lui s0,0x40017
40004340: 30040713 addi a4,s0,768 # 40017300 <_Per_CPU_Information>
40004344: 03072683 lw a3,48(a4)
_Profiling_Thread_dispatch_disable_critical(
cpu_self,
disable_level,
lock_context
);
cpu_self->thread_dispatch_disable_level = disable_level + 1;
40004348: 00168693 addi a3,a3,1 # 4001 <bsp_section_rodata_size+0x18f9>
4000434c: 02d72823 sw a3,48(a4)
40004350: 00c12683 lw a3,12(sp)
40004354: 3006a073 csrs mstatus,a3
static inline struct _Thread_Control *_Per_CPU_Get_executing(
const Per_CPU_Control *cpu
)
{
return cpu->executing;
40004358: 03872583 lw a1,56(a4)
_ISR_lock_ISR_enable( &lock_context );
executing = _Per_CPU_Get_executing( cpu_self );
if ( the_thread == executing ) {
_Thread_Exit( executing, THREAD_LIFE_TERMINATING, PTHREAD_CANCELED );
4000435c: fff00613 li a2,-1
if ( the_thread == executing ) {
40004360: 02b50c63 beq a0,a1,40004398 <pthread_cancel+0x84>
} else {
_Thread_Cancel( the_thread, executing, PTHREAD_CANCELED );
40004364: 6f8040ef jal ra,40008a5c <_Thread_Cancel>
}
_Thread_Dispatch_enable( cpu_self );
40004368: 30040513 addi a0,s0,768
4000436c: 69d020ef jal ra,40007208 <_Thread_Dispatch_enable>
return 0;
40004370: 00000513 li a0,0
}
40004374: 01c12083 lw ra,28(sp)
40004378: 01812403 lw s0,24(sp)
4000437c: 02010113 addi sp,sp,32
40004380: 00008067 ret
40004384: 01c12083 lw ra,28(sp)
40004388: 01812403 lw s0,24(sp)
return EPROTO;
4000438c: 04700513 li a0,71
}
40004390: 02010113 addi sp,sp,32
40004394: 00008067 ret
_Thread_Exit( executing, THREAD_LIFE_TERMINATING, PTHREAD_CANCELED );
40004398: 00400593 li a1,4 <== NOT EXECUTED
4000439c: 08d040ef jal ra,40008c28 <_Thread_Exit> <== NOT EXECUTED
400043a0: fc9ff06f j 40004368 <pthread_cancel+0x54> <== NOT EXECUTED
return ESRCH;
400043a4: 00300513 li a0,3
400043a8: fcdff06f j 40004374 <pthread_cancel+0x60>
40004644 <pthread_cond_init>:
*/
int pthread_cond_init(
pthread_cond_t *cond,
const pthread_condattr_t *attr
)
{
40004644: 00050793 mv a5,a0
POSIX_Condition_variables_Control *the_cond;
the_cond = _POSIX_Condition_variables_Get( cond );
if ( the_cond == NULL ) {
40004648: 04050c63 beqz a0,400046a0 <pthread_cond_init+0x5c>
return EINVAL;
}
if ( attr == NULL ) {
4000464c: 04058e63 beqz a1,400046a8 <pthread_cond_init+0x64>
attr = &_POSIX_Condition_variables_Default_attributes;
}
if ( !attr->is_initialized ) {
40004650: 0005a703 lw a4,0(a1)
return EINVAL;
40004654: 01600513 li a0,22
if ( !attr->is_initialized ) {
40004658: 04070663 beqz a4,400046a4 <pthread_cond_init+0x60>
return EINVAL;
}
if ( !_POSIX_Is_valid_pshared( attr->process_shared ) ) {
4000465c: 0105a683 lw a3,16(a1)
40004660: 00100713 li a4,1
40004664: 04d76063 bltu a4,a3,400046a4 <pthread_cond_init+0x60>
if ( the_attr->clock == CLOCK_MONOTONIC ) {
40004668: 0085a603 lw a2,8(a1)
flags = (uintptr_t) the_cond ^ POSIX_CONDITION_VARIABLES_MAGIC;
4000466c: 18dfb737 lui a4,0x18dfb
40004670: 1fe70713 addi a4,a4,510 # 18dfb1fe <RamSize+0x17dfb1fe>
40004674: 00e7c733 xor a4,a5,a4
)
{
#if defined(RTEMS_SMP)
_SMP_ticket_lock_Initialize( &queue->Lock );
#endif
queue->heads = NULL;
40004678: 0007a623 sw zero,12(a5)
queue->owner = NULL;
4000467c: 0007a823 sw zero,16(a5)
queue->name = name;
40004680: 0007aa23 sw zero,20(a5)
the_cond->mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
40004684: 0007ac23 sw zero,24(a5)
if ( the_attr->clock == CLOCK_MONOTONIC ) {
40004688: 00400693 li a3,4
flags &= ~POSIX_CONDITION_VARIABLES_FLAGS_MASK;
4000468c: ffe77713 andi a4,a4,-2
if ( the_attr->clock == CLOCK_MONOTONIC ) {
40004690: 02d60263 beq a2,a3,400046b4 <pthread_cond_init+0x70>
the_cond->flags = flags;
40004694: 00e7a023 sw a4,0(a5)
return EINVAL;
}
_POSIX_Condition_variables_Initialize( the_cond, attr );
return 0;
40004698: 00000513 li a0,0
4000469c: 00008067 ret
return EINVAL;
400046a0: 01600513 li a0,22
}
400046a4: 00008067 ret
attr = &_POSIX_Condition_variables_Default_attributes;
400046a8: 400125b7 lui a1,0x40012
400046ac: 54858593 addi a1,a1,1352 # 40012548 <_POSIX_Condition_variables_Default_attributes>
400046b0: fa1ff06f j 40004650 <pthread_cond_init+0xc>
if ( the_attr->clock == CLOCK_MONOTONIC ) {
400046b4: 00c5a683 lw a3,12(a1) <== NOT EXECUTED
400046b8: fc069ee3 bnez a3,40004694 <pthread_cond_init+0x50> <== NOT EXECUTED
flags |= POSIX_CONDITION_VARIABLES_CLOCK_MONOTONIC;
400046bc: 00176713 ori a4,a4,1 <== NOT EXECUTED
the_cond->flags = flags;
400046c0: 00e7a023 sw a4,0(a5) <== NOT EXECUTED
return 0;
400046c4: 00000513 li a0,0 <== NOT EXECUTED
400046c8: 00008067 ret <== NOT EXECUTED
400044e8 <pthread_condattr_destroy>:
*/
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
400044e8: 00050793 mv a5,a0
if ( attr == NULL || !attr->is_initialized )
400044ec: 00050e63 beqz a0,40004508 <pthread_condattr_destroy+0x20>
400044f0: 00052703 lw a4,0(a0)
return EINVAL;
400044f4: 01600513 li a0,22
if ( attr == NULL || !attr->is_initialized )
400044f8: 00070a63 beqz a4,4000450c <pthread_condattr_destroy+0x24> <== NEVER TAKEN
attr->is_initialized = false;
400044fc: 0007a023 sw zero,0(a5) # f000 <bsp_section_bss_size+0xc1b4>
return 0;
40004500: 00000513 li a0,0
40004504: 00008067 ret
return EINVAL;
40004508: 01600513 li a0,22
}
4000450c: 00008067 ret
400037a4 <pthread_condattr_getclock>:
int pthread_condattr_getclock(
const pthread_condattr_t *__restrict attr,
clockid_t *__restrict clock
)
{
if ( attr == NULL ) {
400037a4: 00050c63 beqz a0,400037bc <pthread_condattr_getclock+0x18>
return EINVAL;
}
if ( clock == NULL ) {
400037a8: 00058a63 beqz a1,400037bc <pthread_condattr_getclock+0x18> <== ALWAYS TAKEN
return EINVAL;
}
*clock = attr->clock;
400037ac: 00852783 lw a5,8(a0) <== NOT EXECUTED
return 0;
400037b0: 00000513 li a0,0 <== NOT EXECUTED
*clock = attr->clock;
400037b4: 00f5a023 sw a5,0(a1) <== NOT EXECUTED
return 0;
400037b8: 00008067 ret <== NOT EXECUTED
return EINVAL;
400037bc: 01600513 li a0,22
}
400037c0: 00008067 ret
40006c30 <pthread_create>:
Thread_Entry_information entry = {
40006c30: 4000a7b7 lui a5,0x4000a
{
40006c34: f5010113 addi sp,sp,-176
Thread_Entry_information entry = {
40006c38: 85478793 addi a5,a5,-1964 # 40009854 <_Thread_Entry_adaptor_pointer>
40006c3c: 00f12a23 sw a5,20(sp)
int schedpolicy = SCHED_RR;
40006c40: 00200793 li a5,2
{
40006c44: 0a112623 sw ra,172(sp)
40006c48: 0a812423 sw s0,168(sp)
40006c4c: 0a912223 sw s1,164(sp)
40006c50: 0b212023 sw s2,160(sp)
40006c54: 09312e23 sw s3,156(sp)
40006c58: 09412c23 sw s4,152(sp)
40006c5c: 09512a23 sw s5,148(sp)
40006c60: 09612823 sw s6,144(sp)
40006c64: 09712623 sw s7,140(sp)
Thread_Entry_information entry = {
40006c68: 00c12c23 sw a2,24(sp)
40006c6c: 00d12e23 sw a3,28(sp)
int schedpolicy = SCHED_RR;
40006c70: 00f12623 sw a5,12(sp)
if ( !start_routine )
40006c74: 32060663 beqz a2,40006fa0 <pthread_create+0x370>
40006c78: 00050913 mv s2,a0
40006c7c: 00058413 mv s0,a1
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
40006c80: 2c058c63 beqz a1,40006f58 <pthread_create+0x328>
if ( !the_attr->is_initialized )
40006c84: 00042783 lw a5,0(s0)
40006c88: 28078e63 beqz a5,40006f24 <pthread_create+0x2f4>
if ( the_attr->stackaddr != NULL ) {
40006c8c: 00442783 lw a5,4(s0)
memset( &config, 0, sizeof( config ) );
40006c90: 04012423 sw zero,72(sp)
config.is_fp = true;
40006c94: 10100713 li a4,257
memset( &config, 0, sizeof( config ) );
40006c98: 02012023 sw zero,32(sp)
config.is_fp = true;
40006c9c: 04e11423 sh a4,72(sp)
memset( &config, 0, sizeof( config ) );
40006ca0: 02012223 sw zero,36(sp)
40006ca4: 02012423 sw zero,40(sp)
40006ca8: 02012623 sw zero,44(sp)
40006cac: 02012823 sw zero,48(sp)
40006cb0: 02012a23 sw zero,52(sp)
40006cb4: 02012c23 sw zero,56(sp)
40006cb8: 02012e23 sw zero,60(sp)
40006cbc: 04012023 sw zero,64(sp)
40006cc0: 04012223 sw zero,68(sp)
40006cc4: 04012623 sw zero,76(sp)
if ( !_Stack_Is_enough( the_attr->stacksize, config.is_fp ) ) {
40006cc8: 00842483 lw s1,8(s0)
if ( the_attr->stackaddr != NULL ) {
40006ccc: 28078c63 beqz a5,40006f64 <pthread_create+0x334>
bool is_fp
)
{
size_t minimum;
minimum = _TLS_Get_allocation_size();
40006cd0: 02d040ef jal ra,4000b4fc <_TLS_Get_allocation_size>
minimum += _Stack_Minimum();
40006cd4: a481a783 lw a5,-1464(gp) # 400b2a90 <rtems_minimum_stack_size>
40006cd8: 00f50533 add a0,a0,a5
if ( !_Stack_Is_enough( the_attr->stacksize, config.is_fp ) ) {
40006cdc: 24a4e463 bltu s1,a0,40006f24 <pthread_create+0x2f4>
config.stack_size = the_attr->stacksize;
40006ce0: 00842783 lw a5,8(s0)
config.stack_area = the_attr->stackaddr;
40006ce4: 00442703 lw a4,4(s0)
config.stack_size = the_attr->stacksize;
40006ce8: 02f12423 sw a5,40(sp)
switch ( the_attr->inheritsched ) {
40006cec: 01042783 lw a5,16(s0)
config.stack_area = the_attr->stackaddr;
40006cf0: 02e12223 sw a4,36(sp)
switch ( the_attr->inheritsched ) {
40006cf4: 00100713 li a4,1
40006cf8: 28e78a63 beq a5,a4,40006f8c <pthread_create+0x35c>
40006cfc: 00200713 li a4,2
40006d00: 22e79263 bne a5,a4,40006f24 <pthread_create+0x2f4>
schedpolicy = the_attr->schedpolicy;
40006d04: 01442f83 lw t6,20(s0)
schedparam = the_attr->schedparam;
40006d08: 01842f03 lw t5,24(s0)
40006d0c: 01c42e83 lw t4,28(s0)
40006d10: 02042e03 lw t3,32(s0)
40006d14: 02442303 lw t1,36(s0)
40006d18: 02842883 lw a7,40(s0)
40006d1c: 02c42803 lw a6,44(s0)
40006d20: 03042503 lw a0,48(s0)
40006d24: 03442583 lw a1,52(s0)
40006d28: 03842603 lw a2,56(s0)
40006d2c: 03c42683 lw a3,60(s0)
40006d30: 04042703 lw a4,64(s0)
40006d34: 04442783 lw a5,68(s0)
schedpolicy = the_attr->schedpolicy;
40006d38: 01f12623 sw t6,12(sp)
schedparam = the_attr->schedparam;
40006d3c: 05e12823 sw t5,80(sp)
40006d40: 05d12a23 sw t4,84(sp)
40006d44: 05c12c23 sw t3,88(sp)
40006d48: 04612e23 sw t1,92(sp)
40006d4c: 07112023 sw a7,96(sp)
40006d50: 07012223 sw a6,100(sp)
40006d54: 06a12423 sw a0,104(sp)
40006d58: 06b12623 sw a1,108(sp)
40006d5c: 06c12823 sw a2,112(sp)
40006d60: 06d12a23 sw a3,116(sp)
40006d64: 06e12c23 sw a4,120(sp)
40006d68: 06f12e23 sw a5,124(sp)
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
40006d6c: 00c42783 lw a5,12(s0)
return ENOTSUP;
40006d70: 08600493 li s1,134
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
40006d74: 1a079a63 bnez a5,40006f28 <pthread_create+0x2f8>
error = _POSIX_Thread_Translate_sched_param(
40006d78: 00c12503 lw a0,12(sp)
40006d7c: 03c10693 addi a3,sp,60
40006d80: 03810613 addi a2,sp,56
40006d84: 05010593 addi a1,sp,80
40006d88: 7dd050ef jal ra,4000cd64 <_POSIX_Thread_Translate_sched_param>
40006d8c: 00050493 mv s1,a0
if ( error != 0 ) {
40006d90: 18051c63 bnez a0,40006f28 <pthread_create+0x2f8>
normal_prio = schedparam.sched_priority;
40006d94: 05012983 lw s3,80(sp)
config.scheduler = _Thread_Scheduler_get_home( executing );
40006d98: 40091537 lui a0,0x40091
40006d9c: 02850793 addi a5,a0,40 # 40091028 <_Scheduler_Table>
config.priority = _POSIX_Priority_To_core(
40006da0: 00b10613 addi a2,sp,11
40006da4: 00098593 mv a1,s3
40006da8: 02850513 addi a0,a0,40
config.scheduler = _Thread_Scheduler_get_home( executing );
40006dac: 02f12023 sw a5,32(sp)
config.priority = _POSIX_Priority_To_core(
40006db0: 168050ef jal ra,4000bf18 <_POSIX_Priority_To_core>
if ( !valid ) {
40006db4: 00b14783 lbu a5,11(sp)
config.priority = _POSIX_Priority_To_core(
40006db8: 02a12823 sw a0,48(sp)
40006dbc: 02b12a23 sw a1,52(sp)
if ( !valid ) {
40006dc0: 16078263 beqz a5,40006f24 <pthread_create+0x2f4> <== NEVER TAKEN
if ( schedpolicy == SCHED_SPORADIC ) {
40006dc4: 00c12703 lw a4,12(sp)
40006dc8: 00400793 li a5,4
40006dcc: 00f71463 bne a4,a5,40006dd4 <pthread_create+0x1a4>
low_prio = schedparam.sched_ss_low_priority;
40006dd0: 05412983 lw s3,84(sp)
core_low_prio = _POSIX_Priority_To_core( config.scheduler, low_prio, &valid );
40006dd4: 02012503 lw a0,32(sp)
40006dd8: 00b10613 addi a2,sp,11
40006ddc: 00098593 mv a1,s3
40006de0: 138050ef jal ra,4000bf18 <_POSIX_Priority_To_core>
if ( !valid ) {
40006de4: 00b14783 lbu a5,11(sp)
core_low_prio = _POSIX_Priority_To_core( config.scheduler, low_prio, &valid );
40006de8: 00050a93 mv s5,a0
40006dec: 00058a13 mv s4,a1
if ( !valid ) {
40006df0: 12078a63 beqz a5,40006f24 <pthread_create+0x2f4>
if ( the_attr->affinityset == NULL ) {
40006df4: 05842783 lw a5,88(s0)
40006df8: 12078663 beqz a5,40006f24 <pthread_create+0x2f4> <== NEVER TAKEN
_Assert(
_Objects_Allocator_is_owner()
|| !_System_state_Is_up( _System_state_Get() )
);
return ( *information->allocate )( information );
40006dfc: 400b2b37 lui s6,0x400b2
_RTEMS_Lock_allocator();
40006e00: 59d000ef jal ra,40007b9c <_RTEMS_Lock_allocator>
return ( *information->allocate )( information );
40006e04: 0c8b0b93 addi s7,s6,200 # 400b20c8 <_POSIX_Threads_Information>
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate(void)
{
_Objects_Allocator_lock();
_Thread_Kill_zombies();
40006e08: 080040ef jal ra,4000ae88 <_Thread_Kill_zombies>
40006e0c: 008ba783 lw a5,8(s7)
40006e10: 0c8b0513 addi a0,s6,200
40006e14: 000780e7 jalr a5
40006e18: 00050993 mv s3,a0
if ( !the_thread ) {
40006e1c: 1e050663 beqz a0,40007008 <pthread_create+0x3d8>
if ( config.stack_area == NULL ) {
40006e20: 02412783 lw a5,36(sp)
40006e24: 18078263 beqz a5,40006fa8 <pthread_create+0x378>
config.stack_free = _Stack_Free_nothing;
40006e28: 400097b7 lui a5,0x40009
40006e2c: 00078793 mv a5,a5
40006e30: 02f12623 sw a5,44(sp)
status = _Thread_Initialize(
40006e34: 02010613 addi a2,sp,32
40006e38: 00098593 mv a1,s3
40006e3c: 0c8b0513 addi a0,s6,200
40006e40: 33d020ef jal ra,4000997c <_Thread_Initialize>
if ( !status ) {
40006e44: 18050063 beqz a0,40006fc4 <pthread_create+0x394> <== NEVER TAKEN
if ( the_attr->detachstate == PTHREAD_CREATE_DETACHED ) {
40006e48: 05042703 lw a4,80(s0)
the_thread->Life.state |= THREAD_LIFE_DETACHED;
40006e4c: 1ac9a783 lw a5,428(s3)
if ( the_attr->detachstate == PTHREAD_CREATE_DETACHED ) {
40006e50: 00071463 bnez a4,40006e58 <pthread_create+0x228> <== ALWAYS TAKEN
the_thread->Life.state |= THREAD_LIFE_DETACHED;
40006e54: 0107e793 ori a5,a5,16 <== NOT EXECUTED
the_thread->Life.state |= THREAD_LIFE_CHANGE_DEFERRED;
40006e58: 0087e793 ori a5,a5,8
40006e5c: 1af9a623 sw a5,428(s3)
__asm__ volatile (
40006e60: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40006e64: 0087f793 andi a5,a5,8
_ISR_lock_ISR_disable( &lock_context );
40006e68: 00f12823 sw a5,16(sp)
status = _Scheduler_Set_affinity(
40006e6c: 05842603 lw a2,88(s0)
40006e70: 05442583 lw a1,84(s0)
40006e74: 00098513 mv a0,s3
40006e78: 140020ef jal ra,40008fb8 <_Scheduler_Set_affinity>
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40006e7c: 01012783 lw a5,16(sp)
40006e80: 3007a073 csrs mstatus,a5
if ( !status ) {
40006e84: 14050e63 beqz a0,40006fe0 <pthread_create+0x3b0> <== NEVER TAKEN
( the_attr->inheritsched == PTHREAD_INHERIT_SCHED );
40006e88: 01042703 lw a4,16(s0)
api->Sporadic.sched_ss_repl_period =
40006e8c: 02042f03 lw t5,32(s0)
40006e90: 02442e83 lw t4,36(s0)
40006e94: 02842e03 lw t3,40(s0)
40006e98: 02c42303 lw t1,44(s0)
api->Sporadic.sched_ss_init_budget =
40006e9c: 03042883 lw a7,48(s0)
40006ea0: 03442803 lw a6,52(s0)
40006ea4: 03842503 lw a0,56(s0)
40006ea8: 03c42583 lw a1,60(s0)
api->Sporadic.sched_ss_max_repl =
40006eac: 04042603 lw a2,64(s0)
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
40006eb0: 1989a783 lw a5,408(s3)
( the_attr->inheritsched == PTHREAD_INHERIT_SCHED );
40006eb4: fff70713 addi a4,a4,-1
40006eb8: 00173713 seqz a4,a4
if ( schedpolicy == SCHED_SPORADIC ) {
40006ebc: 00c12683 lw a3,12(sp)
( the_attr->inheritsched == PTHREAD_INHERIT_SCHED );
40006ec0: 08e985a3 sb a4,139(s3)
RTEMS_INLINE_ROUTINE void _Priority_Node_set_priority(
Priority_Node *node,
Priority_Control priority
)
{
node->priority = priority;
40006ec4: 0357ac23 sw s5,56(a5) # 40009038 <_Thread_Handler_initialization>
40006ec8: 0347ae23 sw s4,60(a5)
api->Sporadic.sched_ss_repl_period =
40006ecc: 05e7a023 sw t5,64(a5)
40006ed0: 05d7a223 sw t4,68(a5)
40006ed4: 05c7a423 sw t3,72(a5)
40006ed8: 0467a623 sw t1,76(a5)
api->Sporadic.sched_ss_init_budget =
40006edc: 0517a823 sw a7,80(a5)
40006ee0: 0507aa23 sw a6,84(a5)
40006ee4: 04a7ac23 sw a0,88(a5)
40006ee8: 04b7ae23 sw a1,92(a5)
api->Sporadic.sched_ss_max_repl =
40006eec: 06c7a023 sw a2,96(a5)
if ( schedpolicy == SCHED_SPORADIC ) {
40006ef0: 00400713 li a4,4
40006ef4: 10e68463 beq a3,a4,40006ffc <pthread_create+0x3cc>
__asm__ volatile (
40006ef8: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40006efc: 0087f793 andi a5,a5,8
_ISR_lock_ISR_disable( &lock_context );
40006f00: 00f12823 sw a5,16(sp)
status = _Thread_Start( the_thread, &entry, &lock_context );
40006f04: 01010613 addi a2,sp,16
40006f08: 01410593 addi a1,sp,20
40006f0c: 00098513 mv a0,s3
40006f10: 2cc040ef jal ra,4000b1dc <_Thread_Start>
*thread = the_thread->Object.id;
40006f14: 0089a783 lw a5,8(s3)
40006f18: 00f92023 sw a5,0(s2)
_RTEMS_Unlock_allocator();
40006f1c: 48d000ef jal ra,40007ba8 <_RTEMS_Unlock_allocator>
return 0;
40006f20: 0080006f j 40006f28 <pthread_create+0x2f8>
switch ( the_attr->inheritsched ) {
40006f24: 01600493 li s1,22
}
40006f28: 0ac12083 lw ra,172(sp)
40006f2c: 0a812403 lw s0,168(sp)
40006f30: 0a012903 lw s2,160(sp)
40006f34: 09c12983 lw s3,156(sp)
40006f38: 09812a03 lw s4,152(sp)
40006f3c: 09412a83 lw s5,148(sp)
40006f40: 09012b03 lw s6,144(sp)
40006f44: 08c12b83 lw s7,140(sp)
40006f48: 00048513 mv a0,s1
40006f4c: 0a412483 lw s1,164(sp)
40006f50: 0b010113 addi sp,sp,176
40006f54: 00008067 ret
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
40006f58: 40092437 lui s0,0x40092
40006f5c: c8840413 addi s0,s0,-888 # 40091c88 <_POSIX_Threads_Default_attributes>
40006f60: d25ff06f j 40006c84 <pthread_create+0x54>
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
40006f64: 8fc1a983 lw s3,-1796(gp) # 400b2944 <_POSIX_Threads_Minimum_stack_size>
40006f68: 0099f463 bgeu s3,s1,40006f70 <pthread_create+0x340>
40006f6c: 00048993 mv s3,s1
config.stack_size = _POSIX_Threads_Ensure_minimum_stack(
40006f70: 03312423 sw s3,40(sp)
}
#else
(void) is_fp;
#endif
stack_size += _TLS_Get_allocation_size();
40006f74: 588040ef jal ra,4000b4fc <_TLS_Get_allocation_size>
switch ( the_attr->inheritsched ) {
40006f78: 01042783 lw a5,16(s0)
40006f7c: 013509b3 add s3,a0,s3
config.stack_size = _Stack_Extend_size( config.stack_size, config.is_fp );
40006f80: 03312423 sw s3,40(sp)
switch ( the_attr->inheritsched ) {
40006f84: 00100713 li a4,1
40006f88: d6e79ae3 bne a5,a4,40006cfc <pthread_create+0xcc>
error = pthread_getschedparam(
40006f8c: 648000ef jal ra,400075d4 <pthread_self>
40006f90: 05010613 addi a2,sp,80
40006f94: 00c10593 addi a1,sp,12
40006f98: 3d4000ef jal ra,4000736c <pthread_getschedparam>
break;
40006f9c: dd1ff06f j 40006d6c <pthread_create+0x13c>
return EFAULT;
40006fa0: 00e00493 li s1,14
40006fa4: f85ff06f j 40006f28 <pthread_create+0x2f8>
config.stack_area = _Stack_Allocate( config.stack_size );
40006fa8: 02812503 lw a0,40(sp)
config.stack_free = _Stack_Free;
40006fac: 4000b7b7 lui a5,0x4000b
40006fb0: 1d478793 addi a5,a5,468 # 4000b1d4 <_Stack_Free>
40006fb4: 02f12623 sw a5,44(sp)
config.stack_area = _Stack_Allocate( config.stack_size );
40006fb8: 214040ef jal ra,4000b1cc <_Stack_Allocate>
40006fbc: 02a12223 sw a0,36(sp)
if ( status ) {
40006fc0: e6051ae3 bnez a0,40006e34 <pthread_create+0x204>
Objects_Control *the_object
)
{
_Assert( _Objects_Allocator_is_owner() );
_Assert( information->deallocate != NULL );
( *information->deallocate )( information, the_object );
40006fc4: 00cba783 lw a5,12(s7)
40006fc8: 00098593 mv a1,s3
40006fcc: 0c8b0513 addi a0,s6,200
40006fd0: 000780e7 jalr a5
return EAGAIN;
40006fd4: 00b00493 li s1,11
_RTEMS_Unlock_allocator();
40006fd8: 3d1000ef jal ra,40007ba8 <_RTEMS_Unlock_allocator>
40006fdc: f4dff06f j 40006f28 <pthread_create+0x2f8>
( *information->deallocate )( information, the_object );
40006fe0: 00cba783 lw a5,12(s7)
40006fe4: 00098593 mv a1,s3 <== NOT EXECUTED
40006fe8: 0c8b0513 addi a0,s6,200 <== NOT EXECUTED
40006fec: 000780e7 jalr a5 <== NOT EXECUTED
return EINVAL;
40006ff0: 01600493 li s1,22 <== NOT EXECUTED
_RTEMS_Unlock_allocator();
40006ff4: 3b5000ef jal ra,40007ba8 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
return EINVAL;
40006ff8: f31ff06f j 40006f28 <pthread_create+0x2f8> <== NOT EXECUTED
_POSIX_Threads_Sporadic_timer( &api->Sporadic.Timer );
40006ffc: 00878513 addi a0,a5,8 <== NOT EXECUTED
40007000: b05ff0ef jal ra,40006b04 <_POSIX_Threads_Sporadic_timer>
40007004: ef5ff06f j 40006ef8 <pthread_create+0x2c8>
_RTEMS_Unlock_allocator();
40007008: 3a1000ef jal ra,40007ba8 <_RTEMS_Unlock_allocator>
return EAGAIN;
4000700c: 00b00493 li s1,11
40007010: f19ff06f j 40006f28 <pthread_create+0x2f8>
4000712c <pthread_getattr_np>:
Thread_CPU_budget_algorithms budget_algorithm;
const Scheduler_Control *scheduler;
Priority_Control priority;
bool ok;
if ( attr == NULL ) {
4000712c: 18058263 beqz a1,400072b0 <pthread_getattr_np+0x184>
{
40007130: fd010113 addi sp,sp,-48
40007134: 00058793 mv a5,a1
40007138: 02912223 sw s1,36(sp)
return EINVAL;
}
attr = memset( attr, 0, sizeof( *attr ) );
4000713c: 06000613 li a2,96
40007140: 00050493 mv s1,a0
40007144: 00000593 li a1,0
40007148: 00078513 mv a0,a5
{
4000714c: 02112623 sw ra,44(sp)
40007150: 02812423 sw s0,40(sp)
40007154: 03212023 sw s2,32(sp)
40007158: 01312e23 sw s3,28(sp)
4000715c: 01412c23 sw s4,24(sp)
40007160: 01512a23 sw s5,20(sp)
attr = memset( attr, 0, sizeof( *attr ) );
40007164: 209740ef jal ra,4007bb6c <memset>
40007168: 00050413 mv s0,a0
the_thread = _Thread_Get( thread, &lock_context );
4000716c: 00c10593 addi a1,sp,12
40007170: 00048513 mv a0,s1
40007174: 710020ef jal ra,40009884 <_Thread_Get>
40007178: 00050493 mv s1,a0
if ( the_thread == NULL ) {
4000717c: 12050e63 beqz a0,400072b8 <pthread_getattr_np+0x18c>
)
{
#if defined(RTEMS_POSIX_API)
const POSIX_API_Control *api;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
40007180: 19852903 lw s2,408(a0)
_Thread_State_acquire_critical( the_thread, &lock_context );
attr->stackaddr = the_thread->Start.Initial_stack.area;
attr->stacksize = the_thread->Start.Initial_stack.size;
if ( the_thread->was_created_with_inherited_scheduler ) {
40007184: 08b54783 lbu a5,139(a0)
attr->stackaddr = the_thread->Start.Initial_stack.area;
40007188: 0d052683 lw a3,208(a0)
attr->stacksize = the_thread->Start.Initial_stack.size;
4000718c: 0cc52703 lw a4,204(a0)
param->sched_ss_low_priority = _POSIX_Priority_From_core(
40007190: 03892583 lw a1,56(s2)
40007194: 03c92603 lw a2,60(s2)
attr->inheritsched = PTHREAD_INHERIT_SCHED;
} else {
attr->inheritsched = PTHREAD_EXPLICIT_SCHED;
40007198: 0017b793 seqz a5,a5
4000719c: 00178793 addi a5,a5,1
400071a0: 400919b7 lui s3,0x40091
attr->stackaddr = the_thread->Start.Initial_stack.area;
400071a4: 00d42223 sw a3,4(s0)
attr->stacksize = the_thread->Start.Initial_stack.size;
400071a8: 00e42423 sw a4,8(s0)
if ( the_thread->was_created_with_inherited_scheduler ) {
400071ac: 00f42823 sw a5,16(s0)
400071b0: 02898513 addi a0,s3,40 # 40091028 <_Scheduler_Table>
400071b4: 5c1040ef jal ra,4000bf74 <_POSIX_Priority_From_core>
scheduler,
&attr->schedparam
);
priority = the_thread->Real_priority.priority;
if ( _Thread_Is_joinable( the_thread ) ) {
400071b8: 1ac4a783 lw a5,428(s1)
scheduler,
api->Sporadic.Low_priority.priority
);
param->sched_ss_repl_period = api->Sporadic.sched_ss_repl_period;
400071bc: 04092f03 lw t5,64(s2)
400071c0: 04492e83 lw t4,68(s2)
400071c4: 0047d793 srli a5,a5,0x4
400071c8: 04892e03 lw t3,72(s2)
400071cc: 04c92303 lw t1,76(s2)
param->sched_ss_init_budget = api->Sporadic.sched_ss_init_budget;
400071d0: 05092883 lw a7,80(s2)
400071d4: 05492803 lw a6,84(s2)
400071d8: 05892583 lw a1,88(s2)
400071dc: 05c92683 lw a3,92(s2)
param->sched_ss_max_repl = api->Sporadic.sched_ss_max_repl;
400071e0: 06092703 lw a4,96(s2)
400071e4: 0017c793 xori a5,a5,1
400071e8: 0017f793 andi a5,a5,1
priority = the_thread->Real_priority.priority;
400071ec: 0304aa03 lw s4,48(s1)
400071f0: 0344aa83 lw s5,52(s1)
attr->detachstate = PTHREAD_CREATE_JOINABLE;
} else {
attr->detachstate = PTHREAD_CREATE_DETACHED;
}
attr->affinityset = &attr->affinitysetpreallocated;
400071f4: 05c40613 addi a2,s0,92
400071f8: 04f42823 sw a5,80(s0)
attr->affinitysetsize = sizeof( attr->affinitysetpreallocated );
400071fc: 00400793 li a5,4
param->sched_ss_low_priority = _POSIX_Priority_From_core(
40007200: 00a42e23 sw a0,28(s0)
param->sched_ss_init_budget = api->Sporadic.sched_ss_init_budget;
40007204: 02b42c23 sw a1,56(s0)
param->sched_ss_repl_period = api->Sporadic.sched_ss_repl_period;
40007208: 03e42023 sw t5,32(s0)
4000720c: 03d42223 sw t4,36(s0)
40007210: 03c42423 sw t3,40(s0)
40007214: 02642623 sw t1,44(s0)
param->sched_ss_init_budget = api->Sporadic.sched_ss_init_budget;
40007218: 03142823 sw a7,48(s0)
4000721c: 03042a23 sw a6,52(s0)
40007220: 02d42e23 sw a3,60(s0)
param->sched_ss_max_repl = api->Sporadic.sched_ss_max_repl;
40007224: 04e42023 sw a4,64(s0)
attr->affinityset = &attr->affinitysetpreallocated;
40007228: 04c42c23 sw a2,88(s0)
attr->affinitysetsize = sizeof( attr->affinitysetpreallocated );
4000722c: 04f42a23 sw a5,84(s0)
ok = _Scheduler_Get_affinity(
40007230: 00400593 li a1,4
40007234: 00048513 mv a0,s1
40007238: 530010ef jal ra,40008768 <_Scheduler_Get_affinity>
4000723c: 00050913 mv s2,a0
the_thread,
attr->affinitysetsize,
attr->affinityset
);
budget_algorithm = the_thread->budget_algorithm;
40007240: 0904a483 lw s1,144(s1)
40007244: 00c12783 lw a5,12(sp)
40007248: 3007a073 csrs mstatus,a5
_Thread_State_release( the_thread, &lock_context );
attr->is_initialized = true;
4000724c: 00100793 li a5,1
attr->contentionscope = PTHREAD_SCOPE_PROCESS;
attr->cputime_clock_allowed = 1;
attr->schedparam.sched_priority = _POSIX_Priority_From_core(
40007250: 000a0593 mv a1,s4
40007254: 000a8613 mv a2,s5
attr->is_initialized = true;
40007258: 00f42023 sw a5,0(s0)
attr->cputime_clock_allowed = 1;
4000725c: 04f42623 sw a5,76(s0)
attr->contentionscope = PTHREAD_SCOPE_PROCESS;
40007260: 00042623 sw zero,12(s0)
attr->schedparam.sched_priority = _POSIX_Priority_From_core(
40007264: 02898513 addi a0,s3,40
40007268: 50d040ef jal ra,4000bf74 <_POSIX_Priority_From_core>
4000726c: 00a42c23 sw a0,24(s0)
scheduler,
priority
);
attr->schedpolicy =
_POSIX_Thread_Translate_to_sched_policy( budget_algorithm );
40007270: 00048513 mv a0,s1
40007274: 2d1050ef jal ra,4000cd44 <_POSIX_Thread_Translate_to_sched_policy>
attr->schedpolicy =
40007278: 00a42a23 sw a0,20(s0)
return ok ? 0 : EINVAL;
4000727c: 00000513 li a0,0
40007280: 02090463 beqz s2,400072a8 <pthread_getattr_np+0x17c> <== NEVER TAKEN
}
40007284: 02c12083 lw ra,44(sp)
40007288: 02812403 lw s0,40(sp)
4000728c: 02412483 lw s1,36(sp)
40007290: 02012903 lw s2,32(sp)
40007294: 01c12983 lw s3,28(sp)
40007298: 01812a03 lw s4,24(sp)
4000729c: 01412a83 lw s5,20(sp)
400072a0: 03010113 addi sp,sp,48
400072a4: 00008067 ret
return ok ? 0 : EINVAL;
400072a8: 01600513 li a0,22 <== NOT EXECUTED
400072ac: fd9ff06f j 40007284 <pthread_getattr_np+0x158> <== NOT EXECUTED
400072b0: 01600513 li a0,22
}
400072b4: 00008067 ret
return ESRCH;
400072b8: 00300513 li a0,3
400072bc: fc9ff06f j 40007284 <pthread_getattr_np+0x158>
40004148 <pthread_getspecific>:
static inline struct _Thread_Control *_Per_CPU_Get_executing(
const Per_CPU_Control *cpu
)
{
return cpu->executing;
40004148: 400147b7 lui a5,0x40014
4000414c: fb87a783 lw a5,-72(a5) # 40013fb8 <_Per_CPU_Information+0x38>
*/
void *pthread_getspecific(
pthread_key_t key
)
{
40004150: 00050693 mv a3,a0
__asm__ volatile (
40004154: 300475f3 csrrci a1,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40004158: 0085f593 andi a1,a1,8
RBTree_Node *parent;
link = _RBTree_Root_const_reference( the_rbtree );
parent = NULL;
while ( *link != NULL ) {
4000415c: 19c7a503 lw a0,412(a5)
40004160: 00051c63 bnez a0,40004178 <pthread_getspecific+0x30>
40004164: 0280006f j 4000418c <pthread_getspecific+0x44>
parent = *link;
if ( ( *equal )( key, parent ) ) {
return ( *map )( parent );
} else if ( ( *less )( key, parent ) ) {
40004168: 00f6f463 bgeu a3,a5,40004170 <pthread_getspecific+0x28>
return &RB_LEFT( the_node, Node );
4000416c: 00050713 mv a4,a0 <== NOT EXECUTED
while ( *link != NULL ) {
40004170: 00072503 lw a0,0(a4)
40004174: 00050c63 beqz a0,4000418c <pthread_getspecific+0x44> <== NEVER TAKEN
const POSIX_Keys_Key_value_pair *the_right;
the_left = left;
the_right = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( right );
return *the_left == the_right->key;
40004178: 01052783 lw a5,16(a0)
the_right = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( right );
4000417c: ff850613 addi a2,a0,-8
return &RB_RIGHT( the_node, Node );
40004180: 00450713 addi a4,a0,4
if ( ( *equal )( key, parent ) ) {
40004184: fef692e3 bne a3,a5,40004168 <pthread_getspecific+0x20>
_POSIX_Keys_Key_value_acquire( executing, &lock_context );
key_value_pair = _POSIX_Keys_Key_value_find( key, executing );
if ( key_value_pair != NULL ) {
value = key_value_pair->value;
40004188: 02062503 lw a0,32(a2)
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4000418c: 3005a073 csrs mstatus,a1
}
_POSIX_Keys_Key_value_release( executing, &lock_context );
return value;
}
40004190: 00008067 ret
40006890 <pthread_mutex_getprioceiling>:
{
POSIX_Mutex_Control *the_mutex;
unsigned long flags;
Thread_queue_Context queue_context;
if ( prioceiling == NULL ) {
40006890: 0c058063 beqz a1,40006950 <pthread_mutex_getprioceiling+0xc0>
{
40006894: fe010113 addi sp,sp,-32
40006898: 00812c23 sw s0,24(sp)
4000689c: 00112e23 sw ra,28(sp)
400068a0: 00912a23 sw s1,20(sp)
400068a4: 01212823 sw s2,16(sp)
400068a8: 01312623 sw s3,12(sp)
400068ac: 00050413 mv s0,a0
return EINVAL;
}
the_mutex = _POSIX_Mutex_Get( RTEMS_DECONST( pthread_mutex_t *, mutex ) );
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
400068b0: 06050263 beqz a0,40006914 <pthread_mutex_getprioceiling+0x84>
400068b4: 00052903 lw s2,0(a0)
400068b8: 961c17b7 lui a5,0x961c1
400068bc: 3b878793 addi a5,a5,952 # 961c13b8 <RamEnd+0x551c13b8>
400068c0: 01254733 xor a4,a0,s2
400068c4: ff877713 andi a4,a4,-8
400068c8: 00058493 mv s1,a1
400068cc: 04f71063 bne a4,a5,4000690c <pthread_mutex_getprioceiling+0x7c>
__asm__ volatile (
400068d0: 300479f3 csrrci s3,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
400068d4: 0089f993 andi s3,s3,8
_POSIX_Mutex_Acquire( the_mutex, &queue_context );
if ( _POSIX_Mutex_Get_protocol( flags ) == POSIX_MUTEX_PRIORITY_CEILING ) {
400068d8: 00200793 li a5,2
RTEMS_INLINE_ROUTINE POSIX_Mutex_Protocol _POSIX_Mutex_Get_protocol(
unsigned long flags
)
{
return flags & POSIX_MUTEX_PROTOCOL_MASK;
400068dc: 00397913 andi s2,s2,3
400068e0: 04f90a63 beq s2,a5,40006934 <pthread_mutex_getprioceiling+0xa4>
*prioceiling = _POSIX_Priority_From_core(
_POSIX_Mutex_Get_scheduler( the_mutex ),
_POSIX_Mutex_Get_priority( the_mutex )
);
} else {
*prioceiling = 0;
400068e4: 0004a023 sw zero,0(s1)
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400068e8: 3009a073 csrs mstatus,s3
}
_POSIX_Mutex_Release( the_mutex, &queue_context );
return 0;
}
400068ec: 01c12083 lw ra,28(sp)
400068f0: 01812403 lw s0,24(sp)
400068f4: 01412483 lw s1,20(sp)
400068f8: 01012903 lw s2,16(sp)
400068fc: 00c12983 lw s3,12(sp)
return 0;
40006900: 00000513 li a0,0
}
40006904: 02010113 addi sp,sp,32
40006908: 00008067 ret
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
4000690c: 524000ef jal ra,40006e30 <_POSIX_Mutex_Auto_initialization>
40006910: fc0510e3 bnez a0,400068d0 <pthread_mutex_getprioceiling+0x40> <== ALWAYS TAKEN
}
40006914: 01c12083 lw ra,28(sp)
40006918: 01812403 lw s0,24(sp)
4000691c: 01412483 lw s1,20(sp)
40006920: 01012903 lw s2,16(sp)
40006924: 00c12983 lw s3,12(sp)
return EINVAL;
40006928: 01600513 li a0,22
}
4000692c: 02010113 addi sp,sp,32
40006930: 00008067 ret
*prioceiling = _POSIX_Priority_From_core(
40006934: 03042583 lw a1,48(s0)
40006938: 03442603 lw a2,52(s0)
4000693c: 40019537 lui a0,0x40019
40006940: 04850513 addi a0,a0,72 # 40019048 <_Scheduler_Table>
40006944: 7ec000ef jal ra,40007130 <_POSIX_Priority_From_core>
40006948: 00a4a023 sw a0,0(s1)
4000694c: f9dff06f j 400068e8 <pthread_mutex_getprioceiling+0x58>
return EINVAL;
40006950: 01600513 li a0,22
}
40006954: 00008067 ret
40006958 <pthread_mutex_init>:
int pthread_mutex_init(
pthread_mutex_t *mutex,
const pthread_mutexattr_t *attr
)
{
40006958: fe010113 addi sp,sp,-32
4000695c: 00912a23 sw s1,20(sp)
40006960: 00112e23 sw ra,28(sp)
40006964: 00812c23 sw s0,24(sp)
40006968: 00050493 mv s1,a0
POSIX_Mutex_Protocol protocol;
unsigned long flags;
Priority_Control priority;
const Scheduler_Control *scheduler;
if ( attr ) the_attr = attr;
4000696c: 04058063 beqz a1,400069ac <pthread_mutex_init+0x54>
else the_attr = &_POSIX_Mutex_Default_attributes;
/* Check for NULL mutex */
if ( !mutex )
40006970: 10050063 beqz a0,40006a70 <pthread_mutex_init+0x118>
* value in an uninitialized variable to make this fail.
*
* Thus, we do not look at *mutex.
*/
if ( !the_attr->is_initialized )
40006974: 0005a783 lw a5,0(a1)
return EINVAL;
40006978: 01600513 li a0,22
if ( !the_attr->is_initialized )
4000697c: 00078e63 beqz a5,40006998 <pthread_mutex_init+0x40>
return EINVAL;
if ( !_POSIX_Is_valid_pshared( the_attr->process_shared ) ) {
40006980: 0045a703 lw a4,4(a1)
40006984: 00100793 li a5,1
40006988: 00e7e863 bltu a5,a4,40006998 <pthread_mutex_init+0x40>
4000698c: 00c5a703 lw a4,12(a1)
}
/*
* Determine the discipline of the mutex
*/
switch ( the_attr->protocol ) {
40006990: 00200693 li a3,2
40006994: 06e6f663 bgeu a3,a4,40006a00 <pthread_mutex_init+0xa8>
);
the_mutex->Recursive.nest_level = 0;
_Priority_Node_initialize( &the_mutex->Priority_ceiling, priority );
the_mutex->scheduler = scheduler;
return 0;
}
40006998: 01c12083 lw ra,28(sp)
4000699c: 01812403 lw s0,24(sp)
400069a0: 01412483 lw s1,20(sp)
400069a4: 02010113 addi sp,sp,32
400069a8: 00008067 ret
if ( !mutex )
400069ac: 0c050263 beqz a0,40006a70 <pthread_mutex_init+0x118>
flags = (uintptr_t) the_mutex ^ POSIX_MUTEX_MAGIC;
400069b0: 961c17b7 lui a5,0x961c1
400069b4: 3b878793 addi a5,a5,952 # 961c13b8 <RamEnd+0x551c13b8>
400069b8: 00f547b3 xor a5,a0,a5
flags &= ~POSIX_MUTEX_FLAGS_MASK;
400069bc: ff87f793 andi a5,a5,-8
the_mutex->flags = flags;
400069c0: 00f52023 sw a5,0(a0)
priority = 0;
400069c4: 00000513 li a0,0
400069c8: 00000793 li a5,0
}
400069cc: 01c12083 lw ra,28(sp)
400069d0: 01812403 lw s0,24(sp)
RTEMS_INLINE_ROUTINE void _Priority_Node_initialize(
Priority_Node *node,
Priority_Control priority
)
{
node->priority = priority;
400069d4: 02a4a823 sw a0,48(s1)
)
{
#if defined(RTEMS_SMP)
_SMP_ticket_lock_Initialize( &queue->Lock );
#endif
queue->heads = NULL;
400069d8: 0004a623 sw zero,12(s1)
queue->owner = NULL;
400069dc: 0004a823 sw zero,16(s1)
queue->name = name;
400069e0: 0004aa23 sw zero,20(s1)
the_mutex->Recursive.nest_level = 0;
400069e4: 0004ac23 sw zero,24(s1)
400069e8: 02f4aa23 sw a5,52(s1)
the_mutex->scheduler = scheduler;
400069ec: 02b4ac23 sw a1,56(s1)
return 0;
400069f0: 00000513 li a0,0
}
400069f4: 01412483 lw s1,20(sp)
400069f8: 02010113 addi sp,sp,32
400069fc: 00008067 ret
switch ( the_attr->type ) {
40006a00: 0105a683 lw a3,16(a1)
40006a04: 00300613 li a2,3
40006a08: f8d668e3 bltu a2,a3,40006998 <pthread_mutex_init+0x40>
flags = (uintptr_t) the_mutex ^ POSIX_MUTEX_MAGIC;
40006a0c: 961c1637 lui a2,0x961c1
40006a10: 3b860613 addi a2,a2,952 # 961c13b8 <RamEnd+0x551c13b8>
40006a14: 00c4c633 xor a2,s1,a2
flags &= ~POSIX_MUTEX_FLAGS_MASK;
40006a18: ff867613 andi a2,a2,-8
flags |= protocol;
40006a1c: 00e66633 or a2,a2,a4
if ( the_attr->type == PTHREAD_MUTEX_RECURSIVE ) {
40006a20: 00f69463 bne a3,a5,40006a28 <pthread_mutex_init+0xd0>
flags |= POSIX_MUTEX_RECURSIVE;
40006a24: 00466613 ori a2,a2,4 <== NOT EXECUTED
the_mutex->flags = flags;
40006a28: 00c4a023 sw a2,0(s1)
if ( protocol == POSIX_MUTEX_PRIORITY_CEILING ) {
40006a2c: 00200793 li a5,2
40006a30: 04f71c63 bne a4,a5,40006a88 <pthread_mutex_init+0x130>
prio_ceiling = the_attr->prio_ceiling;
40006a34: 0085a583 lw a1,8(a1)
if ( prio_ceiling == INT_MAX ) {
40006a38: 800007b7 lui a5,0x80000
40006a3c: fff7c793 not a5,a5
40006a40: 40019437 lui s0,0x40019
40006a44: 00f59863 bne a1,a5,40006a54 <pthread_mutex_init+0xfc>
RTEMS_INLINE_ROUTINE int _POSIX_Priority_Get_maximum(
const Scheduler_Control *scheduler
)
{
_Assert( (int) scheduler->maximum_priority > 1 );
return (int) scheduler->maximum_priority - 1;
40006a48: 04840793 addi a5,s0,72 # 40019048 <_Scheduler_Table>
40006a4c: 0407a583 lw a1,64(a5) # 80000040 <RamEnd+0x3f000040>
40006a50: fff58593 addi a1,a1,-1
priority = _POSIX_Priority_To_core( scheduler, prio_ceiling, &valid );
40006a54: 00f10613 addi a2,sp,15
40006a58: 04840513 addi a0,s0,72
40006a5c: 678000ef jal ra,400070d4 <_POSIX_Priority_To_core>
if ( !valid ) {
40006a60: 00f14703 lbu a4,15(sp)
priority = _POSIX_Priority_To_core( scheduler, prio_ceiling, &valid );
40006a64: 00058793 mv a5,a1
scheduler = _Thread_Scheduler_get_home( _Thread_Get_executing() );
40006a68: 04840593 addi a1,s0,72
if ( !valid ) {
40006a6c: f60710e3 bnez a4,400069cc <pthread_mutex_init+0x74>
}
40006a70: 01c12083 lw ra,28(sp)
40006a74: 01812403 lw s0,24(sp)
40006a78: 01412483 lw s1,20(sp)
return EINVAL;
40006a7c: 01600513 li a0,22
}
40006a80: 02010113 addi sp,sp,32
40006a84: 00008067 ret
scheduler = NULL;
40006a88: 00000593 li a1,0
priority = 0;
40006a8c: 00000513 li a0,0
40006a90: 00000793 li a5,0
40006a94: f39ff06f j 400069cc <pthread_mutex_init+0x74>
40006cbc <pthread_mutex_setprioceiling>:
int pthread_mutex_setprioceiling(
pthread_mutex_t *mutex,
int prioceiling,
int *old_ceiling
)
{
40006cbc: fb010113 addi sp,sp,-80
40006cc0: 04112623 sw ra,76(sp)
40006cc4: 04812423 sw s0,72(sp)
40006cc8: 04912223 sw s1,68(sp)
40006ccc: 05212023 sw s2,64(sp)
40006cd0: 03312e23 sw s3,60(sp)
40006cd4: 03412c23 sw s4,56(sp)
POSIX_Mutex_Control *the_mutex;
int error;
int unlock_error;
if ( old_ceiling == NULL ) {
40006cd8: 04060e63 beqz a2,40006d34 <pthread_mutex_setprioceiling+0x78>
40006cdc: 00060493 mv s1,a2
40006ce0: 00050913 mv s2,a0
40006ce4: 00058993 mv s3,a1
/*
* Must acquire the mutex before we can change it's ceiling.
* POSIX says block until we acquire it.
*/
error = pthread_mutex_lock( mutex );
40006ce8: db1ff0ef jal ra,40006a98 <pthread_mutex_lock>
40006cec: 00050413 mv s0,a0
if ( error != 0 ) {
40006cf0: 04051263 bnez a0,40006d34 <pthread_mutex_setprioceiling+0x78>
return flags & POSIX_MUTEX_PROTOCOL_MASK;
40006cf4: 00092783 lw a5,0(s2)
return EINVAL;
}
the_mutex = _POSIX_Mutex_Get( mutex );
if (
40006cf8: 00200713 li a4,2
40006cfc: 0037f793 andi a5,a5,3
40006d00: 02e78e63 beq a5,a4,40006d3c <pthread_mutex_setprioceiling+0x80>
error = 0;
} else {
error = EINVAL;
}
} else {
*old_ceiling = 0;
40006d04: 0004a023 sw zero,0(s1)
error = 0;
}
unlock_error = pthread_mutex_unlock( mutex );
40006d08: 00090513 mv a0,s2
40006d0c: 1b8000ef jal ra,40006ec4 <pthread_mutex_unlock>
_Assert( unlock_error == 0 );
(void) unlock_error;
return error;
}
40006d10: 04c12083 lw ra,76(sp)
40006d14: 00040513 mv a0,s0
40006d18: 04812403 lw s0,72(sp)
40006d1c: 04412483 lw s1,68(sp)
40006d20: 04012903 lw s2,64(sp)
40006d24: 03c12983 lw s3,60(sp)
40006d28: 03812a03 lw s4,56(sp)
40006d2c: 05010113 addi sp,sp,80
40006d30: 00008067 ret
return EINVAL;
40006d34: 01600413 li s0,22
40006d38: fd9ff06f j 40006d10 <pthread_mutex_setprioceiling+0x54>
*old_ceiling = _POSIX_Priority_From_core( scheduler, old_priority );
40006d3c: 03092583 lw a1,48(s2)
40006d40: 03492603 lw a2,52(s2)
40006d44: 40019a37 lui s4,0x40019
40006d48: 048a0513 addi a0,s4,72 # 40019048 <_Scheduler_Table>
40006d4c: 3e4000ef jal ra,40007130 <_POSIX_Priority_From_core>
40006d50: 00a4a023 sw a0,0(s1)
new_priority = _POSIX_Priority_To_core( scheduler, prioceiling, &valid );
40006d54: 00b10613 addi a2,sp,11
40006d58: 00098593 mv a1,s3
40006d5c: 048a0513 addi a0,s4,72
40006d60: 374000ef jal ra,400070d4 <_POSIX_Priority_To_core>
if ( valid ) {
40006d64: 00b14783 lbu a5,11(sp)
40006d68: 00079663 bnez a5,40006d74 <pthread_mutex_setprioceiling+0xb8>
error = EINVAL;
40006d6c: 01600413 li s0,22
40006d70: f99ff06f j 40006d08 <pthread_mutex_setprioceiling+0x4c>
return the_mutex->Recursive.Mutex.Queue.Queue.owner;
40006d74: 01092783 lw a5,16(s2)
40006d78: 02012023 sw zero,32(sp)
if ( owner != NULL ) {
40006d7c: 06078063 beqz a5,40006ddc <pthread_mutex_setprioceiling+0x120> <== NEVER TAKEN
__asm__ volatile (
40006d80: 30047773 csrrci a4,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40006d84: 00877713 andi a4,a4,8
RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire(
Thread_Control *the_thread,
Thread_queue_Context *queue_context
)
{
_ISR_lock_ISR_disable( &queue_context->Lock_context.Lock_context );
40006d88: 00e12623 sw a4,12(sp)
_Thread_Priority_changed(
40006d8c: 00c10993 addi s3,sp,12
node->priority = priority;
40006d90: 02a92823 sw a0,48(s2)
40006d94: 02b92a23 sw a1,52(s2)
40006d98: 00098693 mv a3,s3
40006d9c: 00000613 li a2,0
40006da0: 02090593 addi a1,s2,32
40006da4: 00078513 mv a0,a5
40006da8: 555020ef jal ra,40009afc <_Thread_Priority_changed>
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40006dac: 00c12783 lw a5,12(sp)
40006db0: 3007a073 csrs mstatus,a5
disable_level = cpu_self->thread_dispatch_disable_level;
40006db4: 4001e4b7 lui s1,0x4001e
40006db8: bc048713 addi a4,s1,-1088 # 4001dbc0 <_Per_CPU_Information>
40006dbc: 03072783 lw a5,48(a4)
_Thread_Priority_update( &queue_context );
40006dc0: 00098513 mv a0,s3
cpu_self->thread_dispatch_disable_level = disable_level + 1;
40006dc4: 00178793 addi a5,a5,1
40006dc8: 02f72823 sw a5,48(a4)
40006dcc: 5d1020ef jal ra,40009b9c <_Thread_Priority_update>
_Thread_Dispatch_enable( cpu_self );
40006dd0: bc048513 addi a0,s1,-1088
40006dd4: 088030ef jal ra,40009e5c <_Thread_Dispatch_enable>
error = 0;
40006dd8: f31ff06f j 40006d08 <pthread_mutex_setprioceiling+0x4c>
the_mutex->Priority_ceiling.priority = priority_ceiling;
40006ddc: 02a92823 sw a0,48(s2) <== NOT EXECUTED
40006de0: 02b92a23 sw a1,52(s2) <== NOT EXECUTED
40006de4: 00c10993 addi s3,sp,12 <== NOT EXECUTED
40006de8: fcdff06f j 40006db4 <pthread_mutex_setprioceiling+0xf8> <== NOT EXECUTED
40006ec4 <pthread_mutex_unlock>:
Thread_queue_Context queue_context;
Thread_Control *executing;
Status_Control status;
the_mutex = _POSIX_Mutex_Get( mutex );
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
40006ec4: 20050463 beqz a0,400070cc <pthread_mutex_unlock+0x208>
{
40006ec8: fb010113 addi sp,sp,-80
40006ecc: 04912223 sw s1,68(sp)
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
40006ed0: 00052483 lw s1,0(a0)
40006ed4: 961c17b7 lui a5,0x961c1
{
40006ed8: 04812423 sw s0,72(sp)
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
40006edc: 00954733 xor a4,a0,s1
{
40006ee0: 04112623 sw ra,76(sp)
40006ee4: 05212023 sw s2,64(sp)
40006ee8: 03312e23 sw s3,60(sp)
40006eec: 03412c23 sw s4,56(sp)
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
40006ef0: 3b878793 addi a5,a5,952 # 961c13b8 <RamEnd+0x551c13b8>
40006ef4: ff877713 andi a4,a4,-8
40006ef8: 00050413 mv s0,a0
40006efc: 10f71863 bne a4,a5,4000700c <pthread_mutex_unlock+0x148>
__asm__ volatile (
40006f00: 300477f3 csrrci a5,mstatus,8
40006f04: 4001e9b7 lui s3,0x4001e
return mstatus & RISCV_MSTATUS_MIE;
40006f08: 0087f793 andi a5,a5,8
40006f0c: bc098913 addi s2,s3,-1088 # 4001dbc0 <_Per_CPU_Information>
40006f10: 00f12623 sw a5,12(sp)
return flags & POSIX_MUTEX_PROTOCOL_MASK;
40006f14: 0034f493 andi s1,s1,3
40006f18: 03892503 lw a0,56(s2)
executing = _POSIX_Mutex_Acquire( the_mutex, &queue_context );
switch ( _POSIX_Mutex_Get_protocol( flags ) ) {
40006f1c: 0a048e63 beqz s1,40006fd8 <pthread_mutex_unlock+0x114>
40006f20: 00200793 li a5,2
40006f24: 02f48663 beq s1,a5,40006f50 <pthread_mutex_unlock+0x8c>
if ( !_POSIX_Mutex_Is_owner( the_mutex, executing ) ) {
40006f28: 01042783 lw a5,16(s0)
40006f2c: 0af51a63 bne a0,a5,40006fe0 <pthread_mutex_unlock+0x11c>
nest_level = the_mutex->Recursive.nest_level;
40006f30: 01842783 lw a5,24(s0)
if ( nest_level > 0 ) {
40006f34: 14079a63 bnez a5,40007088 <pthread_mutex_unlock+0x1c4> <== NEVER TAKEN
heads = the_mutex->Recursive.Mutex.Queue.Queue.heads;
40006f38: 00c42583 lw a1,12(s0)
the_mutex->Recursive.Mutex.Queue.Queue.owner = owner;
40006f3c: 00042823 sw zero,16(s0)
if ( heads == NULL ) {
40006f40: 14058863 beqz a1,40007090 <pthread_mutex_unlock+0x1cc>
_Thread_queue_Surrender(
40006f44: 40019737 lui a4,0x40019
40006f48: 6c870713 addi a4,a4,1736 # 400196c8 <_Thread_queue_Operations_priority_inherit>
40006f4c: 1080006f j 40007054 <pthread_mutex_unlock+0x190>
unsigned int nest_level;
ISR_lock_Context lock_context;
Per_CPU_Control *cpu_self;
Thread_queue_Heads *heads;
if ( !_POSIX_Mutex_Is_owner( the_mutex, executing ) ) {
40006f50: 01042783 lw a5,16(s0)
40006f54: 08f51663 bne a0,a5,40006fe0 <pthread_mutex_unlock+0x11c>
_POSIX_Mutex_Release( the_mutex, queue_context );
return STATUS_NOT_OWNER;
}
nest_level = the_mutex->Recursive.nest_level;
40006f58: 01842783 lw a5,24(s0)
if ( nest_level > 0 ) {
40006f5c: 12079663 bnez a5,40007088 <pthread_mutex_unlock+0x1c4> <== NEVER TAKEN
_Thread_Resource_count_decrement( executing );
_Thread_queue_Context_clear_priority_updates( queue_context );
_Thread_Wait_acquire_default_critical( executing, &lock_context );
_Thread_Priority_remove(
40006f60: 02040a13 addi s4,s0,32
40006f64: 00c10613 addi a2,sp,12
40006f68: 000a0593 mv a1,s4
40006f6c: 02012023 sw zero,32(sp)
40006f70: 2f1020ef jal ra,40009a60 <_Thread_Priority_remove>
disable_level = cpu_self->thread_dispatch_disable_level;
40006f74: 03092783 lw a5,48(s2)
);
_Thread_Wait_release_default_critical( executing, &lock_context );
cpu_self = _Thread_queue_Dispatch_disable( queue_context );
heads = the_mutex->Recursive.Mutex.Queue.Queue.heads;
40006f78: 00c42503 lw a0,12(s0)
cpu_self->thread_dispatch_disable_level = disable_level + 1;
40006f7c: 00178793 addi a5,a5,1
40006f80: 02f92823 sw a5,48(s2)
if ( heads != NULL ) {
40006f84: 12050c63 beqz a0,400070bc <pthread_mutex_unlock+0x1f8>
const Thread_queue_Operations *operations;
Thread_Control *new_owner;
operations = POSIX_MUTEX_PRIORITY_CEILING_TQ_OPERATIONS;
new_owner = ( *operations->first )( heads );
40006f88: 40019937 lui s2,0x40019
40006f8c: 6b490793 addi a5,s2,1716 # 400196b4 <_Thread_queue_Operations_priority>
40006f90: 0107a783 lw a5,16(a5)
40006f94: 000780e7 jalr a5
_POSIX_Mutex_Set_owner( the_mutex, new_owner );
_Thread_Resource_count_increment( new_owner );
_Thread_Priority_add(
40006f98: 000a0593 mv a1,s4
the_mutex->Recursive.Mutex.Queue.Queue.owner = owner;
40006f9c: 00a42823 sw a0,16(s0)
_Thread_Priority_add(
40006fa0: 00c10613 addi a2,sp,12
new_owner = ( *operations->first )( heads );
40006fa4: 00050493 mv s1,a0
_Thread_Priority_add(
40006fa8: 221020ef jal ra,400099c8 <_Thread_Priority_add>
new_owner,
&the_mutex->Priority_ceiling,
queue_context
);
_Thread_queue_Extract_critical(
40006fac: 00c10693 addi a3,sp,12
40006fb0: 00048613 mv a2,s1
40006fb4: 6b490593 addi a1,s2,1716
40006fb8: 00c40513 addi a0,s0,12
40006fbc: 4c8030ef jal ra,4000a484 <_Thread_queue_Extract_critical>
} else {
_POSIX_Mutex_Set_owner( the_mutex, NULL );
_POSIX_Mutex_Release( the_mutex, queue_context );
}
_Thread_Priority_update( queue_context );
40006fc0: 00c10513 addi a0,sp,12
40006fc4: 3d9020ef jal ra,40009b9c <_Thread_Priority_update>
_Thread_Dispatch_enable( cpu_self );
40006fc8: bc098513 addi a0,s3,-1088
40006fcc: 691020ef jal ra,40009e5c <_Thread_Dispatch_enable>
return STATUS_SUCCESSFUL;
40006fd0: 00000513 li a0,0
40006fd4: 0180006f j 40006fec <pthread_mutex_unlock+0x128>
if ( !_POSIX_Mutex_Is_owner( the_mutex, executing ) ) {
40006fd8: 01042783 lw a5,16(s0)
40006fdc: 04f50e63 beq a0,a5,40007038 <pthread_mutex_unlock+0x174>
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40006fe0: 00c12783 lw a5,12(sp)
40006fe4: 3007a073 csrs mstatus,a5
return STATUS_NOT_OWNER;
40006fe8: 00100513 li a0,1
);
break;
}
return _POSIX_Get_error( status );
}
40006fec: 04c12083 lw ra,76(sp)
40006ff0: 04812403 lw s0,72(sp)
40006ff4: 04412483 lw s1,68(sp)
40006ff8: 04012903 lw s2,64(sp)
40006ffc: 03c12983 lw s3,60(sp)
40007000: 03812a03 lw s4,56(sp)
40007004: 05010113 addi sp,sp,80
40007008: 00008067 ret
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
4000700c: e25ff0ef jal ra,40006e30 <_POSIX_Mutex_Auto_initialization>
40007010: ee0518e3 bnez a0,40006f00 <pthread_mutex_unlock+0x3c>
}
40007014: 04c12083 lw ra,76(sp)
40007018: 04812403 lw s0,72(sp)
4000701c: 04412483 lw s1,68(sp)
40007020: 04012903 lw s2,64(sp)
40007024: 03c12983 lw s3,60(sp)
40007028: 03812a03 lw s4,56(sp)
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
4000702c: 01600513 li a0,22
}
40007030: 05010113 addi sp,sp,80
40007034: 00008067 ret
nest_level = the_mutex->Recursive.nest_level;
40007038: 01842783 lw a5,24(s0)
if ( nest_level > 0 ) {
4000703c: 04079663 bnez a5,40007088 <pthread_mutex_unlock+0x1c4> <== NEVER TAKEN
heads = the_mutex->Recursive.Mutex.Queue.Queue.heads;
40007040: 00c42583 lw a1,12(s0)
the_mutex->Recursive.Mutex.Queue.Queue.owner = owner;
40007044: 00042823 sw zero,16(s0)
if ( heads == NULL ) {
40007048: 04058463 beqz a1,40007090 <pthread_mutex_unlock+0x1cc>
_Thread_queue_Surrender(
4000704c: 40019737 lui a4,0x40019
40007050: 68c70713 addi a4,a4,1676 # 4001968c <_Thread_queue_Operations_FIFO>
40007054: 00c10693 addi a3,sp,12
40007058: 00050613 mv a2,a0
4000705c: 00c40513 addi a0,s0,12
40007060: 584030ef jal ra,4000a5e4 <_Thread_queue_Surrender>
40007064: 04c12083 lw ra,76(sp)
40007068: 04812403 lw s0,72(sp)
4000706c: 04412483 lw s1,68(sp)
40007070: 04012903 lw s2,64(sp)
40007074: 03c12983 lw s3,60(sp)
40007078: 03812a03 lw s4,56(sp)
return STATUS_SUCCESSFUL;
4000707c: 00000513 li a0,0
40007080: 05010113 addi sp,sp,80
40007084: 00008067 ret
the_mutex->Recursive.nest_level = nest_level - 1;
40007088: fff78793 addi a5,a5,-1 <== NOT EXECUTED
4000708c: 00f42c23 sw a5,24(s0) <== NOT EXECUTED
40007090: 00c12783 lw a5,12(sp)
40007094: 3007a073 csrs mstatus,a5
40007098: 04c12083 lw ra,76(sp)
4000709c: 04812403 lw s0,72(sp)
400070a0: 04412483 lw s1,68(sp)
400070a4: 04012903 lw s2,64(sp)
400070a8: 03c12983 lw s3,60(sp)
400070ac: 03812a03 lw s4,56(sp)
return STATUS_SUCCESSFUL;
400070b0: 00000513 li a0,0
400070b4: 05010113 addi sp,sp,80
400070b8: 00008067 ret
the_mutex->Recursive.Mutex.Queue.Queue.owner = owner;
400070bc: 00042823 sw zero,16(s0)
400070c0: 00c12783 lw a5,12(sp)
400070c4: 3007a073 csrs mstatus,a5
}
400070c8: ef9ff06f j 40006fc0 <pthread_mutex_unlock+0xfc>
POSIX_MUTEX_VALIDATE_OBJECT( the_mutex, flags );
400070cc: 01600513 li a0,22
}
400070d0: 00008067 ret
4000357c <pthread_mutexattr_gettype>:
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
int pthread_mutexattr_gettype(
const pthread_mutexattr_t *attr,
int *type
)
{
4000357c: 00050793 mv a5,a0
if ( attr == NULL || !attr->is_initialized || type == NULL )
40003580: 02050263 beqz a0,400035a4 <pthread_mutexattr_gettype+0x28>
40003584: 00052703 lw a4,0(a0)
return EINVAL;
40003588: 01600513 li a0,22
if ( attr == NULL || !attr->is_initialized || type == NULL )
4000358c: 00070e63 beqz a4,400035a8 <pthread_mutexattr_gettype+0x2c>
40003590: 00058c63 beqz a1,400035a8 <pthread_mutexattr_gettype+0x2c> <== NEVER TAKEN
*type = attr->type;
40003594: 0107a783 lw a5,16(a5) # f010 <bsp_section_text_size+0x6b4>
return 0;
40003598: 00000513 li a0,0
*type = attr->type;
4000359c: 00f5a023 sw a5,0(a1)
return 0;
400035a0: 00008067 ret
return EINVAL;
400035a4: 01600513 li a0,22
}
400035a8: 00008067 ret
400035f8 <pthread_mutexattr_settype>:
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
int pthread_mutexattr_settype(
pthread_mutexattr_t *attr,
int type
)
{
400035f8: 00050793 mv a5,a0
if ( !attr || !attr->is_initialized )
400035fc: 02050263 beqz a0,40003620 <pthread_mutexattr_settype+0x28>
40003600: 00052703 lw a4,0(a0)
return EINVAL;
40003604: 01600513 li a0,22
if ( !attr || !attr->is_initialized )
40003608: 00070e63 beqz a4,40003624 <pthread_mutexattr_settype+0x2c> <== NEVER TAKEN
switch ( type ) {
4000360c: 00300713 li a4,3
40003610: 00b76a63 bltu a4,a1,40003624 <pthread_mutexattr_settype+0x2c>
case PTHREAD_MUTEX_NORMAL:
case PTHREAD_MUTEX_RECURSIVE:
case PTHREAD_MUTEX_ERRORCHECK:
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
40003614: 00b7a823 sw a1,16(a5)
return 0;
40003618: 00000513 li a0,0
4000361c: 00008067 ret
return EINVAL;
40003620: 01600513 li a0,22
default:
return EINVAL;
}
}
40003624: 00008067 ret
400058b4 <pthread_rwlock_init>:
{
POSIX_RWLock_Control *the_rwlock;
the_rwlock = _POSIX_RWLock_Get( rwlock );
if ( the_rwlock == NULL ) {
400058b4: 04050c63 beqz a0,4000590c <pthread_rwlock_init+0x58>
400058b8: 00050793 mv a5,a0
return EINVAL;
}
if ( attr != NULL ) {
400058bc: 00058e63 beqz a1,400058d8 <pthread_rwlock_init+0x24>
if ( !attr->is_initialized ) {
400058c0: 0005a703 lw a4,0(a1)
return EINVAL;
400058c4: 01600513 li a0,22
if ( !attr->is_initialized ) {
400058c8: 04070063 beqz a4,40005908 <pthread_rwlock_init+0x54> <== NEVER TAKEN
return EINVAL;
}
if ( !_POSIX_Is_valid_pshared( attr->process_shared ) ) {
400058cc: 0045a683 lw a3,4(a1)
400058d0: 00100713 li a4,1
400058d4: 02d76a63 bltu a4,a3,40005908 <pthread_rwlock_init+0x54>
return EINVAL;
}
}
the_rwlock->flags = (uintptr_t) the_rwlock ^ POSIX_RWLOCK_MAGIC;
400058d8: 9621e737 lui a4,0x9621e
{
400058dc: ff010113 addi sp,sp,-16
the_rwlock->flags = (uintptr_t) the_rwlock ^ POSIX_RWLOCK_MAGIC;
400058e0: abd70713 addi a4,a4,-1347 # 9621dabd <RamEnd+0x5521dabd>
{
400058e4: 00112623 sw ra,12(sp)
the_rwlock->flags = (uintptr_t) the_rwlock ^ POSIX_RWLOCK_MAGIC;
400058e8: 00e7c733 xor a4,a5,a4
_CORE_RWLock_Initialize( &the_rwlock->RWLock );
400058ec: 00478513 addi a0,a5,4
the_rwlock->flags = (uintptr_t) the_rwlock ^ POSIX_RWLOCK_MAGIC;
400058f0: 00e7a023 sw a4,0(a5)
_CORE_RWLock_Initialize( &the_rwlock->RWLock );
400058f4: 6e0010ef jal ra,40006fd4 <_CORE_RWLock_Initialize>
return 0;
}
400058f8: 00c12083 lw ra,12(sp)
return 0;
400058fc: 00000513 li a0,0
}
40005900: 01010113 addi sp,sp,16
40005904: 00008067 ret
40005908: 00008067 ret
return EINVAL;
4000590c: 01600513 li a0,22
40005910: 00008067 ret
40004fe8 <pthread_setcancelstate>:
int pthread_setcancelstate(
int state,
int *oldstate
)
{
40004fe8: ff010113 addi sp,sp,-16
40004fec: 00812423 sw s0,8(sp)
40004ff0: 00912223 sw s1,4(sp)
40004ff4: 00112623 sw ra,12(sp)
40004ff8: 00050413 mv s0,a0
40004ffc: 00058493 mv s1,a1
Thread_Life_state new_life_protection;
Thread_Life_state previous_life_state;
if ( _ISR_Is_in_progress() ) {
40005000: 580000ef jal ra,40005580 <_ISR_Is_in_progress>
40005004: 06051263 bnez a0,40005068 <pthread_setcancelstate+0x80>
return EPROTO;
}
if ( state == PTHREAD_CANCEL_DISABLE ) {
40005008: 00100793 li a5,1
4000500c: 06f40a63 beq s0,a5,40005080 <pthread_setcancelstate+0x98>
new_life_protection = THREAD_LIFE_PROTECTED;
} else if ( state == PTHREAD_CANCEL_ENABLE ) {
new_life_protection = 0;
} else {
return EINVAL;
40005010: 01600513 li a0,22
} else if ( state == PTHREAD_CANCEL_ENABLE ) {
40005014: 02041463 bnez s0,4000503c <pthread_setcancelstate+0x54>
new_life_protection = 0;
40005018: 00000513 li a0,0
}
previous_life_state = _Thread_Set_life_protection( new_life_protection );
4000501c: 55d030ef jal ra,40008d78 <_Thread_Set_life_protection>
40005020: 00050793 mv a5,a0
} else {
*oldstate = PTHREAD_CANCEL_ENABLE;
}
}
return 0;
40005024: 00000513 li a0,0
if ( oldstate != NULL ) {
40005028: 00048a63 beqz s1,4000503c <pthread_setcancelstate+0x54>
if ( ( previous_life_state & THREAD_LIFE_PROTECTED ) != 0 ) {
4000502c: 0017f793 andi a5,a5,1
40005030: 02078063 beqz a5,40005050 <pthread_setcancelstate+0x68> <== ALWAYS TAKEN
*oldstate = PTHREAD_CANCEL_DISABLE;
40005034: 00100793 li a5,1 <== NOT EXECUTED
40005038: 00f4a023 sw a5,0(s1) <== NOT EXECUTED
}
4000503c: 00c12083 lw ra,12(sp)
40005040: 00812403 lw s0,8(sp)
40005044: 00412483 lw s1,4(sp)
40005048: 01010113 addi sp,sp,16
4000504c: 00008067 ret
40005050: 00c12083 lw ra,12(sp)
40005054: 00812403 lw s0,8(sp)
*oldstate = PTHREAD_CANCEL_ENABLE;
40005058: 0004a023 sw zero,0(s1)
}
4000505c: 00412483 lw s1,4(sp)
40005060: 01010113 addi sp,sp,16
40005064: 00008067 ret
40005068: 00c12083 lw ra,12(sp)
4000506c: 00812403 lw s0,8(sp)
40005070: 00412483 lw s1,4(sp)
return EPROTO;
40005074: 04700513 li a0,71
}
40005078: 01010113 addi sp,sp,16
4000507c: 00008067 ret
new_life_protection = THREAD_LIFE_PROTECTED;
40005080: 00100513 li a0,1 <== NOT EXECUTED
40005084: f99ff06f j 4000501c <pthread_setcancelstate+0x34> <== NOT EXECUTED
40005088 <pthread_setcanceltype>:
int pthread_setcanceltype(
int type,
int *oldtype
)
{
40005088: ff010113 addi sp,sp,-16
4000508c: 00812423 sw s0,8(sp)
40005090: 00912223 sw s1,4(sp)
40005094: 00112623 sw ra,12(sp)
40005098: 00050413 mv s0,a0
4000509c: 00058493 mv s1,a1
Thread_Life_state set_life_state;
Thread_Life_state previous_life_state;
if ( _ISR_Is_in_progress() ) {
400050a0: 4e0000ef jal ra,40005580 <_ISR_Is_in_progress>
400050a4: 06051863 bnez a0,40005114 <pthread_setcanceltype+0x8c>
return EPROTO;
}
if ( type == PTHREAD_CANCEL_DEFERRED ) {
400050a8: 04040663 beqz s0,400050f4 <pthread_setcanceltype+0x6c>
set_life_state = THREAD_LIFE_CHANGE_DEFERRED;
} else if ( type == PTHREAD_CANCEL_ASYNCHRONOUS ) {
400050ac: 00100793 li a5,1
set_life_state = 0;
} else {
return EINVAL;
400050b0: 01600513 li a0,22
set_life_state = 0;
400050b4: 00000593 li a1,0
} else if ( type == PTHREAD_CANCEL_ASYNCHRONOUS ) {
400050b8: 02f41463 bne s0,a5,400050e0 <pthread_setcanceltype+0x58>
}
previous_life_state = _Thread_Change_life(
400050bc: 00000613 li a2,0
400050c0: 00800513 li a0,8
400050c4: 3e9030ef jal ra,40008cac <_Thread_Change_life>
400050c8: 00050793 mv a5,a0
} else {
*oldtype = PTHREAD_CANCEL_ASYNCHRONOUS;
}
}
return 0;
400050cc: 00000513 li a0,0
if ( oldtype != NULL ) {
400050d0: 00048863 beqz s1,400050e0 <pthread_setcanceltype+0x58>
if ( ( previous_life_state & THREAD_LIFE_CHANGE_DEFERRED ) != 0 ) {
400050d4: 0087f793 andi a5,a5,8
400050d8: 04078a63 beqz a5,4000512c <pthread_setcanceltype+0xa4> <== NEVER TAKEN
*oldtype = PTHREAD_CANCEL_DEFERRED;
400050dc: 0004a023 sw zero,0(s1)
}
400050e0: 00c12083 lw ra,12(sp)
400050e4: 00812403 lw s0,8(sp)
400050e8: 00412483 lw s1,4(sp)
400050ec: 01010113 addi sp,sp,16
400050f0: 00008067 ret
set_life_state = THREAD_LIFE_CHANGE_DEFERRED;
400050f4: 00800593 li a1,8
previous_life_state = _Thread_Change_life(
400050f8: 00000613 li a2,0
400050fc: 00800513 li a0,8
40005100: 3ad030ef jal ra,40008cac <_Thread_Change_life>
40005104: 00050793 mv a5,a0
return 0;
40005108: 00000513 li a0,0
if ( oldtype != NULL ) {
4000510c: fc0494e3 bnez s1,400050d4 <pthread_setcanceltype+0x4c>
40005110: fd1ff06f j 400050e0 <pthread_setcanceltype+0x58>
}
40005114: 00c12083 lw ra,12(sp)
40005118: 00812403 lw s0,8(sp)
4000511c: 00412483 lw s1,4(sp)
return EPROTO;
40005120: 04700513 li a0,71
}
40005124: 01010113 addi sp,sp,16
40005128: 00008067 ret
4000512c: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40005130: 00812403 lw s0,8(sp) <== NOT EXECUTED
*oldtype = PTHREAD_CANCEL_ASYNCHRONOUS;
40005134: 00100793 li a5,1 <== NOT EXECUTED
40005138: 00f4a023 sw a5,0(s1) <== NOT EXECUTED
}
4000513c: 00412483 lw s1,4(sp) <== NOT EXECUTED
40005140: 01010113 addi sp,sp,16 <== NOT EXECUTED
40005144: 00008067 ret <== NOT EXECUTED
40007668 <pthread_setschedparam>:
const struct sched_param *param
#else
struct sched_param *param
#endif
)
{
40007668: f9010113 addi sp,sp,-112
4000766c: 06112623 sw ra,108(sp)
40007670: 06812423 sw s0,104(sp)
40007674: 06912223 sw s1,100(sp)
40007678: 07212023 sw s2,96(sp)
4000767c: 05312e23 sw s3,92(sp)
40007680: 05412c23 sw s4,88(sp)
40007684: 05512a23 sw s5,84(sp)
40007688: 05612823 sw s6,80(sp)
4000768c: 05712623 sw s7,76(sp)
40007690: 05812423 sw s8,72(sp)
40007694: 05912223 sw s9,68(sp)
40007698: 05a12023 sw s10,64(sp)
4000769c: 03b12e23 sw s11,60(sp)
Thread_Control *the_thread;
Per_CPU_Control *cpu_self;
Thread_queue_Context queue_context;
int error;
if ( param == NULL ) {
400076a0: 1c060e63 beqz a2,4000787c <pthread_setschedparam+0x214>
return EINVAL;
}
error = _POSIX_Thread_Translate_sched_param(
400076a4: 00060413 mv s0,a2
400076a8: 00058993 mv s3,a1
400076ac: 00050493 mv s1,a0
400076b0: 00810693 addi a3,sp,8
400076b4: 00410613 addi a2,sp,4
400076b8: 00040593 mv a1,s0
400076bc: 00098513 mv a0,s3
400076c0: 6a4050ef jal ra,4000cd64 <_POSIX_Thread_Translate_sched_param>
400076c4: 00050d13 mv s10,a0
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( error != 0 ) {
400076c8: 04050263 beqz a0,4000770c <pthread_setschedparam+0xa4>
cpu_self = _Thread_queue_Dispatch_disable( &queue_context );
_Thread_Wait_release( the_thread, &queue_context );
_Thread_Priority_update( &queue_context );
_Thread_Dispatch_enable( cpu_self );
return error;
}
400076cc: 06c12083 lw ra,108(sp)
400076d0: 06812403 lw s0,104(sp)
400076d4: 06412483 lw s1,100(sp)
400076d8: 06012903 lw s2,96(sp)
400076dc: 05c12983 lw s3,92(sp)
400076e0: 05812a03 lw s4,88(sp)
400076e4: 05412a83 lw s5,84(sp)
400076e8: 05012b03 lw s6,80(sp)
400076ec: 04c12b83 lw s7,76(sp)
400076f0: 04812c03 lw s8,72(sp)
400076f4: 04412c83 lw s9,68(sp)
400076f8: 03c12d83 lw s11,60(sp)
400076fc: 000d0513 mv a0,s10
40007700: 04012d03 lw s10,64(sp)
40007704: 07010113 addi sp,sp,112
40007708: 00008067 ret
the_thread = _Thread_Get( thread, &queue_context.Lock_context.Lock_context );
4000770c: 00048513 mv a0,s1
40007710: 00c10593 addi a1,sp,12
queue_context->Priority.update_count = 0;
40007714: 02012023 sw zero,32(sp)
40007718: 16c020ef jal ra,40009884 <_Thread_Get>
4000771c: 00050493 mv s1,a0
if ( the_thread == NULL ) {
40007720: 16050263 beqz a0,40007884 <pthread_setschedparam+0x21c>
normal_prio = param->sched_priority;
40007724: 00042903 lw s2,0(s0)
core_normal_prio = _POSIX_Priority_To_core( scheduler, normal_prio, &valid );
40007728: 40091b37 lui s6,0x40091
4000772c: 00310613 addi a2,sp,3
40007730: 00090593 mv a1,s2
40007734: 028b0513 addi a0,s6,40 # 40091028 <_Scheduler_Table>
error = _POSIX_Set_sched_param(
40007738: 00412c83 lw s9,4(sp)
4000773c: 00812c03 lw s8,8(sp)
core_normal_prio = _POSIX_Priority_To_core( scheduler, normal_prio, &valid );
40007740: 7d8040ef jal ra,4000bf18 <_POSIX_Priority_To_core>
if ( !valid ) {
40007744: 00314703 lbu a4,3(sp)
core_normal_prio = _POSIX_Priority_To_core( scheduler, normal_prio, &valid );
40007748: 00050a93 mv s5,a0
4000774c: 00058a13 mv s4,a1
if ( !valid ) {
40007750: 10070a63 beqz a4,40007864 <pthread_setschedparam+0x1fc> <== NEVER TAKEN
if ( policy == SCHED_SPORADIC ) {
40007754: 00400713 li a4,4
40007758: 10e98e63 beq s3,a4,40007874 <pthread_setschedparam+0x20c>
core_low_prio = _POSIX_Priority_To_core( scheduler, low_prio, &valid );
4000775c: 028b0513 addi a0,s6,40
40007760: 00310613 addi a2,sp,3
40007764: 00090593 mv a1,s2
40007768: 7b0040ef jal ra,4000bf18 <_POSIX_Priority_To_core>
if ( !valid ) {
4000776c: 00314703 lbu a4,3(sp)
core_low_prio = _POSIX_Priority_To_core( scheduler, low_prio, &valid );
40007770: 00050b93 mv s7,a0
40007774: 00058b13 mv s6,a1
if ( !valid ) {
40007778: 0e070663 beqz a4,40007864 <pthread_setschedparam+0x1fc>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4000777c: 1984a903 lw s2,408(s1)
_Watchdog_Remove(
40007780: 400b67b7 lui a5,0x400b6
40007784: cd078513 addi a0,a5,-816 # 400b5cd0 <_Per_CPU_Information+0x50>
_Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
40007788: 00890d93 addi s11,s2,8
4000778c: 000d8593 mv a1,s11
40007790: 1a0040ef jal ra,4000b930 <_Watchdog_Remove>
if ( _Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
40007794: 03492703 lw a4,52(s2)
40007798: 0344aa23 sw s4,52(s1)
4000779c: 0354a823 sw s5,48(s1)
400077a0: fff00a13 li s4,-1
_Thread_Priority_add(
400077a4: 02048593 addi a1,s1,32
if ( _Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
400077a8: 0f470263 beq a4,s4,4000788c <pthread_setschedparam+0x224>
_Thread_Priority_add(
400077ac: 00048513 mv a0,s1
400077b0: 00c10613 addi a2,sp,12
400077b4: 3c1010ef jal ra,40009374 <_Thread_Priority_add>
_Thread_Priority_remove(
400077b8: 00c10613 addi a2,sp,12
400077bc: 02890593 addi a1,s2,40
400077c0: 00048513 mv a0,s1
400077c4: 449010ef jal ra,4000940c <_Thread_Priority_remove>
400077c8: 03492a23 sw s4,52(s2)
api->Sporadic.sched_ss_max_repl = param->sched_ss_max_repl;
400077cc: 02842703 lw a4,40(s0)
api->Sporadic.sched_ss_repl_period = param->sched_ss_repl_period;
400077d0: 00842e03 lw t3,8(s0)
400077d4: 00c42303 lw t1,12(s0)
400077d8: 01042883 lw a7,16(s0)
400077dc: 01442803 lw a6,20(s0)
api->Sporadic.sched_ss_init_budget = param->sched_ss_init_budget;
400077e0: 01842503 lw a0,24(s0)
400077e4: 01c42583 lw a1,28(s0)
400077e8: 02042603 lw a2,32(s0)
400077ec: 02442683 lw a3,36(s0)
the_thread->budget_algorithm = budget_algorithm;
400077f0: 0994a823 sw s9,144(s1)
the_thread->budget_callout = budget_callout;
400077f4: 0984aa23 sw s8,148(s1)
api->Sporadic.sched_ss_max_repl = param->sched_ss_max_repl;
400077f8: 06e92023 sw a4,96(s2)
400077fc: 03792c23 sw s7,56(s2)
40007800: 03692e23 sw s6,60(s2)
api->Sporadic.sched_ss_repl_period = param->sched_ss_repl_period;
40007804: 05c92023 sw t3,64(s2)
40007808: 04692223 sw t1,68(s2)
4000780c: 05192423 sw a7,72(s2)
40007810: 05092623 sw a6,76(s2)
api->Sporadic.sched_ss_init_budget = param->sched_ss_init_budget;
40007814: 04a92823 sw a0,80(s2)
40007818: 04b92a23 sw a1,84(s2)
4000781c: 04c92c23 sw a2,88(s2)
40007820: 04d92e23 sw a3,92(s2)
if ( policy == SCHED_SPORADIC ) {
40007824: 00400713 li a4,4
40007828: 06e98c63 beq s3,a4,400078a0 <pthread_setschedparam+0x238>
the_thread->cpu_time_budget =
4000782c: 9501a703 lw a4,-1712(gp) # 400b2998 <_Watchdog_Ticks_per_timeslice>
40007830: 400b69b7 lui s3,0x400b6
40007834: c8098413 addi s0,s3,-896 # 400b5c80 <_Per_CPU_Information>
40007838: 08e4a623 sw a4,140(s1)
disable_level = cpu_self->thread_dispatch_disable_level;
4000783c: 03042703 lw a4,48(s0)
cpu_self->thread_dispatch_disable_level = disable_level + 1;
40007840: 00170713 addi a4,a4,1
40007844: 02e42823 sw a4,48(s0)
40007848: 00c12703 lw a4,12(sp)
4000784c: 30072073 csrs mstatus,a4
_Thread_Priority_update( &queue_context );
40007850: 00c10513 addi a0,sp,12
40007854: 4f5010ef jal ra,40009548 <_Thread_Priority_update>
_Thread_Dispatch_enable( cpu_self );
40007858: c8098513 addi a0,s3,-896
4000785c: 7ad010ef jal ra,40009808 <_Thread_Dispatch_enable>
return error;
40007860: e6dff06f j 400076cc <pthread_setschedparam+0x64>
40007864: 400b69b7 lui s3,0x400b6
return EINVAL;
40007868: 01600d13 li s10,22
4000786c: c8098413 addi s0,s3,-896 # 400b5c80 <_Per_CPU_Information>
40007870: fcdff06f j 4000783c <pthread_setschedparam+0x1d4>
low_prio = param->sched_ss_low_priority;
40007874: 00442903 lw s2,4(s0)
40007878: ee5ff06f j 4000775c <pthread_setschedparam+0xf4>
return EINVAL;
4000787c: 01600d13 li s10,22
40007880: e4dff06f j 400076cc <pthread_setschedparam+0x64>
return ESRCH;
40007884: 00300d13 li s10,3
40007888: e45ff06f j 400076cc <pthread_setschedparam+0x64>
_Thread_Priority_changed(
4000788c: 00c10693 addi a3,sp,12
40007890: 00000613 li a2,0
40007894: 00048513 mv a0,s1
40007898: 411010ef jal ra,400094a8 <_Thread_Priority_changed>
4000789c: f31ff06f j 400077cc <pthread_setschedparam+0x164>
_Timespec_To_ticks( &api->Sporadic.sched_ss_init_budget );
400078a0: 05090513 addi a0,s2,80
400078a4: 3f1030ef jal ra,4000b494 <_Timespec_To_ticks>
the_thread->cpu_time_budget =
400078a8: 08a4a623 sw a0,140(s1)
expire = ticks + cpu->Watchdog.ticks;
400078ac: 400b69b7 lui s3,0x400b6
_Watchdog_Per_CPU_insert_ticks(
400078b0: 04090513 addi a0,s2,64
400078b4: 3e1030ef jal ra,4000b494 <_Timespec_To_ticks>
400078b8: c8098413 addi s0,s3,-896 # 400b5c80 <_Per_CPU_Information>
400078bc: 04842603 lw a2,72(s0)
400078c0: 04c42683 lw a3,76(s0)
_Watchdog_Insert(header, the_watchdog, expire);
400078c4: 400b67b7 lui a5,0x400b6
expire = ticks + cpu->Watchdog.ticks;
400078c8: 00c50633 add a2,a0,a2
400078cc: 00a63533 sltu a0,a2,a0
_Watchdog_Insert(header, the_watchdog, expire);
400078d0: 00d506b3 add a3,a0,a3
400078d4: 000d8593 mv a1,s11
400078d8: cd078513 addi a0,a5,-816 # 400b5cd0 <_Per_CPU_Information+0x50>
400078dc: 7e5030ef jal ra,4000b8c0 <_Watchdog_Insert>
}
400078e0: f5dff06f j 4000783c <pthread_setschedparam+0x1d4>
40004194 <pthread_setspecific>:
int pthread_setspecific(
pthread_key_t key,
const void *value
)
{
40004194: fe010113 addi sp,sp,-32
40004198: 00812c23 sw s0,24(sp)
4000419c: 01312623 sw s3,12(sp)
400041a0: 400147b7 lui a5,0x40014
400041a4: 00112e23 sw ra,28(sp)
400041a8: 00912a23 sw s1,20(sp)
400041ac: 01212823 sw s2,16(sp)
400041b0: 01412423 sw s4,8(sp)
400041b4: fb87a983 lw s3,-72(a5) # 40013fb8 <_Per_CPU_Information+0x38>
400041b8: 00050413 mv s0,a0
Thread_Control *executing;
int eno;
executing = _Thread_Get_executing();
if ( value != NULL ) {
400041bc: 06058663 beqz a1,40004228 <pthread_setspecific+0x94>
400041c0: 00058493 mv s1,a1
__asm__ volatile (
400041c4: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
400041c8: 0087f593 andi a1,a5,8
while ( *link != NULL ) {
400041cc: 19c9a783 lw a5,412(s3)
400041d0: 00079c63 bnez a5,400041e8 <pthread_setspecific+0x54>
400041d4: 0e80006f j 400042bc <pthread_setspecific+0x128>
} else if ( ( *less )( key, parent ) ) {
400041d8: 00e47463 bgeu s0,a4,400041e0 <pthread_setspecific+0x4c>
return &RB_LEFT( the_node, Node );
400041dc: 00078693 mv a3,a5 <== NOT EXECUTED
while ( *link != NULL ) {
400041e0: 0006a783 lw a5,0(a3) # 4000 <bsp_section_bss_size+0x1ecc>
400041e4: 0c078c63 beqz a5,400042bc <pthread_setspecific+0x128>
return *the_left == the_right->key;
400041e8: 0107a703 lw a4,16(a5)
the_right = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( right );
400041ec: ff878613 addi a2,a5,-8
return &RB_RIGHT( the_node, Node );
400041f0: 00478693 addi a3,a5,4
if ( ( *equal )( key, parent ) ) {
400041f4: fee412e3 bne s0,a4,400041d8 <pthread_setspecific+0x44>
key_value_pair->value = RTEMS_DECONST( void *, value );
400041f8: 02962023 sw s1,32(a2)
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400041fc: 3005a073 csrs mstatus,a1
_POSIX_Keys_Key_value_acquire( executing, &lock_context );
key_value_pair = _POSIX_Keys_Key_value_find( key, executing );
if ( key_value_pair != NULL ) {
eno = _POSIX_Keys_Set_value( key_value_pair, value );
40004200: 00000913 li s2,0
} else {
eno = _POSIX_Keys_Delete_value( key, executing );
}
return eno;
}
40004204: 01c12083 lw ra,28(sp)
40004208: 01812403 lw s0,24(sp)
4000420c: 01412483 lw s1,20(sp)
40004210: 00c12983 lw s3,12(sp)
40004214: 00812a03 lw s4,8(sp)
40004218: 00090513 mv a0,s2
4000421c: 01012903 lw s2,16(sp)
40004220: 02010113 addi sp,sp,32
40004224: 00008067 ret
_RTEMS_Lock_allocator();
40004228: 4e1000ef jal ra,40004f08 <_RTEMS_Lock_allocator>
_Objects_Get_no_protection( (Objects_Id) key, &_POSIX_Keys_Information );
4000422c: 400125b7 lui a1,0x40012
40004230: 22058593 addi a1,a1,544 # 40012220 <_POSIX_Keys_Information>
40004234: 00040513 mv a0,s0
40004238: 611010ef jal ra,40006048 <_Objects_Get_no_protection>
eno = EINVAL;
4000423c: 01600913 li s2,22
if ( the_key != NULL ) {
40004240: 00050e63 beqz a0,4000425c <pthread_setspecific+0xc8>
__asm__ volatile (
40004244: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40004248: 0087f913 andi s2,a5,8
while ( *link != NULL ) {
4000424c: 19c9a583 lw a1,412(s3)
40004250: 02059263 bnez a1,40004274 <pthread_setspecific+0xe0>
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004254: 30092073 csrs mstatus,s2
eno = 0;
40004258: 00000913 li s2,0
_RTEMS_Unlock_allocator();
4000425c: 4b9000ef jal ra,40004f14 <_RTEMS_Unlock_allocator>
return eno;
40004260: fa5ff06f j 40004204 <pthread_setspecific+0x70>
} else if ( ( *less )( key, parent ) ) {
40004264: 00f47463 bgeu s0,a5,4000426c <pthread_setspecific+0xd8> <== NOT EXECUTED
return &RB_LEFT( the_node, Node );
40004268: 00058713 mv a4,a1 <== NOT EXECUTED
while ( *link != NULL ) {
4000426c: 00072583 lw a1,0(a4) <== NOT EXECUTED
40004270: fe0582e3 beqz a1,40004254 <pthread_setspecific+0xc0> <== NOT EXECUTED
return *the_left == the_right->key;
40004274: 0105a783 lw a5,16(a1)
the_right = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( right );
40004278: ff858493 addi s1,a1,-8
return &RB_RIGHT( the_node, Node );
4000427c: 00458713 addi a4,a1,4
if ( ( *equal )( key, parent ) ) {
40004280: fef412e3 bne s0,a5,40004264 <pthread_setspecific+0xd0>
_RBTree_Extract(
40004284: 19c98513 addi a0,s3,412
40004288: 7a1010ef jal ra,40006228 <_RBTree_Extract>
4000428c: 30092073 csrs mstatus,s2
next = the_node->next;
40004290: 0004a703 lw a4,0(s1)
previous = the_node->previous;
40004294: 0044a783 lw a5,4(s1)
_Freechain_Put( &_POSIX_Keys_Keypool, key_value_pair );
40004298: 40014537 lui a0,0x40014
4000429c: 00048593 mv a1,s1
next->previous = previous;
400042a0: 00f72223 sw a5,4(a4)
previous->next = next;
400042a4: 00e7a023 sw a4,0(a5)
400042a8: f4850513 addi a0,a0,-184 # 40013f48 <_POSIX_Keys_Keypool>
400042ac: 64d000ef jal ra,400050f8 <_Freechain_Put>
eno = 0;
400042b0: 00000913 li s2,0
400042b4: 461000ef jal ra,40004f14 <_RTEMS_Unlock_allocator>
return eno;
400042b8: f4dff06f j 40004204 <pthread_setspecific+0x70>
400042bc: 3005a073 csrs mstatus,a1
_RTEMS_Lock_allocator();
400042c0: 449000ef jal ra,40004f08 <_RTEMS_Lock_allocator>
_Objects_Get_no_protection( (Objects_Id) key, &_POSIX_Keys_Information );
400042c4: 400125b7 lui a1,0x40012
400042c8: 22058593 addi a1,a1,544 # 40012220 <_POSIX_Keys_Information>
400042cc: 00040513 mv a0,s0
400042d0: 579010ef jal ra,40006048 <_Objects_Get_no_protection>
400042d4: 00050a13 mv s4,a0
eno = EINVAL;
400042d8: 01600913 li s2,22
if ( the_key != NULL ) {
400042dc: f80500e3 beqz a0,4000425c <pthread_setspecific+0xc8>
key_value_pair = _POSIX_Keys_Key_value_allocate();
400042e0: d55ff0ef jal ra,40004034 <_POSIX_Keys_Key_value_allocate>
400042e4: 00050613 mv a2,a0
eno = ENOMEM;
400042e8: 00c00913 li s2,12
if ( key_value_pair != NULL ) {
400042ec: f60508e3 beqz a0,4000425c <pthread_setspecific+0xc8> <== NEVER TAKEN
old_last = tail->previous;
400042f0: 01ca2783 lw a5,28(s4)
return &the_chain->Tail.Node;
400042f4: 018a0713 addi a4,s4,24
key_value_pair->key = key;
400042f8: 00852c23 sw s0,24(a0)
key_value_pair->thread = executing;
400042fc: 01352e23 sw s3,28(a0)
key_value_pair->value = RTEMS_DECONST( void *, value );
40004300: 02952023 sw s1,32(a0)
the_node->next = tail;
40004304: 00e52023 sw a4,0(a0)
tail->previous = the_node;
40004308: 00aa2e23 sw a0,28(s4)
old_last->next = the_node;
4000430c: 00a7a023 sw a0,0(a5)
_RBTree_Initialize_node( &key_value_pair->Lookup_node );
40004310: 00860593 addi a1,a2,8
return &RB_ROOT( the_rbtree );
40004314: 19c98513 addi a0,s3,412
the_node->previous = old_last;
40004318: 00f62223 sw a5,4(a2)
__asm__ volatile (
4000431c: 300474f3 csrrci s1,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
40004320: 0084f493 andi s1,s1,8
while ( *link != NULL ) {
40004324: 19c9a783 lw a5,412(s3)
40004328: 00079663 bnez a5,40004334 <pthread_setspecific+0x1a0>
4000432c: 0480006f j 40004374 <pthread_setspecific+0x1e0>
40004330: 00070793 mv a5,a4
if ( ( *less )( key, parent ) ) {
40004334: 0107a703 lw a4,16(a5)
return &RB_RIGHT( the_node, Node );
40004338: 00478693 addi a3,a5,4
if ( ( *less )( key, parent ) ) {
4000433c: 00e47463 bgeu s0,a4,40004344 <pthread_setspecific+0x1b0>
return &RB_LEFT( the_node, Node );
40004340: 00078693 mv a3,a5 <== NOT EXECUTED
while ( *link != NULL ) {
40004344: 0006a703 lw a4,0(a3)
40004348: fe0714e3 bnez a4,40004330 <pthread_setspecific+0x19c>
RB_SET( child, parent, Node );
4000434c: 00f62823 sw a5,16(a2)
40004350: 00100793 li a5,1
40004354: 00062623 sw zero,12(a2)
40004358: 00062423 sw zero,8(a2)
4000435c: 00f62a23 sw a5,20(a2)
*link = child;
40004360: 00b6a023 sw a1,0(a3)
_RBTree_Insert_color( the_rbtree, the_node );
40004364: 2f0020ef jal ra,40006654 <_RBTree_Insert_color>
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40004368: 3004a073 csrs mstatus,s1
eno = 0;
4000436c: 00000913 li s2,0
_RTEMS_Unlock_allocator();
40004370: eedff06f j 4000425c <pthread_setspecific+0xc8>
link = _RBTree_Root_reference( the_rbtree );
40004374: 00050693 mv a3,a0
40004378: fd5ff06f j 4000434c <pthread_setspecific+0x1b8>
40005148 <pthread_testcancel>:
/*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
void pthread_testcancel( void )
{
40005148: ff010113 addi sp,sp,-16
4000514c: 00112623 sw ra,12(sp)
if ( _ISR_Is_in_progress() ) {
40005150: 430000ef jal ra,40005580 <_ISR_Is_in_progress>
40005154: 00050863 beqz a0,40005164 <pthread_testcancel+0x1c> <== ALWAYS TAKEN
return;
}
_Thread_Change_life( 0, 0, THREAD_LIFE_CHANGE_DEFERRED );
}
40005158: 00c12083 lw ra,12(sp) <== NOT EXECUTED
4000515c: 01010113 addi sp,sp,16 <== NOT EXECUTED
40005160: 00008067 ret <== NOT EXECUTED
40005164: 00c12083 lw ra,12(sp)
_Thread_Change_life( 0, 0, THREAD_LIFE_CHANGE_DEFERRED );
40005168: 00800613 li a2,8
4000516c: 00000593 li a1,0
}
40005170: 01010113 addi sp,sp,16
_Thread_Change_life( 0, 0, THREAD_LIFE_CHANGE_DEFERRED );
40005174: 3390306f j 40008cac <_Thread_Change_life>
400089c0 <rtems_aio_enqueue>:
{
400089c0: fa010113 addi sp,sp,-96
400089c4: 05312623 sw s3,76(sp)
result = pthread_mutex_lock (&aio_request_queue.mutex);
400089c8: 400189b7 lui s3,0x40018
{
400089cc: 04912a23 sw s1,84(sp)
400089d0: 00050493 mv s1,a0
result = pthread_mutex_lock (&aio_request_queue.mutex);
400089d4: 5b098513 addi a0,s3,1456 # 400185b0 <aio_request_queue>
{
400089d8: 05412423 sw s4,72(sp)
400089dc: 04112e23 sw ra,92(sp)
400089e0: 04812c23 sw s0,88(sp)
400089e4: 05212823 sw s2,80(sp)
result = pthread_mutex_lock (&aio_request_queue.mutex);
400089e8: 455010ef jal ra,4000a63c <pthread_mutex_lock>
400089ec: 00050a13 mv s4,a0
if (result != 0) {
400089f0: 12051063 bnez a0,40008b10 <rtems_aio_enqueue+0x150> <== NEVER TAKEN
pthread_getschedparam (pthread_self(), &policy, ¶m);
400089f4: 255020ef jal ra,4000b448 <pthread_self>
400089f8: 01010613 addi a2,sp,16
400089fc: 00c10593 addi a1,sp,12
40008a00: 109020ef jal ra,4000b308 <pthread_getschedparam>
req->caller_thread = pthread_self ();
40008a04: 245020ef jal ra,4000b448 <pthread_self>
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
40008a08: 0144a783 lw a5,20(s1)
40008a0c: 01012703 lw a4,16(sp)
40008a10: 5b098913 addi s2,s3,1456
40008a14: 0187a603 lw a2,24(a5)
if ((aio_request_queue.idle_threads == 0) &&
40008a18: 0e092683 lw a3,224(s2)
req->caller_thread = pthread_self ();
40008a1c: 00a4a823 sw a0,16(s1)
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
40008a20: 40c70733 sub a4,a4,a2
40008a24: 00e4a623 sw a4,12(s1)
req->policy = policy;
40008a28: 00c12703 lw a4,12(sp)
40008a2c: 00e4a423 sw a4,8(s1)
req->aiocbp->error_code = EINPROGRESS;
40008a30: 07700713 li a4,119
40008a34: 02e7aa23 sw a4,52(a5)
req->aiocbp->return_value = 0;
40008a38: 0207ac23 sw zero,56(a5)
if ((aio_request_queue.idle_threads == 0) &&
40008a3c: 08069863 bnez a3,40008acc <rtems_aio_enqueue+0x10c> <== NEVER TAKEN
40008a40: 0dc92683 lw a3,220(s2)
40008a44: 00400713 li a4,4
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
40008a48: 0007a583 lw a1,0(a5)
if ((aio_request_queue.idle_threads == 0) &&
40008a4c: 0cd75863 bge a4,a3,40008b1c <rtems_aio_enqueue+0x15c>
return _Chain_Immutable_head( the_chain )->next;
40008a50: 0c092403 lw s0,192(s2)
while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
40008a54: 01442783 lw a5,20(s0)
40008a58: 00b7dc63 bge a5,a1,40008a70 <rtems_aio_enqueue+0xb0>
40008a5c: 0c490713 addi a4,s2,196
40008a60: 06e40a63 beq s0,a4,40008ad4 <rtems_aio_enqueue+0x114>
return the_node->next;
40008a64: 00042403 lw s0,0(s0)
40008a68: 01442783 lw a5,20(s0)
40008a6c: feb7cae3 blt a5,a1,40008a60 <rtems_aio_enqueue+0xa0>
if (r_chain->fildes == fildes)
40008a70: 06f59263 bne a1,a5,40008ad4 <rtems_aio_enqueue+0x114>
pthread_mutex_lock (&r_chain->mutex);
40008a74: 02040913 addi s2,s0,32
r_chain->new_fd = 0;
40008a78: 00042c23 sw zero,24(s0)
pthread_mutex_lock (&r_chain->mutex);
40008a7c: 00090513 mv a0,s2
40008a80: 3bd010ef jal ra,4000a63c <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
40008a84: 00048593 mv a1,s1
40008a88: 00840513 addi a0,s0,8
40008a8c: 89dff0ef jal ra,40008328 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
40008a90: 06040513 addi a0,s0,96
40008a94: 60c010ef jal ra,4000a0a0 <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
40008a98: 00090513 mv a0,s2
40008a9c: 659010ef jal ra,4000a8f4 <pthread_mutex_unlock>
pthread_mutex_unlock (&aio_request_queue.mutex);
40008aa0: 5b098513 addi a0,s3,1456
40008aa4: 651010ef jal ra,4000a8f4 <pthread_mutex_unlock>
}
40008aa8: 05c12083 lw ra,92(sp)
40008aac: 05812403 lw s0,88(sp)
40008ab0: 05412483 lw s1,84(sp)
40008ab4: 05012903 lw s2,80(sp)
40008ab8: 04c12983 lw s3,76(sp)
40008abc: 000a0513 mv a0,s4
40008ac0: 04812a03 lw s4,72(sp)
40008ac4: 06010113 addi sp,sp,96
40008ac8: 00008067 ret
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
40008acc: 0007a583 lw a1,0(a5) <== NOT EXECUTED
40008ad0: f81ff06f j 40008a50 <rtems_aio_enqueue+0x90> <== NOT EXECUTED
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
40008ad4: 00100613 li a2,1
40008ad8: 0cc90513 addi a0,s2,204
40008adc: c91ff0ef jal ra,4000876c <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
40008ae0: 01852703 lw a4,24(a0)
40008ae4: 00100793 li a5,1
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
40008ae8: 00050413 mv s0,a0
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
40008aec: 00048593 mv a1,s1
40008af0: 00850513 addi a0,a0,8
if (r_chain->new_fd == 1) {
40008af4: 04f70663 beq a4,a5,40008b40 <rtems_aio_enqueue+0x180>
rtems_aio_insert_prio (&r_chain->perfd, req);
40008af8: 831ff0ef jal ra,40008328 <rtems_aio_insert_prio>
if (aio_request_queue.idle_threads > 0)
40008afc: 0e092783 lw a5,224(s2)
40008b00: faf050e3 blez a5,40008aa0 <rtems_aio_enqueue+0xe0> <== ALWAYS TAKEN
pthread_cond_signal (&aio_request_queue.new_req);
40008b04: 04090513 addi a0,s2,64 <== NOT EXECUTED
40008b08: 598010ef jal ra,4000a0a0 <pthread_cond_signal> <== NOT EXECUTED
40008b0c: f95ff06f j 40008aa0 <rtems_aio_enqueue+0xe0> <== NOT EXECUTED
free (req);
40008b10: 00048513 mv a0,s1 <== NOT EXECUTED
40008b14: e69f70ef jal ra,4000097c <free> <== NOT EXECUTED
return result;
40008b18: f91ff06f j 40008aa8 <rtems_aio_enqueue+0xe8> <== NOT EXECUTED
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
40008b1c: 00100613 li a2,1
40008b20: 0c090513 addi a0,s2,192
40008b24: c49ff0ef jal ra,4000876c <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
40008b28: 01852703 lw a4,24(a0)
40008b2c: 00100793 li a5,1
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
40008b30: 00050413 mv s0,a0
if (r_chain->new_fd == 1) {
40008b34: 02f70863 beq a4,a5,40008b64 <rtems_aio_enqueue+0x1a4>
pthread_mutex_lock (&r_chain->mutex);
40008b38: 02050913 addi s2,a0,32
40008b3c: f41ff06f j 40008a7c <rtems_aio_enqueue+0xbc>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
40008b40: 4d5020ef jal ra,4000b814 <rtems_chain_prepend>
pthread_mutex_init (&r_chain->mutex, NULL);
40008b44: 00000593 li a1,0
r_chain->new_fd = 0;
40008b48: 00042c23 sw zero,24(s0)
pthread_mutex_init (&r_chain->mutex, NULL);
40008b4c: 02040513 addi a0,s0,32
40008b50: 1ad010ef jal ra,4000a4fc <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
40008b54: 00000593 li a1,0
40008b58: 06040513 addi a0,s0,96
40008b5c: 4bc010ef jal ra,4000a018 <pthread_cond_init>
40008b60: f9dff06f j 40008afc <rtems_aio_enqueue+0x13c>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
40008b64: 00048593 mv a1,s1
40008b68: 00850513 addi a0,a0,8
40008b6c: 4a9020ef jal ra,4000b814 <rtems_chain_prepend>
pthread_mutex_init (&r_chain->mutex, NULL);
40008b70: 00000593 li a1,0
r_chain->new_fd = 0;
40008b74: 00042c23 sw zero,24(s0)
pthread_mutex_init (&r_chain->mutex, NULL);
40008b78: 02040513 addi a0,s0,32
40008b7c: 181010ef jal ra,4000a4fc <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
40008b80: 00000593 li a1,0
40008b84: 06040513 addi a0,s0,96
40008b88: 490010ef jal ra,4000a018 <pthread_cond_init>
result = pthread_create (&thid, &aio_request_queue.attr,
40008b8c: 40008637 lui a2,0x40008
40008b90: 00040693 mv a3,s0
40008b94: 37460613 addi a2,a2,884 # 40008374 <rtems_aio_handle>
40008b98: 06090593 addi a1,s2,96
40008b9c: 00810513 addi a0,sp,8
40008ba0: 2d4020ef jal ra,4000ae74 <pthread_create>
40008ba4: 00050413 mv s0,a0
if (result != 0) {
40008ba8: 00051a63 bnez a0,40008bbc <rtems_aio_enqueue+0x1fc> <== NEVER TAKEN
++aio_request_queue.active_threads;
40008bac: 0dc92783 lw a5,220(s2)
40008bb0: 00178793 addi a5,a5,1
40008bb4: 0cf92e23 sw a5,220(s2)
40008bb8: ee9ff06f j 40008aa0 <rtems_aio_enqueue+0xe0>
pthread_mutex_unlock (&aio_request_queue.mutex);
40008bbc: 5b098513 addi a0,s3,1456 <== NOT EXECUTED
40008bc0: 535010ef jal ra,4000a8f4 <pthread_mutex_unlock> <== NOT EXECUTED
return result;
40008bc4: 00040a13 mv s4,s0 <== NOT EXECUTED
40008bc8: ee1ff06f j 40008aa8 <rtems_aio_enqueue+0xe8> <== NOT EXECUTED
40008640 <rtems_aio_init>:
{
40008640: fe010113 addi sp,sp,-32
40008644: 01312623 sw s3,12(sp)
result = pthread_attr_init (&aio_request_queue.attr);
40008648: 400189b7 lui s3,0x40018
{
4000864c: 00812c23 sw s0,24(sp)
result = pthread_attr_init (&aio_request_queue.attr);
40008650: 5b098413 addi s0,s3,1456 # 400185b0 <aio_request_queue>
{
40008654: 01212823 sw s2,16(sp)
result = pthread_attr_init (&aio_request_queue.attr);
40008658: 06040913 addi s2,s0,96
4000865c: 00090513 mv a0,s2
{
40008660: 00912a23 sw s1,20(sp)
40008664: 00112e23 sw ra,28(sp)
result = pthread_attr_init (&aio_request_queue.attr);
40008668: 550020ef jal ra,4000abb8 <pthread_attr_init>
if (result != 0)
4000866c: 00050493 mv s1,a0
40008670: 02050263 beqz a0,40008694 <rtems_aio_init+0x54> <== ALWAYS TAKEN
}
40008674: 01c12083 lw ra,28(sp) <== NOT EXECUTED
40008678: 01812403 lw s0,24(sp) <== NOT EXECUTED
4000867c: 01012903 lw s2,16(sp) <== NOT EXECUTED
40008680: 00c12983 lw s3,12(sp) <== NOT EXECUTED
40008684: 00048513 mv a0,s1 <== NOT EXECUTED
40008688: 01412483 lw s1,20(sp) <== NOT EXECUTED
4000868c: 02010113 addi sp,sp,32 <== NOT EXECUTED
40008690: 00008067 ret <== NOT EXECUTED
pthread_attr_setdetachstate (&aio_request_queue.attr,
40008694: 00000593 li a1,0
40008698: 00090513 mv a0,s2
4000869c: 574020ef jal ra,4000ac10 <pthread_attr_setdetachstate>
if (result != 0)
400086a0: 08051263 bnez a0,40008724 <rtems_aio_init+0xe4> <== NEVER TAKEN
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
400086a4: 00000593 li a1,0
400086a8: 5b098513 addi a0,s3,1456
400086ac: 651010ef jal ra,4000a4fc <pthread_mutex_init>
if (result != 0)
400086b0: 08051663 bnez a0,4000873c <rtems_aio_init+0xfc> <== NEVER TAKEN
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
400086b4: 00000593 li a1,0
400086b8: 04040513 addi a0,s0,64
400086bc: 15d010ef jal ra,4000a018 <pthread_cond_init>
400086c0: 00050493 mv s1,a0
if (result != 0) {
400086c4: 08051a63 bnez a0,40008758 <rtems_aio_init+0x118> <== NEVER TAKEN
tail->previous = head;
400086c8: 0cc40793 addi a5,s0,204
400086cc: 0cf42a23 sw a5,212(s0)
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
400086d0: 0000b7b7 lui a5,0xb
head->next = tail;
400086d4: 0c440613 addi a2,s0,196
tail->previous = head;
400086d8: 0c040693 addi a3,s0,192
head->next = tail;
400086dc: 0d040713 addi a4,s0,208
400086e0: 00b78793 addi a5,a5,11 # b00b <bsp_section_bss_size+0x62f3>
}
400086e4: 01c12083 lw ra,28(sp)
400086e8: 0cc42023 sw a2,192(s0)
head->previous = NULL;
400086ec: 0c042223 sw zero,196(s0)
tail->previous = head;
400086f0: 0cd42423 sw a3,200(s0)
head->next = tail;
400086f4: 0ce42623 sw a4,204(s0)
head->previous = NULL;
400086f8: 0c042823 sw zero,208(s0)
aio_request_queue.active_threads = 0;
400086fc: 0c042e23 sw zero,220(s0)
aio_request_queue.idle_threads = 0;
40008700: 0e042023 sw zero,224(s0)
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
40008704: 0cf42c23 sw a5,216(s0)
}
40008708: 01812403 lw s0,24(sp)
4000870c: 01012903 lw s2,16(sp)
40008710: 00c12983 lw s3,12(sp)
40008714: 00048513 mv a0,s1
40008718: 01412483 lw s1,20(sp)
4000871c: 02010113 addi sp,sp,32
40008720: 00008067 ret
pthread_attr_destroy (&aio_request_queue.attr);
40008724: 00090513 mv a0,s2 <== NOT EXECUTED
40008728: 468020ef jal ra,4000ab90 <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
4000872c: 00000593 li a1,0 <== NOT EXECUTED
40008730: 5b098513 addi a0,s3,1456 <== NOT EXECUTED
40008734: 5c9010ef jal ra,4000a4fc <pthread_mutex_init> <== NOT EXECUTED
if (result != 0)
40008738: f6050ee3 beqz a0,400086b4 <rtems_aio_init+0x74> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
4000873c: 00090513 mv a0,s2 <== NOT EXECUTED
40008740: 450020ef jal ra,4000ab90 <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
40008744: 00000593 li a1,0 <== NOT EXECUTED
40008748: 04040513 addi a0,s0,64 <== NOT EXECUTED
4000874c: 0cd010ef jal ra,4000a018 <pthread_cond_init> <== NOT EXECUTED
40008750: 00050493 mv s1,a0 <== NOT EXECUTED
if (result != 0) {
40008754: f6050ae3 beqz a0,400086c8 <rtems_aio_init+0x88> <== NOT EXECUTED
pthread_mutex_destroy (&aio_request_queue.mutex);
40008758: 5b098513 addi a0,s3,1456 <== NOT EXECUTED
4000875c: 515010ef jal ra,4000a470 <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
40008760: 00090513 mv a0,s2 <== NOT EXECUTED
40008764: 42c020ef jal ra,4000ab90 <pthread_attr_destroy> <== NOT EXECUTED
40008768: f61ff06f j 400086c8 <rtems_aio_init+0x88> <== NOT EXECUTED
40008934 <rtems_aio_remove_req>:
{
40008934: ff010113 addi sp,sp,-16
40008938: 00812423 sw s0,8(sp)
return _Chain_Immutable_head( the_chain )->next;
4000893c: 00052403 lw s0,0(a0)
40008940: 00112623 sw ra,12(sp)
return &the_chain->Tail.Node;
40008944: 00450513 addi a0,a0,4
if (rtems_chain_is_empty (chain))
40008948: 06850263 beq a0,s0,400089ac <rtems_aio_remove_req+0x78>
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
4000894c: 01442783 lw a5,20(s0)
40008950: 02b78063 beq a5,a1,40008970 <rtems_aio_remove_req+0x3c>
return the_node->next;
40008954: 00042403 lw s0,0(s0) <== NOT EXECUTED
40008958: fea41ae3 bne s0,a0,4000894c <rtems_aio_remove_req+0x18> <== NOT EXECUTED
}
4000895c: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40008960: 00812403 lw s0,8(sp) <== NOT EXECUTED
return AIO_NOTCANCELED;
40008964: 00100513 li a0,1 <== NOT EXECUTED
}
40008968: 01010113 addi sp,sp,16 <== NOT EXECUTED
4000896c: 00008067 ret <== NOT EXECUTED
if (rtems_chain_is_tail (chain, node))
40008970: fe8506e3 beq a0,s0,4000895c <rtems_aio_remove_req+0x28>
rtems_chain_extract (node);
40008974: 00040513 mv a0,s0
40008978: 659020ef jal ra,4000b7d0 <rtems_chain_extract>
current->aiocbp->error_code = ECANCELED;
4000897c: 01442783 lw a5,20(s0)
40008980: 08c00713 li a4,140
free (current);
40008984: 00040513 mv a0,s0
current->aiocbp->error_code = ECANCELED;
40008988: 02e7aa23 sw a4,52(a5)
current->aiocbp->return_value = -1;
4000898c: fff00713 li a4,-1
40008990: 02e7ac23 sw a4,56(a5)
free (current);
40008994: fe9f70ef jal ra,4000097c <free>
}
40008998: 00c12083 lw ra,12(sp)
4000899c: 00812403 lw s0,8(sp)
return AIO_CANCELED;
400089a0: 00000513 li a0,0
}
400089a4: 01010113 addi sp,sp,16
400089a8: 00008067 ret
400089ac: 00c12083 lw ra,12(sp)
400089b0: 00812403 lw s0,8(sp)
return AIO_ALLDONE;
400089b4: 00200513 li a0,2
}
400089b8: 01010113 addi sp,sp,16
400089bc: 00008067 ret
4000876c <rtems_aio_search_fd>:
{
4000876c: fe010113 addi sp,sp,-32
40008770: 01412423 sw s4,8(sp)
return _Chain_Immutable_head( the_chain )->next;
40008774: 00052a03 lw s4,0(a0)
40008778: 00912a23 sw s1,20(sp)
4000877c: 01312623 sw s3,12(sp)
while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
40008780: 014a2783 lw a5,20(s4)
{
40008784: 00112e23 sw ra,28(sp)
40008788: 00812c23 sw s0,24(sp)
4000878c: 01212823 sw s2,16(sp)
40008790: 00050993 mv s3,a0
40008794: 00058493 mv s1,a1
while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
40008798: 0cb7de63 bge a5,a1,40008874 <rtems_aio_search_fd+0x108>
return &the_chain->Tail.Node;
4000879c: 00450913 addi s2,a0,4
400087a0: 0f2a0063 beq s4,s2,40008880 <rtems_aio_search_fd+0x114>
400087a4: 000a0413 mv s0,s4
400087a8: 0080006f j 400087b0 <rtems_aio_search_fd+0x44>
400087ac: 03240e63 beq s0,s2,400087e8 <rtems_aio_search_fd+0x7c>
return the_node->next;
400087b0: 00042403 lw s0,0(s0)
400087b4: 01442783 lw a5,20(s0)
400087b8: fe97cae3 blt a5,s1,400087ac <rtems_aio_search_fd+0x40>
if (r_chain->fildes == fildes)
400087bc: 06f49863 bne s1,a5,4000882c <rtems_aio_search_fd+0xc0>
r_chain->new_fd = 0;
400087c0: 00042c23 sw zero,24(s0)
}
400087c4: 01c12083 lw ra,28(sp)
400087c8: 00040513 mv a0,s0
400087cc: 01812403 lw s0,24(sp)
400087d0: 01412483 lw s1,20(sp)
400087d4: 01012903 lw s2,16(sp)
400087d8: 00c12983 lw s3,12(sp)
400087dc: 00812a03 lw s4,8(sp)
400087e0: 02010113 addi sp,sp,32
400087e4: 00008067 ret
r_chain = NULL;
400087e8: 00000413 li s0,0
if (create == 0)
400087ec: fc060ce3 beqz a2,400087c4 <rtems_aio_search_fd+0x58>
r_chain = malloc (sizeof (rtems_aio_request_chain));
400087f0: 08000513 li a0,128
400087f4: c64f80ef jal ra,40000c58 <malloc>
return &the_chain->Tail.Node;
400087f8: 00850793 addi a5,a0,8
400087fc: 00c50713 addi a4,a0,12
40008800: 00050413 mv s0,a0
head->next = tail;
40008804: 00e52423 sw a4,8(a0)
head->previous = NULL;
40008808: 00052623 sw zero,12(a0)
tail->previous = head;
4000880c: 00f52823 sw a5,16(a0)
rtems_chain_initialize_node (&r_chain->next_fd);
40008810: 00050593 mv a1,a0
rtems_chain_insert (rtems_chain_previous (node), &r_chain->next_fd);
40008814: 00492503 lw a0,4(s2)
40008818: 7d9020ef jal ra,4000b7f0 <rtems_chain_insert>
r_chain->new_fd = 1;
4000881c: 00100793 li a5,1
40008820: 00f42c23 sw a5,24(s0)
r_chain->fildes = fildes;
40008824: 00942a23 sw s1,20(s0)
40008828: f9dff06f j 400087c4 <rtems_aio_search_fd+0x58>
if (create == 0)
4000882c: 04060063 beqz a2,4000886c <rtems_aio_search_fd+0x100>
r_chain = malloc (sizeof (rtems_aio_request_chain));
40008830: 08000513 li a0,128
40008834: c24f80ef jal ra,40000c58 <malloc>
return &the_chain->Tail.Node;
40008838: 00850793 addi a5,a0,8
4000883c: 00c50713 addi a4,a0,12
tail->previous = head;
40008840: 00f52823 sw a5,16(a0)
head->next = tail;
40008844: 00e52423 sw a4,8(a0)
head->previous = NULL;
40008848: 00052623 sw zero,12(a0)
return &the_chain->Tail.Node;
4000884c: 00498793 addi a5,s3,4
40008850: 00050913 mv s2,a0
rtems_chain_initialize_node (&r_chain->next_fd);
40008854: 00050593 mv a1,a0
if (rtems_chain_is_empty (chain))
40008858: 04fa1c63 bne s4,a5,400088b0 <rtems_aio_search_fd+0x144>
rtems_chain_prepend (chain, &r_chain->next_fd);
4000885c: 00098513 mv a0,s3
40008860: 7b5020ef jal ra,4000b814 <rtems_chain_prepend>
40008864: 00090413 mv s0,s2
40008868: fb5ff06f j 4000881c <rtems_aio_search_fd+0xb0>
r_chain = NULL;
4000886c: 00000413 li s0,0
40008870: f55ff06f j 400087c4 <rtems_aio_search_fd+0x58>
while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
40008874: 000a0413 mv s0,s4
if (r_chain->fildes == fildes)
40008878: f4f484e3 beq s1,a5,400087c0 <rtems_aio_search_fd+0x54>
4000887c: fb1ff06f j 4000882c <rtems_aio_search_fd+0xc0>
r_chain = NULL;
40008880: 00000413 li s0,0
if (create == 0)
40008884: f40600e3 beqz a2,400087c4 <rtems_aio_search_fd+0x58> <== NEVER TAKEN
r_chain = malloc (sizeof (rtems_aio_request_chain));
40008888: 08000513 li a0,128
4000888c: bccf80ef jal ra,40000c58 <malloc>
return &the_chain->Tail.Node;
40008890: 00850793 addi a5,a0,8
40008894: 00c50713 addi a4,a0,12
40008898: 00050913 mv s2,a0
head->next = tail;
4000889c: 00e52423 sw a4,8(a0)
head->previous = NULL;
400088a0: 00052623 sw zero,12(a0)
tail->previous = head;
400088a4: 00f52823 sw a5,16(a0)
rtems_chain_initialize_node (&r_chain->next_fd);
400088a8: 00050593 mv a1,a0
return &the_chain->Tail.Node;
400088ac: fb1ff06f j 4000885c <rtems_aio_search_fd+0xf0>
400088b0: 00040913 mv s2,s0
400088b4: 00050413 mv s0,a0
400088b8: f5dff06f j 40008814 <rtems_aio_search_fd+0xa8>
400040e0 <sched_get_priority_min>:
*/
int sched_get_priority_min(
int policy
)
{
switch ( policy ) {
400040e0: 00200713 li a4,2
{
400040e4: 00050793 mv a5,a0
switch ( policy ) {
400040e8: 02a74863 blt a4,a0,40004118 <sched_get_priority_min+0x38>
400040ec: 00100513 li a0,1
400040f0: 0207dc63 bgez a5,40004128 <sched_get_priority_min+0x48>
{
400040f4: ff010113 addi sp,sp,-16
400040f8: 00112623 sw ra,12(sp)
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
400040fc: 03d0a0ef jal ra,4000e938 <__errno>
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
}
40004100: 00c12083 lw ra,12(sp)
rtems_set_errno_and_return_minus_one( EINVAL );
40004104: 01600793 li a5,22
40004108: 00f52023 sw a5,0(a0)
4000410c: fff00513 li a0,-1
}
40004110: 01010113 addi sp,sp,16
40004114: 00008067 ret
switch ( policy ) {
40004118: 00400713 li a4,4 <== NOT EXECUTED
4000411c: 00100513 li a0,1 <== NOT EXECUTED
40004120: fce79ae3 bne a5,a4,400040f4 <sched_get_priority_min+0x14> <== NOT EXECUTED
}
40004124: 00008067 ret <== NOT EXECUTED
40004128: 00008067 ret
4000412c <sched_rr_get_interval>:
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
)
{
4000412c: fe010113 addi sp,sp,-32
40004130: 00112e23 sw ra,28(sp)
40004134: 00812c23 sw s0,24(sp)
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid && pid != getpid() )
40004138: 02051263 bnez a0,4000415c <sched_rr_get_interval+0x30> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( ESRCH );
if ( !interval )
4000413c: 04058463 beqz a1,40004184 <sched_rr_get_interval+0x58>
rtems_set_errno_and_return_minus_one( EINVAL );
_Timespec_From_ticks(
40004140: 8b81a503 lw a0,-1864(gp) # 40017160 <_Watchdog_Ticks_per_timeslice>
40004144: 2f8030ef jal ra,4000743c <_Timespec_From_ticks>
rtems_configuration_get_ticks_per_timeslice(),
interval
);
return 0;
40004148: 00000513 li a0,0
}
4000414c: 01c12083 lw ra,28(sp)
40004150: 01812403 lw s0,24(sp)
40004154: 02010113 addi sp,sp,32
40004158: 00008067 ret
4000415c: 00b12623 sw a1,12(sp)
40004160: 00050413 mv s0,a0
if ( pid && pid != getpid() )
40004164: ddcfc0ef jal ra,40000740 <getpid>
40004168: 00c12583 lw a1,12(sp)
4000416c: fc8508e3 beq a0,s0,4000413c <sched_rr_get_interval+0x10>
rtems_set_errno_and_return_minus_one( ESRCH );
40004170: 7c80a0ef jal ra,4000e938 <__errno>
40004174: 00300793 li a5,3
40004178: 00f52023 sw a5,0(a0)
4000417c: fff00513 li a0,-1
40004180: fcdff06f j 4000414c <sched_rr_get_interval+0x20>
rtems_set_errno_and_return_minus_one( EINVAL );
40004184: 7b40a0ef jal ra,4000e938 <__errno>
40004188: 01600793 li a5,22
4000418c: 00f52023 sw a5,0(a0)
40004190: fff00513 li a0,-1
40004194: fb9ff06f j 4000414c <sched_rr_get_interval+0x20>
40008184 <sem_close>:
#endif
#include <rtems/posix/semaphoreimpl.h>
int sem_close( sem_t *sem )
{
40008184: ff010113 addi sp,sp,-16
40008188: 00112623 sw ra,12(sp)
4000818c: 00812423 sw s0,8(sp)
40008190: 00912223 sw s1,4(sp)
POSIX_Semaphore_Control *the_semaphore;
uint32_t open_count;
POSIX_SEMAPHORE_VALIDATE_OBJECT( sem );
40008194: 08050663 beqz a0,40008220 <sem_close+0x9c>
40008198: 5d3687b7 lui a5,0x5d368
4000819c: 00052703 lw a4,0(a0)
400081a0: fe778793 addi a5,a5,-25 # 5d367fe7 <RamEnd+0x1c367fe7>
400081a4: 00f547b3 xor a5,a0,a5
400081a8: 00050413 mv s0,a0
400081ac: 06e79a63 bne a5,a4,40008220 <sem_close+0x9c>
if ( !_POSIX_Semaphore_Is_named( sem ) ) {
400081b0: 01452783 lw a5,20(a0)
400081b4: 06078663 beqz a5,40008220 <sem_close+0x9c> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get(
sem_t *sem
)
{
return RTEMS_CONTAINER_OF( sem, POSIX_Semaphore_Control, Semaphore );
400081b8: ff050493 addi s1,a0,-16
_RTEMS_Lock_allocator();
400081bc: 7c0000ef jal ra,4000897c <_RTEMS_Lock_allocator>
the_semaphore = _POSIX_Semaphore_Get( sem );
_Objects_Allocator_lock();
open_count = the_semaphore->open_count;
400081c0: 0304a783 lw a5,48(s1)
if ( open_count == 0 ) {
400081c4: 04078c63 beqz a5,4000821c <sem_close+0x98> <== NEVER TAKEN
_Objects_Allocator_unlock();
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( open_count == 1 && _POSIX_Semaphore_Is_busy( sem ) ) {
400081c8: 00100713 li a4,1
400081cc: 00e79663 bne a5,a4,400081d8 <sem_close+0x54>
400081d0: 00c42703 lw a4,12(s0)
400081d4: 02071863 bnez a4,40008204 <sem_close+0x80>
_Objects_Allocator_unlock();
rtems_set_errno_and_return_minus_one( EBUSY );
}
the_semaphore->open_count = open_count - 1;
400081d8: fff78793 addi a5,a5,-1
_POSIX_Semaphore_Delete( the_semaphore );
400081dc: 00048513 mv a0,s1
the_semaphore->open_count = open_count - 1;
400081e0: 02f4a823 sw a5,48(s1)
_POSIX_Semaphore_Delete( the_semaphore );
400081e4: 209050ef jal ra,4000dbec <_POSIX_Semaphore_Delete>
_RTEMS_Unlock_allocator();
400081e8: 7a0000ef jal ra,40008988 <_RTEMS_Unlock_allocator>
_Objects_Allocator_unlock();
return 0;
400081ec: 00000513 li a0,0
}
400081f0: 00c12083 lw ra,12(sp)
400081f4: 00812403 lw s0,8(sp)
400081f8: 00412483 lw s1,4(sp)
400081fc: 01010113 addi sp,sp,16
40008200: 00008067 ret
40008204: 784000ef jal ra,40008988 <_RTEMS_Unlock_allocator>
rtems_set_errno_and_return_minus_one( EBUSY );
40008208: 16c0b0ef jal ra,40013374 <__errno>
4000820c: 01000793 li a5,16
40008210: 00f52023 sw a5,0(a0)
40008214: fff00513 li a0,-1
40008218: fd9ff06f j 400081f0 <sem_close+0x6c>
4000821c: 76c000ef jal ra,40008988 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EINVAL );
40008220: 1540b0ef jal ra,40013374 <__errno>
40008224: 01600793 li a5,22
40008228: 00f52023 sw a5,0(a0)
4000822c: fff00513 li a0,-1
40008230: fc1ff06f j 400081f0 <sem_close+0x6c>
400052e0 <sem_open>:
{
400052e0: fb010113 addi sp,sp,-80
400052e4: 02912223 sw s1,36(sp)
400052e8: 03212023 sw s2,32(sp)
400052ec: 01412c23 sw s4,24(sp)
400052f0: 01512a23 sw s5,20(sp)
400052f4: 02112623 sw ra,44(sp)
400052f8: 02812423 sw s0,40(sp)
400052fc: 01312e23 sw s3,28(sp)
40005300: 02c12c23 sw a2,56(sp)
40005304: 02d12e23 sw a3,60(sp)
40005308: 04e12023 sw a4,64(sp)
4000530c: 04f12223 sw a5,68(sp)
40005310: 05012423 sw a6,72(sp)
40005314: 05112623 sw a7,76(sp)
if ( oflag & O_CREAT ) {
40005318: 2005fa13 andi s4,a1,512
{
4000531c: 00058493 mv s1,a1
40005320: 00050913 mv s2,a0
40005324: 00000a93 li s5,0
if ( oflag & O_CREAT ) {
40005328: 060a1a63 bnez s4,4000539c <sem_open+0xbc>
_RTEMS_Lock_allocator();
4000532c: 721000ef jal ra,4000624c <_RTEMS_Lock_allocator>
const char *name,
size_t *name_length_p,
Objects_Get_by_name_error *error
)
{
return (POSIX_Semaphore_Control *) _Objects_Get_by_name(
40005330: 400159b7 lui s3,0x40015
40005334: 00c10693 addi a3,sp,12
40005338: 00810613 addi a2,sp,8
4000533c: 00090593 mv a1,s2
40005340: 2d098513 addi a0,s3,720 # 400152d0 <_POSIX_Semaphore_Information>
40005344: 330020ef jal ra,40007674 <_Objects_Get_by_name>
40005348: 00050413 mv s0,a0
if ( the_semaphore == NULL ) {
4000534c: 06050063 beqz a0,400053ac <sem_open+0xcc>
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
40005350: 000017b7 lui a5,0x1
40005354: a0078793 addi a5,a5,-1536 # a00 <bsp_section_data_size+0x214>
40005358: 00f4f4b3 and s1,s1,a5
4000535c: 10f48663 beq s1,a5,40005468 <sem_open+0x188>
the_semaphore->open_count += 1;
40005360: 03052783 lw a5,48(a0)
return &the_semaphore->Semaphore;
40005364: 01050413 addi s0,a0,16
the_semaphore->open_count += 1;
40005368: 00178793 addi a5,a5,1
4000536c: 02f42023 sw a5,32(s0)
_RTEMS_Unlock_allocator();
40005370: 6e9000ef jal ra,40006258 <_RTEMS_Unlock_allocator>
}
40005374: 02c12083 lw ra,44(sp)
40005378: 00040513 mv a0,s0
4000537c: 02812403 lw s0,40(sp)
40005380: 02412483 lw s1,36(sp)
40005384: 02012903 lw s2,32(sp)
40005388: 01c12983 lw s3,28(sp)
4000538c: 01812a03 lw s4,24(sp)
40005390: 01412a83 lw s5,20(sp)
40005394: 05010113 addi sp,sp,80
40005398: 00008067 ret
va_start(arg, oflag);
4000539c: 03810793 addi a5,sp,56
value = va_arg( arg, unsigned int );
400053a0: 00068a93 mv s5,a3
va_start(arg, oflag);
400053a4: 00f12223 sw a5,4(sp)
va_end(arg);
400053a8: f85ff06f j 4000532c <sem_open+0x4c>
if ( !( error == OBJECTS_GET_BY_NAME_NO_OBJECT && (oflag & O_CREAT) ) ) {
400053ac: 00c12703 lw a4,12(sp)
400053b0: 00200793 li a5,2
400053b4: 08f71663 bne a4,a5,40005440 <sem_open+0x160>
400053b8: 080a0463 beqz s4,40005440 <sem_open+0x160>
sem = _POSIX_Semaphore_Create_support(
400053bc: 00812583 lw a1,8(sp)
if ( value > SEM_VALUE_MAX ) {
400053c0: 0c0ac063 bltz s5,40005480 <sem_open+0x1a0>
name = _Workspace_String_duplicate( name_arg, name_len );
400053c4: 00090513 mv a0,s2
400053c8: 56d050ef jal ra,4000b134 <_Workspace_String_duplicate>
400053cc: 00050493 mv s1,a0
if ( name == NULL ) {
400053d0: 0c050063 beqz a0,40005490 <sem_open+0x1b0> <== NEVER TAKEN
return ( *information->allocate )( information );
400053d4: 2d098913 addi s2,s3,720
400053d8: 00892783 lw a5,8(s2)
400053dc: 2d098513 addi a0,s3,720
400053e0: 000780e7 jalr a5
if ( the_semaphore == NULL ) {
400053e4: 0a050e63 beqz a0,400054a0 <sem_open+0x1c0> <== NEVER TAKEN
information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;
400053e8: 00855683 lhu a3,8(a0)
400053ec: 00492703 lw a4,4(s2)
sem->_flags = (uintptr_t) sem ^ POSIX_SEMAPHORE_MAGIC;
400053f0: 5d3687b7 lui a5,0x5d368
_POSIX_Semaphore_Initialize( &the_semaphore->Semaphore, name, value );
400053f4: 01050413 addi s0,a0,16
400053f8: fe778793 addi a5,a5,-25 # 5d367fe7 <RamEnd+0x1c367fe7>
the_semaphore->open_count = 1;
400053fc: 00100613 li a2,1
40005400: 00f447b3 xor a5,s0,a5
40005404: 00269693 slli a3,a3,0x2
40005408: 00f52823 sw a5,16(a0)
4000540c: 02c52823 sw a2,48(a0)
the_semaphore->linked = true;
40005410: 02c50623 sb a2,44(a0)
const char *_name, unsigned int _count)
{
struct _Semaphore_Control _init =
_SEMAPHORE_NAMED_INITIALIZER(_name, _count);
*_semaphore = _init;
40005414: 00052a23 sw zero,20(a0)
40005418: 00052c23 sw zero,24(a0)
4000541c: 00052e23 sw zero,28(a0)
40005420: 02052023 sw zero,32(a0)
40005424: 02952223 sw s1,36(a0)
40005428: 03552423 sw s5,40(a0)
the_object->name.name_p = name;
4000542c: 00952623 sw s1,12(a0)
information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;
40005430: 00d707b3 add a5,a4,a3
40005434: fea7ae23 sw a0,-4(a5)
_RTEMS_Unlock_allocator();
40005438: 621000ef jal ra,40006258 <_RTEMS_Unlock_allocator>
return sem;
4000543c: f39ff06f j 40005374 <sem_open+0x94>
40005440: 619000ef jal ra,40006258 <_RTEMS_Unlock_allocator>
rtems_set_errno_and_return_value(
40005444: 00c12483 lw s1,12(sp)
40005448: 7c40c0ef jal ra,40011c0c <__errno>
4000544c: 400147b7 lui a5,0x40014
40005450: 00249493 slli s1,s1,0x2
40005454: 91078793 addi a5,a5,-1776 # 40013910 <_POSIX_Get_by_name_error_table>
40005458: 009787b3 add a5,a5,s1
4000545c: 0007a783 lw a5,0(a5)
40005460: 00f52023 sw a5,0(a0)
40005464: f11ff06f j 40005374 <sem_open+0x94>
40005468: 5f1000ef jal ra,40006258 <_RTEMS_Unlock_allocator>
rtems_set_errno_and_return_value( EEXIST, SEM_FAILED );
4000546c: 7a00c0ef jal ra,40011c0c <__errno>
40005470: 01100793 li a5,17
40005474: 00f52023 sw a5,0(a0)
40005478: 00000413 li s0,0
4000547c: ef9ff06f j 40005374 <sem_open+0x94>
rtems_set_errno_and_return_value( EINVAL, SEM_FAILED );
40005480: 78c0c0ef jal ra,40011c0c <__errno>
40005484: 01600793 li a5,22
40005488: 00f52023 sw a5,0(a0)
4000548c: fadff06f j 40005438 <sem_open+0x158>
rtems_set_errno_and_return_value( ENOMEM, SEM_FAILED );
40005490: 77c0c0ef jal ra,40011c0c <__errno> <== NOT EXECUTED
40005494: 00c00793 li a5,12 <== NOT EXECUTED
40005498: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000549c: f9dff06f j 40005438 <sem_open+0x158> <== NOT EXECUTED
_Workspace_Free( name );
400054a0: 00048513 mv a0,s1 <== NOT EXECUTED
400054a4: 481050ef jal ra,4000b124 <_Workspace_Free> <== NOT EXECUTED
rtems_set_errno_and_return_value( ENOSPC, SEM_FAILED );
400054a8: 7640c0ef jal ra,40011c0c <__errno> <== NOT EXECUTED
400054ac: 01c00793 li a5,28 <== NOT EXECUTED
400054b0: 00f52023 sw a5,0(a0) <== NOT EXECUTED
400054b4: f85ff06f j 40005438 <sem_open+0x158> <== NOT EXECUTED
400066a0 <sem_timedwait>:
int sem_timedwait(
sem_t *__restrict _sem,
const struct timespec *__restrict abstime
)
{
400066a0: fc010113 addi sp,sp,-64
400066a4: 02112e23 sw ra,60(sp)
400066a8: 02812c23 sw s0,56(sp)
Thread_queue_Context queue_context;
ISR_Level level;
Thread_Control *executing;
unsigned int count;
POSIX_SEMAPHORE_VALIDATE_OBJECT( _sem );
400066ac: 0a050a63 beqz a0,40006760 <sem_timedwait+0xc0>
400066b0: 5d3687b7 lui a5,0x5d368
400066b4: 00052703 lw a4,0(a0)
400066b8: fe778793 addi a5,a5,-25 # 5d367fe7 <RamEnd+0x1c367fe7>
400066bc: 00f547b3 xor a5,a0,a5
400066c0: 0ae79063 bne a5,a4,40006760 <sem_timedwait+0xc0>
__asm__ volatile (
400066c4: 30047773 csrrci a4,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
400066c8: 00877713 andi a4,a4,8
sem = _Sem_Get( &_sem->_Semaphore );
_Thread_queue_Context_initialize( &queue_context );
_Thread_queue_Context_ISR_disable( &queue_context, level );
executing = _Sem_Queue_acquire_critical( sem, &queue_context );
count = sem->count;
400066cc: 01852783 lw a5,24(a0)
if ( RTEMS_PREDICT_TRUE( count > 0 ) ) {
400066d0: 02078463 beqz a5,400066f8 <sem_timedwait+0x58>
sem->count = count - 1;
400066d4: fff78793 addi a5,a5,-1
400066d8: 00f52c23 sw a5,24(a0)
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400066dc: 30072073 csrs mstatus,a4
_Sem_Queue_release( sem, level, &queue_context );
return 0;
400066e0: 00000413 li s0,0
&queue_context
);
status = _Thread_Wait_get_status( executing );
return _POSIX_Zero_or_minus_one_plus_errno( status );
}
}
400066e4: 03c12083 lw ra,60(sp)
400066e8: 00040513 mv a0,s0
400066ec: 03812403 lw s0,56(sp)
400066f0: 04010113 addi sp,sp,64
400066f4: 00008067 ret
400066f8: 400187b7 lui a5,0x40018
400066fc: 0f87a403 lw s0,248(a5) # 400180f8 <_Per_CPU_Information+0x38>
queue_context->thread_state = thread_state;
40006700: 00200793 li a5,2
40006704: 00058813 mv a6,a1
40006708: 00f12823 sw a5,16(sp)
_Thread_queue_Enqueue(
4000670c: 400145b7 lui a1,0x40014
queue_context->enqueue_callout = _Thread_queue_Add_timeout_realtime_timespec;
40006710: 4000a7b7 lui a5,0x4000a
40006714: 00040613 mv a2,s0
40006718: 68878793 addi a5,a5,1672 # 4000a688 <_Thread_queue_Add_timeout_realtime_timespec>
4000671c: 00c10693 addi a3,sp,12
40006720: 09058593 addi a1,a1,144 # 40014090 <_Thread_queue_Operations_priority>
40006724: 00c50513 addi a0,a0,12
queue_context->Timeout.arg = abstime;
40006728: 01012c23 sw a6,24(sp)
queue_context->enqueue_callout = _Thread_queue_Add_timeout_realtime_timespec;
4000672c: 00f12a23 sw a5,20(sp)
40006730: 00e12623 sw a4,12(sp)
40006734: 66d020ef jal ra,400095a0 <_Thread_queue_Enqueue>
*/
RTEMS_INLINE_ROUTINE Status_Control _Thread_Wait_get_status(
const Thread_Control *the_thread
)
{
return (Status_Control) the_thread->Wait.return_code;
40006738: 04c42403 lw s0,76(s0)
if ( status == STATUS_SUCCESSFUL ) {
4000673c: fa0404e3 beqz s0,400066e4 <sem_timedwait+0x44> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( _POSIX_Get_error( status ) );
40006740: 61d0b0ef jal ra,4001255c <__errno>
return STATUS_GET_POSIX( status );
40006744: 41f45793 srai a5,s0,0x1f
40006748: 0ff7f793 andi a5,a5,255
4000674c: 008787b3 add a5,a5,s0
40006750: 4087d793 srai a5,a5,0x8
rtems_set_errno_and_return_minus_one( _POSIX_Get_error( status ) );
40006754: 00f52023 sw a5,0(a0)
40006758: fff00413 li s0,-1
4000675c: f89ff06f j 400066e4 <sem_timedwait+0x44>
POSIX_SEMAPHORE_VALIDATE_OBJECT( _sem );
40006760: 5fd0b0ef jal ra,4001255c <__errno>
40006764: 01600793 li a5,22
40006768: 00f52023 sw a5,0(a0)
4000676c: fff00413 li s0,-1
40006770: f75ff06f j 400066e4 <sem_timedwait+0x44>
40004e48 <shm_open>:
{
40004e48: fb010113 addi sp,sp,-80
40004e4c: 04112623 sw ra,76(sp)
40004e50: 04812423 sw s0,72(sp)
40004e54: 04912223 sw s1,68(sp)
40004e58: 05212023 sw s2,64(sp)
40004e5c: 03312e23 sw s3,60(sp)
40004e60: 03412c23 sw s4,56(sp)
40004e64: 03512a23 sw s5,52(sp)
40004e68: 03612823 sw s6,48(sp)
40004e6c: 03712623 sw s7,44(sp)
40004e70: 03812423 sw s8,40(sp)
40004e74: 03912223 sw s9,36(sp)
if ( ( oflag & O_ACCMODE ) != O_RDONLY && ( oflag & O_ACCMODE ) != O_RDWR ) {
40004e78: 0015f793 andi a5,a1,1
40004e7c: 04078463 beqz a5,40004ec4 <shm_open+0x7c> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EACCES );
40004e80: 37c0b0ef jal ra,400101fc <__errno> <== NOT EXECUTED
40004e84: 00d00793 li a5,13 <== NOT EXECUTED
40004e88: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return -1;
40004e8c: fff00513 li a0,-1 <== NOT EXECUTED
}
40004e90: 04c12083 lw ra,76(sp)
40004e94: 04812403 lw s0,72(sp)
40004e98: 04412483 lw s1,68(sp)
40004e9c: 04012903 lw s2,64(sp)
40004ea0: 03c12983 lw s3,60(sp)
40004ea4: 03812a03 lw s4,56(sp)
40004ea8: 03412a83 lw s5,52(sp)
40004eac: 03012b03 lw s6,48(sp)
40004eb0: 02c12b83 lw s7,44(sp)
40004eb4: 02812c03 lw s8,40(sp)
40004eb8: 02412c83 lw s9,36(sp)
40004ebc: 05010113 addi sp,sp,80
40004ec0: 00008067 ret
if ( ( oflag & ~( O_RDONLY | O_RDWR | O_CREAT | O_EXCL | O_TRUNC ) ) != 0 ) {
40004ec4: fffff7b7 lui a5,0xfffff
40004ec8: 1fd78793 addi a5,a5,509 # fffff1fd <RamEnd+0xbefff1fd>
40004ecc: 00f5f7b3 and a5,a1,a5
40004ed0: 00058493 mv s1,a1
40004ed4: fa0796e3 bnez a5,40004e80 <shm_open+0x38> <== NEVER TAKEN
if ( ( oflag & O_TRUNC ) != 0 && ( oflag & O_ACCMODE ) != O_RDWR ) {
40004ed8: 4005fb13 andi s6,a1,1024
40004edc: 00050a13 mv s4,a0
40004ee0: 00060a93 mv s5,a2
40004ee4: 0035f913 andi s2,a1,3
40004ee8: 060b1263 bnez s6,40004f4c <shm_open+0x104> <== NEVER TAKEN
iop = rtems_libio_allocate();
40004eec: e59fb0ef jal ra,40000d44 <rtems_libio_allocate>
40004ef0: 00050413 mv s0,a0
if ( iop == NULL ) {
40004ef4: 24050863 beqz a0,40005144 <shm_open+0x2fc> <== NEVER TAKEN
_RTEMS_Lock_allocator();
40004ef8: 644000ef jal ra,4000553c <_RTEMS_Lock_allocator>
return (POSIX_Shm_Control *) _Objects_Get_by_name(
40004efc: 4001abb7 lui s7,0x4001a
40004f00: 00c10693 addi a3,sp,12
40004f04: 00810613 addi a2,sp,8
40004f08: 000a0593 mv a1,s4
40004f0c: de8b8513 addi a0,s7,-536 # 40019de8 <_POSIX_Shm_Information>
40004f10: 008010ef jal ra,40005f18 <_Objects_Get_by_name>
40004f14: 00050993 mv s3,a0
if ( shm == NULL ) {
40004f18: 06050663 beqz a0,40004f84 <shm_open+0x13c> <== ALWAYS TAKEN
if ( ( oflag & ( O_EXCL | O_CREAT ) ) == ( O_EXCL | O_CREAT ) ) {
40004f1c: 000017b7 lui a5,0x1 <== NOT EXECUTED
40004f20: a0078793 addi a5,a5,-1536 # a00 <bsp_section_data_size+0x2f0> <== NOT EXECUTED
40004f24: 00f4f4b3 and s1,s1,a5 <== NOT EXECUTED
40004f28: 02f49863 bne s1,a5,40004f58 <shm_open+0x110> <== NOT EXECUTED
_RTEMS_Unlock_allocator();
40004f2c: 61c000ef jal ra,40005548 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
err = EEXIST;
40004f30: 01100493 li s1,17 <== NOT EXECUTED
rtems_libio_free( iop );
40004f34: 00040513 mv a0,s0 <== NOT EXECUTED
40004f38: e69fb0ef jal ra,40000da0 <rtems_libio_free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( err );
40004f3c: 2c00b0ef jal ra,400101fc <__errno> <== NOT EXECUTED
40004f40: 00952023 sw s1,0(a0) <== NOT EXECUTED
40004f44: fff00513 li a0,-1 <== NOT EXECUTED
40004f48: f49ff06f j 40004e90 <shm_open+0x48> <== NOT EXECUTED
if ( ( oflag & O_TRUNC ) != 0 && ( oflag & O_ACCMODE ) != O_RDWR ) {
40004f4c: 00200793 li a5,2 <== NOT EXECUTED
40004f50: f8f90ee3 beq s2,a5,40004eec <shm_open+0xa4> <== NOT EXECUTED
40004f54: f2dff06f j 40004e80 <shm_open+0x38> <== NOT EXECUTED
return rtems_filesystem_check_access( flags, shm->mode, shm->uid, shm->gid );
40004f58: 02e55683 lhu a3,46(a0) <== NOT EXECUTED
40004f5c: 02c55603 lhu a2,44(a0) <== NOT EXECUTED
40004f60: 03052583 lw a1,48(a0) <== NOT EXECUTED
flags = RTEMS_FS_PERMS_WRITE;
40004f64: 00193513 seqz a0,s2 <== NOT EXECUTED
40004f68: 00151513 slli a0,a0,0x1 <== NOT EXECUTED
return rtems_filesystem_check_access( flags, shm->mode, shm->uid, shm->gid );
40004f6c: 00250513 addi a0,a0,2 <== NOT EXECUTED
40004f70: 4fc040ef jal ra,4000946c <rtems_filesystem_check_access> <== NOT EXECUTED
} else if ( !shm_access_ok( shm, oflag ) ) {
40004f74: 18051263 bnez a0,400050f8 <shm_open+0x2b0> <== NOT EXECUTED
40004f78: 5d0000ef jal ra,40005548 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
err = EACCES;
40004f7c: 00d00493 li s1,13 <== NOT EXECUTED
40004f80: fb5ff06f j 40004f34 <shm_open+0xec> <== NOT EXECUTED
switch ( obj_err ) {
40004f84: 00c12783 lw a5,12(sp)
40004f88: 1a078263 beqz a5,4000512c <shm_open+0x2e4> <== NEVER TAKEN
40004f8c: 00100c13 li s8,1
40004f90: 19878863 beq a5,s8,40005120 <shm_open+0x2d8>
if ( name_arg[0] != '/' ) {
40004f94: 000a4703 lbu a4,0(s4)
40004f98: 02f00793 li a5,47
40004f9c: 18f71863 bne a4,a5,4000512c <shm_open+0x2e4>
if ( ( oflag & O_CREAT ) != O_CREAT ) {
40004fa0: 2004f793 andi a5,s1,512
40004fa4: 18078a63 beqz a5,40005138 <shm_open+0x2f0> <== NEVER TAKEN
name = _Workspace_String_duplicate( name_arg, name_len );
40004fa8: 00812583 lw a1,8(sp)
40004fac: 000a0513 mv a0,s4
40004fb0: 6f0030ef jal ra,400086a0 <_Workspace_String_duplicate>
40004fb4: 00050a13 mv s4,a0
if ( name == NULL ) {
40004fb8: 1a050063 beqz a0,40005158 <shm_open+0x310> <== NEVER TAKEN
return ( *information->allocate )( information );
40004fbc: de8b8c93 addi s9,s7,-536
40004fc0: 008ca783 lw a5,8(s9)
40004fc4: de8b8513 addi a0,s7,-536
40004fc8: 000780e7 jalr a5
40004fcc: 00050993 mv s3,a0
if ( shm == NULL ) {
40004fd0: 18050a63 beqz a0,40005164 <shm_open+0x31c> <== NEVER TAKEN
gettimeofday( &tv, 0 );
40004fd4: 00000593 li a1,0
40004fd8: 01010513 addi a0,sp,16
40004fdc: 729030ef jal ra,40008f04 <gettimeofday>
shm->shm_object.ops = &_POSIX_Shm_Object_operations;
40004fe0: 400187b7 lui a5,0x40018
40004fe4: 58878793 addi a5,a5,1416 # 40018588 <_POSIX_Shm_Object_operations>
40004fe8: 02f9a423 sw a5,40(s3)
shm->reference_count = 1;
40004fec: 0189ae23 sw s8,28(s3)
shm->shm_object.handle = NULL;
40004ff0: 0209a023 sw zero,32(s3)
shm->shm_object.size = 0;
40004ff4: 0209a223 sw zero,36(s3)
shm->mode = mode & ~rtems_filesystem_umask;
40004ff8: cc0fd0ef jal ra,400024b8 <rtems_current_user_env_get>
40004ffc: 00852603 lw a2,8(a0)
shm->oflag = oflag;
40005000: 0299aa23 sw s1,52(s3)
shm->mode = mode & ~rtems_filesystem_umask;
40005004: fff64613 not a2,a2
40005008: 01567633 and a2,a2,s5
4000500c: 02c9a823 sw a2,48(s3)
shm->uid = geteuid();
40005010: 6d9030ef jal ra,40008ee8 <geteuid>
40005014: 02a99623 sh a0,44(s3)
shm->gid = getegid();
40005018: 6b5030ef jal ra,40008ecc <getegid>
information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;
4000501c: 0089d703 lhu a4,8(s3)
shm->atime = (time_t) tv.tv_sec;
40005020: 01012603 lw a2,16(sp)
40005024: 01412683 lw a3,20(sp)
40005028: 004ca783 lw a5,4(s9)
4000502c: 00271713 slli a4,a4,0x2
shm->gid = getegid();
40005030: 02a99723 sh a0,46(s3)
shm->atime = (time_t) tv.tv_sec;
40005034: 02c9ac23 sw a2,56(s3)
40005038: 02d9ae23 sw a3,60(s3)
shm->mtime = (time_t) tv.tv_sec;
4000503c: 04c9a023 sw a2,64(s3)
40005040: 04d9a223 sw a3,68(s3)
shm->ctime = (time_t) tv.tv_sec;
40005044: 04c9a423 sw a2,72(s3)
40005048: 04d9a623 sw a3,76(s3)
the_object->name.name_p = name;
4000504c: 0149a623 sw s4,12(s3)
information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;
40005050: 00e787b3 add a5,a5,a4
40005054: ff37ae23 sw s3,-4(a5)
_RTEMS_Unlock_allocator();
40005058: 4f0000ef jal ra,40005548 <_RTEMS_Unlock_allocator>
if ( oflag & O_TRUNC ) {
4000505c: 0a0b1863 bnez s6,4000510c <shm_open+0x2c4> <== NEVER TAKEN
fd = rtems_libio_iop_to_descriptor( iop );
40005060: 4001c7b7 lui a5,0x4001c
40005064: b9878793 addi a5,a5,-1128 # 4001bb98 <rtems_libio_iops>
40005068: 40f407b3 sub a5,s0,a5
4000506c: aaaab737 lui a4,0xaaaab
40005070: 4047d793 srai a5,a5,0x4
40005074: aab70713 addi a4,a4,-1365 # aaaaaaab <RamEnd+0x69aaaaab>
40005078: 02e78533 mul a0,a5,a4
iop->pathinfo.handlers = &shm_handlers;
4000507c: 400187b7 lui a5,0x40018
40005080: 54878793 addi a5,a5,1352 # 40018548 <shm_handlers>
40005084: 02f42023 sw a5,32(s0)
iop->pathinfo.mt_entry = &rtems_filesystem_null_mt_entry;
40005088: 4001a7b7 lui a5,0x4001a
4000508c: f2878793 addi a5,a5,-216 # 40019f28 <rtems_filesystem_null_mt_entry>
40005090: 02f42223 sw a5,36(s0)
iop->data1 = shm;
40005094: 03342623 sw s3,44(s0)
iop->pathinfo.node_access = shm;
40005098: 01342c23 sw s3,24(s0)
rtems_filesystem_location_add_to_mt_entry( &iop->pathinfo );
4000509c: 01040793 addi a5,s0,16
iop->data0 = fd;
400050a0: 02a42423 sw a0,40(s0)
__asm__ volatile (
400050a4: 30047773 csrrci a4,mstatus,8
&loc->mt_entry->location_chain,
400050a8: 02442683 lw a3,36(s0)
old_last = tail->previous;
400050ac: 01c6a603 lw a2,28(a3) # f01c <bsp_section_bss_size+0xbdd4>
return &the_chain->Tail.Node;
400050b0: 01868593 addi a1,a3,24
the_node->next = tail;
400050b4: 00b42823 sw a1,16(s0)
tail->previous = the_node;
400050b8: 00f6ae23 sw a5,28(a3)
old_last->next = the_node;
400050bc: 00f62023 sw a5,0(a2) # 2000 <bsp_section_rtemsstack_size>
the_node->previous = old_last;
400050c0: 00c42a23 sw a2,20(s0)
return mstatus & RISCV_MSTATUS_MIE;
400050c4: 00877793 andi a5,a4,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400050c8: 3007a073 csrs mstatus,a5
flags |= LIBIO_FLAGS_READ;
400050cc: 00001737 lui a4,0x1
flags |= LIBIO_FLAGS_READ_WRITE;
400050d0: 90670693 addi a3,a4,-1786 # 906 <bsp_section_data_size+0x1f6>
if ( (oflag & O_ACCMODE) == O_RDONLY ) {
400050d4: 00091463 bnez s2,400050dc <shm_open+0x294> <== ALWAYS TAKEN
flags |= LIBIO_FLAGS_READ;
400050d8: 90270693 addi a3,a4,-1790 <== NOT EXECUTED
__asm__ volatile (
400050dc: 300477f3 csrrci a5,mstatus,8
*obj = val | arg;
400050e0: 00042703 lw a4,0(s0)
400050e4: 00d76733 or a4,a4,a3
400050e8: 00e42023 sw a4,0(s0)
return mstatus & RISCV_MSTATUS_MIE;
400050ec: 0087f793 andi a5,a5,8
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
400050f0: 3007a073 csrs mstatus,a5
return fd;
400050f4: d9dff06f j 40004e90 <shm_open+0x48>
++shm->reference_count;
400050f8: 01c9a783 lw a5,28(s3) <== NOT EXECUTED
400050fc: 00178793 addi a5,a5,1 <== NOT EXECUTED
40005100: 00f9ae23 sw a5,28(s3) <== NOT EXECUTED
40005104: 444000ef jal ra,40005548 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
if ( oflag & O_TRUNC ) {
40005108: f40b0ce3 beqz s6,40005060 <shm_open+0x218> <== NOT EXECUTED
err = shm_ftruncate( iop, 0 );
4000510c: 00000593 li a1,0 <== NOT EXECUTED
40005110: 00000613 li a2,0 <== NOT EXECUTED
40005114: 00040513 mv a0,s0 <== NOT EXECUTED
40005118: b81ff0ef jal ra,40004c98 <shm_ftruncate> <== NOT EXECUTED
4000511c: f45ff06f j 40005060 <shm_open+0x218> <== NOT EXECUTED
40005120: 428000ef jal ra,40005548 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
err = ENAMETOOLONG;
40005124: 05b00493 li s1,91 <== NOT EXECUTED
40005128: e0dff06f j 40004f34 <shm_open+0xec> <== NOT EXECUTED
4000512c: 41c000ef jal ra,40005548 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
*error = EINVAL;
40005130: 01600493 li s1,22 <== NOT EXECUTED
40005134: e01ff06f j 40004f34 <shm_open+0xec> <== NOT EXECUTED
40005138: 410000ef jal ra,40005548 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
*error = ENOENT;
4000513c: 00200493 li s1,2 <== NOT EXECUTED
40005140: df5ff06f j 40004f34 <shm_open+0xec> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EMFILE );
40005144: 0b80b0ef jal ra,400101fc <__errno> <== NOT EXECUTED
40005148: 01800793 li a5,24 <== NOT EXECUTED
4000514c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40005150: fff00513 li a0,-1 <== NOT EXECUTED
40005154: d3dff06f j 40004e90 <shm_open+0x48> <== NOT EXECUTED
40005158: 3f0000ef jal ra,40005548 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
*error = ENOSPC;
4000515c: 01c00493 li s1,28 <== NOT EXECUTED
40005160: dd5ff06f j 40004f34 <shm_open+0xec> <== NOT EXECUTED
_Workspace_Free( name );
40005164: 000a0513 mv a0,s4 <== NOT EXECUTED
40005168: 528030ef jal ra,40008690 <_Workspace_Free> <== NOT EXECUTED
*error = ENFILE;
4000516c: 01700493 li s1,23 <== NOT EXECUTED
40005170: 3d8000ef jal ra,40005548 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
if ( err != 0 ) {
40005174: dc1ff06f j 40004f34 <shm_open+0xec> <== NOT EXECUTED
40006ef4 <shm_unlink>:
#include <rtems/seterr.h>
#include <rtems/posix/shmimpl.h>
int shm_unlink( const char *name )
{
40006ef4: fe010113 addi sp,sp,-32
40006ef8: 00812c23 sw s0,24(sp)
40006efc: 00912a23 sw s1,20(sp)
40006f00: 00050413 mv s0,a0
40006f04: 00112e23 sw ra,28(sp)
40006f08: 01212823 sw s2,16(sp)
40006f0c: 4001a4b7 lui s1,0x4001a
_RTEMS_Lock_allocator();
40006f10: 488020ef jal ra,40009398 <_RTEMS_Lock_allocator>
40006f14: 00c10693 addi a3,sp,12
40006f18: 00000613 li a2,0
40006f1c: 00040593 mv a1,s0
40006f20: 9f048513 addi a0,s1,-1552 # 400199f0 <_POSIX_Shm_Information>
40006f24: 461030ef jal ra,4000ab84 <_Objects_Get_by_name>
POSIX_Shm_Control *shm;
_Objects_Allocator_lock();
shm = _POSIX_Shm_Get_by_name( name, 0, &obj_err );
if ( shm ) {
40006f28: 06050a63 beqz a0,40006f9c <shm_unlink+0xa8> <== NEVER TAKEN
40006f2c: 00050413 mv s0,a0
_Objects_Namespace_remove_string(
40006f30: 00050593 mv a1,a0
40006f34: 9f048513 addi a0,s1,-1552
40006f38: 441030ef jal ra,4000ab78 <_Objects_Namespace_remove_string>
&_POSIX_Shm_Information,
&shm->Object
);
if ( shm->reference_count == 0 ) {
40006f3c: 01c42903 lw s2,28(s0)
40006f40: 02091c63 bnez s2,40006f78 <shm_unlink+0x84> <== NEVER TAKEN
( *information->deallocate )( information, the_object );
40006f44: 9f048793 addi a5,s1,-1552
40006f48: 00c7a783 lw a5,12(a5)
40006f4c: 00040593 mv a1,s0
40006f50: 9f048513 addi a0,s1,-1552
40006f54: 000780e7 jalr a5
_RTEMS_Unlock_allocator();
40006f58: 44c020ef jal ra,400093a4 <_RTEMS_Unlock_allocator>
_Objects_Allocator_unlock();
if ( err != 0 )
rtems_set_errno_and_return_minus_one( err );
return 0;
}
40006f5c: 01c12083 lw ra,28(sp)
40006f60: 01812403 lw s0,24(sp)
40006f64: 01412483 lw s1,20(sp)
40006f68: 00090513 mv a0,s2
40006f6c: 01012903 lw s2,16(sp)
40006f70: 02010113 addi sp,sp,32
40006f74: 00008067 ret
40006f78: 42c020ef jal ra,400093a4 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
40006f7c: 01c12083 lw ra,28(sp) <== NOT EXECUTED
40006f80: 01812403 lw s0,24(sp) <== NOT EXECUTED
return 0;
40006f84: 00000913 li s2,0 <== NOT EXECUTED
}
40006f88: 01412483 lw s1,20(sp) <== NOT EXECUTED
40006f8c: 00090513 mv a0,s2 <== NOT EXECUTED
40006f90: 01012903 lw s2,16(sp) <== NOT EXECUTED
40006f94: 02010113 addi sp,sp,32 <== NOT EXECUTED
40006f98: 00008067 ret <== NOT EXECUTED
switch ( obj_err ) {
40006f9c: 00c12703 lw a4,12(sp) <== NOT EXECUTED
40006fa0: 00100793 li a5,1 <== NOT EXECUTED
40006fa4: 00f70e63 beq a4,a5,40006fc0 <shm_unlink+0xcc> <== NOT EXECUTED
40006fa8: 3fc020ef jal ra,400093a4 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
err = ENOENT;
40006fac: 00200413 li s0,2 <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( err );
40006fb0: 2640e0ef jal ra,40015214 <__errno> <== NOT EXECUTED
40006fb4: 00852023 sw s0,0(a0) <== NOT EXECUTED
40006fb8: fff00913 li s2,-1 <== NOT EXECUTED
40006fbc: fa1ff06f j 40006f5c <shm_unlink+0x68> <== NOT EXECUTED
40006fc0: 3e4020ef jal ra,400093a4 <_RTEMS_Unlock_allocator> <== NOT EXECUTED
err = ENAMETOOLONG;
40006fc4: 05b00413 li s0,91 <== NOT EXECUTED
40006fc8: fe9ff06f j 40006fb0 <shm_unlink+0xbc> <== NOT EXECUTED
4000eb34 <sigaction>:
int sigaction(
int sig,
const struct sigaction *__restrict act,
struct sigaction *__restrict oact
)
{
4000eb34: ff010113 addi sp,sp,-16
4000eb38: 00112623 sw ra,12(sp)
4000eb3c: 00812423 sw s0,8(sp)
4000eb40: 00912223 sw s1,4(sp)
4000eb44: 01212023 sw s2,0(sp)
Thread_queue_Context queue_context;
if ( !sig )
4000eb48: 0e050663 beqz a0,4000ec34 <sigaction+0x100>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
4000eb4c: fff50793 addi a5,a0,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
4000eb50: 01f00713 li a4,31
4000eb54: 00050413 mv s0,a0
4000eb58: 0cf76e63 bltu a4,a5,4000ec34 <sigaction+0x100>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
4000eb5c: 00900793 li a5,9
4000eb60: 0cf50a63 beq a0,a5,4000ec34 <sigaction+0x100>
4000eb64: 00058493 mv s1,a1
__asm__ volatile (
4000eb68: 30047973 csrrci s2,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
4000eb6c: 00897913 andi s2,s2,8
rtems_set_errno_and_return_minus_one( EINVAL );
_Thread_queue_Context_initialize( &queue_context );
_POSIX_signals_Acquire( &queue_context );
if ( oact )
4000eb70: 02060a63 beqz a2,4000eba4 <sigaction+0x70>
*oact = _POSIX_signals_Vectors[ sig ];
4000eb74: 00151713 slli a4,a0,0x1
4000eb78: 00a70733 add a4,a4,a0
4000eb7c: 400187b7 lui a5,0x40018
4000eb80: 00271713 slli a4,a4,0x2
4000eb84: 1d478793 addi a5,a5,468 # 400181d4 <_POSIX_signals_Vectors>
4000eb88: 00e787b3 add a5,a5,a4
4000eb8c: 0007a683 lw a3,0(a5)
4000eb90: 0047a703 lw a4,4(a5)
4000eb94: 0087a783 lw a5,8(a5)
4000eb98: 00d62023 sw a3,0(a2)
4000eb9c: 00e62223 sw a4,4(a2)
4000eba0: 00f62423 sw a5,8(a2)
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
4000eba4: 04048263 beqz s1,4000ebe8 <sigaction+0xb4> <== NEVER TAKEN
/*
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
if ( act->sa_handler == SIG_DFL ) {
4000eba8: 0084a783 lw a5,8(s1)
4000ebac: 04078e63 beqz a5,4000ec08 <sigaction+0xd4>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
} else {
_POSIX_signals_Clear_process_signals( sig );
4000ebb0: 00040513 mv a0,s0
4000ebb4: 591000ef jal ra,4000f944 <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
4000ebb8: 00141513 slli a0,s0,0x1
4000ebbc: 0004a683 lw a3,0(s1)
4000ebc0: 0044a703 lw a4,4(s1)
4000ebc4: 0084a783 lw a5,8(s1)
4000ebc8: 00850533 add a0,a0,s0
4000ebcc: 00251513 slli a0,a0,0x2
4000ebd0: 40018437 lui s0,0x40018
4000ebd4: 1d440413 addi s0,s0,468 # 400181d4 <_POSIX_signals_Vectors>
4000ebd8: 00a40433 add s0,s0,a0
4000ebdc: 00d42023 sw a3,0(s0)
4000ebe0: 00e42223 sw a4,4(s0)
4000ebe4: 00f42423 sw a5,8(s0)
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
4000ebe8: 30092073 csrs mstatus,s2
}
}
_POSIX_signals_Release( &queue_context );
return 0;
4000ebec: 00000513 li a0,0
}
4000ebf0: 00c12083 lw ra,12(sp)
4000ebf4: 00812403 lw s0,8(sp)
4000ebf8: 00412483 lw s1,4(sp)
4000ebfc: 00012903 lw s2,0(sp)
4000ec00: 01010113 addi sp,sp,16
4000ec04: 00008067 ret
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
4000ec08: 00141513 slli a0,s0,0x1
4000ec0c: 00850533 add a0,a0,s0
4000ec10: 400157b7 lui a5,0x40015
4000ec14: 00251513 slli a0,a0,0x2
4000ec18: 9f878793 addi a5,a5,-1544 # 400149f8 <_POSIX_signals_Default_vectors>
4000ec1c: 00a787b3 add a5,a5,a0
4000ec20: 0007a683 lw a3,0(a5)
4000ec24: 0047a703 lw a4,4(a5)
4000ec28: 40018437 lui s0,0x40018
4000ec2c: 0087a783 lw a5,8(a5)
4000ec30: fa5ff06f j 4000ebd4 <sigaction+0xa0>
rtems_set_errno_and_return_minus_one( EINVAL );
4000ec34: 1d9030ef jal ra,4001260c <__errno>
4000ec38: 01600793 li a5,22
4000ec3c: 00f52023 sw a5,0(a0)
4000ec40: fff00513 li a0,-1
4000ec44: fadff06f j 4000ebf0 <sigaction+0xbc>
40009364 <sigtimedwait>:
int sigtimedwait(
const sigset_t *__restrict set,
siginfo_t *__restrict info,
const struct timespec *__restrict timeout
)
{
40009364: f9010113 addi sp,sp,-112
40009368: 06112623 sw ra,108(sp)
4000936c: 06812423 sw s0,104(sp)
40009370: 06912223 sw s1,100(sp)
40009374: 07212023 sw s2,96(sp)
40009378: 05312e23 sw s3,92(sp)
int error;
/*
* Error check parameters before disabling interrupts.
*/
if ( !set )
4000937c: 30050863 beqz a0,4000968c <sigtimedwait+0x328>
40009380: 00050913 mv s2,a0
40009384: 00058493 mv s1,a1
40009388: 00060413 mv s0,a2
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
if ( timeout != NULL ) {
4000938c: 16060463 beqz a2,400094f4 <sigtimedwait+0x190>
const struct timespec *end;
_Timecounter_Nanouptime( &uptime );
40009390: 01810513 addi a0,sp,24
40009394: 945fb0ef jal ra,40004cd8 <_Timecounter_Nanouptime>
&& (unsigned long) ts->tv_nsec < WATCHDOG_NANOSECONDS_PER_SECOND;
40009398: 00842683 lw a3,8(s0) # 4001c008 <__sf+0x40>
4000939c: 3b9ad637 lui a2,0x3b9ad
400093a0: 9ff60613 addi a2,a2,-1537 # 3b9ac9ff <RamSize+0x3a9ac9ff>
400093a4: 0ed67e63 bgeu a2,a3,400094a0 <sigtimedwait+0x13c>
return NULL;
400093a8: 00000793 li a5,0
queue_context->Timeout.arg = abstime;
400093ac: 02f12c23 sw a5,56(sp)
queue_context->enqueue_callout =
400093b0: 400077b7 lui a5,0x40007
400093b4: 5a478793 addi a5,a5,1444 # 400075a4 <_Thread_queue_Add_timeout_monotonic_timespec>
400093b8: 02f12a23 sw a5,52(sp)
/*
* Initialize local variables.
*/
the_info = ( info ) ? info : &signal_information;
400093bc: 14048463 beqz s1,40009504 <sigtimedwait+0x1a0> <== NEVER TAKEN
400093c0: 4001b7b7 lui a5,0x4001b
400093c4: 6b87a403 lw s0,1720(a5) # 4001b6b8 <_Per_CPU_Information+0x38>
executing = _Thread_Get_executing();
api = executing->API_Extensions[ THREAD_API_POSIX ];
400093c8: 19842983 lw s3,408(s0)
__asm__ volatile (
400093cc: 300477f3 csrrci a5,mstatus,8
return mstatus & RISCV_MSTATUS_MIE;
400093d0: 0087f793 andi a5,a5,8
_ISR_lock_ISR_disable( &queue_context->Lock_context.Lock_context );
400093d4: 02f12623 sw a5,44(sp)
*/
/* API signals pending? */
_POSIX_signals_Acquire( &queue_context );
if ( *set & api->signals_pending ) {
400093d8: 00092783 lw a5,0(s2)
400093dc: 06c9a703 lw a4,108(s3)
400093e0: 00e7f6b3 and a3,a5,a4
400093e4: 1e069663 bnez a3,400095d0 <sigtimedwait+0x26c>
return the_info->si_signo;
}
/* Process pending signals? */
if ( *set & _POSIX_signals_Pending ) {
400093e8: 9081a703 lw a4,-1784(gp) # 40019688 <_POSIX_signals_Pending>
400093ec: 00e7f6b3 and a3,a5,a4
400093f0: 10069e63 bnez a3,4000950c <sigtimedwait+0x1a8>
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
return signo;
}
the_info->si_signo = -1;
400093f4: fff00713 li a4,-1
400093f8: 00e4a023 sw a4,0(s1)
executing->Wait.option = *set;
400093fc: 04f42423 sw a5,72(s0)
executing->Wait.return_argument = the_info;
_Thread_queue_Context_set_thread_state(
&queue_context,
STATES_WAITING_FOR_SIGNAL | STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Thread_queue_Enqueue(
40009400: 400175b7 lui a1,0x40017
40009404: 40019537 lui a0,0x40019
queue_context->thread_state = thread_state;
40009408: 100007b7 lui a5,0x10000
4000940c: 40078793 addi a5,a5,1024 # 10000400 <RamSize+0xf000400>
40009410: 02c10693 addi a3,sp,44
40009414: 00040613 mv a2,s0
40009418: 30058593 addi a1,a1,768 # 40017300 <_Thread_queue_Operations_FIFO>
4000941c: 21050513 addi a0,a0,528 # 40019210 <_POSIX_signals_Wait_queue>
executing->Wait.return_argument = the_info;
40009420: 04942023 sw s1,64(s0)
40009424: 02f12823 sw a5,48(sp)
_Thread_queue_Enqueue(
40009428: b14fd0ef jal ra,4000673c <_Thread_queue_Enqueue>
/*
* When the thread is set free by a signal, it is need to eliminate
* the signal.
*/
_POSIX_signals_Clear_signals(
4000942c: 0004a583 lw a1,0(s1)
40009430: 00100793 li a5,1
40009434: 00000713 li a4,0
40009438: 00098513 mv a0,s3
4000943c: 00000693 li a3,0
40009440: 00048613 mv a2,s1
40009444: 105020ef jal ra,4000bd48 <_POSIX_signals_Clear_signals>
return _POSIX_Get_by_name_error_table[ error ];
}
RTEMS_INLINE_ROUTINE int _POSIX_Get_error( Status_Control status )
{
return STATUS_GET_POSIX( status );
40009448: 04c42783 lw a5,76(s0)
* was not in our set.
*/
error = _POSIX_Get_error_after_wait( executing );
if (
4000944c: 00400713 li a4,4
40009450: 41f7d993 srai s3,a5,0x1f
40009454: 0ff9f993 andi s3,s3,255
40009458: 00f989b3 add s3,s3,a5
4000945c: 4089d993 srai s3,s3,0x8
40009460: 20e99863 bne s3,a4,40009670 <sigtimedwait+0x30c>
error != EINTR
|| ( *set & signo_to_mask( the_info->si_signo ) ) == 0
40009464: 0004a403 lw s0,0(s1)
40009468: 00092703 lw a4,0(s2)
return 1u << (sig - 1);
4000946c: 00100793 li a5,1
40009470: fff40693 addi a3,s0,-1
40009474: 00d797b3 sll a5,a5,a3
40009478: 00e7f7b3 and a5,a5,a4
4000947c: 20078063 beqz a5,4000967c <sigtimedwait+0x318>
rtems_set_errno_and_return_minus_one( error );
}
return the_info->si_signo;
}
40009480: 06c12083 lw ra,108(sp)
40009484: 00040513 mv a0,s0
40009488: 06812403 lw s0,104(sp)
4000948c: 06412483 lw s1,100(sp)
40009490: 06012903 lw s2,96(sp)
40009494: 05c12983 lw s3,92(sp)
40009498: 07010113 addi sp,sp,112
4000949c: 00008067 ret
return _Watchdog_Is_valid_timespec( ts ) && ts->tv_sec >= 0;
400094a0: 00442583 lw a1,4(s0)
400094a4: 00042783 lw a5,0(s0)
400094a8: f005c0e3 bltz a1,400093a8 <sigtimedwait+0x44> <== NEVER TAKEN
sec += (uint64_t) delta->tv_sec;
400094ac: 01c12503 lw a0,28(sp)
400094b0: 01812703 lw a4,24(sp)
400094b4: 00a585b3 add a1,a1,a0
now->tv_nsec += delta->tv_nsec;
400094b8: 02012503 lw a0,32(sp)
sec += (uint64_t) delta->tv_sec;
400094bc: 00e78733 add a4,a5,a4
400094c0: 00f737b3 sltu a5,a4,a5
now->tv_nsec += delta->tv_nsec;
400094c4: 00a686b3 add a3,a3,a0
sec += (uint64_t) delta->tv_sec;
400094c8: 00b787b3 add a5,a5,a1
if ( now->tv_nsec >= WATCHDOG_NANOSECONDS_PER_SECOND ) {
400094cc: 0ed64063 blt a2,a3,400095ac <sigtimedwait+0x248>
now->tv_nsec += delta->tv_nsec;
400094d0: 02d12023 sw a3,32(sp)
if ( sec <= INT64_MAX ) {
400094d4: 0007d863 bgez a5,400094e4 <sigtimedwait+0x180> <== ALWAYS TAKEN
now->tv_sec = INT64_MAX;
400094d8: 800007b7 lui a5,0x80000 <== NOT EXECUTED
400094dc: fff00713 li a4,-1 <== NOT EXECUTED
400094e0: fff7c793 not a5,a5 <== NOT EXECUTED
400094e4: 00f12e23 sw a5,28(sp)
400094e8: 00e12c23 sw a4,24(sp)
return now;
400094ec: 01810793 addi a5,sp,24
400094f0: ebdff06f j 400093ac <sigtimedwait+0x48>
queue_context->enqueue_callout = _Thread_queue_Enqueue_do_nothing_extra;
400094f4: 400067b7 lui a5,0x40006
400094f8: 72878793 addi a5,a5,1832 # 40006728 <_Thread_queue_Enqueue_do_nothing_extra>
400094fc: 02f12a23 sw a5,52(sp)
the_info = ( info ) ? info : &signal_information;
40009500: ec0490e3 bnez s1,400093c0 <sigtimedwait+0x5c>
40009504: 00c10493 addi s1,sp,12
40009508: eb9ff06f j 400093c0 <sigtimedwait+0x5c>
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
4000950c: 01b00413 li s0,27
40009510: 00100693 li a3,1
40009514: 02000613 li a2,32
40009518: fff40793 addi a5,s0,-1
4000951c: 00f697b3 sll a5,a3,a5
if ( set & signo_to_mask( signo ) ) {
40009520: 00e7f7b3 and a5,a5,a4
40009524: 02079a63 bnez a5,40009558 <sigtimedwait+0x1f4> <== NEVER TAKEN
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
40009528: 00140413 addi s0,s0,1
4000952c: fec416e3 bne s0,a2,40009518 <sigtimedwait+0x1b4>
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
40009530: 00100413 li s0,1
40009534: 00100693 li a3,1
40009538: 01b00613 li a2,27
4000953c: 00c0006f j 40009548 <sigtimedwait+0x1e4>
40009540: 00140413 addi s0,s0,1
40009544: 00c40a63 beq s0,a2,40009558 <sigtimedwait+0x1f4>
40009548: fff40793 addi a5,s0,-1
4000954c: 00f697b3 sll a5,a3,a5
if ( set & signo_to_mask( signo ) ) {
40009550: 00e7f7b3 and a5,a5,a4
40009554: fe0786e3 beqz a5,40009540 <sigtimedwait+0x1dc>
_POSIX_signals_Clear_signals( api, signo, the_info, true, false, false );
40009558: 00000793 li a5,0
4000955c: 00000713 li a4,0
40009560: 00100693 li a3,1
40009564: 00048613 mv a2,s1
40009568: 00040593 mv a1,s0
4000956c: 00098513 mv a0,s3
40009570: 7d8020ef jal ra,4000bd48 <_POSIX_signals_Clear_signals>
__asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );
40009574: 02c12783 lw a5,44(sp)
40009578: 3007a073 csrs mstatus,a5
the_info->si_signo = signo;
4000957c: 0084a023 sw s0,0(s1)
}
40009580: 06c12083 lw ra,108(sp)
40009584: 00040513 mv a0,s0
40009588: 06812403 lw s0,104(sp)
the_info->si_code = SI_USER;
4000958c: 00100793 li a5,1
40009590: 00f4a223 sw a5,4(s1)
the_info->si_value.sival_int = 0;
40009594: 0004a423 sw zero,8(s1)
}
40009598: 06012903 lw s2,96(sp)
4000959c: 06412483 lw s1,100(sp)
400095a0: 05c12983 lw s3,92(sp)
400095a4: 07010113 addi sp,sp,112
400095a8: 00008067 ret
++sec;
400095ac: 00170613 addi a2,a4,1 <== NOT EXECUTED
400095b0: 00e635b3 sltu a1,a2,a4 <== NOT EXECUTED
now->tv_nsec -= WATCHDOG_NANOSECONDS_PER_SECOND;
400095b4: c4653737 lui a4,0xc4653 <== NOT EXECUTED
400095b8: 60070713 addi a4,a4,1536 # c4653600 <RamEnd+0x83653600> <== NOT EXECUTED
400095bc: 00e686b3 add a3,a3,a4 <== NOT EXECUTED
400095c0: 02d12023 sw a3,32(sp) <== NOT EXECUTED
++sec;
400095c4: 00060713 mv a4,a2 <== NOT EXECUTED
400095c8: 00f587b3 add a5,a1,a5 <== NOT EXECUTED
400095cc: f09ff06f j 400094d4 <sigtimedwait+0x170> <== NOT EXECUTED
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
400095d0: 01b00593 li a1,27
400095d4: 00100693 li a3,1
400095d8: 02000613 li a2,32
400095dc: fff58793 addi a5,a1,-1
400095e0: 00f697b3 sll a5,a3,a5
if ( set & signo_to_mask( signo ) ) {
400095e4: 00e7f7b3 and a5,a5,a4
400095e8: 02079a63 bnez a5,4000961c <sigtimedwait+0x2b8> <== NEVER TAKEN
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
400095ec: 00158593 addi a1,a1,1
400095f0: fec596e3 bne a1,a2,400095dc <sigtimedwait+0x278>
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
400095f4: 00100593 li a1,1
400095f8: 00100693 li a3,1
400095fc: 01b00613 li a2,27
40009600: 00c0006f j 4000960c <sigtimedwait+0x2a8>
40009604: 00158593 addi a1,a1,1
40009608: 00c58a63 beq a1,a2,4000961c <sigtimedwait+0x2b8>
4000960c: fff58793 addi a5,a1,-1
40009610: 00f697b3 sll a5,a3,a5
if ( set & signo_to_mask( signo ) ) {
40009614: 00e7f7b3 and a5,a5,a4
40009618: fe0786e3 beqz a5,40009604 <sigtimedwait+0x2a0>
the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending );
4000961c: 00b4a023 sw a1,0(s1)
_POSIX_signals_Clear_signals(
40009620: 00000793 li a5,0
40009624: 00000713 li a4,0
40009628: 00000693 li a3,0
4000962c: 00048613 mv a2,s1
40009630: 00098513 mv a0,s3
40009634: 714020ef jal ra,4000bd48 <_POSIX_signals_Clear_signals>
40009638: 02c12783 lw a5,44(sp)
4000963c: 3007a073 csrs mstatus,a5
return the_info->si_signo;
40009640: 0004a403 lw s0,0(s1)
}
40009644: 06c12083 lw ra,108(sp)
the_info->si_code = SI_USER;
40009648: 00100793 li a5,1
}
4000964c: 00040513 mv a0,s0
40009650: 06812403 lw s0,104(sp)
the_info->si_code = SI_USER;
40009654: 00f4a223 sw a5,4(s1)
the_info->si_value.sival_int = 0;
40009658: 0004a423 sw zero,8(s1)
}
4000965c: 06012903 lw s2,96(sp)
40009660: 06412483 lw s1,100(sp)
40009664: 05c12983 lw s3,92(sp)
40009668: 07010113 addi sp,sp,112
4000966c: 00008067 ret
if ( error == ETIMEDOUT ) {
40009670: 07400793 li a5,116
40009674: 00f99463 bne s3,a5,4000967c <sigtimedwait+0x318>
error = EAGAIN;
40009678: 00b00993 li s3,11
rtems_set_errno_and_return_minus_one( error );
4000967c: 479060ef jal ra,400102f4 <__errno>
40009680: 01352023 sw s3,0(a0)
40009684: fff00413 li s0,-1
40009688: df9ff06f j 40009480 <sigtimedwait+0x11c>
rtems_set_errno_and_return_minus_one( EINVAL );
4000968c: 469060ef jal ra,400102f4 <__errno>
40009690: 01600793 li a5,22
40009694: 00f52023 sw a5,0(a0)
40009698: fff00413 li s0,-1
4000969c: de5ff06f j 40009480 <sigtimedwait+0x11c>
4000a920 <sigwait>:
int sigwait(
const sigset_t *__restrict set,
int *__restrict sig
)
{
4000a920: ff010113 addi sp,sp,-16
4000a924: 00812423 sw s0,8(sp)
int status;
status = sigtimedwait( set, NULL, NULL );
4000a928: 00000613 li a2,0
{
4000a92c: 00058413 mv s0,a1
status = sigtimedwait( set, NULL, NULL );
4000a930: 00000593 li a1,0
{
4000a934: 00112623 sw ra,12(sp)
status = sigtimedwait( set, NULL, NULL );
4000a938: cadff0ef jal ra,4000a5e4 <sigtimedwait>
if ( status != -1 ) {
4000a93c: fff00713 li a4,-1
4000a940: 02e50263 beq a0,a4,4000a964 <sigwait+0x44>
4000a944: 00050793 mv a5,a0
if ( sig )
*sig = status;
return 0;
4000a948: 00000513 li a0,0
if ( sig )
4000a94c: 00040463 beqz s0,4000a954 <sigwait+0x34> <== NEVER TAKEN
*sig = status;
4000a950: 00f42023 sw a5,0(s0)
}
return errno;
}
4000a954: 00c12083 lw ra,12(sp)
4000a958: 00812403 lw s0,8(sp)
4000a95c: 01010113 addi sp,sp,16
4000a960: 00008067 ret
return errno;
4000a964: 445060ef jal ra,400115a8 <__errno>
}
4000a968: 00c12083 lw ra,12(sp)
4000a96c: 00812403 lw s0,8(sp)
return errno;
4000a970: 00052503 lw a0,0(a0)
}
4000a974: 01010113 addi sp,sp,16
4000a978: 00008067 ret
4000b5bc <timer_create>:
{
4000b5bc: ff010113 addi sp,sp,-16
4000b5c0: 00112623 sw ra,12(sp)
4000b5c4: 00812423 sw s0,8(sp)
4000b5c8: 00912223 sw s1,4(sp)
4000b5cc: 01212023 sw s2,0(sp)
if ( clock_id != CLOCK_REALTIME )
4000b5d0: 00100793 li a5,1
4000b5d4: 14f51663 bne a0,a5,4000b720 <timer_create+0x164>
4000b5d8: 00060493 mv s1,a2
if ( !timerid )
4000b5dc: 14060263 beqz a2,4000b720 <timer_create+0x164>
4000b5e0: 00058413 mv s0,a1
if (evp != NULL) {
4000b5e4: 0e058263 beqz a1,4000b6c8 <timer_create+0x10c>
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
4000b5e8: 0005a783 lw a5,0(a1)
4000b5ec: fff78793 addi a5,a5,-1
4000b5f0: 12f56863 bltu a0,a5,4000b720 <timer_create+0x164>
if ( !evp->sigev_signo )
4000b5f4: 0045a783 lw a5,4(a1)
4000b5f8: 12078463 beqz a5,4000b720 <timer_create+0x164> <== NEVER TAKEN
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
4000b5fc: fff78793 addi a5,a5,-1
if ( !is_valid_signo(evp->sigev_signo) )
4000b600: 01f00713 li a4,31
4000b604: 10f76e63 bltu a4,a5,4000b720 <timer_create+0x164>
* This function allocates a timer control block from
* the inactive chain of free timer control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void )
{
return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information );
4000b608: 40015937 lui s2,0x40015
4000b60c: 33c90513 addi a0,s2,828 # 4001533c <_POSIX_Timer_Information>
4000b610: d4dfb0ef jal ra,4000735c <_Objects_Allocate>
if ( !ptimer ) {
4000b614: 0e050063 beqz a0,4000b6f4 <timer_create+0x138> <== NEVER TAKEN
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
4000b618: 00200793 li a5,2
4000b61c: 02f50a23 sb a5,52(a0)
ptimer->thread_id = _Thread_Get_executing()->Object.id;
4000b620: 400267b7 lui a5,0x40026
4000b624: 6f87a783 lw a5,1784(a5) # 400266f8 <_Per_CPU_Information+0x38>
ptimer->inf.sigev_notify = evp->sigev_notify;
4000b628: 00042603 lw a2,0(s0)
ptimer->inf.sigev_signo = evp->sigev_signo;
4000b62c: 00442703 lw a4,4(s0)
ptimer->thread_id = _Thread_Get_executing()->Object.id;
4000b630: 0087a683 lw a3,8(a5)
ptimer->inf.sigev_value = evp->sigev_value;
4000b634: 00842783 lw a5,8(s0)
ptimer->inf.sigev_notify = evp->sigev_notify;
4000b638: 02c52c23 sw a2,56(a0)
ptimer->thread_id = _Thread_Get_executing()->Object.id;
4000b63c: 02d52823 sw a3,48(a0)
ptimer->inf.sigev_signo = evp->sigev_signo;
4000b640: 02e52e23 sw a4,60(a0)
ptimer->inf.sigev_value = evp->sigev_value;
4000b644: 04f52023 sw a5,64(a0)
_Objects_Get_index( the_object->id ),
4000b648: 00852603 lw a2,8(a0)
information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;
4000b64c: 33c90913 addi s2,s2,828
4000b650: 00492783 lw a5,4(s2)
4000b654: 01061713 slli a4,a2,0x10
RB_COLOR( &the_watchdog->Node.RBTree, Node ) = state;
4000b658: 00200693 li a3,2
4000b65c: 00d52e23 sw a3,28(a0)
4000b660: 01075713 srli a4,a4,0x10
the_watchdog->routine = routine;
4000b664: 4000b6b7 lui a3,0x4000b
ptimer->timer_data.it_value.tv_sec = 0;
4000b668: 00000813 li a6,0
4000b66c: 00000893 li a7,0
4000b670: 00271713 slli a4,a4,0x2
4000b674: 73468693 addi a3,a3,1844 # 4000b734 <_POSIX_Timer_TSR>
ptimer->overrun = 0;
4000b678: 06052a23 sw zero,116(a0)
ptimer->timer_data.it_value.tv_sec = 0;
4000b67c: 07052023 sw a6,96(a0)
4000b680: 07152223 sw a7,100(a0)
ptimer->timer_data.it_value.tv_nsec = 0;
4000b684: 06052423 sw zero,104(a0)
ptimer->timer_data.it_interval.tv_sec = 0;
4000b688: 05052823 sw a6,80(a0)
4000b68c: 05152a23 sw a7,84(a0)
ptimer->timer_data.it_interval.tv_nsec = 0;
4000b690: 04052c23 sw zero,88(a0)
4000b694: 02d52023 sw a3,32(a0)
the_object->name.name_u32 = name;
4000b698: 00052623 sw zero,12(a0)
information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;
4000b69c: 00e787b3 add a5,a5,a4
4000b6a0: fea7ae23 sw a0,-4(a5)
*timerid = ptimer->Object.id;
4000b6a4: 00c4a023 sw a2,0(s1)
_RTEMS_Unlock_allocator();
4000b6a8: bb1fa0ef jal ra,40006258 <_RTEMS_Unlock_allocator>
return 0;
4000b6ac: 00000513 li a0,0
}
4000b6b0: 00c12083 lw ra,12(sp)
4000b6b4: 00812403 lw s0,8(sp)
4000b6b8: 00412483 lw s1,4(sp)
4000b6bc: 00012903 lw s2,0(sp)
4000b6c0: 01010113 addi sp,sp,16
4000b6c4: 00008067 ret
4000b6c8: 40015937 lui s2,0x40015
4000b6cc: 33c90513 addi a0,s2,828 # 4001533c <_POSIX_Timer_Information>
4000b6d0: c8dfb0ef jal ra,4000735c <_Objects_Allocate>
if ( !ptimer ) {
4000b6d4: 02050063 beqz a0,4000b6f4 <timer_create+0x138>
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
4000b6d8: 00200793 li a5,2
4000b6dc: 02f50a23 sb a5,52(a0)
ptimer->thread_id = _Thread_Get_executing()->Object.id;
4000b6e0: 400267b7 lui a5,0x40026
4000b6e4: 6f87a783 lw a5,1784(a5) # 400266f8 <_Per_CPU_Information+0x38>
4000b6e8: 0087a783 lw a5,8(a5)
4000b6ec: 02f52823 sw a5,48(a0)
if ( evp != NULL ) {
4000b6f0: f59ff06f j 4000b648 <timer_create+0x8c>
4000b6f4: b65fa0ef jal ra,40006258 <_RTEMS_Unlock_allocator>
rtems_set_errno_and_return_minus_one( EAGAIN );
4000b6f8: 514060ef jal ra,40011c0c <__errno>
}
4000b6fc: 00c12083 lw ra,12(sp)
4000b700: 00812403 lw s0,8(sp)
rtems_set_errno_and_return_minus_one( EAGAIN );
4000b704: 00b00793 li a5,11
4000b708: 00f52023 sw a5,0(a0)
}
4000b70c: 00412483 lw s1,4(sp)
4000b710: 00012903 lw s2,0(sp)
rtems_set_errno_and_return_minus_one( EAGAIN );
4000b714: fff00513 li a0,-1
}
4000b718: 01010113 addi sp,sp,16
4000b71c: 00008067 ret
rtems_set_errno_and_return_minus_one( EINVAL );
4000b720: 4ec060ef jal ra,40011c0c <__errno>
4000b724: 01600793 li a5,22
4000b728: 00f52023 sw a5,0(a0)
4000b72c: fff00513 li a0,-1
4000b730: f81ff06f j 4000b6b0 <timer_create+0xf4>
40009a64 <timer_gettime>:
int timer_gettime(
timer_t timerid,
struct itimerspec *value
)
{
40009a64: fe010113 addi sp,sp,-32
40009a68: 00112e23 sw ra,28(sp)
40009a6c: 00812c23 sw s0,24(sp)
40009a70: 00912a23 sw s1,20(sp)
POSIX_Timer_Control *ptimer;
ISR_lock_Context lock_context;
uint64_t now;
uint32_t remaining;
if ( !value )
40009a74: 08058c63 beqz a1,40009b0c <timer_gettime+0xa8>
40009a78: 40022637 lui a2,0x40022
40009a7c: 00058493 mv s1,a1
40009a80: 83c60613 addi a2,a2,-1988 # 4002183c <_POSIX_Timer_Information>
40009a84: 00c10593 addi a1,sp,12
40009a88: 341010ef jal ra,4000b5c8 <_Objects_Get>
40009a8c: 00050413 mv s0,a0
rtems_set_errno_and_return_minus_one( EINVAL );
ptimer = _POSIX_Timer_Get( timerid, &lock_context );
if ( ptimer != NULL ) {
40009a90: 06050e63 beqz a0,40009b0c <timer_gettime+0xa8>
Per_CPU_Control *cpu;
cpu = _POSIX_Timer_Acquire_critical( ptimer, &lock_context );
now = cpu->Watchdog.ticks;
40009a94: 400257b7 lui a5,0x40025
40009a98: bc078793 addi a5,a5,-1088 # 40024bc0 <_Per_CPU_Information>
40009a9c: 04c7a703 lw a4,76(a5)
if ( now < ptimer->Timer.expire ) {
40009aa0: 02c52683 lw a3,44(a0)
now = cpu->Watchdog.ticks;
40009aa4: 0487a783 lw a5,72(a5)
if ( now < ptimer->Timer.expire ) {
40009aa8: 02852503 lw a0,40(a0)
40009aac: 04d77863 bgeu a4,a3,40009afc <timer_gettime+0x98>
remaining = (uint32_t) ( ptimer->Timer.expire - now );
40009ab0: 40f50533 sub a0,a0,a5
} else {
remaining = 0;
}
_Timespec_From_ticks( remaining, &value->it_value );
40009ab4: 01048593 addi a1,s1,16
40009ab8: 71c020ef jal ra,4000c1d4 <_Timespec_From_ticks>
value->it_interval = ptimer->timer_data.it_interval;
40009abc: 05042603 lw a2,80(s0)
40009ac0: 05442683 lw a3,84(s0)
40009ac4: 05842703 lw a4,88(s0)
40009ac8: 05c42783 lw a5,92(s0)
40009acc: 00c4a023 sw a2,0(s1)
40009ad0: 00d4a223 sw a3,4(s1)
40009ad4: 00e4a423 sw a4,8(s1)
40009ad8: 00f4a623 sw a5,12(s1)
40009adc: 00c12783 lw a5,12(sp)
40009ae0: 3007a073 csrs mstatus,a5
_POSIX_Timer_Release( cpu, &lock_context );
return 0;
40009ae4: 00000513 li a0,0
}
rtems_set_errno_and_return_minus_one( EINVAL );
}
40009ae8: 01c12083 lw ra,28(sp)
40009aec: 01812403 lw s0,24(sp)
40009af0: 01412483 lw s1,20(sp)
40009af4: 02010113 addi sp,sp,32
40009af8: 00008067 ret
if ( now < ptimer->Timer.expire ) {
40009afc: 00e69463 bne a3,a4,40009b04 <timer_gettime+0xa0>
40009b00: faa7e8e3 bltu a5,a0,40009ab0 <timer_gettime+0x4c>
remaining = 0;
40009b04: 00000513 li a0,0 <== NOT EXECUTED
40009b08: fadff06f j 40009ab4 <timer_gettime+0x50> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EINVAL );
40009b0c: 0ad070ef jal ra,400113b8 <__errno>
40009b10: 01600793 li a5,22
40009b14: 00f52023 sw a5,0(a0)
40009b18: fff00513 li a0,-1
40009b1c: fcdff06f j 40009ae8 <timer_gettime+0x84>
40005904 <timer_settime>:
timer_t timerid,
int flags,
const struct itimerspec *__restrict value,
struct itimerspec *__restrict ovalue
)
{
40005904: fb010113 addi sp,sp,-80
40005908: 04112623 sw ra,76(sp)
4000590c: 04812423 sw s0,72(sp)
40005910: 04912223 sw s1,68(sp)
40005914: 05212023 sw s2,64(sp)
40005918: 03312e23 sw s3,60(sp)
4000591c: 03412c23 sw s4,56(sp)
POSIX_Timer_Control *ptimer;
ISR_lock_Context lock_context;
uint32_t initial_period;
struct itimerspec normalize;
if ( !value )
40005920: 2e060463 beqz a2,40005c08 <timer_settime+0x304> <== NEVER TAKEN
/*
* First, it verifies if the structure "value" is correct
* if the number of nanoseconds is not correct return EINVAL
*/
if ( !_Timespec_Is_valid( &(value->it_value) ) ) {
40005924: 00050993 mv s3,a0
40005928: 01060513 addi a0,a2,16
4000592c: 00060913 mv s2,a2
40005930: 00058413 mv s0,a1
40005934: 00068493 mv s1,a3
40005938: 4bd030ef jal ra,400095f4 <_Timespec_Is_valid>
4000593c: 2c050663 beqz a0,40005c08 <timer_settime+0x304>
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !_Timespec_Is_valid( &(value->it_interval) ) ) {
40005940: 00090513 mv a0,s2
40005944: 4b1030ef jal ra,400095f4 <_Timespec_Is_valid>
40005948: 2c050063 beqz a0,40005c08 <timer_settime+0x304> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) {
4000594c: 00400793 li a5,4
40005950: 24f40463 beq s0,a5,40005b98 <timer_settime+0x294>
40005954: 2a041a63 bnez s0,40005c08 <timer_settime+0x304>
rtems_set_errno_and_return_minus_one( EINVAL );
}
normalize = *value;
40005958: 00092883 lw a7,0(s2)
4000595c: 00492803 lw a6,4(s2)
40005960: 00892503 lw a0,8(s2)
40005964: 00c92583 lw a1,12(s2)
40005968: 01092603 lw a2,16(s2)
4000596c: 01492683 lw a3,20(s2)
40005970: 01892703 lw a4,24(s2)
40005974: 01c92783 lw a5,28(s2)
40005978: 01112823 sw a7,16(sp)
4000597c: 01012a23 sw a6,20(sp)
40005980: 00a12c23 sw a0,24(sp)
40005984: 00b12e23 sw a1,28(sp)
40005988: 02c12023 sw a2,32(sp)
4000598c: 02d12223 sw a3,36(sp)
40005990: 02e12423 sw a4,40(sp)
40005994: 02f12623 sw a5,44(sp)
/* Convert absolute to relative time */
if (flags == TIMER_ABSTIME) {
40005998: 00010413 mv s0,sp
4000599c: 40018637 lui a2,0x40018
400059a0: 00040593 mv a1,s0
400059a4: bd060613 addi a2,a2,-1072 # 40017bd0 <_POSIX_Timer_Information>
400059a8: 00098513 mv a0,s3
400059ac: 235010ef jal ra,400073e0 <_Objects_Get>
400059b0: 00050413 mv s0,a0
* something with the structure of times of the timer: to stop, start
* or start it again
*/
ptimer = _POSIX_Timer_Get( timerid, &lock_context );
if ( ptimer != NULL ) {
400059b4: 24050a63 beqz a0,40005c08 <timer_settime+0x304>
Per_CPU_Control *cpu;
cpu = _POSIX_Timer_Acquire_critical( ptimer, &lock_context );
/* Stop the timer */
_Watchdog_Remove(
400059b8: 01050a13 addi s4,a0,16
400059bc: 4001a9b7 lui s3,0x4001a
400059c0: 000a0593 mv a1,s4
400059c4: 9d098513 addi a0,s3,-1584 # 400199d0 <_Per_CPU_Information+0x50>
400059c8: 601030ef jal ra,400097c8 <_Watchdog_Remove>
&cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
&ptimer->Timer
);
/* First, it verifies if the timer must be stopped */
if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) {
400059cc: 02012783 lw a5,32(sp)
400059d0: 02412703 lw a4,36(sp)
400059d4: 00e7e7b3 or a5,a5,a4
400059d8: 0c079063 bnez a5,40005a98 <timer_settime+0x194>
400059dc: 02812503 lw a0,40(sp)
400059e0: 0a051c63 bnez a0,40005a98 <timer_settime+0x194>
/* The old data of the timer are returned */
if ( ovalue )
400059e4: 04048263 beqz s1,40005a28 <timer_settime+0x124>
*ovalue = ptimer->timer_data;
400059e8: 05042303 lw t1,80(s0)
400059ec: 05442883 lw a7,84(s0)
400059f0: 05842803 lw a6,88(s0)
400059f4: 05c42583 lw a1,92(s0)
400059f8: 06042603 lw a2,96(s0)
400059fc: 06442683 lw a3,100(s0)
40005a00: 06842703 lw a4,104(s0)
40005a04: 06c42783 lw a5,108(s0)
40005a08: 0064a023 sw t1,0(s1)
40005a0c: 0114a223 sw a7,4(s1)
40005a10: 0104a423 sw a6,8(s1)
40005a14: 00b4a623 sw a1,12(s1)
40005a18: 00c4a823 sw a2,16(s1)
40005a1c: 00d4aa23 sw a3,20(s1)
40005a20: 00e4ac23 sw a4,24(s1)
40005a24: 00f4ae23 sw a5,28(s1)
/* The new data are set */
ptimer->timer_data = normalize;
40005a28: 01012783 lw a5,16(sp)
40005a2c: 04f42823 sw a5,80(s0)
40005a30: 01412783 lw a5,20(sp)
40005a34: 04f42a23 sw a5,84(s0)
40005a38: 01812783 lw a5,24(sp)
40005a3c: 04f42c23 sw a5,88(s0)
40005a40: 01c12783 lw a5,28(sp)
40005a44: 04f42e23 sw a5,92(s0)
40005a48: 02012783 lw a5,32(sp)
40005a4c: 06f42023 sw a5,96(s0)
40005a50: 02412783 lw a5,36(sp)
40005a54: 06f42223 sw a5,100(s0)
40005a58: 02812783 lw a5,40(sp)
40005a5c: 06f42423 sw a5,104(s0)
40005a60: 02c12783 lw a5,44(sp)
40005a64: 06f42623 sw a5,108(s0)
/* Indicates that the timer is created and stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
40005a68: 00400793 li a5,4
40005a6c: 02f40a23 sb a5,52(s0)
40005a70: 00012783 lw a5,0(sp)
40005a74: 3007a073 csrs mstatus,a5
_POSIX_Timer_Release( cpu, &lock_context );
return 0;
}
rtems_set_errno_and_return_minus_one( EINVAL );
}
40005a78: 04c12083 lw ra,76(sp)
40005a7c: 04812403 lw s0,72(sp)
40005a80: 04412483 lw s1,68(sp)
40005a84: 04012903 lw s2,64(sp)
40005a88: 03c12983 lw s3,60(sp)
40005a8c: 03812a03 lw s4,56(sp)
40005a90: 05010113 addi sp,sp,80
40005a94: 00008067 ret
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
40005a98: 00090513 mv a0,s2
40005a9c: 43d030ef jal ra,400096d8 <_Timespec_To_ticks>
40005aa0: 06a42823 sw a0,112(s0)
initial_period = _Timespec_To_ticks( &normalize.it_value );
40005aa4: 02010513 addi a0,sp,32
40005aa8: 431030ef jal ra,400096d8 <_Timespec_To_ticks>
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
40005aac: 00300793 li a5,3
initial_period = _Timespec_To_ticks( &normalize.it_value );
40005ab0: 00050913 mv s2,a0
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
40005ab4: 02f40a23 sb a5,52(s0)
40005ab8: 07840513 addi a0,s0,120
40005abc: a18fe0ef jal ra,40003cd4 <_Timecounter_Nanotime>
cpu->Watchdog.ticks + ticks
40005ac0: 4001a7b7 lui a5,0x4001a
40005ac4: 98078793 addi a5,a5,-1664 # 40019980 <_Per_CPU_Information>
_Watchdog_Insert(
40005ac8: 0487a603 lw a2,72(a5)
40005acc: 04c7a683 lw a3,76(a5)
40005ad0: 000a0593 mv a1,s4
40005ad4: 00c90633 add a2,s2,a2
40005ad8: 01263933 sltu s2,a2,s2
40005adc: 00d906b3 add a3,s2,a3
40005ae0: 9d098513 addi a0,s3,-1584
40005ae4: d50ff0ef jal ra,40005034 <_Watchdog_Insert>
if ( ovalue )
40005ae8: 04048263 beqz s1,40005b2c <timer_settime+0x228>
*ovalue = ptimer->timer_data;
40005aec: 05042883 lw a7,80(s0)
40005af0: 05442803 lw a6,84(s0)
40005af4: 05842503 lw a0,88(s0)
40005af8: 05c42583 lw a1,92(s0)
40005afc: 06042603 lw a2,96(s0)
40005b00: 06442683 lw a3,100(s0)
40005b04: 06842703 lw a4,104(s0)
40005b08: 06c42783 lw a5,108(s0)
40005b0c: 0114a023 sw a7,0(s1)
40005b10: 0104a223 sw a6,4(s1)
40005b14: 00a4a423 sw a0,8(s1)
40005b18: 00b4a623 sw a1,12(s1)
40005b1c: 00c4a823 sw a2,16(s1)
40005b20: 00d4aa23 sw a3,20(s1)
40005b24: 00e4ac23 sw a4,24(s1)
40005b28: 00f4ae23 sw a5,28(s1)
ptimer->timer_data = normalize;
40005b2c: 01012783 lw a5,16(sp)
40005b30: 04f42823 sw a5,80(s0)
40005b34: 01412783 lw a5,20(sp)
40005b38: 04f42a23 sw a5,84(s0)
40005b3c: 01812783 lw a5,24(sp)
40005b40: 04f42c23 sw a5,88(s0)
40005b44: 01c12783 lw a5,28(sp)
40005b48: 04f42e23 sw a5,92(s0)
40005b4c: 02012783 lw a5,32(sp)
40005b50: 06f42023 sw a5,96(s0)
40005b54: 02412783 lw a5,36(sp)
40005b58: 06f42223 sw a5,100(s0)
40005b5c: 02812783 lw a5,40(sp)
40005b60: 06f42423 sw a5,104(s0)
40005b64: 02c12783 lw a5,44(sp)
40005b68: 06f42623 sw a5,108(s0)
40005b6c: 00012783 lw a5,0(sp)
40005b70: 3007a073 csrs mstatus,a5
return 0;
40005b74: 00000513 li a0,0
}
40005b78: 04c12083 lw ra,76(sp)
40005b7c: 04812403 lw s0,72(sp)
40005b80: 04412483 lw s1,68(sp)
40005b84: 04012903 lw s2,64(sp)
40005b88: 03c12983 lw s3,60(sp)
40005b8c: 03812a03 lw s4,56(sp)
40005b90: 05010113 addi sp,sp,80
40005b94: 00008067 ret
normalize = *value;
40005b98: 00c92583 lw a1,12(s2)
40005b9c: 00092303 lw t1,0(s2)
40005ba0: 00492883 lw a7,4(s2)
40005ba4: 00892803 lw a6,8(s2)
40005ba8: 01092603 lw a2,16(s2)
40005bac: 01492683 lw a3,20(s2)
40005bb0: 01892703 lw a4,24(s2)
40005bb4: 01c92783 lw a5,28(s2)
40005bb8: 00010413 mv s0,sp
40005bbc: 00040513 mv a0,s0
40005bc0: 00b12e23 sw a1,28(sp)
40005bc4: 00612823 sw t1,16(sp)
40005bc8: 01112a23 sw a7,20(sp)
40005bcc: 01012c23 sw a6,24(sp)
40005bd0: 02c12023 sw a2,32(sp)
40005bd4: 02d12223 sw a3,36(sp)
40005bd8: 02e12423 sw a4,40(sp)
40005bdc: 02f12623 sw a5,44(sp)
40005be0: 8f4fe0ef jal ra,40003cd4 <_Timecounter_Nanotime>
if ( _Timespec_Greater_than( &now, &normalize.it_value ) )
40005be4: 00040593 mv a1,s0
40005be8: 02010513 addi a0,sp,32
40005bec: 239030ef jal ra,40009624 <_Timespec_Less_than>
40005bf0: 00051c63 bnez a0,40005c08 <timer_settime+0x304>
_Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value );
40005bf4: 02010613 addi a2,sp,32
40005bf8: 00060593 mv a1,a2
40005bfc: 00040513 mv a0,s0
40005c00: 26d030ef jal ra,4000966c <_Timespec_Subtract>
40005c04: d99ff06f j 4000599c <timer_settime+0x98>
rtems_set_errno_and_return_minus_one( EINVAL );
40005c08: 5c40e0ef jal ra,400141cc <__errno>
40005c0c: 01600793 li a5,22
40005c10: 00f52023 sw a5,0(a0)
40005c14: fff00513 li a0,-1
40005c18: f61ff06f j 40005b78 <timer_settime+0x274>
4000013c <wait.part.0>:
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
4000013c: 400176b7 lui a3,0x40017
40000140: 400175b7 lui a1,0x40017
40000144: 40017537 lui a0,0x40017
static void wait(void)
40000148: ff010113 addi sp,sp,-16
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
4000014c: 45068693 addi a3,a3,1104 # 40017450 <bsp_section_rodata_begin>
40000150: 05c00613 li a2,92
40000154: 46858593 addi a1,a1,1128 # 40017468 <bsp_section_rodata_begin+0x18>
40000158: 49850513 addi a0,a0,1176 # 40017498 <bsp_section_rodata_begin+0x48>
static void wait(void)
4000015c: 00112623 sw ra,12(sp)
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
40000160: 481000ef jal ra,40000de0 <__wrap_printf>
40000164: 00000513 li a0,0
40000168: 465000ef jal ra,40000dcc <rtems_test_exit> <== NOT EXECUTED