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.\" 2548b7ea76SChris Costello.\" $FreeBSD$ 2648b7ea76SChris Costello.\" 27c041c1e0SRuslan Ermilov.Dd September 15, 2002 2848b7ea76SChris Costello.Dt MEMCONTROL 8 29a4c37c81SRuslan Ermilov.Os 3048b7ea76SChris Costello.Sh NAME 3148b7ea76SChris Costello.Nm memcontrol 32eb083802SRuslan Ermilov.Nd "control system cache behaviour with respect to memory" 3348b7ea76SChris Costello.Sh SYNOPSIS 3448b7ea76SChris Costello.Nm 35c041c1e0SRuslan Ermilov.Cm list 3648b7ea76SChris Costello.Op Fl a 3748b7ea76SChris Costello.Nm 38c041c1e0SRuslan Ermilov.Cm set 3948b7ea76SChris Costello.Fl b Ar base 4048b7ea76SChris Costello.Fl l Ar length 4148b7ea76SChris Costello.Fl o Ar owner 4248b7ea76SChris Costello.Ar attribute 4348b7ea76SChris Costello.Nm 44c041c1e0SRuslan Ermilov.Cm clear 4548b7ea76SChris Costello.Fl o Ar owner 4648b7ea76SChris Costello.Nm 47c041c1e0SRuslan Ermilov.Cm clear 4848b7ea76SChris Costello.Fl b Ar base 4948b7ea76SChris Costello.Fl l Ar length 5048b7ea76SChris Costello.Sh DESCRIPTION 5148b7ea76SChris CostelloA number of supported system architectures allow the behaviour of the CPU 5248b7ea76SChris Costellocache to be programmed to behave differently depending on the region being 5348b7ea76SChris Costellowritten. 5448b7ea76SChris Costello.Pp 55490d5836SPhilippe CharnierThe 56490d5836SPhilippe Charnier.Nm 57490d5836SPhilippe Charnierutility 5848b7ea76SChris Costelloprovides an interface to this facility, allowing CPU cache behavior to 5948b7ea76SChris Costellobe altered for ranges of system physical memory. 6048b7ea76SChris Costello.Pp 6148b7ea76SChris CostelloThese ranges are typically power-of-2 aligned and sized, however the specific 62c041c1e0SRuslan Ermilovrules governing their layout vary between architectures. 63c041c1e0SRuslan ErmilovThe 64e97407b4SRuslan Ermilov.Nm 65490d5836SPhilippe Charnierutility does not attempt to enforce these rules, however the system will 6648b7ea76SChris Costelloreject any attempt to set an illegal combination. 67c041c1e0SRuslan Ermilov.Bl -tag -width ".Cm clear" 68c041c1e0SRuslan Ermilov.It Cm list 6948b7ea76SChris CostelloList range slots. 70c041c1e0SRuslan Ermilov.Bl -tag -width indent 71c041c1e0SRuslan Ermilov.It Fl a 72c041c1e0SRuslan ErmilovList all range slots, even those that are inactive. 7348b7ea76SChris Costello.El 74c041c1e0SRuslan Ermilov.It Cm set 7548b7ea76SChris CostelloSet memory range attributes. 76c041c1e0SRuslan Ermilov.Bl -tag -width indent 7748b7ea76SChris Costello.It Fl b Ar base 78c041c1e0SRuslan ErmilovMemory range base address. 7948b7ea76SChris Costello.It Fl l Ar length 80c041c1e0SRuslan ErmilovLength of memory range in bytes, power of 2. 8148b7ea76SChris Costello.It Fl o Ar owner 82c041c1e0SRuslan ErmilovText identifier for this setting (7 char max). 8348b7ea76SChris Costello.It Ar attribute 8493f39ea8SDavid MaloneAttributes applied to this range; combinations of 85c041c1e0SRuslan Ermilov.Cm force , uncacheable , write-combine , write-through , write-back , 86c041c1e0SRuslan Ermilovand 87c041c1e0SRuslan Ermilov.Cm write-protect . 8848b7ea76SChris Costello.El 89c041c1e0SRuslan Ermilov.It Cm clear 90f2e366a1SSheldon HearnClear memory range attributes. 91f2e366a1SSheldon HearnRanges may be cleared by owner or by 9248b7ea76SChris Costellobase/length combination. 9348b7ea76SChris Costello.Pp 9448b7ea76SChris CostelloTo clear based on ownership: 95c041c1e0SRuslan Ermilov.Bl -tag -width indent 9648b7ea76SChris Costello.It Fl o Ar owner 97c041c1e0SRuslan ErmilovAll ranges with this owner will be cleared. 9848b7ea76SChris Costello.El 9948b7ea76SChris Costello.Pp 10048b7ea76SChris CostelloTo clear based on the base/length combination: 101c041c1e0SRuslan Ermilov.Bl -tag -width indent 10248b7ea76SChris Costello.It Fl b Ar base 103c041c1e0SRuslan ErmilovMemory range base address. 10448b7ea76SChris Costello.It Fl l Ar length 105c041c1e0SRuslan ErmilovLength of memory range in bytes, power of 2. 10648b7ea76SChris Costello.El 10748b7ea76SChris Costello.Pp 10848b7ea76SChris CostelloBase and length must exactly match an existing range. 10948b7ea76SChris Costello.El 11048b7ea76SChris Costello.Sh SEE ALSO 11148b7ea76SChris Costello.Xr mem 4 112