xref: /freebsd/usr.sbin/memcontrol/memcontrol.8 (revision e0c4386e)
1.\" Copyright (c) 1999 Chris Costello
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd September 15, 2002
26.Dt MEMCONTROL 8
27.Os
28.Sh NAME
29.Nm memcontrol
30.Nd "control system cache behaviour with respect to memory"
31.Sh SYNOPSIS
32.Nm
33.Cm list
34.Op Fl a
35.Nm
36.Cm set
37.Fl b Ar base
38.Fl l Ar length
39.Fl o Ar owner
40.Ar attribute
41.Nm
42.Cm clear
43.Fl o Ar owner
44.Nm
45.Cm clear
46.Fl b Ar base
47.Fl l Ar length
48.Sh DESCRIPTION
49A number of supported system architectures allow the behaviour of the CPU
50cache to be programmed to behave differently depending on the region being
51written.
52.Pp
53The
54.Nm
55utility
56provides an interface to this facility, allowing CPU cache behavior to
57be altered for ranges of system physical memory.
58.Pp
59These ranges are typically power-of-2 aligned and sized, however the specific
60rules governing their layout vary between architectures.
61The
62.Nm
63utility does not attempt to enforce these rules, however the system will
64reject any attempt to set an illegal combination.
65.Bl -tag -width ".Cm clear"
66.It Cm list
67List range slots.
68.Bl -tag -width indent
69.It Fl a
70List all range slots, even those that are inactive.
71.El
72.It Cm set
73Set memory range attributes.
74.Bl -tag -width indent
75.It Fl b Ar base
76Memory range base address.
77.It Fl l Ar length
78Length of memory range in bytes, power of 2.
79.It Fl o Ar owner
80Text identifier for this setting (7 char max).
81.It Ar attribute
82Attributes applied to this range; combinations of
83.Cm force , uncacheable , write-combine , write-through , write-back ,
84and
85.Cm write-protect .
86.El
87.It Cm clear
88Clear memory range attributes.
89Ranges may be cleared by owner or by
90base/length combination.
91.Pp
92To clear based on ownership:
93.Bl -tag -width indent
94.It Fl o Ar owner
95All ranges with this owner will be cleared.
96.El
97.Pp
98To clear based on the base/length combination:
99.Bl -tag -width indent
100.It Fl b Ar base
101Memory range base address.
102.It Fl l Ar length
103Length of memory range in bytes, power of 2.
104.El
105.Pp
106Base and length must exactly match an existing range.
107.El
108.Sh SEE ALSO
109.Xr mem 4
110