1
0
Files
irix-657m-src/eoe/man/manD/map.d2x
2022-09-29 17:59:04 +03:00

59 lines
2.1 KiB
Plaintext

.TH map D2X
.SH NAME
\f4map\f1 \- support virtual mapping for memory-mapped device
.SH SYNOPSIS
.nf
\f4#include <sys/types.h>
#include <sys/mman.h>
#include <sys/ddi.h>
#include <ksys/ddmap.h>
.sp
int prefixmap(dev_t \f1\f2dev\f1\f4, vhandl_t *\f1\f2vt\f1\f4, off_t \f1\f2off\f1\f4, size_t \f1\f2len\f1\f4, uint \f1\f2prot\f1\f4);\f1
.fi
.SS Arguments
.TP
\f2dev\f1
Device whose memory is to be mapped.
.TP
\f2vt\f1
A pointer to the kernel-resident data structure that describes the virtual space
to which the device memory will be mapped.
The driver needs this pointer when calling kernel service routines (i.e., \f4v_mapphys\f1(D3X)).
.TP
\f2off\f1
Offset within device memory at which mapping begins.
.TP
\f2len\f1
The length (in bytes) of the device memory to be mapped into the user's address space.
.TP
\f2prot\f1
Protection flags from \f2mman.h\f1.
.SH DESCRIPTION
The map entry point provides a way to support drivers for memory-mapped devices. A memory-mapped device has memory that can be mapped into a process's address space. The \f4mmap\f1(2) system call allows this device memory to be mapped into user space for direct access by the user application (this way no kernel buffering or system call overhead is incurred).
.SS "Return Values"
If the protection and offset are valid for the device, the driver should return 0. Otherwise, the appropriate error number should be returned.
.SH USAGE
This entry point is optional, and valid for memory-mapped device drivers only.
.P
Valid values for \f2prot\f1 are:
.TP
\f2PROT_READ\f1
Page can be read.
.TP
\f2PROT_WRITE\f1
Page can be written.
.TP
\f2PROT_EXEC\f1
Page can be executed.
.TP
\f2PROT_ALL\f1
All of the above.
.P
The driver should treat \f2vt\f1 as opaque and should not try to directly
set any of the member values.
To map physical addresses into user address space, drivers should use the \f4v_mapphys\f1(D3X) function. Use \f4v_gethandle\f1(D3X) if the driver must remember several virtual handles.
.SS "Synchronization Constraints"
The map routine has user context and can sleep.
.SH REFERENCES
\f4unmap\f1(D2X), \f4v_getaddr\f1(D3X), \f4v_getlen\f1(D3X), \f4v_gethandle\f1(D3X), \f4v_mapphys\f1(D3X)