Separate CVS parsing logic from tools/mksyscall.c; Create tools/mksymtab.c to create symbol tables from CSV files
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5075 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
1d28db3742
commit
345e9ec8d7
@ -8,7 +8,6 @@
|
|||||||
<tr align="center" bgcolor="#e4e4e4">
|
<tr align="center" bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
<h1><big><font color="#3c34ec"><i>On-Demand Paging</i></font></big></h1>
|
<h1><big><font color="#3c34ec"><i>On-Demand Paging</i></font></big></h1>
|
||||||
<h2><font color="#dc143c">>>> Under Construction <<<</font></h2>
|
|
||||||
<p>Last Updated: August 12, 2010</p>
|
<p>Last Updated: August 12, 2010</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
<tr align="center" bgcolor="#e4e4e4">
|
<tr align="center" bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
<h1><big><font color="#3c34ec"><i>NXFLAT</i></font></big></h1>
|
<h1><big><font color="#3c34ec"><i>NXFLAT</i></font></big></h1>
|
||||||
<h2><font color="#dc143c">>>> Under Construction <<<</font></h2>
|
<p>Last Updated: September 1, 2012</p>
|
||||||
<p>Last Updated: June 29, 2012</p>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -90,7 +89,13 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><br></td>
|
<td><br></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="#making">1.4 Making an NXFLAT module</a>
|
<a href="#mksymtab">1.4 mksymtab</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><br></td>
|
||||||
|
<td>
|
||||||
|
<a href="#making">1.5 Making an NXFLAT module</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -122,7 +127,7 @@
|
|||||||
<a name="overview"><h1>1.0 Overview</h1></a>
|
<a name="overview"><h1>1.0 Overview</h1></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>f
|
</table>
|
||||||
|
|
||||||
<a name="functionality"><h2>1.1 Functionality</h2></a>
|
<a name="functionality"><h2>1.1 Functionality</h2></a>
|
||||||
|
|
||||||
@ -386,7 +391,41 @@ any following arguments.
|
|||||||
debug output is enabled [Default: no verbose output].
|
debug output is enabled [Default: no verbose output].
|
||||||
</pre></ul>
|
</pre></ul>
|
||||||
|
|
||||||
<a name="making"><h2>1.4 Making an NXFLAT module</h2></a>
|
<a name="mksymtab"><h2>1.4 mksymtab</h2></a>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
There is a small helper program available in <code>nuttx/tools</code> call <code>mksymtab</code>.
|
||||||
|
<code>mksymtab</code> can be sued to generate symbol tables for the NuttX base code that would be usable by the typical NXFLAT application.
|
||||||
|
<code>mksymtab</code> builds symbol tables from common-separated value (CSV) files.
|
||||||
|
In particular, the CSV files:
|
||||||
|
</p>
|
||||||
|
<ol>
|
||||||
|
<li>
|
||||||
|
<code>nuttx/syscall/syscall.csv</code> that describes the NuttX RTOS interface, and
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>nuttx/lib/lib/csv</code> that describes the NuttX C library interface.
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
<ul><pre>
|
||||||
|
USAGE: ./mksymtab <cvs-file> <symtab-file>
|
||||||
|
|
||||||
|
Where:
|
||||||
|
|
||||||
|
<cvs-file> : The path to the input CSV file
|
||||||
|
<symtab-file>: The path to the output symbol table file
|
||||||
|
-d : Enable debug output
|
||||||
|
</pre></ul>
|
||||||
|
<p>
|
||||||
|
For example,
|
||||||
|
</p>
|
||||||
|
<ul><pre>
|
||||||
|
cd nuttx/tools
|
||||||
|
cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv
|
||||||
|
./mksymtab.exe tmp.csv tmp.c
|
||||||
|
</pre></ul>
|
||||||
|
|
||||||
|
<a name="making"><h2>1.5 Making an NXFLAT module</h2></a>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Below is a snippet from an NXFLAT make file (simplified from NuttX
|
Below is a snippet from an NXFLAT make file (simplified from NuttX
|
||||||
@ -639,8 +678,7 @@ any following arguments.
|
|||||||
<p>
|
<p>
|
||||||
<ul><pre>
|
<ul><pre>
|
||||||
ldr r1, .L0 <-- Fetch the offset to 'x'
|
ldr r1, .L0 <-- Fetch the offset to 'x'
|
||||||
ldr r0, [r10, r1] <-- Load the value of 'x' with PIC
|
ldr r0, [r10, r1] <-- Load the value of 'x' with PIC offset`
|
||||||
offset
|
|
||||||
...
|
...
|
||||||
.L0: .word x <-- Offset to 'x'
|
.L0: .word x <-- Offset to 'x'
|
||||||
</pre></ul>
|
</pre></ul>
|
||||||
@ -652,8 +690,7 @@ any following arguments.
|
|||||||
|
|
||||||
<ul><pre>
|
<ul><pre>
|
||||||
ldr r1, .L0 <-- Fetch the offset to the GOT entry
|
ldr r1, .L0 <-- Fetch the offset to the GOT entry
|
||||||
ldr r1, [r10,r1] <-- Fetch the (relocated) address
|
ldr r1, [r10,r1] <-- Fetch the (relocated) address of 'x' from the GOT
|
||||||
of 'x' from the GOT
|
|
||||||
ldr r0, [r1, #0] <-- Fetch the value of 'x'
|
ldr r0, [r1, #0] <-- Fetch the value of 'x'
|
||||||
...
|
...
|
||||||
.L1 .word x(GOT) <-- Offset to entry in the GOT
|
.L1 .word x(GOT) <-- Offset to entry in the GOT
|
||||||
@ -667,9 +704,9 @@ any following arguments.
|
|||||||
execution time.
|
execution time.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
NXFLAT (like <a href="http://xflat.sourceforge.net/">XFLAT</a>) can work even better with
|
NXFLAT (like <a href="http://xflat.sourceforge.net/">XFLAT</a>) can work even better without
|
||||||
the GOT.
|
the GOT.
|
||||||
Patches again older version of GCC exist to eliminate the GOT indirections.
|
Patches against older version of GCC exist to eliminate the GOT indirections.
|
||||||
Several are available <a href="http://xflat.cvs.sourceforge.net/viewvc/xflat/xflat/gcc/">here</a>
|
Several are available <a href="http://xflat.cvs.sourceforge.net/viewvc/xflat/xflat/gcc/">here</a>
|
||||||
if you are inspired to port them to a new GCC version.
|
if you are inspired to port them to a new GCC version.
|
||||||
</p>
|
</p>
|
||||||
@ -735,7 +772,7 @@ any following arguments.
|
|||||||
<a href="http://xflat.cvs.sourceforge.net/viewvc/*checkout*/xflat/xflat/gcc/README?revision=1.1.1.1">XFLAT discussion</a>.
|
<a href="http://xflat.cvs.sourceforge.net/viewvc/*checkout*/xflat/xflat/gcc/README?revision=1.1.1.1">XFLAT discussion</a>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Patches again older version of GCC exist to correct this GCC behavior.
|
Patches against older version of GCC exist to correct this GCC behavior.
|
||||||
Several are available <a href="http://xflat.cvs.sourceforge.net/viewvc/xflat/xflat/gcc/">here</a>
|
Several are available <a href="http://xflat.cvs.sourceforge.net/viewvc/xflat/xflat/gcc/">here</a>
|
||||||
if you are inspired to port them to a new GCC version.
|
if you are inspired to port them to a new GCC version.
|
||||||
</p>
|
</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user