diff options
author | markm <markm@FreeBSD.org> | 2000-11-21 20:16:49 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2000-11-21 20:16:49 +0000 |
commit | a3da3ab72cd06286d3802b38bba4ee1edd58dfb3 (patch) | |
tree | 89345673900e85f3d00809180810f91d1362b5d3 /sys/amd64 | |
parent | ae30fcfec826cbc1aef366e520ae248267e5ac2e (diff) | |
download | FreeBSD-src-a3da3ab72cd06286d3802b38bba4ee1edd58dfb3.zip FreeBSD-src-a3da3ab72cd06286d3802b38bba4ee1edd58dfb3.tar.gz |
Assembler fixes.
Fix opcodes that were typed as ".byte 0xNN, 0xMM" when an older
assembler could not recognise the newer Pentium instructions.
Reviewed by: jhb
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/identcpu.c | 2 | ||||
-rw-r--r-- | sys/amd64/amd64/locore.S | 4 | ||||
-rw-r--r-- | sys/amd64/amd64/locore.s | 4 | ||||
-rw-r--r-- | sys/amd64/include/cpufunc.h | 8 |
4 files changed, 9 insertions, 9 deletions
diff --git a/sys/amd64/amd64/identcpu.c b/sys/amd64/amd64/identcpu.c index d1559be..230675f 100644 --- a/sys/amd64/amd64/identcpu.c +++ b/sys/amd64/amd64/identcpu.c @@ -112,7 +112,7 @@ static void do_cpuid(u_int ax, u_int *p) { __asm __volatile( - ".byte 0x0f, 0xa2;" + "cpuid;" "movl %%eax, (%2);" "movl %%ebx, 4(%2);" "movl %%ecx, 8(%2);" diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index f3e4cde..08aada2 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -661,7 +661,7 @@ trycyrix: trycpuid: /* Use the `cpuid' instruction. */ xorl %eax,%eax - .byte 0x0f,0xa2 # cpuid 0 + cpuid # cpuid 0 movl %eax,R(_cpu_high) # highest capability movl %ebx,R(_cpu_vendor) # store vendor string movl %edx,R(_cpu_vendor+4) @@ -669,7 +669,7 @@ trycpuid: /* Use the `cpuid' instruction. */ movb $0,R(_cpu_vendor+12) movl $1,%eax - .byte 0x0f,0xa2 # cpuid 1 + cpuid # cpuid 1 movl %eax,R(_cpu_id) # store cpu_id movl %edx,R(_cpu_feature) # store cpu_feature rorl $8,%eax # extract family type diff --git a/sys/amd64/amd64/locore.s b/sys/amd64/amd64/locore.s index f3e4cde..08aada2 100644 --- a/sys/amd64/amd64/locore.s +++ b/sys/amd64/amd64/locore.s @@ -661,7 +661,7 @@ trycyrix: trycpuid: /* Use the `cpuid' instruction. */ xorl %eax,%eax - .byte 0x0f,0xa2 # cpuid 0 + cpuid # cpuid 0 movl %eax,R(_cpu_high) # highest capability movl %ebx,R(_cpu_vendor) # store vendor string movl %edx,R(_cpu_vendor+4) @@ -669,7 +669,7 @@ trycpuid: /* Use the `cpuid' instruction. */ movb $0,R(_cpu_vendor+12) movl $1,%eax - .byte 0x0f,0xa2 # cpuid 1 + cpuid # cpuid 1 movl %eax,R(_cpu_id) # store cpu_id movl %edx,R(_cpu_feature) # store cpu_feature rorl $8,%eax # extract family type diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index fef36e0..8941ba1 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -379,7 +379,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); } @@ -388,7 +388,7 @@ rdpmc(u_int pmc) { u_int64_t rv; - __asm __volatile(".byte 0x0f, 0x33" : "=A" (rv) : "c" (pmc)); + __asm __volatile("rdpmc" : "=A" (rv) : "c" (pmc)); return (rv); } @@ -397,7 +397,7 @@ rdtsc(void) { u_int64_t rv; - __asm __volatile(".byte 0x0f, 0x31" : "=A" (rv)); + __asm __volatile("rdtsc" : "=A" (rv)); return (rv); } @@ -416,7 +416,7 @@ write_eflags(u_int ef) 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_int |