blob: d427e5e28db4af106854a474fb0a93b705277778 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
/* IBM_PROLOG_BEGIN_TAG
* This is an automatically generated prolog.
*
* $Source: src/include/usr/mbox/mboxif.H $
*
* IBM CONFIDENTIAL
*
* COPYRIGHT International Business Machines Corp. 2012
*
* p1
*
* Object Code Only (OCO) source materials
* Licensed Internal Code Source Materials
* IBM HostBoot Licensed Internal Code
*
* The source code for this program is not published or other-
* wise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* Origin: 30
*
* IBM_PROLOG_END_TAG
*/
#ifndef __MBOX_MBOXIF_H
#define __MBOX_MBOXIF_H
#include <sys/msg.h>
#include <errl/errlentry.H>
#include <mbox/mbox_queues.H>
namespace MBOX
{
/**
* Register a message queue to receive mailbox messages
* @param[in] i_queueu_id, The queue identifier
* @param[in] i_msgQ, The message queue created with msg_q_create()
* @see sys/msg.h
* @return errlHndl_t on error
*/
errlHndl_t msgq_register(queue_id_t i_queue_id, msg_q_t i_msgQ);
/**
* Un register a message queue from the mailbox service
* @param[in] i_queue_id, The queue identifier
* @return The message queue | NULL if i_queue_id not registered.
*/
msg_q_t msgq_unregister(queue_id_t i_queue_id);
/**
* Send message asynchronously
* @param[in] i_q_id id, of the FSP message queue to send the msg to.
* @param[in] i_msg. The message to send.
*
* @return errlHndl_t on error.
*
* @pre i_msg->extra_data == NULL If there is no extra data is associated
* with the message.
*
* @pre i_msg->extra_data = malloc(size); i_msg->data[1] = size;
* Any extra data associated with i_msg was obtained from the heap
* using malloc and i_msg->data[1] contains the length of that data.
*
* @post free(i_msg->extra_dat) was done (if no error)
* @post msg_free(i_msg) was done (if no error)
*/
errlHndl_t send(queue_id_t i_q_id, msg_t * i_msg);
/**
* Send message synchronously
* @param[in] i_q_id id, of the FSP message queue to send the msg to.
* @param[in/out] io_msg. The message sent and returned.
*
* @return errlHndl_t on error
*
* @pre io_msg->extra_data == NULL If there is no extra data is associated
* with the message.
*
* @pre io_msg->extra_data = malloc(size); io_msg->data[1] = size;
* Any extra data associated with io_msg was obtained from the heap
* using malloc and io_msg->data[1] contains the length of that data.
*
* @post free(i_msg->extra_data) was done (if no error)
*
* @note: On return, if io_msg->extra_data != NULL, the caller must
* call free(io_msg->extra_data);
*/
errlHndl_t sendrecv(queue_id_t i_q_id, msg_t * io_msg);
/**
* Determine if the mailbox is enabled
*
* @return bool
* true -> mailbox is enabled
* flalse -> mailbox is disabled (spless system)
*/
bool mailbox_enabled();
}; // end namespace MBOX
#endif
|