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 <twl/mi.h></CODE><BR> 20 <BR> 21 <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> 22 <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> 23 <BR> 24 </dd> 25 <dd><CODE>(#define)<BR> 26 <font color="#7f7f7f">MI_ReserveWram_A( size, proc )</font><br> 27 MI_ReserveWram_B( size, proc )<BR> 28 </CODE></dd> 29 <dd><CODE> 30 MI_ReserveWram_C( size, proc )</CODE></dd> 31 <dd><font color="#7f7f7f"><CODE>MI_ReserveWramSlot_A( slot, size, proc )</CODE></font></dd> 32 <dd><CODE>MI_ReserveWramSlot_B( slot, size, proc )</CODE></dd> 33 <dd> 34<CODE>MI_ReserveWramSlot_C( slot, size, proc )</CODE></dd> 35</dl> 36<h2>Arguments</h2> 37<TABLE border="1" width="100%"> 38 <TBODY> 39 <TR> 40 <TD width="13%"><EM><STRONG>wram</STRONG></EM></TD> 41 <TD width="87%">WRAM to reserve.</TD> 42 </TR> 43 <TR> 44 <TD><EM><STRONG>slot</STRONG></EM></TD> 45 <TD>Slot number.</TD> 46 </TR> 47 <TR> 48 <TD><EM><STRONG>size</STRONG></EM></TD> 49 <TD>Size to reserve.</TD> 50 </TR> 51 <TR> 52 <TD><STRONG><EM>proc</EM></STRONG></TD> 53 <TD>Processor to reserve for.</TD> 54 </TR> 55 </TBODY> 56</TABLE> 57 58<h2>Return Values</h2> 59<p>Returns the starting address if the reservation was successful.<BR>Returns 0 if the reservation failed.</p> 60<H2>Description</H2> 61<P>Reserves WRAM for the specified processor.</P> 62<P>Call this function if you aren't 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> 63 64<P>The <B><I>wram</I></B> argument indicates the target WRAM. This is of type <CODE><A href="../mi_constant.html">MIWramPos</A></CODE> and will be <CODE>MI_WRAM_A</CODE>, <CODE>MI_WRAM_B</CODE>, or <CODE>MI_WRAM_C</CODE>.</P> 65<P>The <B><I>slot </I></B> argument is the starting slot number when specifying the location.</P> 66<P>The <B><I>size</I></B> argument indicates the size to reserve. This is of type <A href="../mi_constant.html"><CODE>MIWramSize</CODE></A> and will be 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> 67<P>The <B><I>proc</I></B> argument indicates which processor the reservation is for. This is of type <CODE><A href="../mi_constant.html">MIWramProc</A></CODE> and will be <CODE>MI_WRAM_ARM9</CODE>, <CODE>MI_WRAM_ARM7</CODE>, or <CODE>MI_WRAM_DSP</CODE>.</P> 68<P>If WRAM reservations are made with <CODE>MI_ReserveWram()</CODE>, the system will start searching through contiguous unused slots in the target WRAM for areas that are of the requested size, starting the search from the lower-order addresses. Once found, the function will return immediately. With <CODE>MI_ReserveWramSlot()</CODE>, the location is user-specified. This will fail if there is a region for which even one slot cannot be reserved.</P> 69<P>If the reservation was successful, the starting address is returned by the function. If it failed, 0 is returned.</P> 70<P>A reserved region can only be allocated by the processor for which it was reserved. No other processors can allocate the region.</P> 71<P><CODE><font color="#7f7f7f">MI_ReserveWram_A</CODE> 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> 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> 72<P>To cancel a reservation, call one of the <CODE><A href="MI_CancelWram.html">MI_CancelWram*</A></CODE> functions.</P> 73<P><BR> (Example) Here, we will reserve 64 KB from WRAM-C for the DSP.</P> 74<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> 75</P> 76<h2>See Also</h2> 77<P><A href="about_Wram.html">Overview (Work RAM)</A>, <A href="../mi_constant.html">MI-Related Constants</A></P> 78<H2>Revision History</H2> 79<P>2007/08/20 Initial version.</P> 80<hr><p>CONFIDENTIAL</p></body> 81</html> 82