PHYS(2) — Silicon Graphics
NAME
phys − allow a process to access physical addresses
SYNOPSIS
phys(physnum, virtaddr, size, physaddr)
int physnum
char *virtaddr;
long size;
char *physaddr;
DESCRIPTION
The phys(2) call maps arbitrary physical memory into a process’s virtual address space. The virtual address used by phys must not otherwise be used. physnum is a number (0-3) that specifies which of 4 physical spaces to set up. Up to 4 phys(2) calls can be active at any one time. Virtaddr is the process’s virtual address. Size is the number of bytes to map in. physaddr is the physical address to map in.
Valid virtaddr and physaddr values are constrained by hardware and must be at an address multiple of the resolution of the CPU’s memory management scheme. If size is non-zero, size is rounded up to the next MMU resolution boundary. If size is zero, any previous phys(2) mapping for that physnum segment is nullified.
For example, the call:
phys(2, 0x100000, 32768, 0)
will allow a process to access physical locations 0 through 32767 by referencing virtual address 0x100000 through 0x100000+32767.
In actuality, the CPU MMU register is loaded with physaddr shifted to account for page resolution.
phys(2) may only be executed by the super-user.
DIAGNOSTICS
The value zero is returned if the phys call was successful. The value −1 is returned if not super-user, if virtaddr or physaddr is not in the proper range, or if the specified virtaddr segment register is already in use.
BUGS
This system call is very machine dependent.
ASSEMBLER
moveq#55,D0
movlphysnum,A0
movlvirtaddr,D1
movlsize,A1
movlD2,save
movlphysaddr,D2
trap#0
movlsave,D2
Carry bit cleared on success.
NOTE
This system call is not supported.
Version 2.5 — April 22, 1987