diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2003-05-27 23:52:02 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2003-05-27 23:52:02 +0000 |
commit | 7a731a1fe6524c31ce7f6e8fecd60489379c6daf (patch) | |
tree | 00251abe7338d48a80bbc0279c93255f57a32969 /sys/arch | |
parent | 70241e466fecebe64b70cf3856dcb01af8d7d01b (diff) |
change .byte for the correct opcodes now that gas can handle'em.
art@ toby@ ok.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/i386/longrun.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/microtime.s | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/pctr.c | 10 | ||||
-rw-r--r-- | sys/arch/i386/include/cpu.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/include/cpufunc.h | 6 | ||||
-rw-r--r-- | sys/arch/i386/include/pctr.h | 10 | ||||
-rw-r--r-- | sys/arch/i386/isa/clock.c | 6 |
8 files changed, 25 insertions, 25 deletions
diff --git a/sys/arch/i386/i386/longrun.c b/sys/arch/i386/i386/longrun.c index 239a1fda324..51e1fc2b036 100644 --- a/sys/arch/i386/i386/longrun.c +++ b/sys/arch/i386/i386/longrun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: longrun.c,v 1.2 2003/05/26 08:30:03 tedu Exp $ */ +/* $OpenBSD: longrun.c,v 1.3 2003/05/27 23:52:01 fgsch Exp $ */ /* * Copyright (c) 2003 Ted Unangst * Copyright (c) 2001 Tamotsu Hattori @@ -126,7 +126,7 @@ static void longrun_readreg(u_int32_t ax, u_int32_t *regs) { __asm __volatile( - ".byte 0x0f, 0xa2;" + "cpuid;" "movl %%eax, 0(%2);" "movl %%ebx, 4(%2);" "movl %%ecx, 8(%2);" diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index f3f4099b901..f6541028e97 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.232 2003/05/18 02:43:12 andreas Exp $ */ +/* $OpenBSD: machdep.c,v 1.233 2003/05/27 23:52:01 fgsch Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -1219,11 +1219,11 @@ intel686_cpu_setup(cpu_device, model, step) #define rdmsr(msr) \ ({ \ u_quad_t 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)); /* * Original PPro returns SYSCALL in CPUID but is non-functional. diff --git a/sys/arch/i386/i386/microtime.s b/sys/arch/i386/i386/microtime.s index 718f20842b7..6d46c2cbeb3 100644 --- a/sys/arch/i386/i386/microtime.s +++ b/sys/arch/i386/i386/microtime.s @@ -1,4 +1,4 @@ -/* $OpenBSD: microtime.s,v 1.17 2003/04/17 03:42:14 drahn Exp $ */ +/* $OpenBSD: microtime.s,v 1.18 2003/05/27 23:52:01 fgsch Exp $ */ /* $NetBSD: microtime.s,v 1.16 1995/04/17 12:06:47 cgd Exp $ */ /*- @@ -149,7 +149,7 @@ common_microtime: pentium_microtime: pushfl cli - .byte 0x0f, 0x31 # RDTSC + rdtsc subl _C_LABEL(pentium_base_tsc),%eax sbbl _C_LABEL(pentium_base_tsc)+4,%edx /* diff --git a/sys/arch/i386/i386/pctr.c b/sys/arch/i386/i386/pctr.c index 72c2122af30..d8a171bdce5 100644 --- a/sys/arch/i386/i386/pctr.c +++ b/sys/arch/i386/i386/pctr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pctr.c,v 1.15 2002/03/14 01:26:32 millert Exp $ */ +/* $OpenBSD: pctr.c,v 1.16 2003/05/27 23:52:01 fgsch Exp $ */ /* * Pentium performance counter driver for OpenBSD. @@ -55,16 +55,16 @@ pctrattach (num) if (usep6ctr) /* Enable RDTSC and RDPMC instructions from user-level. */ - __asm __volatile (".byte 0xf,0x20,0xe0 # movl %%cr4,%%eax\n" + __asm __volatile ("movl %%cr4,%%eax\n" "\tandl %0,%%eax\n" "\torl %1,%%eax\n" - "\t.byte 0xf,0x22,0xe0 # movl %%cr4,%%eax" + "\tmovl %%cr4,%%eax" :: "i" (~CR4_TSD), "i" (CR4_PCE) : "eax"); else if (usetsc) /* Enable RDTSC instruction from user-level. */ - __asm __volatile (".byte 0xf,0x20,0xe0 # movl %%cr4,%%eax\n" + __asm __volatile ("movl %%cr4,%%eax\n" "\tandl %0,%%eax\n" - "\t.byte 0xf,0x22,0xe0 # movl %%cr4,%%eax" + "\tmovl %%cr4,%%eax" :: "i" (~CR4_TSD) : "eax"); if (usep6ctr) 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_ */ diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c index 7fdb55e9435..52bfc4c82c7 100644 --- a/sys/arch/i386/isa/clock.c +++ b/sys/arch/i386/isa/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.28 2002/07/06 19:14:20 nordin Exp $ */ +/* $OpenBSD: clock.c,v 1.29 2003/05/27 23:52:01 fgsch Exp $ */ /* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */ /*- @@ -451,9 +451,9 @@ calibrate_cyclecounter() { unsigned long long count, last_count; - __asm __volatile(".byte 0xf, 0x31" : "=A" (last_count)); + __asm __volatile("rdtsc" : "=A" (last_count)); delay(1000000); - __asm __volatile(".byte 0xf, 0x31" : "=A" (count)); + __asm __volatile("rdtsc" : "=A" (count)); pentium_mhz = ((count - last_count) + 500000) / 1000000; } #endif |