 |
Index for Section 9 |
|
 |
Alphabetical listing for W |
|
 |
Bottom of page |
|
ws_map_region(9r)
NAME
ws_map_region - Graphics: Maps kernel addresses into the process virtual
address space
SYNOPSIS
caddr_t ws_map_region(
caddr_t kaddr,
caddr_t uaddr,
register int nbytes,
int how,
int *erroraddr );
ARGUMENTS
kaddr
Specifies the kernel address of the memory to be mapped.
uaddr
Specifies the address of the current process where kaddr is to be
mapped. This argument should be NULL unless you need to map kernel
addresses to a specific location in the process's address.
nbytes
Specifies the size (in bytes) of the memory to be mapped.
how Specifies the access mode in octal for the physical memory segment.
erroraddr
Specifies a pointer to the error number (errno) address, which returns
NULL if the memory cannot be mapped.
DESCRIPTION
The ws_map_region routine takes the physical addresses that kaddr specifies
and maps them into the current process's virtual address space. This
routine is typcially called by map_unmap_screen to map the physical address
of the defined screen into virtual address space.
NOTES
Each call to this routine allocates one memory segment. Because shared
memory segments are expensive system resources, you should minimize the
number of separate areas mapped.
RETURN VALUES
On success, the ws_map_region routine returns the address of the memory
map. If the memory could not be mapped, it returns a NULL pointer.
EXAMPLES
The following example shows how the myvga_map_unmap_screen function calls
ws_map_region to map I/O registers to user space:
int
myvga_map_unmap_screen(caddr_t screen_handle,
ws_depth_descriptor *depths,
ws_screen_descriptor *screen,
ws_map_control *mp)
{
.
.
.
dp->pixmap = ws_map_region(temp, NULL, nbytes,
0600, (int *)NULL);
.
.
.
}
FILES
/usr/sys/include/sys/workstation.h
/usr/sys/include/sys/wsdevice.h
 |
Index for Section 9 |
|
 |
Alphabetical listing for W |
|
 |
Top of page |
|