1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>MI_GetAllocatableWramSlot</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">MI_GetAllocatableWramSlot* <IMG src="../../image/TWL.gif" align="middle"></h1>
15<h2>Syntax</h2>
16
17<dl>
18  <dd>
19<CODE>#include &lt;twl/mi.h&gt;</CODE><BR> <BR> <CODE>u8 MI_GetAllocatableWramSlot( <A href="../mi_constant.html">MIWramPos</A> wram, <A href="../mi_constant.html">MIWramProc</A> proc );</CODE><br> <BR> <CODE>(define)</CODE><br> <CODE>MI_GetAllocatableWramSlot_A( MIWramProc proc );</CODE><br> <CODE>MI_GetAllocatableWramSlot_B( MIWramProc proc );</CODE><br> <CODE>MI_GetAllocatableWramSlot_C( MIWramProc proc );</CODE><br>
20  </dd>
21</dl>
22<h2>Arguments</h2>
23<TABLE border="1">
24  <TBODY>
25    <TR>
26<TD><B><I>wram</I></B></TD>
27<TD>The WRAM to get information about.</TD>
28    </TR>
29    <TR>
30<TD><B><I>proc</I></B></TD>
31<TD>Processor. Gets the WRAM banks that can be assigned to this processor.<BR>Specify either MI_WRAM_ARM9, MI_WRAM_ARM7, or MI_WRAM_DSP.</TD>
32    </TR>
33  </TBODY>
34</TABLE>
35<h2>Return Values</h2>
36<p>Returns information about those WRAM slots in the specified WRAM region that can be assigned to the specified processor. Returns slot values between 0-3 for WRAM-A, or returns slot values between 0-7 for WRAM-B and WRAM-C.</p>
37<H2>Description</H2>
38<P>Gets information about which WRAM slots of the specified WRAM region can be assigned to the specified processor.</P>
39<P><BR> <B>Assignable slots:</B></P>
40<P>Assignable slots:</P>
41<P> - The slot must not be assigned to any processor.<BR>- The slot must either not be reserved by any processor, or must be reserved by the specified processor.</P>
42<P>To be assignable, a slot must meet both conditions.</P>
43<P><BR> <B>About the return values:</B></P>
44<p>The lower bits of the u8 value indicate slot 0, slot 1, and so on (in order). If a given bit is 1, it means that the corresponding slot can be assigned.</p>
45<p>For example, if the return value of <CODE>MI_GetAllocatableWramSlot( MI_WRAM_B, MI_WRAM_ARM9 )</CODE> is <CODE>0xC0</CODE> (11000000 in binary), this indicates that WRAM-B slots 0, 1, 2, 3, 4, and 5 cannot be assigned to the ARM9 (these slots are already either assigned to another processor or reserved for another processor), and that slots 6 and 7 can be assigned to the ARM9.</p>
46<BLOCKQUOTE><IMG src="image_allocatable1.gif" width="226" height="163" border="0"></BLOCKQUOTE>
47<P><BR> <B>If MI_WRAM_FREE is specified for the processor:</B></P>
48<P>Normally, you specify MI_WRAM_ARM9, MI_WRAM_ARM7, or MI_WRAM_DSP as the <B><I>proc</I></B> argument to determine which WRAM slots can be allocated for the given processor, but it is also possible to specify MI_WRAM_FREE as a special way of using this function.</P>
49<P>By specifying MI_WRAM_FREE, it is possible to obtain information about which WRAM slots are completely free (those slots that are not reserved for or allocated by anything), but there is also a separate function for doing just this, <CODE><A href="MI_GetFreeWramSlot.html">MI_GetFreeWramSlot()</A></CODE>. We recommend using <CODE><A href="MI_GetFreeWramSlot.html">MI_GetFreeWramSlot()</A></CODE>.</P>
50<P><BR> <B>Examples</B><BR>
51</P>
52<BLOCKQUOTE><IMG src="image_allocatable2.gif" width="225" height="448" border="0"></BLOCKQUOTE>
53<P>Under the situation described above, the results will be as follows:</P>
54<BLOCKQUOTE><CODE>MI_GetAllocatableWramSlot( MI_WRAM_B, MI_WRAM_ARM9 )</CODE>   ? 0x0C<BR> <CODE>MI_GetAllocatableWramSlot( MI_WRAM_B, MI_WRAM_ARM7 )</CODE>   ? 0x48<BR> <CODE>MI_GetAllocatableWramSlot( MI_WRAM_B, MI_WRAM_DSP )</CODE>   ? 0x08<BR> <BR> <CODE>MI_GetAllocatableWramSlot( MI_WRAM_C, MI_WRAM_ARM9 )</CODE>   ? 0xDF<BR> <CODE>MI_GetAllocatableWramSlot( MI_WRAM_C, MI_WRAM_ARM7 )</CODE>   ? 0xD8<BR> <CODE>MI_GetAllocatableWramSlot( MI_WRAM_C, MI_WRAM_DSP )</CODE>   ? 0xD8<BR> <BR> <CODE>MI_GetAllocatableWramSlot( MI_WRAM_A, MI_WRAM_ARM9 )</CODE>   ? 0x00<BR> <CODE>MI_GetAllocatableWramSlot( MI_WRAM_A, MI_WRAM_ARM7 )</CODE>   ? 0x0F<BR> <CODE>MI_GetAllocatableWramSlot( MI_WRAM_A, MI_WRAM_DSP )</CODE>   ? 0x00<BR>
55</BLOCKQUOTE>
56<P><BR> <B>Convenience functions that include the WRAM type in the function name:</B></P>
57<P><CODE>MI_GetAllocatableWramSlot_A(...)</CODE> is the <CODE>#define</CODE> directive of <CODE>MI_GetAllocatableWramSlot( MI_WRAM_A, ... )</CODE>.<BR><CODE>MI_GetAllocatableWramSlot_B(...)</CODE> is the <CODE>#define</CODE> directive of <CODE>MI_GetAllocatableWramSlot( MI_WRAM_B, ... )</CODE>.<BR><CODE>MI_GetAllocatableWramSlot_C(...)</CODE> is the <CODE>#define</CODE> directive of <CODE>MI_GetAllocatableWramSlot( MI_WRAM_C, ... )</CODE>.<BR>
58
59
60<h2>Internal Operation</h2>
61<p>The WRAM manager managed by the ARM9 determines the return value.<BR>The ARM7 gets values from the ARM9 through PXI.</p>
62
63<h2>See Also</h2>
64<P><A href="about_Wram.html">Overview (Work RAM)</A><BR> <A href="../mi_constant.html">MI-Related Constants</A> <BR> <CODE><A href="MI_GetFreeWramSlot.html">MI_GetFreeWramSlot</A><BR> <A href="MI_GetUsedWramSlot.html">MI_GetUsedWramSlot</A></CODE></P>
65
66<H2>Revision History</H2>
67<P>2008/05/29 Initial version.</P>
68<hr><p>CONFIDENTIAL</p></body>
69</html>
70