148b7ea76SChris Costello.\" Copyright (c) 1999 Chris Costello 248b7ea76SChris Costello.\" All rights reserved. 348b7ea76SChris Costello.\" 448b7ea76SChris Costello.\" Redistribution and use in source and binary forms, with or without 548b7ea76SChris Costello.\" modification, are permitted provided that the following conditions 648b7ea76SChris Costello.\" are met: 748b7ea76SChris Costello.\" 1. Redistributions of source code must retain the above copyright 848b7ea76SChris Costello.\" notice, this list of conditions and the following disclaimer. 948b7ea76SChris Costello.\" 2. Redistributions in binary form must reproduce the above copyright 1048b7ea76SChris Costello.\" notice, this list of conditions and the following disclaimer in the 1148b7ea76SChris Costello.\" documentation and/or other materials provided with the distribution. 1248b7ea76SChris Costello.\" 1348b7ea76SChris Costello.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1448b7ea76SChris Costello.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1548b7ea76SChris Costello.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1648b7ea76SChris Costello.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1748b7ea76SChris Costello.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1848b7ea76SChris Costello.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1948b7ea76SChris Costello.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2048b7ea76SChris Costello.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2148b7ea76SChris Costello.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2248b7ea76SChris Costello.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2348b7ea76SChris Costello.\" SUCH DAMAGE. 2448b7ea76SChris Costello.\" 25c041c1e0SRuslan Ermilov.Dd September 15, 2002 2648b7ea76SChris Costello.Dt MEMCONTROL 8 27a4c37c81SRuslan Ermilov.Os 2848b7ea76SChris Costello.Sh NAME 2948b7ea76SChris Costello.Nm memcontrol 30eb083802SRuslan Ermilov.Nd "control system cache behaviour with respect to memory" 3148b7ea76SChris Costello.Sh SYNOPSIS 3248b7ea76SChris Costello.Nm 33c041c1e0SRuslan Ermilov.Cm list 3448b7ea76SChris Costello.Op Fl a 3548b7ea76SChris Costello.Nm 36c041c1e0SRuslan Ermilov.Cm set 3748b7ea76SChris Costello.Fl b Ar base 3848b7ea76SChris Costello.Fl l Ar length 3948b7ea76SChris Costello.Fl o Ar owner 4048b7ea76SChris Costello.Ar attribute 4148b7ea76SChris Costello.Nm 42c041c1e0SRuslan Ermilov.Cm clear 4348b7ea76SChris Costello.Fl o Ar owner 4448b7ea76SChris Costello.Nm 45c041c1e0SRuslan Ermilov.Cm clear 4648b7ea76SChris Costello.Fl b Ar base 4748b7ea76SChris Costello.Fl l Ar length 4848b7ea76SChris Costello.Sh DESCRIPTION 4948b7ea76SChris CostelloA number of supported system architectures allow the behaviour of the CPU 5048b7ea76SChris Costellocache to be programmed to behave differently depending on the region being 5148b7ea76SChris Costellowritten. 5248b7ea76SChris Costello.Pp 53490d5836SPhilippe CharnierThe 54490d5836SPhilippe Charnier.Nm 55490d5836SPhilippe Charnierutility 5648b7ea76SChris Costelloprovides an interface to this facility, allowing CPU cache behavior to 5748b7ea76SChris Costellobe altered for ranges of system physical memory. 5848b7ea76SChris Costello.Pp 5948b7ea76SChris CostelloThese ranges are typically power-of-2 aligned and sized, however the specific 60c041c1e0SRuslan Ermilovrules governing their layout vary between architectures. 61c041c1e0SRuslan ErmilovThe 62e97407b4SRuslan Ermilov.Nm 63490d5836SPhilippe Charnierutility does not attempt to enforce these rules, however the system will 6448b7ea76SChris Costelloreject any attempt to set an illegal combination. 65c041c1e0SRuslan Ermilov.Bl -tag -width ".Cm clear" 66c041c1e0SRuslan Ermilov.It Cm list 6748b7ea76SChris CostelloList range slots. 68c041c1e0SRuslan Ermilov.Bl -tag -width indent 69c041c1e0SRuslan Ermilov.It Fl a 70c041c1e0SRuslan ErmilovList all range slots, even those that are inactive. 7148b7ea76SChris Costello.El 72c041c1e0SRuslan Ermilov.It Cm set 7348b7ea76SChris CostelloSet memory range attributes. 74c041c1e0SRuslan Ermilov.Bl -tag -width indent 7548b7ea76SChris Costello.It Fl b Ar base 76c041c1e0SRuslan ErmilovMemory range base address. 7748b7ea76SChris Costello.It Fl l Ar length 78c041c1e0SRuslan ErmilovLength of memory range in bytes, power of 2. 7948b7ea76SChris Costello.It Fl o Ar owner 80c041c1e0SRuslan ErmilovText identifier for this setting (7 char max). 8148b7ea76SChris Costello.It Ar attribute 8293f39ea8SDavid MaloneAttributes applied to this range; combinations of 83c041c1e0SRuslan Ermilov.Cm force , uncacheable , write-combine , write-through , write-back , 84c041c1e0SRuslan Ermilovand 85c041c1e0SRuslan Ermilov.Cm write-protect . 8648b7ea76SChris Costello.El 87c041c1e0SRuslan Ermilov.It Cm clear 88f2e366a1SSheldon HearnClear memory range attributes. 89f2e366a1SSheldon HearnRanges may be cleared by owner or by 9048b7ea76SChris Costellobase/length combination. 9148b7ea76SChris Costello.Pp 9248b7ea76SChris CostelloTo clear based on ownership: 93c041c1e0SRuslan Ermilov.Bl -tag -width indent 9448b7ea76SChris Costello.It Fl o Ar owner 95c041c1e0SRuslan ErmilovAll ranges with this owner will be cleared. 9648b7ea76SChris Costello.El 9748b7ea76SChris Costello.Pp 9848b7ea76SChris CostelloTo clear based on the base/length combination: 99c041c1e0SRuslan Ermilov.Bl -tag -width indent 10048b7ea76SChris Costello.It Fl b Ar base 101c041c1e0SRuslan ErmilovMemory range base address. 10248b7ea76SChris Costello.It Fl l Ar length 103c041c1e0SRuslan ErmilovLength of memory range in bytes, power of 2. 10448b7ea76SChris Costello.El 10548b7ea76SChris Costello.Pp 10648b7ea76SChris CostelloBase and length must exactly match an existing range. 10748b7ea76SChris Costello.El 10848b7ea76SChris Costello.Sh SEE ALSO 10948b7ea76SChris Costello.Xr mem 4 110