National Instruments NI-VXI Network Card User Manual


 
Chapter 3 Software Overview
© National Instruments Corporation 3-35 NI-VXI User Manual
VXIinLR (reg, width, value)
VXIinLR
reads a single byte, word, or longword from the local CPU
VXI/VME registers. On many CPUs, the local CPU VXI/VME
registers cannot be accessed from the local CPU in the A16 address
space window (due to hardware limitations). Another area in the local
CPU address space is reserved for accessing the local CPU VXI
registers.
VXIinLR
is designed to read these local registers. The
VXI/VME access privilege is not applicable but can be assumed to be
Nonprivileged Data. The byte order is Motorola. Unless otherwise
specified, reads should always be performed as words. This function
can be used to read configuration information (manufacturer, model
code, and so on) for the local CPU.
VXImemAlloc (size, useraddr, vxiaddr)
VXImemAlloc
allocates physical RAM from the operating system’s
dynamic memory pool. This RAM will reside in the VXI/VME Shared
RAM region of the local CPU.
VXImemAlloc
returns not only the user
address that the application uses, but also the VXI/VME address that a
remote device would use to access this RAM. This function is very
helpful on virtual memory systems, which require contiguous,
locked-down blocks of virtual-to-physical RAM. On non-virtual
memory systems, this function is a malloc (standard C dynamic
allocation routine) and an address translation. When the application is
finished using the memory, it should make a call to
VXImemFree
to
return the memory to the operating system’s dynamic memory pool.
VXImemCopy (useraddr, bufaddr, size, dir)
VXImemCopy
copies blocks of memory to or from the local user’s
address space into the local shared memory region. On some interfaces,
your application cannot directly access local shared memory.
VXImemCopy
gives you fast access to this local shared memory.
VXImemFree (useraddr)
VXImemFree
reallocates physical RAM from the operating system’s
dynamic memory pool allocated using
VXImemAlloc
.
VXImemAlloc
returns not only the user address that the application uses, but also the
VXI address that a remote device would use to access this RAM. When
the application is through using the memory, it should make a call to
VXImemFree
(with the user address) to return the memory to the
operating system’s dynamic memory pool.