02.03.2014 Views

vxworks programmer's guide.pdf - DAQ Plone Site

vxworks programmer's guide.pdf - DAQ Plone Site

vxworks programmer's guide.pdf - DAQ Plone Site

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7<br />

Virtual Memory Interface<br />

7.5 Using the MMU Programmatically<br />

This section describes the facilities provided for manipulating the MMU<br />

programmatically using low-level routines in vmLib. You can make data private<br />

to a task or code segment, make portions of memory noncacheable, or writeprotect<br />

portions of memory. The fundamental structure used to implement virtual<br />

memory is the virtual memory context (VMC).<br />

For a summary of the VxVMI routines, see the reference entry for vmLib.<br />

7.5.1 Virtual Memory Contexts<br />

7<br />

A virtual memory context (VM_CONTEXT, defined in vmLib) is made up of a<br />

translation table and other information used for mapping a virtual address to a<br />

physical address. Multiple virtual memory contexts can be created and swapped<br />

in and out as desired.<br />

Global Virtual Memory<br />

Some system objects, such as text segments and semaphores, must be accessible to<br />

all tasks in the system regardless of which virtual memory context is made current.<br />

These objects are made accessible by means of global virtual memory. Global virtual<br />

memory is created by mapping all the physical memory in the system (the<br />

mapping is defined in sysPhysMemDesc) to the identical address in the virtual<br />

memory space. In the default system configuration, this initially gives a one-to-one<br />

relationship between physical memory and global virtual memory; for example,<br />

virtual address 0x5000 maps to physical address 0x5000. On some architectures, it<br />

is possible to use sysPhysMemDesc to set up virtual memory so that the mapping<br />

of virtual-to-physical addresses is not one-to-one; see 7.3 Virtual Memory<br />

Configuration, p.290 for additional information.<br />

Global virtual memory is accessible from all virtual memory contexts.<br />

Modifications made to the global mapping in one virtual memory context appear<br />

in all virtual memory contexts. Before virtual memory contexts are created, add all<br />

global memory with vmGlobalMap( ). Global memory that is added after virtual<br />

memory contexts are created may not be available to existing contexts.<br />

293

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!