summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r--sys/arch/i386/include/cpu.h4
-rw-r--r--sys/arch/i386/include/cpufunc.h6
-rw-r--r--sys/arch/i386/include/pctr.h10
3 files changed, 10 insertions, 10 deletions
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h
index 9b6894f0c44..fa22463d0b3 100644
--- a/sys/arch/i386/include/cpu.h
+++ b/sys/arch/i386/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.47 2003/05/14 22:08:04 tedu Exp $ */
+/* $OpenBSD: cpu.h,v 1.48 2003/05/27 23:52:01 fgsch Exp $ */
/* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */
/*-
@@ -105,7 +105,7 @@ extern u_quad_t pentium_base_tsc;
do { \
if (pentium_mhz) { \
__asm __volatile("cli\n" \
- ".byte 0xf, 0x31\n" \
+ "rdtsc\n" \
"sti\n" \
: "=A" (pentium_base_tsc) \
: ); \
diff --git a/sys/arch/i386/include/cpufunc.h b/sys/arch/i386/include/cpufunc.h
index b7c039ab585..193c12e829e 100644
--- a/sys/arch/i386/include/cpufunc.h
+++ b/sys/arch/i386/include/cpufunc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpufunc.h,v 1.8 2002/03/14 01:26:33 millert Exp $ */
+/* $OpenBSD: cpufunc.h,v 1.9 2003/05/27 23:52:01 fgsch Exp $ */
/* $NetBSD: cpufunc.h,v 1.8 1994/10/27 04:15:59 cgd Exp $ */
/*
@@ -171,7 +171,7 @@ wbinvd(void)
static __inline void
wrmsr(u_int msr, u_int64_t newval)
{
- __asm __volatile(".byte 0x0f, 0x30" : : "A" (newval), "c" (msr));
+ __asm __volatile("wrmsr" : : "A" (newval), "c" (msr));
}
static __inline u_int64_t
@@ -179,7 +179,7 @@ rdmsr(u_int msr)
{
u_int64_t rv;
- __asm __volatile(".byte 0x0f, 0x32" : "=A" (rv) : "c" (msr));
+ __asm __volatile("rdmsr" : "=A" (rv) : "c" (msr));
return (rv);
}
diff --git a/sys/arch/i386/include/pctr.h b/sys/arch/i386/include/pctr.h
index 3e0b6cf428c..3deb3e47582 100644
--- a/sys/arch/i386/include/pctr.h
+++ b/sys/arch/i386/include/pctr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pctr.h,v 1.11 2001/06/05 05:05:38 pvalchev Exp $ */
+/* $OpenBSD: pctr.h,v 1.12 2003/05/27 23:52:01 fgsch Exp $ */
/*
* Pentium performance counter driver for OpenBSD.
@@ -56,7 +56,7 @@ struct pctrst {
#define rdtsc() \
({ \
pctrval v; \
- __asm __volatile (".byte 0xf, 0x31" : "=A" (v)); \
+ __asm __volatile ("rdtsc" : "=A" (v)); \
v; \
})
@@ -64,7 +64,7 @@ struct pctrst {
#define rdpmc(ctr) \
({ \
pctrval v; \
- __asm __volatile (".byte 0xf, 0x33\n" \
+ __asm __volatile ("rdpmc\n" \
"\tandl $0xff, %%edx" \
: "=A" (v) : "c" (ctr)); \
v; \
@@ -75,12 +75,12 @@ struct pctrst {
#define rdmsr(msr) \
({ \
pctrval v; \
- __asm __volatile (".byte 0xf, 0x32" : "=A" (v) : "c" (msr)); \
+ __asm __volatile ("rdmsr" : "=A" (v) : "c" (msr)); \
v; \
})
#define wrmsr(msr, v) \
- __asm __volatile (".byte 0xf, 0x30" :: "A" ((u_quad_t) (v)), "c" (msr));
+ __asm __volatile ("wrmsr" :: "A" ((u_quad_t) (v)), "c" (msr));
#endif /* _KERNEL */
#endif /* ! _I386_PCTR_H_ */