Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add x86_msr_xcall(9).
details: https://anonhg.NetBSD.org/src/rev/4516458afaa9
branches: trunk
changeset: 757243:4516458afaa9
user: jruoho <jruoho%NetBSD.org@localhost>
date: Sat Aug 21 10:11:34 2010 +0000
description:
Add x86_msr_xcall(9).
diffstat:
distrib/sets/lists/comp/mi | 5 +-
share/man/man9/Makefile | 4 +-
share/man/man9/man9.x86/Makefile | 7 ++
share/man/man9/man9.x86/x86_msr_xcall.9 | 97 +++++++++++++++++++++++++++++++++
4 files changed, 110 insertions(+), 3 deletions(-)
diffs (163 lines):
diff -r d828e7387934 -r 4516458afaa9 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi Sat Aug 21 09:16:28 2010 +0000
+++ b/distrib/sets/lists/comp/mi Sat Aug 21 10:11:34 2010 +0000
@@ -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
diff -r d828e7387934 -r 4516458afaa9 share/man/man9/Makefile
--- a/share/man/man9/Makefile Sat Aug 21 09:16:28 2010 +0000
+++ b/share/man/man9/Makefile Sat Aug 21 10:11:34 2010 +0000
@@ -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>
diff -r d828e7387934 -r 4516458afaa9 share/man/man9/man9.x86/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man9/man9.x86/Makefile Sat Aug 21 10:11:34 2010 +0000
@@ -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>
diff -r d828e7387934 -r 4516458afaa9 share/man/man9/man9.x86/x86_msr_xcall.9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man9/man9.x86/x86_msr_xcall.9 Sat Aug 21 10:11:34 2010 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index