📄 c-smo4.html
字号:
<tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="87206"> </a><b class="symbol_UC">SM_OBJ_MAX_MEM_PART</b> </div></td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87208"> </a>4</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="87210"> </a>Maximum number of user-created shared-memory partitions. </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="85592"> </a>If the size of the objects created exceeds the shared-memory region, an error message is displayed on CPU 0 during initialization. After shared memory is configured for the shared objects, the remainder of shared memory is used for the shared-memory system partition.</p><dd><p class="Body"><a name="85595"> </a>The routine<b class="routine"><i class="routine"> smObjShow</i></b><b>(</b> <b>)</b> displays the current number of used shared-memory objects and other statistics, as follows:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85596"></b><tt class="output">-></tt><b> smObjShow </b><tt class="output">value = 0 = 0x0</tt><b></a></b></pre></dl><dd><p class="Body"><a name="85597"> </a>The routine is automatically included if <b class="symbol_UC">INCLUDE_SM_OBJ </b>is selected for inclusion in the project facility VxWorks view. The output of <b class="routine"><i class="routine">smObjShow</i></b><b>(</b> <b>)</b> is sent to the standard output device, and looks like the following:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85598"></b><tt class="output">Shared Mem Anchor Local Addr : 0x600 Shared Mem Hdr Local Addr : 0x363ed0 Attached CPU : 2 Max Tries to Take Lock : 0 Shared Object Type Current Maximum Available ------------------ ------- ------- --------- Tasks 1 40 39 Binary Semaphores 3 30 27 Counting Semaphores 0 30 27 Messages Queues 1 10 9 Memory Partitions 1 4 3 Names in Database 5 100 95</tt><b> </a></b></pre></dl></dl><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="86556"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION: </font></b></a>If the master CPU is rebooted, it is necessary to reboot all the slaves. If a slave CPU is to be rebooted, it must not have tasks pended on a shared-memory object. </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="85620">6.4.4 Configuration Example</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85622"> </a>The following example shows the configuration for a multiprocessor system with three CPUs. The master is CPU 0, and shared memory is configured from its dual-ported memory. This application has 20 tasks using shared-memory objects, and uses 12 message queues and 20 semaphores. The maximum size of the name database is the default value (100), and only one user-defined memory partition is required. On CPU 0, the shared-memory pool is configured to be on-board. This memory is allocated from the processor's system memory. On CPU 1 and CPU 2, the shared-memory pool is configured to be off-board. <a href="c-smo4.html#87285">Table 6-6</a> shows the values set on the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Params</font></b> tab of the properties window for <b class="symbol_UC">INCLUDE_SM_OBJECTS</b> in the project facility. <p class="table"><h4 class="EntityTitle"><a name="87285"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 6-6: Configuration Settings for Three CPU System</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="87291"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">CPU </font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="87293"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Symbolic Constant</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeadingC" align="center"><a name="87295"> </a><b><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="CellBodyC" align="center"><a name="87297"> </a>Master <br>(<b class="symbol_UC">CPU 0</b>) </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="87300"> </a><b class="symbol_UC"> <br>SM_OBJ_MAX_TASK</b> </div></td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87302"> </a> <br>20</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87304"> </a></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="87307"> </a><b class="symbol_UC">SM_OBJ_MAX_SEM</b> </div></td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87309"> </a>20</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87311"> </a></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="87314"> </a><b class="symbol_UC">SM_OBJ_MAX_NAME</b> </div></td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87316"> </a>100</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="87318"> </a> </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="87321"> </a><b class="symbol_UC">SM_OBJ_MAX_MSG_Q</b> </div></td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87323"> </a>12</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="87325"> </a> </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="87328"> </a><b class="symbol_UC">SM_OBJ_MAX_MEM_PART</b> </div></td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87330"> </a>1</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="87585"> </a> </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="87587"> </a><b class="symbol_UC">SM_OFF_BOARD</b> </div></td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87589"> </a><b class="symbol_UC">FALSE</b> </div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="87424"> </a> </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="87426"> </a><b class="symbol_UC">SM_MEM_ADRS</b> </div></td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87428"> </a>NONE</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="87418"> </a> </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="87420"> </a><b class="symbol_UC">SM_MEM_SIZE</b> </div></td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="87422"> </a>0x10000</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="87412"> </a> </div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -