- Implement RtlPrefectMemoryNonTemporal. Patch by Patrick Baggett <baggett.patrick...
[reactos.git] / reactos / ntoskrnl / ke / i386 / tlbflush.S
1 /*
2 * i386-specific implemetation of Translation Buffer Flushing
3 * Written By: Alex Ionescu <alex@relsoft.net>
4 * Reference: IA-32 IntelĀ® Architecture Software Developer's Manual, Volume 3: System Programming Guide,
5 * Chapter 10 - Memory Cache Control. Section 10.9 - Invalidating the Translation Lookaside Buffers
6 */
7
8 #include <internal/i386/ke.h>
9
10
11 .globl _KeFlushCurrentTb@0
12 _KeFlushCurrentTb@0:
13 /* Check for global page support */
14 testb $0xff, (_Ke386GlobalPagesEnabled)
15 jz .L1
16
17 /* Modifying the PSE, PGE or PAE Flag in CR4 causes the TLB to be flushed */
18 movl %cr4, %eax
19 andl $~X86_CR4_PGE, %eax
20 movl %eax, %cr4
21 orl $X86_CR4_PGE, %eax
22 movl %eax, %cr4
23 ret
24
25 .L1:
26 /* the old way ... */
27 movl %cr3, %eax
28 movl %eax, %cr3
29 ret