📄 smobjlib.html
字号:
</blockquote><h1><i>smObjInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>smObjInit</i>( )</strong> - initialize a shared memory objects descriptor (VxMP Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void smObjInit ( SM_OBJ_DESC * pSmObjDesc, /* ptr */ /* to */ /* shared */ /* memory */ /* descriptor */ SM_ANCHOR * anchorLocalAdrs,/* shared memory anchor local adrs */ int ticksPerBeat, /* cpu ticks per heartbeat */ int smObjMaxTries, /* max no. of tries to obtain spinLock */ int intType, /* interrupt method */ int intArg1, /* interrupt argument #1 */ int intArg2, /* interrupt argument #2 */ int intArg3 /* interrupt argument #3 */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes a shared memory descriptor. The descriptor mustalready be allocated in the CPU's local memory. Once the descriptor hasbeen initialized by this routine, the CPU may attach itself to the shared memory area by calling <b><i><a href="./smObjLib.html#smObjAttach">smObjAttach</a></i>( )</b>.<p>This routine is called automatically when the configuration macro<b>INCLUDE_SM_OBJ</b> is defined.<p>Only the shared memory descriptor itself is modified by this routine.No structures in shared memory are affected.<p>Parameters:<dl><dt><i>pSmObjDesc</i><dd>the address of the shared memory descriptor to be initialized; thisstructure must be allocated before <b><i><a href="./smObjLib.html#smObjInit">smObjInit</a></i>( )</b> is called.<p><dt><i>anchorLocalAdrs</i><dd>the memory address by which the local CPU may access the shared memoryanchor. This address may vary among CPUs in the system because of addressoffsets (particularly if the anchor is located in one CPU's dual-portedmemory).<p><dt><i>cpuNum</i><dd>the number to be used to identify this CPU during shared memory operations.CPUs are numbered starting with zero for the master CPU, up to 1 less thanthe maximum number of CPUs defined during the master CPU's <b><i><a href="./smObjLib.html#smObjSetup">smObjSetup</a></i>( )</b>call. CPUs can attach in any order, regardless of their CPU number.<p><dt><i>ticksPerBeat</i><dd>specifies the frequency of the shared memory anchor's heartbeat. Thefrequency is expressed in terms of how many CPU ticks on the local CPUcorrespond to one heartbeat period.<p><dt><i>smObjMaxTries</i><dd>specifies the maximum number of tries to obtain access to an internalmutually exclusive data structure. Its default value is 100, but it canbe set to a higher value for a heavily loaded system.<p><dt><i>intType</i>, <i>intArg1</i>, <i>intArg2</i>, and <i>intArg3</i><dd> allow a CPU to announce the method by which it is to be notified of sharedmemory events. See the manual entry for if_sm for a discussion aboutinterrupt types and their associated parameters. </dl><p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled shared memoryobjects support option, VxMP.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./smObjLib.html#top">smObjLib</a></b>, <b><i><a href="./smObjLib.html#smObjSetup">smObjSetup</a></i>( )</b>, <b><i><a href="./smObjLib.html#smObjAttach">smObjAttach</a></i>( )</b><hr><a name="smObjAttach"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>smObjAttach</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>smObjAttach</i>( )</strong> - attach the calling CPU to the shared memory objects facility (VxMP Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS smObjAttach ( SM_OBJ_DESC * pSmObjDesc /* pointer to shared memory descriptor */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine "attaches" the calling CPU to the shared memory objectsfacility. The shared memory area is identified by the shared memorydescriptor with an address specified by <i>pSmObjDesc</i>. The descriptor mustalready have been initialized by calling <b><i><a href="./smObjLib.html#smObjInit">smObjInit</a></i>( )</b>.<p>This routine is called automatically when the configuration macro<b>INCLUDE_SM_OBJ</b> is defined.<p>This routine will complete the attach process only if and when the sharedmemory has been initialized by the master CPU. If the shared memory isnot recognized as active within the timeout period (10 minutes), thisroutine returns ERROR.<p>The <b><i><a href="./smObjLib.html#smObjAttach">smObjAttach</a></i>( )</b> routine connects the shared memory objects handler to theshared memory interrupt. Note that this interrupt may be shared betweenthe shared memory network driver and the shared memory objects facilitywhen both are used at the same time.<p></blockquote><h4>WARNING</h4><blockquote><p><p>Once a CPU has attached itself to the shared memory objects facility, it cannot be detached. Since the shared memory network driver and the shared memory objects facility use the same low-level attachingmechanism, a CPU cannot be detached from a shared memory network driverif the CPU also uses shared memory objects.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled shared memoryobjects support option, VxMP.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the shared memory objects facility is not activeor the number of CPUs exceeds the maximum.<p></blockquote><h4>ERRNO</h4><blockquote><p><p> S_smLib_INVALID_CPU_NUMBER<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./smObjLib.html#top">smObjLib</a></b>, <b><i><a href="./smObjLib.html#smObjSetup">smObjSetup</a></i>( )</b>, <b><i><a href="./smObjLib.html#smObjInit">smObjInit</a></i>( )</b><hr><a name="smObjLocalToGlobal"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>smObjLocalToGlobal</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>smObjLocalToGlobal</i>( )</strong> - convert a local address to a global address (VxMP Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void * smObjLocalToGlobal ( void * localAdrs /* local address to convert */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine converts a local shared memory address <i>localAdrs</i> to itscorresponding global value. This routine does not verify that<i>localAdrs</i> is really a valid local shared memory address.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled shared memoryobjects support option, VxMP.<p></blockquote><h4>RETURNS</h4><blockquote><p>The global shared memory address pointed to by <i>localAdrs</i>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./smObjLib.html#top">smObjLib</a></b><hr><a name="smObjGlobalToLocal"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>smObjGlobalToLocal</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>smObjGlobalToLocal</i>( )</strong> - convert a global address to a local address (VxMP Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void * smObjGlobalToLocal ( void * globalAdrs /* global address to convert */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine converts a global shared memory address <i>globalAdrs</i> to itscorresponding local value. This routine does not verify that <i>globalAdrs</i>is really a valid global shared memory address.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled shared memoryobjects support option, VxMP.<p></blockquote><h4>RETURNS</h4><blockquote><p>The local shared memory address pointed to by <i>globalAdrs</i>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./smObjLib.html#top">smObjLib</a></b><hr><a name="smObjTimeoutLogEnable"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>smObjTimeoutLogEnable</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>smObjTimeoutLogEnable</i>( )</strong> - enable/disable logging of failed attempts to take a spin-lock (VxMP Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void smObjTimeoutLogEnable ( BOOL timeoutLogEnable /* TRUE to enable, FALSE to disable */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine enables or disables the printing of a message whenan attempt to take a shared memory spin-lock fails.<p>By default, message logging is enabled.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled shared memoryobjects support option, VxMP.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./smObjLib.html#top">smObjLib</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -