PHYS(2) — Stardent Computer Inc. (System Calls)
NAME
phys − allow a process to access physical addresses
DESCRIPTION
The argument vaddr specifies a process virtual address and the argument paddr specifies a processor physical address. The range [vaddr, vaddr + nbytes - 1] is rounded up to an integral number of pages and the backing store for these virtual pages is replaced by the set of real pages specified by the range [paddr + paddr + nbytes - 1]. The addresses vaddr and paddr must both specify the same offset within a page. That is, vaddr modulo pagesize must equal paddr modulo pagesize.
The virtual pages defined by the parameters must be a set of already valid mappings in the process address space. Use brk(2) or sbrk(2) to ensure this.
This call may only be executed by the super-user.
RETURN VALUE
Upon successful completion, phys returns a value of 0. Otherwise, a value of -1 is returned and the global variable errno is set to indicate the error.
ERRORS
Phys will fail and no child processes will be created if one or more of the following are true:
[EPERM] The caller is not the super-user.
[EINVAL] No current valid mapping exists for the range specified by the virtual address vaddr and nbytes argument.
[EINVAL] vaddr modulo pagesize does not equal paddr modulo pagesize.
SEE ALSO
September 29, 2021