1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef _I386_TLBFLUSH_H
13 #define _I386_TLBFLUSH_H
16 #include <asm/processor.h>
18 #define __flush_tlb() __native_flush_tlb()
19 #define __flush_tlb_global() __native_flush_tlb_global()
20 #define __flush_tlb_single(addr) __native_flush_tlb_single(addr)
22 #define __native_flush_tlb() do { unsigned int tmpreg; __asm__ __volatile__( "movl %%cr3, %0; \n" "movl %0, %%cr3; # flush TLB \n" : "=r" (tmpreg) :: "memory"); } while (0)
24 #define __native_flush_tlb_global() do { unsigned int tmpreg, cr4, cr4_orig; __asm__ __volatile__( "movl %%cr4, %2; # turn off PGE \n" "movl %2, %1; \n" "andl %3, %1; \n" "movl %1, %%cr4; \n" "movl %%cr3, %0; \n" "movl %0, %%cr3; # flush TLB \n" "movl %2, %%cr4; # turn PGE back on \n" : "=&r" (tmpreg), "=&r" (cr4), "=&r" (cr4_orig) : "i" (~X86_CR4_PGE) : "memory"); } while (0)
26 #define __native_flush_tlb_single(addr) __asm__ __volatile__("invlpg (%0)" ::"r" (addr) : "memory")
28 #define __flush_tlb_all() do { if (cpu_has_pge) __flush_tlb_global(); else __flush_tlb(); } while (0)
30 #define cpu_has_invlpg (boot_cpu_data.x86 > 3)
32 #define __flush_tlb_one(addr) do { if (cpu_has_invlpg) __flush_tlb_single(addr); else __flush_tlb(); } while (0)
34 #define TLB_FLUSH_ALL 0xffffffff
36 #include <linux/sched.h>
38 #define flush_tlb() __flush_tlb()
39 #define flush_tlb_all() __flush_tlb_all()
40 #define local_flush_tlb() __flush_tlb()
42 #define flush_tlb_others(mask, mm, va) native_flush_tlb_others(&mask, mm, va)