Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/include Add some MSR-related calls. From Free...



details:   https://anonhg.NetBSD.org/src/rev/6d836ce2f2b7
branches:  trunk
changeset: 484065:6d836ce2f2b7
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Mar 24 19:07:12 2000 +0000

description:
Add some MSR-related calls.  From FreeBSD.

diffstat:

 sys/arch/i386/include/cpufunc.h |  23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r b16a63f4e657 -r 6d836ce2f2b7 sys/arch/i386/include/cpufunc.h
--- a/sys/arch/i386/include/cpufunc.h   Fri Mar 24 19:06:07 2000 +0000
+++ b/sys/arch/i386/include/cpufunc.h   Fri Mar 24 19:07:12 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.h,v 1.16 1998/08/15 04:57:50 mycroft Exp $     */
+/*     $NetBSD: cpufunc.h,v 1.17 2000/03/24 19:07:12 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -164,6 +164,27 @@
        __asm __volatile("pushl %0; popfl" : : "r" (ef));
 }
 
+static __inline u_int64_t
+rdmsr(u_int msr)
+{
+       u_int64_t rv;
+
+       __asm __volatile(".byte 0x0f, 0x32" : "=A" (rv) : "c" (msr));
+       return (rv);
+}
+
+static __inline void
+wrmsr(u_int msr, u_int64_t newval)
+{
+       __asm __volatile(".byte 0x0f, 0x30" : : "A" (newval), "c" (msr));
+}
+
+static __inline void
+wbinvd(void)
+{
+       __asm __volatile("wbinvd");
+}
+
 /* Break into DDB/KGDB. */
 static __inline void
 breakpoint(void)



Home | Main Index | Thread Index | Old Index