<div>Hi Peter,</div>
<div>&nbsp;</div>
<div class="gmail_quote">On Tue, Apr 22, 2008 at 7:52 PM, Peter Nguyen &lt;<a href="mailto:peter.nguyen@adelaide.edu.au">peter.nguyen@adelaide.edu.au</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>OK, so what functions can i use (assuming they exist) to specify how<br>many message registers that i want to be transferred in an IPC call?</blockquote>

<div>&nbsp;</div>
<div>
<div>All meta-data for a message - flags, label, and count of message registers used - are stored in the message tag (a word of type L4_MsgTag_t, defined in libs/l4/include/message.h). When an IPC is effected, the message tag is stored in MR[0] (with the actual payload of the message stored in subsequent MRs), and the OKL4 kernel extracts from MR[0] that meta-data.</div>

<div>&nbsp;</div>
<div>Convenience functions are provided for the construction of a message that appropriately modify the meta-data in the&nbsp;message tag. For example, L4_MsgAppendWord will add the given word to the given message at the next unused MR slot and increment the count of MRs in the given message&#39;s tag. It&#39;s important to note that modifying a message (of type L4_Msg_t) does not directly modify the MRs of the thread: an L4_MsgLoad must be performed after constructing the message. This simply loads the message words out of the message struct and into the thread&#39;s message registers - with the first, MR[0], being set to the tag of the message.</div>

<div>&nbsp;</div>
<div>Using such convenience functions means you needn&#39;t worry about setting the number of MRs to be transferred yourself. That&#39;s still technically possible though; if you wanted to construct an IPC using only L4_LoadMR you would just need to ensure that you load MR[0] with an appropriately constructed L4_MsgTag. The convenience functions are definitely recommended, however.</div>

<div>&nbsp;</div>
<div>Additionally, the current number of MRs set in a given message tag can be determined via L4_UntypedWords(msgtag), and the message tag from a received (or just loaded) IPC can be retrieved via L4_MsgTag().</div>
<div>&nbsp;</div>
<div>Best regards,</div>
<div>&nbsp;</div>
<div>Josh Matthews</div></div></div>