The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 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. |
| 9 | *** |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _I386_TLBFLUSH_H |
| 20 | #define _I386_TLBFLUSH_H |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 21 | #include <linux/mm.h> |
| 22 | #include <asm/processor.h> |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 23 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 24 | #define __flush_tlb() __native_flush_tlb() |
| 25 | #define __flush_tlb_global() __native_flush_tlb_global() |
| 26 | #define __flush_tlb_single(addr) __native_flush_tlb_single(addr) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 27 | #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) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 28 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 29 | #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) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 30 | #define __native_flush_tlb_single(addr) __asm__ __volatile__("invlpg (%0)" ::"r" (addr) : "memory") |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 31 | #define __flush_tlb_all() do { if (cpu_has_pge) __flush_tlb_global(); else __flush_tlb(); } while (0) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 32 | #define cpu_has_invlpg (boot_cpu_data.x86 > 3) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 33 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 34 | #define __flush_tlb_one(addr) do { if (cpu_has_invlpg) __flush_tlb_single(addr); else __flush_tlb(); } while (0) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 35 | #define TLB_FLUSH_ALL 0xffffffff |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 36 | #include <linux/sched.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 37 | #define flush_tlb() __flush_tlb() |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 38 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 39 | #define flush_tlb_all() __flush_tlb_all() |
| 40 | #define local_flush_tlb() __flush_tlb() |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 41 | #define flush_tlb_others(mask, mm, va) native_flush_tlb_others(&mask, mm, va) |
| 42 | #endif |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 43 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |