diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 18:50:09 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 18:50:09 -0400 |
| commit | 9dfb7808fb05643b0d06df7411b94d9546696bf1 (patch) | |
| tree | aa1a9cc1e79ae66f6cbb0fe39d79a80ca76331e8 /include/asm-parisc/tlbflush.h | |
| parent | c45154a3b1fecdbb51b5462c9f730b44e62b83a5 (diff) | |
| parent | 20731945ae743034353a88c307920d1f16cf8ac8 (diff) | |
Merge branch 'master'
Diffstat (limited to 'include/asm-parisc/tlbflush.h')
| -rw-r--r-- | include/asm-parisc/tlbflush.h | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h index eb27b78930e8..84af4ab1fe51 100644 --- a/include/asm-parisc/tlbflush.h +++ b/include/asm-parisc/tlbflush.h | |||
| @@ -7,6 +7,26 @@ | |||
| 7 | #include <linux/mm.h> | 7 | #include <linux/mm.h> |
| 8 | #include <asm/mmu_context.h> | 8 | #include <asm/mmu_context.h> |
| 9 | 9 | ||
| 10 | |||
| 11 | /* This is for the serialisation of PxTLB broadcasts. At least on the | ||
| 12 | * N class systems, only one PxTLB inter processor broadcast can be | ||
| 13 | * active at any one time on the Merced bus. This tlb purge | ||
| 14 | * synchronisation is fairly lightweight and harmless so we activate | ||
| 15 | * it on all SMP systems not just the N class. */ | ||
| 16 | #ifdef CONFIG_SMP | ||
| 17 | extern spinlock_t pa_tlb_lock; | ||
| 18 | |||
| 19 | #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) | ||
| 20 | #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) | ||
| 21 | |||
| 22 | #else | ||
| 23 | |||
| 24 | #define purge_tlb_start(x) do { } while(0) | ||
| 25 | #define purge_tlb_end(x) do { } while (0) | ||
| 26 | |||
| 27 | #endif | ||
| 28 | |||
| 29 | |||
| 10 | extern void flush_tlb_all(void); | 30 | extern void flush_tlb_all(void); |
| 11 | 31 | ||
| 12 | /* | 32 | /* |
| @@ -64,29 +84,26 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, | |||
| 64 | { | 84 | { |
| 65 | unsigned long npages; | 85 | unsigned long npages; |
| 66 | 86 | ||
| 67 | |||
| 68 | npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT; | 87 | npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT; |
| 69 | if (npages >= 512) /* XXX arbitrary, should be tuned */ | 88 | if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ |
| 70 | flush_tlb_all(); | 89 | flush_tlb_all(); |
| 71 | else { | 90 | else { |
| 72 | 91 | ||
| 73 | mtsp(vma->vm_mm->context,1); | 92 | mtsp(vma->vm_mm->context,1); |
| 93 | purge_tlb_start(); | ||
| 74 | if (split_tlb) { | 94 | if (split_tlb) { |
| 75 | purge_tlb_start(); | ||
| 76 | while (npages--) { | 95 | while (npages--) { |
| 77 | pdtlb(start); | 96 | pdtlb(start); |
| 78 | pitlb(start); | 97 | pitlb(start); |
| 79 | start += PAGE_SIZE; | 98 | start += PAGE_SIZE; |
| 80 | } | 99 | } |
| 81 | purge_tlb_end(); | ||
| 82 | } else { | 100 | } else { |
| 83 | purge_tlb_start(); | ||
| 84 | while (npages--) { | 101 | while (npages--) { |
| 85 | pdtlb(start); | 102 | pdtlb(start); |
| 86 | start += PAGE_SIZE; | 103 | start += PAGE_SIZE; |
| 87 | } | 104 | } |
| 88 | purge_tlb_end(); | ||
| 89 | } | 105 | } |
| 106 | purge_tlb_end(); | ||
| 90 | } | 107 | } |
| 91 | } | 108 | } |
| 92 | 109 | ||
