Changes in kernel/arch/amd64/src/cpu/cpu.c [811770c:49e6c6b4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/cpu/cpu.c
r811770c r49e6c6b4 76 76 void cpu_setup_fpu(void) 77 77 { 78 write_cr0((read_cr0() & ~CR0_EM) | CR0_MP); 79 write_cr4(read_cr4() | CR4_OSFXSR); 78 asm volatile ( 79 "movq %%cr0, %%rax\n" 80 "btsq $1, %%rax\n" /* cr0.mp */ 81 "btrq $2, %%rax\n" /* cr0.em */ 82 "movq %%rax, %%cr0\n" 83 84 "movq %%cr4, %%rax\n" 85 "bts $9, %%rax\n" /* cr4.osfxsr */ 86 "movq %%rax, %%cr4\n" 87 ::: "%rax" 88 ); 80 89 } 81 90 … … 88 97 void fpu_disable(void) 89 98 { 90 write_cr0(read_cr0() | CR0_TS); 99 asm volatile ( 100 "mov %%cr0, %%rax\n" 101 "bts $3, %%rax\n" 102 "mov %%rax, %%cr0\n" 103 ::: "%rax" 104 ); 91 105 } 92 106 93 107 void fpu_enable(void) 94 108 { 95 write_cr0(read_cr0() & ~CR0_TS); 109 asm volatile ( 110 "mov %%cr0, %%rax\n" 111 "btr $3, %%rax\n" 112 "mov %%rax, %%cr0\n" 113 ::: "%rax" 114 ); 96 115 } 97 116
Note:
See TracChangeset
for help on using the changeset viewer.