summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-08-16 21:36:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-08-16 21:36:15 +0000
commitb3a6713265ceca05f1138759921e3064f55df7ff (patch)
treedc30e0349dd3d55ab6795c31b12e60a2290f3826
parent2001-08-09 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-b3a6713265ceca05f1138759921e3064f55df7ff.tar.bz2
2001-08-16 Joel Sherrill <joel@OARcorp.com>
* src/mqueuesendsupp.c: Account for possibly blocking during the core send operation. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * src/msgqsubmit.c: Add a comment indicating that we do not have to account for possibly blocking during the core send operation because Classic API message queue send is always non-blocking. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * include/rtems/score/coremsg.h, src/coremsgsubmit.c: Add a new return status to account for blocking sends. Otherwise, the caller will think that the returned message status will have the ultimate results of the operation. If the send times out, the final status will be in the return_code of the thread. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * src/coremutexsurrender.c: Use holder thread not executing thread because even though they may and often are the same it is not guaranteed unless the proper attribute is set. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * startup/linkcmds: Modified to work better with gcc 2.8.1 and gnat 3.13p. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * tools/runtest.in: Recognize debug variant of monitor test. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * sp13/sp13.scn: Id in screen had wrong class field value. * sp13/system.h: Account for message buffer memory. * sp13/task2.c: Remove unnecessary check for failure. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * sp20/system.h: Account for extra task stacks properly. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * include/tmacros.h: Attempt to print errno as further information.
-rw-r--r--c/src/exec/posix/src/mqueuesendsupp.c13
-rw-r--r--c/src/exec/rtems/src/msgqsubmit.c5
-rw-r--r--c/src/exec/score/include/rtems/score/coremsg.h3
-rw-r--r--c/src/exec/score/src/coremsgsubmit.c2
-rw-r--r--c/src/exec/score/src/coremutexsurrender.c2
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/linkcmds4
-rw-r--r--c/src/lib/libbsp/sparc/erc32/tools/runtest.in2
-rw-r--r--c/src/tests/sptests/sp13/sp13.scn2
-rw-r--r--c/src/tests/sptests/sp13/system.h1
-rw-r--r--c/src/tests/sptests/sp13/task2.c2
-rw-r--r--c/src/tests/sptests/sp20/system.h2
-rw-r--r--c/src/tests/support/include/tmacros.h6
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 ); \
} \