Changeset View
Changeset View
Standalone View
Standalone View
share/man/man4/mem.4
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)mem.4 5.3 (Berkeley) 5/2/91 | .\" @(#)mem.4 5.3 (Berkeley) 5/2/91 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd August 25, 2020 | .Dd March 11, 2022 | ||||
.Dt MEM 4 | .Dt MEM 4 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm mem , | .Nm mem , | ||||
.Nm kmem | .Nm kmem | ||||
.Nd memory files | .Nd memory files | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Cd "device mem" | .Cd "device mem" | ||||
Show All 20 Lines | |||||
per-process data | per-process data | ||||
size | size | ||||
for the current process | for the current process | ||||
is | is | ||||
.Dv UPAGES | .Dv UPAGES | ||||
long, and ends at virtual | long, and ends at virtual | ||||
address 0xf0000000. | address 0xf0000000. | ||||
.Sh IOCTL INTERFACE | .Sh IOCTL INTERFACE | ||||
.Ss Address Properties | |||||
The | The | ||||
.Dv MEM_EXTRACT_PADDR | .Dv MEM_EXTRACT_PADDR | ||||
ioctl can be used to look up the physical address and NUMA domain of a given | ioctl can be used to look up the physical address and NUMA domain of a given | ||||
virtual address in the calling process' address space. | virtual address in the calling process' address space. | ||||
The request is described by | The request is described by | ||||
.Bd -literal | .Bd -literal | ||||
struct mem_extract { | struct mem_extract { | ||||
uint64_t me_vaddr; /* input */ | uint64_t me_vaddr; /* input */ | ||||
Show All 23 Lines | |||||
.It Dv ME_STATE_VALID | .It Dv ME_STATE_VALID | ||||
The virtual address is valid but is not mapped at the time of the ioctl call. | The virtual address is valid but is not mapped at the time of the ioctl call. | ||||
.It Dv ME_STATE_MAPPED | .It Dv ME_STATE_MAPPED | ||||
The virtual address corresponds to a physical page mapping, and the | The virtual address corresponds to a physical page mapping, and the | ||||
.Fa me_paddr | .Fa me_paddr | ||||
and | and | ||||
.Fa me_domain | .Fa me_domain | ||||
fields are valid. | fields are valid. | ||||
.El | |||||
.Ss Memory Ranges | |||||
.Pp | .Pp | ||||
Several architectures allow attributes to be associated with ranges of physical | Several architectures allow attributes to be associated with ranges of physical | ||||
memory. | memory. | ||||
These attributes can be manipulated via | These attributes can be manipulated via | ||||
.Fn ioctl | .Fn ioctl | ||||
calls performed on | calls performed on | ||||
.Pa /dev/mem . | .Pa /dev/mem . | ||||
Declarations and data types are to be found in | Declarations and data types are to be found in | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
.Va mo_arg[0] | .Va mo_arg[0] | ||||
should be set to | should be set to | ||||
.Dv MEMRANGE_SET_UPDATE | .Dv MEMRANGE_SET_UPDATE | ||||
to update an existing or establish a new range, or to | to update an existing or establish a new range, or to | ||||
.Dv MEMRANGE_SET_REMOVE | .Dv MEMRANGE_SET_REMOVE | ||||
to remove a range. | to remove a range. | ||||
.El | .El | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
.Ss MEM_EXTRACT_PADDR | |||||
The | |||||
.Dv MEM_EXTRACT_PADDR | |||||
ioctl always returns a value of zero. | |||||
.Ss MEMRANGE_GET/MEMRANGE_SET | |||||
.Bl -tag -width Er | .Bl -tag -width Er | ||||
.It Bq Er EOPNOTSUPP | .It Bq Er EOPNOTSUPP | ||||
Memory range operations are not supported on this architecture. | Memory range operations are not supported on this architecture. | ||||
.It Bq Er ENXIO | .It Bq Er ENXIO | ||||
No memory range descriptors are available (e.g., firmware has not enabled | No memory range descriptors are available (e.g., firmware has not enabled | ||||
any). | any). | ||||
.It Bq Er EINVAL | .It Bq Er EINVAL | ||||
The memory range supplied as an argument is invalid or overlaps another | The memory range supplied as an argument is invalid or overlaps another | ||||
Show All 36 Lines |