📄 msgqsmlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/msgQSmLib.html - generated by refgen from msgQSmLib.c --> <title> msgQSmLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>msgQSmLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>msgQSmLib</strong> - shared memory message queue library (VxMP Option) </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./msgQSmLib.html#msgQSmCreate">msgQSmCreate</a>( )</b> - create and initialize a shared memory message queue (VxMP Option)<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides the interface to shared memory message queues.Shared memory message queues allow a variable number of messages (varyingin length) to be queued in first-in-first-out order. Any task running onany CPU in the system can send messages to or receive messages from ashared message queue. Tasks can also send to and receive from thesame shared message queue. Full-duplex communication between twotasks generally requires two shared message queues, one for eachdirection.<p>Shared memory message queues are created with <b><a href="./msgQSmLib.html#msgQSmCreate">msgQSmCreate</a>( )</b>. Oncecreated, they can be manipulated using the generic routines for localmessage queues; for more information on the use of these routines, see themanual entry for <b><a href="./msgQLib.html#top">msgQLib</a></b>.<p></blockquote><h4>MEMORY REQUIREMENTS</h4><blockquote><p>The shared memory message queue structure is allocated from a dedicated shared memory partition. This shared memory partition is initialized bythe shared memory objects master CPU. The size of this partition isdefined by the maximum number of shared message queues, <b>SM_OBJ_MAX_MSG_Q</b>.<p>The message queue buffers are allocated from the shared memory system partition. <p></blockquote><h4>RESTRICTIONS</h4><blockquote><p>Shared memory message queues differ from local message queues in thefollowing ways:<p><dl><dt><b>Interrupt Use:</b><dd>Shared memory message queues may not be used (sent to or received from) atinterrupt level.<p><dt><b>Deletion:</b><dd>There is no way to delete a shared memory message queue and free its associatedshared memory. Attempts to delete a shared message queue return ERROR andset <b>errno</b> to <b>S_smObjLib_NO_OBJECT_DESTROY</b>.<p><dt><b>Queuing Style:</b><dd>The shared message queue task queueing order specified when a message queue iscreated must be FIFO.</dl></blockquote><h4>CONFIGURATION</h4><blockquote><p>Before routines in this library can be called, the shared memory objectsfacility must be initialized by calling <b>usrSmObjInit( )</b>. This is doneautomatically during VxWorks initialization if the component <b>INCLUDE_SM_OBJ</b>is included.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This module is distributed as a component of the unbundled sharedobjects memory support option, VxMP.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>msgQSmLib.h</b>, <b>msgQLib.h</b>, <b>smMemLib.h</b>, <b>smObjLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./msgQLib.html#top">msgQLib</a></b>, <b><a href="./smObjLib.html#top">smObjLib</a></b>, <b><a href="./msgQShow.html#top">msgQShow</a></b>, <b>usrSmObjInit( )</b>,<i>VxWorks Programmer's Guide: Shared Memory Objects</i><hr><a name="msgQSmCreate"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>msgQSmCreate( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>msgQSmCreate( )</strong> - create and initialize a shared memory message queue (VxMP Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>MSG_Q_ID msgQSmCreate ( int maxMsgs, /* max messages that can be queued */ int maxMsgLength, /* max bytes in a message */ int options /* message queue options */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates a shared memory message queue capable of holding upto <i>maxMsgs</i> messages, each up to <i>maxMsgLength</i> bytes long. It returns amessage queue ID used to identify the created message queue. The queuecan only be created with the option <b>MSG_Q_FIFO</b> (0), thus queuing pendedtasks in FIFO order.<p>The global message queue identifier returned can be used directly by genericmessage queue handling routines in <b><a href="./msgQLib.html#top">msgQLib</a></b> -- <b><a href="./msgQLib.html#msgQSend">msgQSend</a>( )</b>, <b><a href="./msgQLib.html#msgQReceive">msgQReceive</a>( )</b>, and <b><a href="./msgQLib.html#msgQNumMsgs">msgQNumMsgs</a>( )</b> -- and by the show routines <b><a href="./usrLib.html#show">show</a>( )</b> and <b><a href="./msgQShow.html#msgQShow">msgQShow</a>( )</b>.<p>If there is insufficient memory to store the message queue structurein the shared memory message queue partition or if the shared memory systempool cannot handle the requested message queue size, shared memory message queue creation will fail with <b>errno</b> set to <b>S_memLib_NOT_ENOUGH_MEMORY</b>.This problem can be solved by incrementing the value of <b>SM_OBJ_MAX_MSG_Q</b>and/or the shared memory objects dedicated memory size <b>SM_OBJ_MEM_SIZE</b> .<p>Before this routine can be called, the shared memory objects facility mustbe initialized (see <b><a href="./msgQSmLib.html#top">msgQSmLib</a></b>).<p></blockquote><h4>AVAILABILITY</h4><blockquote><p><p>This routine is distributed as a component of the unbundled shared memoryobjects support option, VxMP.<p></blockquote><h4>RETURNS</h4><blockquote><p><b>MSG_Q_ID</b>, or NULL if error.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_memLib_NOT_ENOUGH_MEMORY</b>, <b>S_intLib_NOT_ISR_CALLABLE</b>,<b>S_msgQLib_INVALID_QUEUE_TYPE</b>, <b>S_smObjLib_LOCK_TIMEOUT</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./msgQSmLib.html#top">msgQSmLib</a></b>, <b><a href="./smObjLib.html#top">smObjLib</a></b>, <b><a href="./msgQLib.html#top">msgQLib</a></b>, <b><a href="./msgQShow.html#top">msgQShow</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -