Help: ICE_ICELIB_PIC_MAP
Deprecated, use PIC_MAPMEM
Function PIC_MAP - Deprecated, use PIC_MAPMEM
PIC p Handle to Device
int **vaddr User buffer virtual address (buffers pointer by reference)
int *paddr The physical PCI address of DMA buffer (phys addr by reference)
int bytes Number of bytes in the user buffer
int mode 1 = alloc/map, -1 = unmap/dealloc, 2 = map, -2 = unmap
If mode = 1, this routine prepares a user memory buffer for DMA transfers.
It first allocates a buffer of the requested size. Depending on the machine
architecture, this is either mmap'ed to reserved physical pages (Linux PC) or
mapped through hardware bus mapping registers (DEC Alpha) to the PCI bus.
The user buffer's virtual address and the physical start address for the DMA
are returned.
If the memory is not allocatable, start is set to zero and a -1 is returned.
The start and count pointers are inputs to the PIC_DMA routine. These numbers
are checked by the driver to ensure the addresses are valid before the DMA is
started.
If mode = -1, this routine unmaps and unlocks the memory associated with this
DMA buffer address.
Syntax EXAMPLE from C:
int_4 buffer[], phys_addr, bytes;
status = pic_map (p, &buffer, &phys_addr, bytes, 1)
Syntax EXAMPLE from FORTRAN:
integer*4 buffer(*), phys_addr, bytes;
pointer (pbuffer,buffer)
status = m$pic_map (p, pbuffer, phys_addr, bytes, p1)
If you have trouble with the pass by reference, remember that the phys_addr is
not really a pointer, it is a 4-byte integer. The routine will be writing to
both buffer (or pbuffer in FORTRAN) and phys_addr.
If <mode> is 2 or -2, instead of 1 and -1, the virtual buffer alloc and
free are not performed in pic_map and must be handled by external code.
This has been added to allow acquisition into buffers that are mmapped to
other processes by user code. This mode is currently only supported on VMS.