Fix bug in control register writing
This commit is contained in:
parent
3c29c69d14
commit
6470487f2e
|
@ -151,22 +151,22 @@ size_t ReadControlRegister(int CRX) {
|
||||||
size_t WriteControlRegister(int CRX, size_t Data) {
|
size_t WriteControlRegister(int CRX, size_t Data) {
|
||||||
switch(CRX) {
|
switch(CRX) {
|
||||||
case 0:
|
case 0:
|
||||||
__asm__ __volatile__ ("mov %[dest], %%cr0" : : [dest] "r" (Data) : );
|
__asm__ __volatile__ ("movq %[dest], %%cr0" : : [dest] "r" (Data) : );
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
__asm__ __volatile__ ("mov %[dest], %%cr1" : : [dest] "r" (Data) : );
|
__asm__ __volatile__ ("movq %[dest], %%cr1" : : [dest] "r" (Data) : );
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
__asm__ __volatile__ ("mov %[dest], %%cr2" : : [dest] "r" (Data) : );
|
__asm__ __volatile__ ("movq %[dest], %%cr2" : : [dest] "r" (Data) : );
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
__asm__ __volatile__ ("mov %[dest], %%cr3" : : [dest] "r" (Data) : );
|
__asm__ __volatile__ ("movq %[dest], %%cr3" : : [dest] "r" (Data) : );
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
__asm__ __volatile__ ("mov %[dest], %%cr4" : : [dest] "r" (Data) : );
|
__asm__ __volatile__ ("movq %[dest], %%cr4" : : [dest] "r" (Data) : );
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
__asm__ __volatile__ ("mov %[dest], %%cr8" : : [dest] "r" (Data) : );
|
__asm__ __volatile__ ("movq %[dest], %%cr8" : : [dest] "r" (Data) : );
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
__asm__ __volatile__ ("pushq %[dest]\n\t" "popfq" : : [dest] "r" (Data) : "cc");
|
__asm__ __volatile__ ("pushq %[dest]\n\t" "popfq" : : [dest] "r" (Data) : "cc");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user