1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../css/manpage.css" type="text/css" />
7    <title>LoadModule</title>
8  </head>
9  <body>
10    <h1><a href="../../nn/Overview.html">nn</a>::<a href="../../nn/ro/Overview.html">ro</a>::LoadModule Function</h1>
11    <h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14<a href="../../nn/ro/Module/Overview.html">Module</a> * LoadModule(
15     void * pRo,
16     size_t roSize,
17     void * pBuffer,
18     size_t bufferSize,
19     bool doRegister = true,
20     <a href="../../nn/ro/FixLevel.html">FixLevel</a> fixLevel = FIX_LEVEL_1,
21     const <a href="../../nn/ro/RegistrationList/Overview.html">RegistrationList</a> * pRr = NULL
22);
23</pre>
24    </div>
25    <h2>Arguments</h2>
26    <div class="section">
27      <table class="arguments">
28        <thead>
29          <tr>
30            <td width="15" />
31            <th>Name</th>
32            <td>Description</td>
33          </tr>
34        </thead>
35        <tr>
36          <td>in</td>
37          <th><CODE>pRo</CODE></th>
38          <td>Specifies the start address of the <CODE>cro</CODE> to be loaded.<br /> Must be aligned on a 4096-byte boundary. The memory must be other than device memory. </td>
39        </tr>
40        <tr>
41          <td>in</td>
42          <th><CODE>roSize</CODE></th>
43          <td>Specifies the size of the <CODE>cro</CODE> pointed to by <CODE>pRo</CODE>.</td>
44        </tr>
45        <tr>
46          <td>in</td>
47          <th><CODE>pBuffer</CODE></th>
48          <td>Specifies the start address of the memory to be used for the .data/.bss section. Must be aligned on a 8-byte boundary.</td>
49        </tr>
50        <tr>
51          <td>in</td>
52          <th><CODE>bufferSize</CODE></th>
53          <td>Specifies the size of the memory pointed to by <CODE>pBuffer</CODE>.<br /> A size greater than or equal to the value stored in <a href="../../nn/ro/SizeInfo/Overview.html"><CODE>SizeInfo::bufferSize</CODE></a> by <CODE>GetSizeInfo</CODE> must be specified.</td>
54        </tr>
55        <tr>
56          <td>in</td>
57          <th><CODE>doRegister</CODE></th>
58          <td>Specifies whether to register as an automatic link target.<BR> Registers as an automatic link target if <CODE>true</CODE>. Does not register as an automatic link target if <CODE>false</CODE>.</td>
59        </tr>
60        <tr>
61          <td>in</td>
62          <th><CODE>fixLevel</CODE></th>
63          <td>Specifies that the memory be released after loading.</td>
64        </tr>
65        <tr>
66          <td>in</td>
67          <th><CODE>pRr</CODE></th>
68          <td>Specifies the <CODE>crr</CODE> for which <CODE>cro</CODE> information specified by <CODE>pR0</CODE> is registered.<BR> Searches among registered <CODE>crr</CODE> files if NULL is specified.</td>
69        </tr> </table>
70    </div>
71    <h2>Return Values</h2>
72    <div class="section">Returns a pointer to a module representing the loaded <CODE>cro</CODE> if the <CODE>cro</CODE> is loaded successfully. If the function fails it returns NULL. </div>
73    <h2>Description</h2>
74    <div class="section">
75      <p>Loads a <CODE>cro</CODE>.</p><p>Relocates <CODE>cro</CODE>, resolves references among already loaded modules registered as automatic link targets, and places them under the management of the <a href="../../nn/ro/Overview.html"><CODE>ro</CODE></a> library. </p><p>If execution succeeds, the memory pointed to by pRo is placed under the management of the <a href="../../nn/ro/Overview.html"><CODE>ro</CODE></a> library, after which it cannot be used for other purposes. To remove this memory region from management by the <a href="../../nn/ro/Overview.html"><CODE>ro</CODE></a> library, you must call <a href="../../nn/ro/Module/Unload.html"><CODE>Module::Unload</CODE></a>.</p><p>If <CODE>true</CODE> is specified in <CODE>doRegister</CODE>, the <CODE>cro</CODE> is registered as an automatic link target. Once registered as an automatic link target, references with other modules are automatically resolved.  References for the cro can also be resolved using <a href="../../nn/ro/Module/Link.html">Module::Link</a>. </p><p>The corresponding memory after loading is successful is released from management by the <a href="../../nn/ro/Overview.html">ro</a> library if a value other than <CODE>FIX_LEVEL_0</CODE> (<CODE>FIX_LEVEL_NONE</CODE>) is specified in <CODE>fixLevel</CODE>. This allows the memory to be used for other purposes. Although you usually cannot specify the memory specified for pRo as pBuffer, memory released using fixLevel can be specified for pBuffer. </p><p>Usually, you must call <a href="../../nn/ro/Module/DoInitialize.html"><CODE>Module::DoInitialize</CODE></a> after loading the <CODE>cro</CODE> succeeds, but before referencing functions and symbols inside the module.</p><p>The pointer to <a href="../../nn/ro/Module/Overview.html"><CODE>Module</CODE></a> returned by this function can be released using the <a href="../../nn/ro/Module/Unload.html"><CODE>Module::Unload</CODE></a> function.</p><!-- write here --></div>
76    <h2>Revision History</h2>
77    <div class="section">
78      <dl class="history">
79        <dt>2011/07/29</dt>
80        <dd>Initial version.<br />
81        </dd>
82      </dl>
83    </div>
84  <hr><p>CONFIDENTIAL</p></body>
85</html>
86