Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/identcpu.c
Show First 20 Lines • Show All 1,196 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Special exception 6 handler. | * Special exception 6 handler. | ||||
* The rdmsr instruction generates invalid opcodes fault on 486-class | * The rdmsr instruction generates invalid opcodes fault on 486-class | ||||
* Cyrix CPU. Stacked eip register points the rdmsr instruction in the | * Cyrix CPU. Stacked eip register points the rdmsr instruction in the | ||||
* function identblue() when this handler is called. Stacked eip should | * function identblue() when this handler is called. Stacked eip should | ||||
* be advanced. | * be advanced. | ||||
*/ | */ | ||||
inthand_t bluetrap6; | inthand_t bluetrap6; | ||||
#ifdef __GNUCLIKE_ASM | |||||
__asm | __asm | ||||
(" \n\ | (" \n\ | ||||
.text \n\ | .text \n\ | ||||
.p2align 2,0x90 \n\ | .p2align 2,0x90 \n\ | ||||
.type " __XSTRING(CNAME(bluetrap6)) ",@function \n\ | .type " __XSTRING(CNAME(bluetrap6)) ",@function \n\ | ||||
" __XSTRING(CNAME(bluetrap6)) ": \n\ | " __XSTRING(CNAME(bluetrap6)) ": \n\ | ||||
ss \n\ | ss \n\ | ||||
movl $0xa8c1d," __XSTRING(CNAME(trap_by_rdmsr)) " \n\ | movl $0xa8c1d," __XSTRING(CNAME(trap_by_rdmsr)) " \n\ | ||||
addl $2, (%esp) /* rdmsr is a 2-byte instruction */ \n\ | addl $2, (%esp) /* rdmsr is a 2-byte instruction */ \n\ | ||||
iret \n\ | iret \n\ | ||||
"); | "); | ||||
#endif | |||||
/* | /* | ||||
* Special exception 13 handler. | * Special exception 13 handler. | ||||
* Accessing non-existent MSR generates general protection fault. | * Accessing non-existent MSR generates general protection fault. | ||||
*/ | */ | ||||
inthand_t bluetrap13; | inthand_t bluetrap13; | ||||
#ifdef __GNUCLIKE_ASM | |||||
__asm | __asm | ||||
(" \n\ | (" \n\ | ||||
.text \n\ | .text \n\ | ||||
.p2align 2,0x90 \n\ | .p2align 2,0x90 \n\ | ||||
.type " __XSTRING(CNAME(bluetrap13)) ",@function \n\ | .type " __XSTRING(CNAME(bluetrap13)) ",@function \n\ | ||||
" __XSTRING(CNAME(bluetrap13)) ": \n\ | " __XSTRING(CNAME(bluetrap13)) ": \n\ | ||||
ss \n\ | ss \n\ | ||||
movl $0xa89c4," __XSTRING(CNAME(trap_by_rdmsr)) " \n\ | movl $0xa89c4," __XSTRING(CNAME(trap_by_rdmsr)) " \n\ | ||||
popl %eax /* discard error code */ \n\ | popl %eax /* discard error code */ \n\ | ||||
addl $2, (%esp) /* rdmsr is a 2-byte instruction */ \n\ | addl $2, (%esp) /* rdmsr is a 2-byte instruction */ \n\ | ||||
iret \n\ | iret \n\ | ||||
"); | "); | ||||
#endif | |||||
/* | /* | ||||
* Distinguish IBM Blue Lightning CPU from Cyrix CPUs that does not | * Distinguish IBM Blue Lightning CPU from Cyrix CPUs that does not | ||||
* support cpuid instruction. This function should be called after | * support cpuid instruction. This function should be called after | ||||
* loading interrupt descriptor table register. | * loading interrupt descriptor table register. | ||||
* | * | ||||
* I don't like this method that handles fault, but I couldn't get | * I don't like this method that handles fault, but I couldn't get | ||||
* information for any other methods. Does blue giant know? | * information for any other methods. Does blue giant know? | ||||
▲ Show 20 Lines • Show All 1,429 Lines • Show Last 20 Lines |