direct-io.hg

view linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/tlbflush.h @ 11509:2e6c10dc7c0b

[POWERPC][XEN] make sure put_domain() is called in case of allocate_rma() failuer

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Tue Sep 12 10:53:46 2006 -0400 (2006-09-12)
parents fd9b2c1bb577
children 3adf00179a63
line source
1 #ifndef _I386_TLBFLUSH_H
2 #define _I386_TLBFLUSH_H
4 #include <linux/config.h>
5 #include <linux/mm.h>
6 #include <asm/processor.h>
8 #define __flush_tlb() xen_tlb_flush()
9 #define __flush_tlb_global() xen_tlb_flush()
10 #define __flush_tlb_all() xen_tlb_flush()
12 extern unsigned long pgkern_mask;
14 #define cpu_has_invlpg (boot_cpu_data.x86 > 3)
16 #define __flush_tlb_single(addr) xen_invlpg(addr)
18 #define __flush_tlb_one(addr) __flush_tlb_single(addr)
20 /*
21 * TLB flushing:
22 *
23 * - flush_tlb() flushes the current mm struct TLBs
24 * - flush_tlb_all() flushes all processes TLBs
25 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
26 * - flush_tlb_page(vma, vmaddr) flushes one page
27 * - flush_tlb_range(vma, start, end) flushes a range of pages
28 * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
29 * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
30 *
31 * ..but the i386 has somewhat limited tlb flushing capabilities,
32 * and page-granular flushes are available only on i486 and up.
33 */
35 #ifndef CONFIG_SMP
37 #define flush_tlb() __flush_tlb()
38 #define flush_tlb_all() __flush_tlb_all()
39 #define local_flush_tlb() __flush_tlb()
41 static inline void flush_tlb_mm(struct mm_struct *mm)
42 {
43 if (mm == current->active_mm)
44 __flush_tlb();
45 }
47 static inline void flush_tlb_page(struct vm_area_struct *vma,
48 unsigned long addr)
49 {
50 if (vma->vm_mm == current->active_mm)
51 __flush_tlb_one(addr);
52 }
54 static inline void flush_tlb_range(struct vm_area_struct *vma,
55 unsigned long start, unsigned long end)
56 {
57 if (vma->vm_mm == current->active_mm)
58 __flush_tlb();
59 }
61 #else
63 #include <asm/smp.h>
65 #define local_flush_tlb() \
66 __flush_tlb()
68 extern void flush_tlb_all(void);
69 extern void flush_tlb_current_task(void);
70 extern void flush_tlb_mm(struct mm_struct *);
71 extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
73 #define flush_tlb() flush_tlb_current_task()
75 static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long start, unsigned long end)
76 {
77 flush_tlb_mm(vma->vm_mm);
78 }
80 #define TLBSTATE_OK 1
81 #define TLBSTATE_LAZY 2
83 struct tlb_state
84 {
85 struct mm_struct *active_mm;
86 int state;
87 char __cacheline_padding[L1_CACHE_BYTES-8];
88 };
89 DECLARE_PER_CPU(struct tlb_state, cpu_tlbstate);
92 #endif
94 #define flush_tlb_kernel_range(start, end) flush_tlb_all()
96 static inline void flush_tlb_pgtables(struct mm_struct *mm,
97 unsigned long start, unsigned long end)
98 {
99 /* i386 does not keep any page table caches in TLB */
100 }
102 #endif /* _I386_TLBFLUSH_H */