Module Name: src Committed By: jruoho Date: Sat Aug 21 10:11:35 UTC 2010
Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man9: Makefile Added Files: src/share/man/man9/man9.x86: Makefile x86_msr_xcall.9 Log Message: Add x86_msr_xcall(9). To generate a diff of this commit: cvs rdiff -u -r1.1496 -r1.1497 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.340 -r1.341 src/share/man/man9/Makefile cvs rdiff -u -r0 -r1.1 src/share/man/man9/man9.x86/Makefile \ src/share/man/man9/man9.x86/x86_msr_xcall.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1496 src/distrib/sets/lists/comp/mi:1.1497 --- src/distrib/sets/lists/comp/mi:1.1496 Wed Aug 11 18:46:32 2010 +++ src/distrib/sets/lists/comp/mi Sat Aug 21 10:11:34 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1496 2010/08/11 18:46:32 pgoyette Exp $ +# $NetBSD: mi,v 1.1497 2010/08/21 10:11:34 jruoho Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -10011,6 +10011,7 @@ ./usr/share/man/cat9/wsmouse.0 comp-sys-catman .cat ./usr/share/man/cat9/wsmouse_input.0 comp-sys-catman .cat ./usr/share/man/cat9/wsmousedevprint.0 comp-sys-catman .cat +./usr/share/man/cat9/x86/x86_msr_xcall.0 comp-sys-catman .cat ./usr/share/man/cat9/xc_broadcast.0 comp-sys-catman .cat ./usr/share/man/cat9/xc_unicast.0 comp-sys-catman .cat ./usr/share/man/cat9/xc_wait.0 comp-sys-catman .cat @@ -15764,6 +15765,7 @@ ./usr/share/man/html9/wsmouse.html comp-sys-htmlman html ./usr/share/man/html9/wsmouse_input.html comp-sys-htmlman html ./usr/share/man/html9/wsmousedevprint.html comp-sys-htmlman html +./usr/share/man/html9/x86/x86_msr_xcall.html comp-sys-htmlman html ./usr/share/man/html9/xc_broadcast.html comp-sys-htmlman html ./usr/share/man/html9/xc_unicast.html comp-sys-htmlman html ./usr/share/man/html9/xc_wait.html comp-sys-htmlman html @@ -21776,6 +21778,7 @@ ./usr/share/man/man9/wsmouse.9 comp-sys-man .man ./usr/share/man/man9/wsmouse_input.9 comp-sys-man .man ./usr/share/man/man9/wsmousedevprint.9 comp-sys-man .man +./usr/share/man/man9/x86/x86_msr_xcall.9 comp-sys-man .man ./usr/share/man/man9/xc_broadcast.9 comp-sys-man .man ./usr/share/man/man9/xc_unicast.9 comp-sys-man .man ./usr/share/man/man9/xc_wait.9 comp-sys-man .man Index: src/share/man/man9/Makefile diff -u src/share/man/man9/Makefile:1.340 src/share/man/man9/Makefile:1.341 --- src/share/man/man9/Makefile:1.340 Wed Aug 11 18:20:09 2010 +++ src/share/man/man9/Makefile Sat Aug 21 10:11:35 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.340 2010/08/11 18:20:09 pgoyette Exp $ +# $NetBSD: Makefile,v 1.341 2010/08/21 10:11:35 jruoho Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -921,7 +921,7 @@ xcall.9 xc_unicast.9 \ xcall.9 xc_wait.9 -SUBDIR= man9.i386 man9.sun3 +SUBDIR= man9.i386 man9.sun3 man9.x86 .include <bsd.man.mk> .include <bsd.subdir.mk> Added files: Index: src/share/man/man9/man9.x86/Makefile diff -u /dev/null src/share/man/man9/man9.x86/Makefile:1.1 --- /dev/null Sat Aug 21 10:11:36 2010 +++ src/share/man/man9/man9.x86/Makefile Sat Aug 21 10:11:35 2010 @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.1 2010/08/21 10:11:35 jruoho Exp $ + +MAN= x86_msr_xcall.9 + +MANSUBDIR=/x86 + +.include <bsd.man.mk> Index: src/share/man/man9/man9.x86/x86_msr_xcall.9 diff -u /dev/null src/share/man/man9/man9.x86/x86_msr_xcall.9:1.1 --- /dev/null Sat Aug 21 10:11:36 2010 +++ src/share/man/man9/man9.x86/x86_msr_xcall.9 Sat Aug 21 10:11:35 2010 @@ -0,0 +1,97 @@ +.\" $NetBSD: x86_msr_xcall.9,v 1.1 2010/08/21 10:11:35 jruoho Exp $ +.\" +.\" Copyright (c) 2010 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Jukka Ruohonen. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT 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 SUCH DAMAGE. +.\" +.Dd August 21, 2010 +.Dt x86_msr_xcall 9 +.Os +.Sh NAME +.Nm x86_msr_xcall +.Nd MSR specific cross-call +.Sh SYNOPSIS +.In x86/cpu_msr.h +.Ft void +.Fn x86_msr_xcall "void *arg1" "void *arg1" +.Sh DESCRIPTION +The +.Fn x86_msr_xcall +function provides a x86-specific IPI handler suitable for use with the +.Xr xcall 9 +interface. +It can be used to ensure that a given +.Tn MSR +call is executed on all processors. +The prototype follows the +.Ft xcfunc_t +function pointer type and the opaque +.Fa arg1 +pointer is casted to the following structure: +.Bd -literal -offset indent +struct msr_rw_info { + int msr_read; + int msr_type; + uint64_t msr_value; + uint64_t msr_mask; +}; +.Ed +.Pp +This structure must be filled prior to the call. +Two fields are compulsory: +.Fa msr_type +is used as the address of the +.Tn MSR +and +.Fa msr_value +is the value to be written. +If +.Fa msr_read +is not zero, +.Fn x86_msr_xcall +will first read from +.Fa msr_type +and then clear the mask specified in +.Fa msr_mask +before the write operation. +.Sh EXAMPLES +The following example writes a value zero to the +.Tn MSR_THERM_CONTROL +model-specific register on all processors in the system: +.Bd -literal -offset indent +struct msr_rw_info msr; +uint64_t xc; + +msr.msr_value = 0; +msr.msr_read = true; +msr.msr_type = MSR_THERM_CONTROL; +msr.msr_mask = 0x1e; + +xc = xc_broadcast(0, (xcfunc_t)x86_msr_xcall, &msr, NULL); +xc_wait(xc); +.Ed +.Sh SEE ALSO +.Xr xcall 9