summaryrefslogtreecommitdiffstats
path: root/cpukit/itron/include/itronsys/msgbuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/itron/include/itronsys/msgbuffer.h')
-rw-r--r--cpukit/itron/include/itronsys/msgbuffer.h157
1 files changed, 157 insertions, 0 deletions
diff --git a/cpukit/itron/include/itronsys/msgbuffer.h b/cpukit/itron/include/itronsys/msgbuffer.h
new file mode 100644
index 0000000000..20a7563851
--- /dev/null
+++ b/cpukit/itron/include/itronsys/msgbuffer.h
@@ -0,0 +1,157 @@
+/*
+ * 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$
+ */
+
+#ifndef __ITRON_MESSAGEBUFFER_h_
+#define __ITRON_MESSAGEBUFFER_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Create Message Buffer (cre_mbf) Structure
+ */
+
+typedef struct t_cmbf {
+ VP exinf; /* extended information */
+ ATR mbfatr; /* messagebuffer attributes */
+ INT bufsz; /* messagebuffer size */
+ INT maxmsz; /* maximum size of messages */
+ /* additional information may be included depending on the implementation */
+} T_CMBF;
+
+/*
+ * mbfatr
+ */
+
+#define TA_TFIFO 0x00 /* tasks waiting to receive messages are handled
+ by FIFO */
+#define TA_TPRI 0x01 /* tasks waiting to receive messages are handled
+ by priority */
+
+/*
+ * mbfid
+ */
+
+#define TMBF_OS (-4) /* messagebuffer used for OS error log */
+#define TMBF_DB (-3) /* messagebuffer used for debugging */
+
+/*
+ * Reference Message Buffer (ref_mbf) Structure
+ */
+
+typedef struct t_rmbf {
+ VP exinf; /* extended information */
+ BOOL_ID wtsk; /* indicates whether or not there is a */
+ /* task waiting to receive a message */
+ BOOL_ID stsk; /* indicates whether or not there is a */
+ /* task waiting to send a message */
+ INT msgsz; /* size of message to be sent next */
+ INT frbufsz; /* size of free buffer */
+ /* additional information may be included depending on the implementation */
+} T_RMBF;
+
+/*
+ * Message Buffer Functions
+ */
+
+/*
+ * cre_mbf - Create MessageBuffer
+ */
+
+ER cre_mbf(
+ ID mbfid,
+ T_CMBF *pk_cmbf
+);
+
+/*
+ * del_mbf - Delete MessageBuffer
+ */
+
+ER del_mbf(
+ ID mbfid
+);
+
+/*
+ * snd_mbf - Send Message to MessageBuffer
+ */
+
+ER snd_mbf(
+ ID mbfid,
+ VP msg,
+ INT msgsz
+);
+
+/*
+ * psnd_mbf - Poll and Send Message to MessageBuffer
+ */
+
+ER psnd_mbf(
+ ID mbfid,
+ VP msg,
+ INT msgsz
+);
+
+/*
+ * tsnd_mbf - Send Message to MessageBuffer with Timeout
+ */
+
+ER tsnd_mbf(
+ ID mbfid,
+ VP msg,
+ INT msgsz,
+ TMO tmout
+);
+
+/*
+ * rcv_mbf - Receive Message from MessageBuffer
+ */
+
+ER rcv_mbf(
+ VP msg,
+ INT *p_msgsz,
+ ID mbfid
+);
+
+/*
+ * prcv_mbf - Poll and Receive Message from MessageBuffer
+ */
+
+ER prcv_mbf(
+ VP msg,
+ INT *p_msgsz,
+ ID mbfid
+);
+
+/*
+ * trcv_mbf - Receive Message from MessageBuffer with Timeout
+ */
+
+ER trcv_mbf(
+ VP msg,
+ INT *p_msgsz,
+ ID mbfid,
+ TMO tmout
+);
+
+/*
+ * ref_mbf - Reference MessageBuffer Status
+ */
+
+ER ref_mbf(
+ T_RMBF *pk_rmbf,
+ ID mbfid
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
+