.TH mapPhysUser() "" "" "Internal Kernel Routine"
.PC "Overlay user data with memory-mapped hardware"
\fBint mapPhysUser(\fIvirtAddr\fB, \fIphysAddr\fB, \fInumBytes\^\fB)\fR
\fBint \fIvirtAddr\fB, \fIphysAddr\fB, \fInumBytes\^\fB;\fR
.PP
.B mapPhysUser()
mapped the virtual address
.I virtAddr
into the user data-page table for the current process at address
.IR "physAddr" ,
for the byte count of
.IR "numBytes" .
.PP
This function must observe the following restrictions:
.IP \fB1.\fR 0.3i
Addresses
.I "virtAddr"
and
.I "physAddr"
must be aligned to four-kilobyte boundaries,
i.e., must be multiples of 4,096.
This is a consequence of the 386/486 paging hardware.
.IP \fB2.\fR
Addresses from
.I virtAddr
to
.I virtAddr
plus
.I numBytes
minus one must be in the user data segment (\fInot\fR within the user stack).
.IP \fB3.\fR
Addresses from
.I physAddr
to
.I physAddr
plus
.I numBytes
minus one must be either all outside of installed RAM
or all inside the range of physical addresses within the
.B PHYS_MEM
pool.
.PP
If any of these conditions are not met,
.B mapPhysUser()
does nothing.
Otherwise, all subsequent access to the specified range of user addresses
goes to the physical range requested.
.PP
.B mapPhysUser()
returns zero if any of the above requirements is not met; otherwise,
it returns one.
.SH "See Also"
.B
internal kernel routines
.R
.SH Notes
.I numbytes
must be an exact multiple of four kilobytes (4,096 bytes).
If it is not, \*(CO rounds it up to the next multiple of four kilobytes.
