2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #include <linux/sched.h>
10 #include <asm/tlbflush.h>
13 struct vm_area_struct *ta_vma;
14 unsigned long ta_start;
18 static inline void ipi_flush_tlb_all(void *ignored)
20 local_flush_tlb_all();
23 static inline void ipi_flush_tlb_mm(void *arg)
25 struct mm_struct *mm = (struct mm_struct *)arg;
27 local_flush_tlb_mm(mm);
30 static inline void ipi_flush_tlb_page(void *arg)
32 struct tlb_args *ta = (struct tlb_args *)arg;
34 local_flush_tlb_page(ta->ta_vma, ta->ta_start);
37 static inline void ipi_flush_tlb_range(void *arg)
39 struct tlb_args *ta = (struct tlb_args *)arg;
41 local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end);
44 static inline void ipi_flush_tlb_kernel_range(void *arg)
46 struct tlb_args *ta = (struct tlb_args *)arg;
48 local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end);
51 void flush_tlb_all(void)
53 on_each_cpu(ipi_flush_tlb_all, NULL, 1);
56 void flush_tlb_mm(struct mm_struct *mm)
58 on_each_cpu_mask(mm_cpumask(mm), ipi_flush_tlb_mm, mm, 1);
61 void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
66 on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_page, &ta, 1);
69 void flush_tlb_range(struct vm_area_struct *vma,
70 unsigned long start, unsigned long end)
76 on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_range, &ta, 1);
79 void flush_tlb_kernel_range(unsigned long start, unsigned long end)
84 on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1);