diff options
-rw-r--r-- | c/src/exec/posix/src/mqueuesendsupp.c | 13 | ||||
-rw-r--r-- | c/src/exec/rtems/src/msgqsubmit.c | 5 | ||||
-rw-r--r-- | c/src/exec/score/include/rtems/score/coremsg.h | 3 | ||||
-rw-r--r-- | c/src/exec/score/src/coremsgsubmit.c | 2 | ||||
-rw-r--r-- | c/src/exec/score/src/coremutexsurrender.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/startup/linkcmds | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/erc32/tools/runtest.in | 2 | ||||
-rw-r--r-- | c/src/tests/sptests/sp13/sp13.scn | 2 | ||||
-rw-r--r-- | c/src/tests/sptests/sp13/system.h | 1 | ||||
-rw-r--r-- | c/src/tests/sptests/sp13/task2.c | 2 | ||||
-rw-r--r-- | c/src/tests/sptests/sp20/system.h | 2 | ||||
-rw-r--r-- | c/src/tests/support/include/tmacros.h | 6 |
12 files changed, 31 insertions, 13 deletions
diff --git a/c/src/exec/posix/src/mqueuesendsupp.c b/c/src/exec/posix/src/mqueuesendsupp.c index 9615244583..5a1f2cd708 100644 --- a/c/src/exec/posix/src/mqueuesendsupp.c +++ b/c/src/exec/posix/src/mqueuesendsupp.c @@ -87,8 +87,19 @@ int _POSIX_Message_queue_Send_support( ); _Thread_Enable_dispatch(); + + /* + * If we had to block, then this is where the task returns + * after it wakes up. The returned status is correct for + * non-blocking operations but if we blocked, then we need + * to look at the status in our TCB. + */ + + if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT ) + msg_status = _Thread_Executing->Wait.return_code; + if ( !msg_status ) - return 0; + return msg_status; set_errno_and_return_minus_one( _POSIX_Message_queue_Translate_core_message_queue_return_code( diff --git a/c/src/exec/rtems/src/msgqsubmit.c b/c/src/exec/rtems/src/msgqsubmit.c index 5cca0ae5dd..2334f131a7 100644 --- a/c/src/exec/rtems/src/msgqsubmit.c +++ b/c/src/exec/rtems/src/msgqsubmit.c @@ -132,6 +132,11 @@ rtems_status_code _Message_queue_Submit( } _Thread_Enable_dispatch(); + /* + * Since this API does not allow for blocking sends, we can directly + * return the returned msg_status. + */ + return _Message_queue_Translate_core_message_queue_return_code( msg_status ); diff --git a/c/src/exec/score/include/rtems/score/coremsg.h b/c/src/exec/score/include/rtems/score/coremsg.h index 0036db0f81..c53f29cea1 100644 --- a/c/src/exec/score/include/rtems/score/coremsg.h +++ b/c/src/exec/score/include/rtems/score/coremsg.h @@ -95,7 +95,8 @@ typedef enum { CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED, CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT, CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED, - CORE_MESSAGE_QUEUE_STATUS_TIMEOUT + CORE_MESSAGE_QUEUE_STATUS_TIMEOUT, + CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT } CORE_message_queue_Status; /* diff --git a/c/src/exec/score/src/coremsgsubmit.c b/c/src/exec/score/src/coremsgsubmit.c index 94398db4c0..eabcb79ddf 100644 --- a/c/src/exec/score/src/coremsgsubmit.c +++ b/c/src/exec/score/src/coremsgsubmit.c @@ -171,5 +171,5 @@ CORE_message_queue_Status _CORE_message_queue_Submit( _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } - return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; + return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; } diff --git a/c/src/exec/score/src/coremutexsurrender.c b/c/src/exec/score/src/coremutexsurrender.c index 7eb1497c9f..c4dda7e3a7 100644 --- a/c/src/exec/score/src/coremutexsurrender.c +++ b/c/src/exec/score/src/coremutexsurrender.c @@ -86,7 +86,7 @@ CORE_mutex_Status _CORE_mutex_Surrender( } } - _Thread_Executing->resource_count--; + holder->resource_count--; the_mutex->holder = NULL; the_mutex->holder_id = 0; diff --git a/c/src/lib/libbsp/powerpc/psim/startup/linkcmds b/c/src/lib/libbsp/powerpc/psim/startup/linkcmds index 41570480f9..d637fcce72 100644 --- a/c/src/lib/libbsp/powerpc/psim/startup/linkcmds +++ b/c/src/lib/libbsp/powerpc/psim/startup/linkcmds @@ -64,8 +64,8 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) } >RAM - .init : { *(.init) } >RAM - .fini : { *(.fini) } >RAM + .init : { __init = .; *(.init) } >RAM + .fini : { __fini = .; *(.fini) } >RAM .rodata : { *(.rodata) *(.gnu.linkonce.r*) } >RAM .rodata1 : { *(.rodata1) } >RAM PROVIDE (_etext = .); diff --git a/c/src/lib/libbsp/sparc/erc32/tools/runtest.in b/c/src/lib/libbsp/sparc/erc32/tools/runtest.in index b7c6f723c2..c550565069 100644 --- a/c/src/lib/libbsp/sparc/erc32/tools/runtest.in +++ b/c/src/lib/libbsp/sparc/erc32/tools/runtest.in @@ -131,7 +131,7 @@ do TEST_TYPE="single" case $tname in - monitor) + monitor*) if [ $run_to_completion = "yes" ] then warn "Skipping $tname; it is interactive" diff --git a/c/src/tests/sptests/sp13/sp13.scn b/c/src/tests/sptests/sp13/sp13.scn index 66ecca6c60..51441e1c15 100644 --- a/c/src/tests/sptests/sp13/sp13.scn +++ b/c/src/tests/sptests/sp13/sp13.scn @@ -1,5 +1,5 @@ *** TEST 13 *** -TA1 - rtems_message_queue_ident - qid => 18010001 +TA1 - rtems_message_queue_ident - qid => 1c010001 TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 TA1 - rtems_task_wake_after - sleep 5 seconds diff --git a/c/src/tests/sptests/sp13/system.h b/c/src/tests/sptests/sp13/system.h index fea6a652a6..c30459a477 100644 --- a/c/src/tests/sptests/sp13/system.h +++ b/c/src/tests/sptests/sp13/system.h @@ -53,6 +53,7 @@ rtems_task Task_3( #define CONFIGURE_RTEMS_INIT_TASKS_TABLE +#define CONFIGURE_MEMORY_OVERHEAD 32 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) #include <confdefs.h> diff --git a/c/src/tests/sptests/sp13/task2.c b/c/src/tests/sptests/sp13/task2.c index 258a036f8c..e970eac4e7 100644 --- a/c/src/tests/sptests/sp13/task2.c +++ b/c/src/tests/sptests/sp13/task2.c @@ -100,8 +100,6 @@ rtems_task Task_2( Fill_buffer( "BUFFER 2 TO Q 2", (long *)buffer ); puts( "TA2 - rtems_message_queue_send - BUFFER 2 TO Q 2" ); - directive_failed( status, "rtems_message_queue_send" ); - status = rtems_message_queue_send( Queue_id[ 2 ], buffer, MESSAGE_SIZE ); directive_failed( status, "rtems_message_queue_send" ); diff --git a/c/src/tests/sptests/sp20/system.h b/c/src/tests/sptests/sp20/system.h index 868fd60ae5..a5971aa3cd 100644 --- a/c/src/tests/sptests/sp20/system.h +++ b/c/src/tests/sptests/sp20/system.h @@ -45,7 +45,7 @@ void Get_all_counters( void ); #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_EXTRA_TASK_STACKS (15 * RTEMS_MINIMUM_STACK_SIZE) +#define CONFIGURE_EXTRA_TASK_STACKS (6 * 3 * RTEMS_MINIMUM_STACK_SIZE) #include <confdefs.h> diff --git a/c/src/tests/support/include/tmacros.h b/c/src/tests/support/include/tmacros.h index 6009ef473e..8b3619a639 100644 --- a/c/src/tests/support/include/tmacros.h +++ b/c/src/tests/support/include/tmacros.h @@ -91,8 +91,10 @@ extern "C" { do { \ check_dispatch_disable_level( _level ); \ if ( (_stat) != (_desired) ) { \ - printf( "\n%s FAILED -- expected (%s) got (%s)\n", \ - (_msg), strerror(_desired), strerror(_stat) ); \ + printf( "\n%s FAILED -- expected (%d - %s) got (%d - %s)\n", \ + (_msg), _desired, strerror(_desired), _stat, strerror(_stat) ); \ + printf( "\n FAILED -- errno (%d - %s)\n", \ + errno, strerror(errno) ); \ fflush(stdout); \ exit( _stat ); \ } \ |