ia64/xen-unstable

view linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/tlbflush.h @ 8534:da7873110bbb

Tiny bootstrap cleanup.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Jan 09 19:46:46 2006 +0100 (2006-01-09)
parents 06d84bf87159
children
line source
1 #ifndef _X8664_TLBFLUSH_H
2 #define _X8664_TLBFLUSH_H
4 #include <linux/config.h>
5 #include <linux/mm.h>
6 #include <asm/processor.h>
8 #define __flush_tlb() xen_tlb_flush()
10 /*
11 * Global pages have to be flushed a bit differently. Not a real
12 * performance problem because this does not happen often.
13 */
14 #define __flush_tlb_global() xen_tlb_flush()
17 extern unsigned long pgkern_mask;
19 #define __flush_tlb_all() __flush_tlb_global()
21 #define __flush_tlb_one(addr) xen_invlpg((unsigned long)addr)
24 /*
25 * TLB flushing:
26 *
27 * - flush_tlb() flushes the current mm struct TLBs
28 * - flush_tlb_all() flushes all processes TLBs
29 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
30 * - flush_tlb_page(vma, vmaddr) flushes one page
31 * - flush_tlb_range(vma, start, end) flushes a range of pages
32 * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
33 * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
34 *
35 * ..but the x86_64 has somewhat limited tlb flushing capabilities,
36 * and page-granular flushes are available only on i486 and up.
37 */
39 #ifndef CONFIG_SMP
41 #define flush_tlb() __flush_tlb()
42 #define flush_tlb_all() __flush_tlb_all()
43 #define local_flush_tlb() __flush_tlb()
45 static inline void flush_tlb_mm(struct mm_struct *mm)
46 {
47 if (mm == current->active_mm)
48 __flush_tlb();
49 }
51 static inline void flush_tlb_page(struct vm_area_struct *vma,
52 unsigned long addr)
53 {
54 if (vma->vm_mm == current->active_mm)
55 __flush_tlb_one(addr);
56 }
58 static inline void flush_tlb_range(struct vm_area_struct *vma,
59 unsigned long start, unsigned long end)
60 {
61 if (vma->vm_mm == current->active_mm)
62 __flush_tlb();
63 }
65 #else
67 #include <asm/smp.h>
69 #define local_flush_tlb() \
70 __flush_tlb()
72 extern void flush_tlb_all(void);
73 extern void flush_tlb_current_task(void);
74 extern void flush_tlb_mm(struct mm_struct *);
75 extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
77 #define flush_tlb() flush_tlb_current_task()
79 static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long start, unsigned long end)
80 {
81 flush_tlb_mm(vma->vm_mm);
82 }
84 #define TLBSTATE_OK 1
85 #define TLBSTATE_LAZY 2
87 #endif
89 #define flush_tlb_kernel_range(start, end) flush_tlb_all()
91 static inline void flush_tlb_pgtables(struct mm_struct *mm,
92 unsigned long start, unsigned long end)
93 {
94 /* x86_64 does not keep any page table caches in TLB */
95 }
97 #endif /* _X8664_TLBFLUSH_H */