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.
This commit is contained in:
Joel Sherrill
2001-08-16 21:36:15 +00:00
parent 5ccb03b887
commit b3a6713265
12 changed files with 31 additions and 13 deletions

View File

@@ -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(

View File

@@ -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 );

View File

@@ -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;
/*

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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 = .);

View File

@@ -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"

View File

@@ -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

View File

@@ -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>

View File

@@ -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" );

View File

@@ -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>

View File

@@ -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 ); \
} \