diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2012-03-22 14:34:06 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-04-05 15:20:19 -0500 |
commit | 3b9b970812926d1cbc063174dd7f097b4fcb3793 (patch) | |
tree | 3b191befecbef21c540540f8c2fde42d68fb9e54 /src/include/usr/mbox/mboxif.H | |
parent | d26e75088c24cdf95e02575b0d172068cdb1a58b (diff) | |
download | talos-hostboot-3b9b970812926d1cbc063174dd7f097b4fcb3793.tar.gz talos-hostboot-3b9b970812926d1cbc063174dd7f097b4fcb3793.zip |
Mailbox service provider
RTC: 35323
Change-Id: Ifd626870fcc31f94a684f8a19fdc7816e092a7fa
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/798
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/mbox/mboxif.H')
-rw-r--r-- | src/include/usr/mbox/mboxif.H | 64 |
1 files changed, 62 insertions, 2 deletions
diff --git a/src/include/usr/mbox/mboxif.H b/src/include/usr/mbox/mboxif.H index cb6b23ffe..fc321f757 100644 --- a/src/include/usr/mbox/mboxif.H +++ b/src/include/usr/mbox/mboxif.H @@ -23,8 +23,68 @@ #ifndef __MBOX_MBOXIF_H #define __MBOX_MBOXIF_H +#include <sys/msg.h> +#include <errl/errlentry.H> +#include <mbox/mbox_queues.H> + namespace MBOX { - // TODO add mailbox service interfaces -}; + /** + * 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); + +}; // end namespace MBOX + #endif |