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_ReserveWram</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">MI_ReserveWram* <IMG src="../../image/TWL.gif" width="24" height="12" border="0" align="middle"></h1>
15<h2>Syntax</h2>
16
17<dl>
18  <dd>
19<CODE>#include &lt;twl/mi.h&gt;</CODE><BR> <BR> <CODE>u32 MI_ReserveWram( <A href="../mi_constant.html">MIWramPos</A> wram, <A href="../mi_constant.html">MIWramSize</A> size, <A href="../mi_constant.html">MIWramProc</A> proc )</CODE><BR> <CODE>u32 MI_ReserveWramSlot( <A href="../mi_constant.html">MIWramPos</A> wram, int slot, <A href="../mi_constant.html">MIWramSize</A> size, <A href="../mi_constant.html">MIWramProc</A> proc )</CODE><BR> <BR>
20  </dd>
21<dd><CODE>(#define)<BR> <font color="#7f7f7f">#define MI_ReserveWram_A( size, proc )</font><br> #define MI_ReserveWram_B( size, proc )<BR></CODE></dd>
22<dd><CODE>#define MI_ReserveWram_C( size, proc )</CODE></dd>
23<dd><font color="#7f7f7f"><CODE>#define MI_ReserveWramSlot_A( slot, size, proc )</CODE></font></dd>
24<dd><CODE>#define MI_ReserveWramSlot_B( slot, size, proc )</CODE></dd>
25  <dd>
26<CODE>#define MI_ReserveWramSlot_C( slot, size, proc )</CODE></dd>
27</dl>
28<h2>Arguments</h2>
29<TABLE border="1" width="100%">
30  <TBODY>
31    <TR>
32<TD width="13%"><EM><STRONG>wram</STRONG></EM></TD>
33<TD width="87%">WRAM to reserve.</TD>
34    </TR>
35    <TR>
36<TD><EM><STRONG>slot</STRONG></EM></TD>
37<TD>Slot number.</TD>
38    </TR>
39    <TR>
40<TD><EM><STRONG>size</STRONG></EM></TD>
41<TD>Size to reserve.</TD>
42    </TR>
43    <TR>
44<TD><STRONG><EM>proc</EM></STRONG></TD>
45<TD>Processor to reserve for.</TD>
46    </TR>
47  </TBODY>
48</TABLE>
49
50<h2>Return Values</h2>
51<p>Returns the starting address if the reservation was successful.<BR>Returns 0 if the reservation failed.</p>
52<H2>Description</H2>
53<P>Reserves WRAM for the specified processor.</P>
54<P>Call this function if you are not quite ready to actually allocate and use WRAM, but you want to reserve the WRAM for a certain processor. It is acceptable to reserve WRAM for a processor other than the one this function is called from. In other words, reservations for the ARM7 can be made from the ARM9.</P>
55
56<P>The <SPAN class="argument">wram</SPAN> argument indicates the target WRAM. This is of type <CODE><A href="../mi_constant.html">MIWramPos</A></CODE> and is <CODE>MI_WRAM_A</CODE>, <CODE>MI_WRAM_B</CODE>, or <CODE>MI_WRAM_C</CODE>.</P>
57<P>The <SPAN class="argument">slot</SPAN> argument is the starting slot number when specifying the location.</P>
58<P>The <SPAN class="argument">size</SPAN> argument indicates the size to reserve. This is of type <A href="../mi_constant.html"><CODE>MIWramSize</CODE></A> and is between <CODE>MI_WRAM_SIZE_32KB</CODE> and <CODE>MI_WRAM_SIZE_256KB</CODE>. WRAM can have a separate reservation for each slot: that is, 64 KB for WRAM-A, and 32 KB for WRAM-B and WRAM-C.</P>
59<P>The <SPAN class="argument">proc</SPAN> argument indicates which processor the reservation is for. This is of type <A href="../mi_constant.html"><CODE>MIWramProc</CODE></A> and is <CODE>MI_WRAM_ARM9</CODE>, <CODE>MI_WRAM_ARM7</CODE>, or <CODE>MI_WRAM_DSP</CODE>.</P>
60<P>If WRAM reservations are made with the <CODE>MI_ReserveWram</CODE> function, the system starts searching through contiguous unused slots in the target WRAM for areas that are of the requested size, starting from the lower-order addresses. Once found, the function returns immediately. With the <CODE>MI_ReserveWramSlot</CODE> function, the location is user-specified. This fails if there is a region for which even one slot cannot be reserved.</P>
61<P>If the reservation was successful, the starting address is returned by the function. If it failed, 0 is returned.</P>
62<P>A reserved region can only be allocated by the processor for which it was reserved. No other processors can allocate the region.</P>
63<P><CODE><font color="#7f7f7f">MI_ReserveWram_A</CODE></font> is the #define directive of <CODE><font color="#7f7f7f">MI_ReserveWram( MI_WRAM_A, ... )</CODE></font>.<BR><CODE>MI_ReserveWram_B</CODE> is the #define directive of <CODE>MI_ReserveWram( MI_WRAM_B, ... )</CODE>. <BR><CODE>MI_ReserveWram_C</CODE> is the #define directive of <CODE>MI_ReserveWram( MI_WRAM_C, ... )</CODE>. <BR><font color="#7f7f7f"><CODE>MI_ReserveWramSlot_A</CODE></font> is the #define directive of <font color="#7f7f7f"><CODE>MI_ReserveWramSlot( MI_WRAM_A, ... )</CODE></font>.<BR><CODE>MI_ReserveWramSlot_B</CODE> is the #define directive of <CODE>MI_ReserveWramSlot( MI_WRAM_B, ... )</CODE>. <BR><CODE>MI_ReserveWramSlot_C</CODE> is the #define directive of <CODE>MI_ReserveWramSlot( MI_WRAM_C, ... )</CODE>. <BR></P>
64<P>To cancel a reservation, call one of the <CODE><A href="MI_CancelWram.html">MI_CancelWram*</A></CODE> functions.</P>
65<P><BR> Example: Here, we reserve 64 KB from WRAM-C for the DSP.</P>
66<P><CODE>MI_ReserveWram( MI_WRAM_C, MI_WRAM_SIZE_64KB, MI_WRAM_DSP );</CODE><BR> OR<BR> <CODE>MI_ReserveWram_C( MI_WRAM_SIZE_64KB, MI_WRAM_DSP );</CODE><BR>
67</P>
68<h2>See Also</h2>
69<P><A href="about_Wram.html">Overview: Work RAM</A><BR> <A href="../mi_constant.html">MI-Related Constants</A></P>
70<H2>Revision History</H2>
71<P>2007/08/20 Initial version.</P>
72<hr><p>CONFIDENTIAL</p></body>
73</html>
74