1c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/**************************************************************************** 2c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner **************************************************************************** 3c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner *** 4c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner *** This header was automatically generated from a Linux kernel header 5c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner *** of the same name, to make information necessary for userspace to 6c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner *** call into the kernel available to libc. It contains only constants, 7c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner *** structures, and macros generated from the original header, and thus, 8c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner *** contains no copyrightable information. 9c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner *** 1029539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh *** To edit the content of this header, modify the corresponding 1129539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh *** source file (e.g. under external/kernel-headers/original/) then 1229539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh *** run bionic/libc/kernel/tools/update_all.py 1329539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh *** 1429539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh *** Any manual change here will be lost the next time this script will 1529539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh *** be run. You've been warned! 1629539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh *** 17c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner **************************************************************************** 18c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ****************************************************************************/ 19c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#ifndef _I386_TLBFLUSH_H 20c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define _I386_TLBFLUSH_H 21c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#include <linux/mm.h> 22c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#include <asm/processor.h> 2329539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define __flush_tlb() __native_flush_tlb() 25c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define __flush_tlb_global() __native_flush_tlb_global() 26c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define __flush_tlb_single(addr) __native_flush_tlb_single(addr) 27c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#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) 2829539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#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) 30c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define __native_flush_tlb_single(addr) __asm__ __volatile__("invlpg (%0)" ::"r" (addr) : "memory") 31c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define __flush_tlb_all() do { if (cpu_has_pge) __flush_tlb_global(); else __flush_tlb(); } while (0) 32c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define cpu_has_invlpg (boot_cpu_data.x86 > 3) 3329539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define __flush_tlb_one(addr) do { if (cpu_has_invlpg) __flush_tlb_single(addr); else __flush_tlb(); } while (0) 35c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define TLB_FLUSH_ALL 0xffffffff 36c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#include <linux/sched.h> 37c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define flush_tlb() __flush_tlb() 3829539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define flush_tlb_all() __flush_tlb_all() 40c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define local_flush_tlb() __flush_tlb() 41c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define flush_tlb_others(mask, mm, va) native_flush_tlb_others(&mask, mm, va) 42c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#endif 4329539e93c9d8dfe03934458288597a12e5ed3693Andrew Hsieh/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44