map device memory into user space
Synopsis (Not in current DDI version)
int drv_mmap(vaddr_t vaddr, paddr_t paddr,
size_t len, vaddr_t *uvaddrp,
uint_t prot, uint_t maxprot,
function provides a convenient interface
for setting up a user mapping
to a range of kernel virtual or physical addresses.
Kernel address of the object to be mapped.
If vaddr is non-zero,
it is the kernel address of the object to be mapped
(and paddr is ignored).
Otherwise, paddr is the physical address of the object.
paddr is the physical address
of the object to be mapped.
Number of bytes to map into user space.
User address at which to map the object.
If the MAP_FIXED flag is set,
the value passed in *uvaddrp is used as the address;
otherwise, the kernel assigns an address.
Initial protection flags.
This determines whether read, write,
execute, or some combination of these accesses are permitted
to the pages being mapped.
The protection options are:
Page can be read.
Page can be written.
Page can be executed.
Page cannot be accessed.
This is similar to prot,
but specifies the maximum permissions the user can subsequently
Specifies whether the user address is supplied by
the driver or the kernel.
If the MAP_FIXED flag is used,
*uvaddrp is used as the user address
at which to map the object;
any previous mapping at this address will be replaced.
Otherwise, the kernel chooses
a currently unused user address
and place it into *uvaddrp.
If the parameters are valid,
returns with the user address for the object map
in *uvaddrp, and returns 0.
Otherwise, a non-zero errno is returned.
A typical use for
is for video frame buffers mapped through
ioctls rather than of
for compatibility with pre-SVR4 applications.
Note that the mapping is at a page granularity.
You can pass in addresses and lengths
that are not page-aligned,
but the user will have access to entire pages.
Not all implementations literally provide
all possible combinations.
For example, PROT_WRITE is often implemented as
and PROT_EXEC as PROT_READ|PROT_EXEC.
However, no implementation permits a write to succeed
if PROT_WRITE has not been set,
because it might still be set from a previous operation.
To release a mapping acquired by
Context and synchronization
5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp
Differences between versions
This function was removed from the DDI 8 definition
because of implementation difficulties
involved in providing support for
DMA access of memory greater than 4GB.
function was not removed from DDI 8,
although it is rendered meaningless without
SCO expects to restore
in a DDI version after version 8.
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005