📄 c-config4.html
字号:
<td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></li></ul></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85152">VxWorks Private Header Files</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85154"> </a>VxWorks modules are designed so that you never need to know or reference the modules' internal data structures. In general, all legitimate access to a facility is provided by a module's subroutine interfaces. The internal details should be thought of as "hidden" from application developers. This means that the internal implementations can change without affecting your use of the corresponding facilities.</p><dd><p class="Body"><a name="85155"> </a>Internal details in VxWorks are hidden using two conventions. Some header files mark hidden code using the following comments:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85156">/* HIDDEN */ ... /* END HIDDEN */</a></b></pre></dl><dd><p class="Body"><a name="85157"> </a>Internal details are also hidden with <i class="term">private</i> header files: files that are stored in the directory <i class="textVariable">installDir</i><b class="file">/target/h/private</b>. The naming conventions for these files parallel those in<b class="file"> </b><i class="textVariable">installDir</i><b class="file">/target/h</b> with the library name followed by <b class="file">P.h</b>. For example, the private header file for <b class="library">semLib</b> is <i class="textVariable">installDir</i><b class="file">/target/h/private/semLibP.h</b>.</p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/caution.gif"></td><td><hr><div class="CalloutCell"><a name="85162"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION: </font></b></a>Never make references to any of the hidden definitions, or base any assumptions on those definitions. The only supported uses of a module's facilities are through the public definitions in the header file, and through the module's subroutine interfaces. Although this rule is not currently enforced in any way, it is in your interest to observe it. Your adherence ensures that your application code is not affected by internal changes in the implementation of a VxWorks module.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85170">8.4.2 Compiling Application Modules</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85171"> </a>Tornado includes a full-featured C and C++ compiler and associated tools, collectively called the <i class="title">GNU ToolKit</i>. Extensive documentation for this set of tools is printed in a separate manual: the <i class="title">GNU ToolKit User's Guide</i>. This section provides some general orientation about the source of these tools, and describes how the tools are integrated into the Tornado development environment.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85172">The GNU Tools</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85174"> </a>GNU ("GNU's Not UNIX!") is a project of the Free Software Foundation started by Richard Stallman and others to promote <i class="term">free software</i>. To the FSF, free software is software whose source code can be copied, modified, and redistributed without restriction. GNU software is not in the public domain; it is protected by copyright and subject to the terms of the GNU General Public License, a legal document designed to ensure that the software remains free--for example, by prohibiting proprietary modifications and concomitant restrictions on its use. The General Public License can be found in the file <b class="symbol_UC">COPYING</b> that accompanies the source code for the GNU tools, and in the section titled <i class="title">Free Software</i> at the back of the <i class="title">GNU ToolKit User's Guide</i>.</p><dd><p class="Body"><a name="85175"> </a>It is important to be aware that the terms under which the GNU tools are distributed do not apply to the software you create with them. In fact, the General Public License makes no requirements of you as a software developer at all, as long as you do not modify or redistribute the tools themselves. On the other hand, it gives you the right to do both of these things, provided you comply with its terms and conditions. It also permits you to make unrestricted copies for your own use.</p><dd><p class="Body"><a name="85176"> </a>The Wind River GNU distribution consists of the GNU ToolKit, which contains GNU tools modified and configured for use with your VxWorks target architecture. The source code for these tools is included. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85177">Cross-Development Commands</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85179"> </a>The GNU cross-development tools in Tornado have names that clearly indicate the target architecture. This allows you to install and use tools for more than one architecture, and to avoid confusion with corresponding host native tools. A suffix identifying the target architecture is appended to each tool name. For example, the cross-compiler for the 68K processor family is called <b class="command">cc68k</b>, and the assembler <b class="command">as68k</b>. The suffixes used are shown in <a href="c-config4.html#85186">Table 8-3</a>. Note that the text in the <i class="title">GNU ToolKit User's Guide</i> refers to these tools by their generic names (without a suffix).<p class="table"><h4 class="EntityTitle"><a name="85186"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 8-3: Suffixes for Cross-Development Tools</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="85190"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Architecture</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="85192"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Command Suffix</font></b></div></th></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85194"> </a>MC680<i class="textVariable">x</i>0 </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85196"> </a><b class="command">68k</b> </div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85198"> </a>SPARC/SPARClite </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85200"> </a><b class="command">sparc</b> </div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85202"> </a>i960 </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85210"> </a><sup><b class="FootnoteMarker">1</b></sup> </div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85212"> </a>x86 </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85214"> </a><b class="command">386</b> </div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85216"> </a>MIPS </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85218"> </a><b class="command">mips</b> </div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85220"> </a>PowerPC </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85222"> </a><b class="command">ppc</b> </div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85224"> </a>ARM </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85226"> </a><b class="command">arm</b> </div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85228"> </a>Simulators </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85230"> </a><b class="command">simso</b>, <b class="command">hppa</b>, <b class="command">simnt</b> </div></td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"><p class="FootnoteNumberMarker">1: <span class="TableFootnote"><a name="85209"> </a>See <i class="title"><a href="x-960.html#84369">C. Intel i960</a>.</i></span></p></td></tr></table></p></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85232">Defining the CPU Type</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85235"> </a>Tornado can support multiple target architectures in a single development tree. To accommodate this, several VxWorks header files contain conditional compilation directives based on the definition of the variable <b class="symbol_UC">CPU</b>. When using these header files, the variable <b class="symbol_UC">CPU</b> must be defined in one of the following places: </p></dl><dl class="margin"><ul class="DashSingle" type="circle"><li><a name="85237"> </a>the source modules</li></ul><ul class="DashSingle" type="circle"><li><a name="85238"> </a>the header files</li></ul><ul class="DashSingle" type="circle"><li><a name="85239"> </a>the compilation command line</li></ul></dl><dl class="margin"><dd><p class="Body"><a name="85240"> </a>To define <b class="symbol_UC">CPU</b> in the source modules or header files, add the following line:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85241">#define CPU <i class="textVariable">cputype</i></a></b></pre></dl><dd><p class="Body"><a name="85242"> </a>To define <b class="symbol_UC">CPU</b> on the compilation command line, add the following flag:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85243">-DCPU=<i class="textVariable">cputype</i></a></b></pre></dl><dd><p class="Body"><a name="85292"> </a>The constants shown in <a href="c-config4.html#85250">Table 8-4</a> are supported values for <i class="textVariable">cputype</i>.<p class="table"><h4 class="EntityTitle"><a name="85250"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 8-4: Values for <i class="textVariable">cputype</i></font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="85254"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Architecture</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="85256"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Value</font></b></div></th></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85258"> </a>MC680<i class="textVariable">x</i>0 </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85263"> </a><b class="symbol_UC">MC68000</b>, <b class="symbol_UC">MC68010</b>, <b class="symbol_UC">MC68020<sup><b class="FootnoteMarker">1</b></sup></b>, <b class="symbol_UC">MC68040</b>, <b class="symbol_UC">MC68LC040<sup><b class="FootnoteMarker">2</b></sup></b>, <b class="symbol_UC">MC68060</b>, <b class="symbol_UC">CPU32</b> </div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85265"> </a>SPARC, SPARClite </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85267"> </a><b class="symbol_UC">SPARC</b><sup><b class="FootnoteMarker">3</b></sup> </div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85269"> </a>i960 </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85271"> </a><b class="symbol_UC">I960CA</b>, <b class="symbol_UC">I960KB</b>, <b class="symbol_UC">I960KA</b>, <b class="symbol_UC">I960JX</b> </div></td></tr><tr valign="top">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -