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

📄 vmlib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<p><strong>vmContextDelete(&nbsp;)</strong> - delete a virtual memory context (VxVMI Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS vmContextDelete    (    VM_CONTEXT_ID context    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deallocates the underlying translation table associated witha virtual memory context.  It does not free the physical memory alreadymapped into the virtual memory space.<p>This routine should not be called from interrupt level.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled virtual memorysupport option, VxVMI.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if <i>context</i> is not a valid context descriptor orif an error occurs deleting the translation table.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vmLib.html#top">vmLib</a></b><hr><a name="vmStateSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>vmStateSet(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>vmStateSet(&nbsp;)</strong> - change the state of a block of virtual memory (VxVMI Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS vmStateSet    (    VM_CONTEXT_ID context,    /* context - NULL == currentContext */    void *        pVirtual,   /* virtual address to modify state of */    int           len,        /* len of virtual space to modify state of */    UINT          stateMask,  /* state mask */    UINT          state       /* state */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine changes the state of a block of virtual memory.  Each pageof virtual memory has at least three elements of state information:validity, writability, and cacheability.  Specific architectures maydefine additional state information; see <b>vmLib.h</b> for additionalarchitecture-specific states.  Memory accesses to a page marked asinvalid will result in an exception.  Pages may be invalidated to preventthem from being corrupted by invalid references.  Pages may be defined asread-only or writable, depending on the state of the writable bits.Memory accesses to pages marked as not-cacheable will always result in amemory cycle, bypassing the cache.  This is useful for multiprocessing,multiple bus masters, and hardware control registers.<p>The following states are provided and may be or'ed together in the state parameter:  <p><table><tr valign=top><td align=left><b>VM_STATE_VALID</b>     </td><td align=left> <b>VM_STATE_VALID_NOT</b>     </td><td align=left> valid/invalid</tr><tr valign=top><td align=left><b>VM_STATE_WRITABLE</b>  </td><td align=left> <b>VM_STATE_WRITABLE_NOT</b>  </td><td align=left> writable/write-protected</tr><tr valign=top><td align=left><b>VM_STATE_CACHEABLE</b> </td><td align=left> <b>VM_STATE_CACHEABLE_NOT</b> </td><td align=left> cacheable/not-cacheable</tr><tr valign=top><td align=left></tr></tr></table>Additionally, the following masks are provided so that only specificstates may be set.  These may be or'ed together in the <b>stateMask</b> parameter. <p>&nbsp;<b>VM_STATE_MASK_VALID</b><br>&nbsp;<b>VM_STATE_MASK_WRITABLE</b><br>&nbsp;<b>VM_STATE_MASK_CACHEABLE</b><p>If <i>context</i> is specified as NULL, the current context is used.<p>This routine is callable from interrupt level.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled virtual memorysupport option, VxVMI.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or, ERROR if the validation fails, <i>pVirtual</i> is not on a pageboundary, <i>len</i> is not a multiple of page size, or thearchitecture-dependent state set fails for the specified virtual address.<p></blockquote><h4>ERRNO</h4><blockquote><p><p><b>S_vmLib_NOT_PAGE_ALIGNED</b>,<b>S_vmLib_BAD_STATE_PARAM</b>,<b>S_vmLib_BAD_MASK_PARAM</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vmLib.html#top">vmLib</a></b><hr><a name="vmStateGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>vmStateGet(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>vmStateGet(&nbsp;)</strong> - get the state of a page of virtual memory (VxVMI Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS vmStateGet    (    VM_CONTEXT_ID context,    /* context - NULL == currentContext */    void *        pPageAddr,  /* virtual page addr */    UINT *        pState      /* where to return state */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine extracts state bits with the following masks: <p>&nbsp;<b>VM_STATE_MASK_VALID</b><br>&nbsp;<b>VM_STATE_MASK_WRITABLE</b><br>&nbsp;<b>VM_STATE_MASK_CACHEABLE</b><p>Individual states may be identified with the following constants:<p><table><tr valign=top><td align=left><b>VM_STATE_VALID</b>    </td><td align=left> <b>VM_STATE_VALID_NOT</b>     </td><td align=left> valid/invalid</tr><tr valign=top><td align=left><b>VM_STATE_WRITABLE</b> </td><td align=left> <b>VM_STATE_WRITABLE_NOT</b>  </td><td align=left> writable/write-protected</tr><tr valign=top><td align=left><b>VM_STATE_CACHEABLE</b></td><td align=left> <b>VM_STATE_CACHEABLE_NOT</b> </td><td align=left> cacheable/not-cacheable</tr><tr valign=top><td align=left></tr></tr></table>For example, to see if a page is writable, the following code would be used:<p><pre>    vmStateGet (vmContext, pageAddr, &amp;state);    if ((state &amp; VM_STATE_MASK_WRITABLE) &amp; VM_STATE_WRITABLE)       ...</pre>If <i>context</i> is specified as NULL, the current virtual memory context is used.<p>This routine is callable from interrupt level.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled virtual memorysupport option, VxVMI.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if <i>pageAddr</i> is not on a page boundary, thevalidity check fails, or the architecture-dependent state get fails forthe specified virtual address.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_vmLib_NOT_PAGE_ALIGNED</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vmLib.html#top">vmLib</a></b><hr><a name="vmMap"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>vmMap(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>vmMap(&nbsp;)</strong> - map physical space into virtual space (VxVMI Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS vmMap    (    VM_CONTEXT_ID context,      /* context - NULL == currentContext */    void *        virtualAddr,  /* virtual address */    void *        physicalAddr, /* physical address */    UINT          len           /* len of virtual and physical spaces */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine maps physical pages into a contiguous block of virtualmemory.  <i>virtualAddr</i> and <i>physicalAddr</i> must be on page boundaries, and<i>len</i> must be evenly divisible by the page size.  After the call to<b><a href="./vmLib.html#vmMap">vmMap</a>(&nbsp;)</b>, the state of all pages in the the newly mapped virtual memory isvalid, writable, and cacheable.<p>The <b><a href="./vmLib.html#vmMap">vmMap</a>(&nbsp;)</b> routine can fail if the specified virtual address spaceconflicts with the translation tables of the global virtual memory space.The global virtual address space is architecture-dependent and isinitialized at boot time with calls to <b><a href="./vmLib.html#vmGlobalMap">vmGlobalMap</a>(&nbsp;)</b> by<b><a href="./vmLib.html#vmGlobalMapInit">vmGlobalMapInit</a>(&nbsp;)</b>.  If a conflict results, <b>errno</b> is set to<b>S_vmLib_ADDR_IN_GLOBAL_SPACE</b>.  To avoid this conflict, use<b><a href="./vmLib.html#vmGlobalInfoGet">vmGlobalInfoGet</a>(&nbsp;)</b> to ascertain which portions of the virtual address spaceare reserved for the global virtual address space.  If <i>context</i> isspecified as NULL, the current virtual memory context is used.<p>This routine should not be called from interrupt level.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled virtual memorysupport option, VxVMI.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if <i>virtualAddr</i> or <i>physicalAddr</i> are not on page boundaries, <i>len</i> is not a multiple of the page size, the validation fails, or the mapping fails.<p></blockquote><h4>ERRNO</h4><blockquote><p><p><b>S_vmLib_NOT_PAGE_ALIGNED</b>,<b>S_vmLib_ADDR_IN_GLOBAL_SPACE</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./vmLib.html#top">vmLib</a></b><hr><a name="vmGlobalMap"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>vmGlobalMap(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>vmGlobalMap(&nbsp;)</strong> - map physical pages to virtual space in shared global virtual memory (VxVMI Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS vmGlobalMap    (    void * virtualAddr,       /* virtual address */    void * physicalAddr,      /* physical address */    UINT   len                /* len of virtual and physical spaces */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine maps physical pages to virtual space that is shared by allvirtual memory contexts.  Calls to <b><a href="./vmLib.html#vmGlobalMap">vmGlobalMap</a>(&nbsp;)</b> should be made before anyvirtual memory contexts are created to insure that the shared globalmappings are included in all virtual memory contexts.  Mappings createdwith <b><a href="./vmLib.html#vmGlobalMap">vmGlobalMap</a>(&nbsp;)</b> after virtual memory contexts are created are notguaranteed to appear in all virtual memory contexts.  After the call to<b><a href="./vmLib.html#vmGlobalMap">vmGlobalMap</a>(&nbsp;)</b>, the state of all pages in the the newly mapped virtualmemory is unspecified and must be set with a call to <b><a href="./vmLib.html#vmStateSet">vmStateSet</a>(&nbsp;)</b>, oncethe initial virtual memory context is created.<p>This routine should not be called from interrupt level.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled virtual memorysupport option, VxVMI.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if <i>virtualAddr</i> or <i>physicalAddr</i> are not on page boundaries, <i>len</i> is not a multiple of the page size, or the mapping fails.<p></blockquote><h4>ERRNO</h4><blockquote><p>

⌨️ 快捷键说明

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