Lines 35-42
Link Here
|
35 |
unsigned long cr0 = read_cr0(); |
35 |
unsigned long cr0 = read_cr0(); |
36 |
write_cr0(((cr0 & (0xdfffffff)) | 0x40000000)); |
36 |
write_cr0(((cr0 & (0xdfffffff)) | 0x40000000)); |
37 |
wbinvd(); |
37 |
wbinvd(); |
|
|
38 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0) |
38 |
*cr4 = read_cr4(); |
39 |
*cr4 = read_cr4(); |
39 |
if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80); |
40 |
if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80); |
|
|
41 |
#else |
42 |
*cr4 = __read_cr4(); |
43 |
if (*cr4 & 0x80) __write_cr4(*cr4 & ~0x80); |
44 |
#endif |
40 |
__flush_tlb(); |
45 |
__flush_tlb(); |
41 |
} |
46 |
} |
42 |
|
47 |
|
Lines 46-52
Link Here
|
46 |
wbinvd(); |
51 |
wbinvd(); |
47 |
__flush_tlb(); |
52 |
__flush_tlb(); |
48 |
write_cr0((cr0 & 0x9fffffff)); |
53 |
write_cr0((cr0 & 0x9fffffff)); |
|
|
54 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0) |
49 |
if (cr4 & 0x80) write_cr4(cr4); |
55 |
if (cr4 & 0x80) write_cr4(cr4); |
|
|
56 |
#else |
57 |
if (cr4 & 0x80) __write_cr4(cr4); |
58 |
#endif |
50 |
} |
59 |
} |
51 |
|
60 |
|
52 |
static int nv_determine_pat_mode(void) |
61 |
static int nv_determine_pat_mode(void) |