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
This commit is contained in:
parent
faa913d76d
commit
39413503a4
@ -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);"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user