mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
x86_64 cpu: enable SSE
This commit is contained in:
@@ -29,4 +29,15 @@ void cpu_initstate() {
|
||||
wrmsr(MSR_LSTAR, (uint64_t)arch_syscall_entry);
|
||||
wrmsr(MSR_CSTAR, 0); // no compatibility mode syscall handler
|
||||
wrmsr(MSR_FMASK, 0x200); // disable interrupts on syscall
|
||||
|
||||
// enable SSE
|
||||
asm volatile(
|
||||
"mov %%cr0, %%rax;"
|
||||
"and $0xFFFB, %%ax;"
|
||||
"or $2, %%eax;"
|
||||
"mov %%rax, %%cr0;"
|
||||
"mov %%cr4, %%rax;"
|
||||
"or $0b11000000000, %%rax;"
|
||||
"mov %%rax, %%cr4;"
|
||||
: : : "rax");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user