source: rtems/cpukit/itron/include/itronsys/mbox.h @ 5e96e917

4.104.114.84.95
Last change on this file since 5e96e917 was 5e96e917, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 15:24:11

Updated Mailbox Manager submitted and split into multiple files.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*
2 *  The license and distribution terms for this file may be
3 *  found in the file LICENSE in this distribution or at
4 *  http://www.OARcorp.com/rtems/license.html.
5 *
6 *  $Id$
7 */
8
9#ifndef __ITRON_MBOX_h_
10#define __ITRON_MBOX_h_
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/*
17 *  Create Mailbox (cre_mbx) Structure
18 */
19
20typedef struct t_cmbx {
21  VP    exinf;    /* extended information */
22  ATR   mbxatr;   /* mailbox attributes */
23  /* Following is implementation-dependent function */
24  INT   bufcnt;   /* maximum number of messages to let pend */
25  /* additional information may be included depending on the implementation */
26} T_CMBX;
27
28/*
29 *  mbxatr
30 */
31
32#define TA_TFIFO   0x00   /* waiting tasks are handled by FIFO */
33#define TA_TPRI    0x01   /* waiting tasks are handled by priority */
34#define TA_MFIFO   0x00   /* messages are handled by FIFO */
35#define TA_MPRI    0x02   /* messages are handled by priority */
36
37typedef struct t_msg {
38  /*
39   *  A region (header) reserved by the OS may be included first
40   *  depending on the implementation.
41   *
42   *  NOTE: The first two fields are RTEMS specific.
43   */
44
45  INT       msgpri;   /* priority of each message */
46  /* VB   msgcont[];  XXX */
47  unsigned8 msgcont[1];
48} T_MSG;
49
50/*
51 *  Reference Mailbox (ref_mbx) Structure
52 */
53
54typedef struct t_rmbx {
55  VP        exinf;    /* extended information */
56  BOOL_ID   wtsk;     /* indicates whether or not there is a waiting task */
57  T_MSG    *pk_msg;   /* message to be sent next */
58  /* additional information may be included depending on the implementation */
59} T_RMBX;
60
61/*
62 *  Mailbox Functions
63 */
64
65/*
66 *  cre_mbx - Create Mailbox
67 */
68
69ER cre_mbx(
70  ID      mbxid,
71  T_CMBX *pk_cmbx
72);
73
74/*
75 *  del_mbx - Delete Mailbox
76 */
77
78ER del_mbx(
79  ID mbxid
80);
81
82/*
83 *  snd_msg - Send Message to Mailbox
84 */
85
86ER snd_msg(
87  ID     mbxid,
88  T_MSG *pk_msg
89);
90
91/*
92 *  rcv_msg - Receive Message from Mailbox
93 */
94
95ER rcv_msg(
96  T_MSG **ppk_msg,
97  ID      mbxid
98);
99
100/*
101 *  prcv_msg - Poll and Receive Message from Mailbox
102 */
103
104ER prcv_msg(
105  T_MSG **ppk_msg,
106  ID      mbxid
107);
108
109/*
110 *  trcv_msg - Receive Message from Mailbox with Timeout
111 */
112
113ER trcv_msg(
114  T_MSG **ppk_msg,
115  ID      mbxid,
116  TMO     tmout
117);
118
119/*
120 *  ref_mbx - Reference Mailbox Status
121 */
122
123ER ref_mbx(
124  T_RMBX *pk_rmbx,
125  ID      mbxid
126);
127
128
129#ifdef __cplusplus
130}
131#endif
132
133#endif
134/* end of include file */
135
Note: See TracBrowser for help on using the repository browser.