⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c-vm3.html

📁 vxworks相关论文
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    Virtual Memory Interface   </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-vm.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-vm2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-vm4.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="84391">7.3  &nbsp;&nbsp;Virtual Memory Configuration</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84393"> </a>The following discussion of configuration applies to both bundled and unbundled virtual memory support. </p><dd><p class="Body"><a name="84397"> </a>In the project facility, define the constants in <a href="c-vm3.html#84401">Table&nbsp;7-1</a> to reflect your system configuration.<p class="table"><h4 class="EntityTitle"><a name="84401"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 7-1:&nbsp;&nbsp;MMU Configuration Constants</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="84405"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Constant</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84407"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Description</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="84410"> </a><b class="symbol_lc">INCLUDE_MMU_BASIC</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84412"> </a>Basic MMU support without VxVMI option.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84415"> </a><b class="symbol_lc">INCLUDE_MMU_FULL</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84417"> </a>Full MMU support with the VxVMI option.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84420"> </a><b class="symbol_lc">INCLUDE_PROTECT_TEXT</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84422"> </a>Text segment protection (requires full MMU support).&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84425"> </a><b class="symbol_lc">INCLUDE_PROTECT_VEC_TABLE</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84427"> </a>Exception vector table protection (requires full MMU support).&nbsp;</div></td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><dd><p class="Body"><a name="84429"> </a>The appropriate default page size for your processor (4 KB or 8KB) is defined by <b class="symbol_UC">VM_PAGE_SIZE</b> in your BSP. If you must change this value for some reason, redefine <b class="symbol_UC">VM_PAGE_SIZE</b> in <b class="file">config.h</b>. (See <a href="c-config.html#84365"><i class="title">8.&nbsp;Configuration and Build</i></a>.)</p><dd><p class="Body"><a name="84431"> </a>To make memory noncacheable, it must have a virtual-to-physical mapping. The data structure<b class="symbol_UC"> PHYS_MEM_DESC</b> in <b class="file">vmLib.h</b> defines the parameters used for mapping physical memory. Each board's memory map is defined in <b class="file">sysLib.c</b> using <b class="symbol_lc">sysPhysMemDesc</b> (which is declared as an array of<b class="symbol_UC"> PHYS_MEM_DESC</b>). In addition to defining the initial state of the memory pages, the <b class="symbol_lc">sysPhysMemDesc</b> structure defines the virtual addresses used for mapping virtual-to-physical memory. For a discussion of page states, see <a href="c-vm5.html#84502"><i class="title">Page States</i></a>. </p><dd><p class="Body"><a name="84438"> </a>Modify the <b class="symbol_lc">sysPhysMemDesc</b> structure to reflect your system configuration. For example, you may need to add the addresses of interprocessor communication buffers not already included in the structure. Or, you may need to map and make noncacheable the VMEbus addresses of the shared-memory data structures. Most board support packages have a section of VME space defined in <b class="symbol_lc">sysPhysMemDesc</b>; however, this may not include all the space required by your system configuration. </p><dd><p class="Body"><a name="84439"> </a>I/O devices and memory not already included in the structure must also be mapped and made noncacheable. In general, off-board memory regions are specified as noncacheable; see <i class="title">VxWorks Network Programmer's Guide: Data Link Layer Network Components</i>.</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="85328"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION:  </font></b></a>The regions of memory defined in <b class="symbol_lc">sysPhysMemDesc</b> must be page-aligned, and must span complete pages. In other words, the first three fields (virtual address, physical address, and length) of a <b class="symbol_UC">PHYS_MEM_DESC</b> structure must all be even multiples of <b class="symbol_UC">VM_PAGE_SIZE</b>. Specifying elements of <b class="symbol_lc">sysPhysMemDesc</b> that are not page-aligned leads to crashes during VxWorks initialization.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="84450"> </a>The following example configuration consists of multiple CPUs using the shared-memory network. A separate memory board is used for the shared-memory pool. Because this memory is not already mapped, it must be added to <b class="symbol_lc">sysPhysMemDesc</b> for all the boards on the network. The memory starts at 0x4000000 and must be made noncacheable, as shown in the following code excerpt:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84451">/* shared memory */ { (void *) 0x4000000,         /* virtual address */ (void *) 0x4000000,         /* physical address */ 0x20000,              /* length */ /* initial state mask */ VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE |VM_STATE_MASK_CACHEABLE, /* initial state */ VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT }</a></b></pre></dl><dd><p class="Body"><a name="84461"> </a>For MC680<i class="textVariable">x</i>0 boards, the virtual address <i class="i">must</i> be the same as the physical address. For other boards, the virtual and physical addresses are the same as a matter of convention.</p></dl></dl><a name="foot"><hr></a><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-vm.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-vm2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-vm4.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc.    conversion tool:  Quadralay WebWorks Publisher 4.0.11    template:         CSS Template, Jan 1998 - Jefro --->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -