source: rtems/cpukit/itron/include/itronsys/mbox.h @ 9d9a3dd

4.104.114.84.95
Last change on this file since 9d9a3dd was 9d9a3dd, checked in by Jennifer Averett <Jennifer.Averett@…>, on 11/17/99 at 16:47:58

+ Updated copyright information.

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