diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-02 21:45:15 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-02 21:45:15 +0000 |
commit | 82cb78d84c7962d2b55e1f83c9f8cbcbef386d87 (patch) | |
tree | bae0b9595689a38992ffcc4bad8ddfea285fc16b /cpukit/score/src/coremsgflush.c | |
parent | Split Heap and Time of Day Handlers. (diff) | |
download | rtems-82cb78d84c7962d2b55e1f83c9f8cbcbef386d87.tar.bz2 |
Split core message queue and watchdog handler objects into separate files.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/coremsgflush.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/cpukit/score/src/coremsgflush.c b/cpukit/score/src/coremsgflush.c new file mode 100644 index 0000000000..9d219e90b7 --- /dev/null +++ b/cpukit/score/src/coremsgflush.c @@ -0,0 +1,56 @@ +/* + * CORE Message Queue Handler + * + * DESCRIPTION: + * + * This package is the implementation of the CORE Message Queue Handler. + * This core object provides task synchronization and communication functions + * via messages passed to queue objects. + * + * COPYRIGHT (c) 1989-1998. + * On-Line Applications Research Corporation (OAR). + * Copyright assigned to U.S. Government, 1994. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.OARcorp.com/rtems/license.html. + * + * $Id$ + */ + +#include <rtems/system.h> +#include <rtems/score/chain.h> +#include <rtems/score/isr.h> +#include <rtems/score/object.h> +#include <rtems/score/coremsg.h> +#include <rtems/score/states.h> +#include <rtems/score/thread.h> +#include <rtems/score/wkspace.h> +#if defined(RTEMS_MULTIPROCESSING) +#include <rtems/score/mpci.h> +#endif + +/*PAGE + * + * _CORE_message_queue_Flush + * + * This function flushes the message_queue's task wait queue. The number + * of messages flushed from the queue is returned. + * + * Input parameters: + * the_message_queue - the message_queue to be flushed + * + * Output parameters: + * returns - the number of messages flushed from the queue + */ + +unsigned32 _CORE_message_queue_Flush( + CORE_message_queue_Control *the_message_queue +) +{ + if ( the_message_queue->number_of_pending_messages != 0 ) + return _CORE_message_queue_Flush_support( the_message_queue ); + else + return 0; +} + |