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

📄 vxlib.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/vxLib.html - generated by refgen from vxLib.c --> <title> vxLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>vxLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>vxLib</strong> - miscellaneous support routines </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./vxLib.html#vxTas">vxTas</a></i>(&nbsp;)</b>  -  C-callable atomic test-and-set primitive<br><b><i><a href="./vxLib.html#vxMemArchProbe">vxMemArchProbe</a></i>(&nbsp;)</b>  -  architecture specific part of vxMemProbe<br><b><i><a href="./vxLib.html#vxMemProbe">vxMemProbe</a></i>(&nbsp;)</b>  -  probe an address for a bus error<br><b><i><a href="./vxLib.html#vxMemProbeAsi">vxMemProbeAsi</a></i>(&nbsp;)</b>  -  probe address in ASI space for bus error (SPARC)<br><b><i><a href="./vxLib.html#vxSSEnable">vxSSEnable</a></i>(&nbsp;)</b>  -  enable the superscalar dispatch (MC68060)<br><b><i><a href="./vxLib.html#vxSSDisable">vxSSDisable</a></i>(&nbsp;)</b>  -  disable the superscalar dispatch (MC68060)<br><b><i><a href="./vxLib.html#vxPowerModeSet">vxPowerModeSet</a></i>(&nbsp;)</b>  -  set the power management mode (PowerPC)<br><b><i><a href="./vxLib.html#vxPowerModeGet">vxPowerModeGet</a></i>(&nbsp;)</b>  -  get the power management mode (PowerPC)<br><b><i><a href="./vxLib.html#vxPowerDown">vxPowerDown</a></i>(&nbsp;)</b>  -  place the processor in reduced-power mode (PowerPC)<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This module contains miscellaneous VxWorks support routines.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>vxLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vxLib.html#top">vxLib</a></b><hr><a name="vxTas"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>vxTas</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>vxTas</i>(&nbsp;)</strong> - C-callable atomic test-and-set primitive</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>BOOL vxTas    (    void * address /* address to test and set */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine provides a C-callable interface to a test-and-setinstruction.  The test-and-set instruction is executed on the specifiedaddress.  The architecture test-and-set instruction is:<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;68K:&nbsp;&nbsp;&nbsp;&nbsp;<b>tas</b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SPARC:&nbsp;&nbsp;<b>ldstub</b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i960:&nbsp;&nbsp;&nbsp;<b>atmod</b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ARM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>swpb</b><p>This routine is equivalent to <b><i><a href="./sysLib.html#sysBusTas">sysBusTas</a></i>(&nbsp;)</b> in sysLib.<p></blockquote><h4>BUGS (MIPS)</h4><blockquote><p><p>Only <b>Kseg0</b> and <b>Kseg1</b> addresses are accepted; other addresses alwaysreturn FALSE. <p></blockquote><h4>RETURNS</h4><blockquote><p><p>TRUE if the value had not been set (but is now), or FALSE if thevalue was set already.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vxLib.html#top">vxLib</a></b>, <b><i><a href="./sysLib.html#sysBusTas">sysBusTas</a></i>(&nbsp;)</b><hr><a name="vxMemArchProbe"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>vxMemArchProbe</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>vxMemArchProbe</i>(&nbsp;)</strong> - architecture specific part of vxMemProbe</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS vxMemArchProbe    (    char * adrs,   /* address to be probed */    int    mode,   /* VX_READ or VX_WRITE */    int    length, /* 1, 2, 4, or 8 */    char * pVal    /* where to return value, or ptr to value to be written */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This is the routine implementing the architecture specific part of thevxMemProbe routine.  It traps the relevant exceptionswhile accessing the specified address.  If anexception occurs, then the result will be ERROR.  If no exception occursthen the result will be OK.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR if an exception occurred during access.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vxLib.html#top">vxLib</a></b><hr><a name="vxMemProbe"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>vxMemProbe</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>vxMemProbe</i>(&nbsp;)</strong> - probe an address for a bus error</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS vxMemProbe    (    char * adrs,   /* address to be probed */    int    mode,   /* VX_READ or VX_WRITE */    int    length, /* 1, 2, 4, or 8 */    char * pVal    /* where to return value, or ptr to value to be written */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine probes a specified address to see if it is readable orwritable, as specified by <i>mode</i>.  The address is read or written as1, 2, or 4 bytes, as specified by <i>length</i> (values other than 1, 2, or 4yield unpredictable results).  If the probe is a <b>VX_READ</b> (0), the valueread is copied to the location pointed to by <i>pVal</i>.  If the probe is a<b>VX_WRITE</b> (1), the value written is taken from the location pointed to by<i>pVal</i>.  In either case, <i>pVal</i> should point to a value of 1, 2, or 4bytes, as specified by <i>length</i>.<p>Note that only bus errors are trapped during the probe, and that theaccess must otherwise be valid (i.e., it must not generate an address error).<p></blockquote><h4>EXAMPLE</h4><blockquote><p><pre>    testMem (adrs)        char *adrs;        {        char testW = 1;        char testR;        if (vxMemProbe (adrs, VX_WRITE, 1, &amp;testW) == OK)            printf ("value %d written to adrs %x\n", testW, adrs);        if (vxMemProbe (adrs, VX_READ, 1, &amp;testR) == OK)            printf ("value %d read from adrs %x\n", testR, adrs);        }</pre></blockquote><h4>MODIFICATION</h4><blockquote><p>The BSP can modify the behaviour of <b><i><a href="./vxLib.html#vxMemProbe">vxMemProbe</a></i>(&nbsp;)</b> by supplying an alternateroutine and placing the address in the global variable_func_vxMemProbeHook.  The BSP routine will be called instead of thearchitecture specific routine <b><i><a href="./vxLib.html#vxMemArchProbe">vxMemArchProbe</a></i>(&nbsp;)</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the probe caused a bus error or was misaligned.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vxLib.html#top">vxLib</a></b>, <b><i><a href="./vxLib.html#vxMemArchProbe">vxMemArchProbe</a></i>(&nbsp;)</b><hr><a name="vxMemProbeAsi"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>vxMemProbeAsi</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>vxMemProbeAsi</i>(&nbsp;)</strong> - probe address in ASI space for bus error (SPARC)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS vxMemProbeAsi    (    char * adrs,   /* address to be probed */    int    mode,   /* VX_READ or VX_WRITE */    int    length, /* 1, 2, 4, or 8 */    char * pVal,   /* where to return value, or ptr to value to be written */    int    adrsAsi /* ASI field of address to be probed */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine probes the specified address to see if it is readable orwritable, as specified by <i>mode</i>.  The address will beread/written as 1, 2, 4, or 8 bytes as specified by <i>length</i> (values other than 1, 2, 4, or 8 return ERROR).  If the probe is a<b>VX_READ</b> (0), then the value read will be returned in the location pointed toby <i>pVal</i>.  If the probe is a <b>VX_WRITE</b> (1), then the value written will betaken from the location pointed to by <i>pVal</i>.  In either case, <i>pVal</i>should point to a value of the appropriate length, 1, 2, 4, or 8 bytes, asspecified by <i>length</i>.<p>The fifth parameter <i>adrsAsi</i> is the ASI parameter used to modifythe <i>adrs</i> parameter.<p></blockquote><h4>EXAMPLE</h4><blockquote><p><pre>    testMem (adrs)       char *adrs;       {       char testW = 1;       char testR;       if (vxMemProbeAsi (adrs, VX_WRITE, 1, &amp;testW) == OK)           printf ("value %d written to adrs %x\n", testW, adrs);       if (vxMemProbeAsi (adrs, VX_READ, 1, &amp;testR) == OK)           printf ("value %d read from adrs %x\n", testR, adrs);       }</pre></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the probe caused a bus error orwas misaligned.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vxLib.html#top">vxLib</a></b><hr><a name="vxSSEnable"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>vxSSEnable</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>vxSSEnable</i>(&nbsp;)</strong> - enable the superscalar dispatch (MC68060)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void vxSSEnable (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function sets the ESS bit of the Processor Configuration Register (PCR)to enable the superscalar dispatch.<p></blockquote><h4>RETURNS </h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vxLib.html#top">vxLib</a></b><hr><a name="vxSSDisable"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>vxSSDisable</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>vxSSDisable</i>(&nbsp;)</strong> - disable the superscalar dispatch (MC68060)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void vxSSDisable (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function resets the ESS bit of the Processor Configuration Register (PCR)to disable the superscalar dispatch.<p></blockquote><h4>RETURNS </h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vxLib.html#top">vxLib</a></b><hr><a name="vxPowerModeSet"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>vxPowerModeSet</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>vxPowerModeSet</i>(&nbsp;)</strong> - set the power management mode (PowerPC)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS vxPowerModeSet    (    UINT32 mode /* power management mode to select */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine selects the power management mode to be activated when<b><i><a href="./vxLib.html#vxPowerDown">vxPowerDown</a></i>(&nbsp;)</b> is called.  <b><i><a href="./vxLib.html#vxPowerModeSet">vxPowerModeSet</a></i>(&nbsp;)</b> is normally called in the BSPinitialization routine <b><i><a href="./sysLib.html#sysHwInit">sysHwInit</a></i>(&nbsp;)</b>.<p>Power management modes include the following:<dl><dt><b>VX_POWER_MODE_DISABLE</b> (0x1)<dd>Power management is disabled; this prevents the MSR(POW) bit from beingset (all PPC).<p><dt><b>VX_POWER_MODE_FULL</b> (0x2)<dd>All CPU units are active while the kernel is idle (PPC603, PPCEC603 andPPC860 only).<p><dt><b>VX_POWER_MODE_DOZE</b> (0x4)<dd>Only the decrementer, data cache, and bus snooping are active while thekernel is idle (PPC603, PPCEC603 and PPC860).<p><dt><b>VX_POWER_MODE_NAP</b> (0x8)<dd>Only the decrementer is active while the kernel is idle (PPC603, PPCEC603 andPPC604 ).<p><dt><b>VX_POWER_MODE_SLEEP</b> (0x10)<dd>All CPU units are inactive while the kernel is idle (PPC603, PPCEC603 andPPC860 - not recommended for the PPC603 and PPCEC603 architecture).<p><dt><b>VX_POWER_MODE_DEEP_SLEEP</b> (0x20)<dd>All CPU units are inactive while the kernel is idle (PPC860 only - notrecommended).<p><dt><b>VX_POWER_MODE_DPM</b> (0x40)<dd>Dynamic Power Management Mode (PPC603 and PPCEC603 only).<p><dt><b>VX_POWER_MODE_DOWN</b> (0x80)<dd> Only a hard reset causes an exit from power-down low power mode (PPC860 only- not recommended).<p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;or&nbsp;ERROR&nbsp;if&nbsp;<i>mode</i>&nbsp;is&nbsp;incorrect&nbsp;or&nbsp;not&nbsp;supported&nbsp;by&nbsp;theprocessor.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vxLib.html#top">vxLib</a></b>, <b><i><a href="./vxLib.html#vxPowerModeGet">vxPowerModeGet</a></i>(&nbsp;)</b>, <b><i><a href="./vxLib.html#vxPowerDown">vxPowerDown</a></i>(&nbsp;)</b><hr><a name="vxPowerModeGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>vxPowerModeGet</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>vxPowerModeGet</i>(&nbsp;)</strong> - get the power management mode (PowerPC)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>UINT32 vxPowerModeGet (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the power management mode set by <b><i><a href="./vxLib.html#vxPowerModeSet">vxPowerModeSet</a></i>(&nbsp;)</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The power management mode, or ERROR if no mode has been selected or if power management is not supported.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vxLib.html#top">vxLib</a></b>, <b><i><a href="./vxLib.html#vxPowerModeSet">vxPowerModeSet</a></i>(&nbsp;)</b>, <b><i><a href="./vxLib.html#vxPowerDown">vxPowerDown</a></i>(&nbsp;)</b><hr><a name="vxPowerDown"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>vxPowerDown</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>vxPowerDown</i>(&nbsp;)</strong> - place the processor in reduced-power mode (PowerPC)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>UINT32 vxPowerDown (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine activates the reduced-power mode if power management is enabled.It is called by the scheduler when the kernel enters the idle loop.The power management mode is selected by <b><i><a href="./vxLib.html#vxPowerModeSet">vxPowerModeSet</a></i>(&nbsp;)</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if power management is not supported or if externalinterrupts are disabled.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vxLib.html#top">vxLib</a></b>, <b><i><a href="./vxLib.html#vxPowerModeSet">vxPowerModeSet</a></i>(&nbsp;)</b>, <b><i><a href="./vxLib.html#vxPowerModeGet">vxPowerModeGet</a></i>(&nbsp;)</b><p>STATUS vxPowerDown (void)</body></html>

⌨️ 快捷键说明

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