Vineet Gupta | cc562d2 | 2013-01-18 15:12:19 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
| 3 | * |
| 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. |
| 7 | */ |
| 8 | |
| 9 | #ifndef _ASM_ARC_TLB_H |
| 10 | #define _ASM_ARC_TLB_H |
| 11 | |
Vineet Gupta | 8d56bec | 2013-04-05 18:38:31 +0530 | [diff] [blame] | 12 | #define tlb_flush(tlb) \ |
| 13 | do { \ |
| 14 | if (tlb->fullmm) \ |
| 15 | flush_tlb_mm((tlb)->mm); \ |
| 16 | } while (0) |
Vineet Gupta | d79e678 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 17 | |
| 18 | /* |
| 19 | * This pair is called at time of munmap/exit to flush cache and TLB entries |
| 20 | * for mappings being torn down. |
Vineet Gupta | 4102b53 | 2013-05-09 21:54:51 +0530 | [diff] [blame] | 21 | * 1) cache-flush part -implemented via tlb_start_vma( ) for VIPT aliasing D$ |
Vineet Gupta | 8d56bec | 2013-04-05 18:38:31 +0530 | [diff] [blame] | 22 | * 2) tlb-flush part - implemted via tlb_end_vma( ) flushes the TLB range |
Vineet Gupta | d79e678 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 23 | * |
| 24 | * Note, read http://lkml.org/lkml/2004/1/15/6 |
| 25 | */ |
Vineet Gupta | 4102b53 | 2013-05-09 21:54:51 +0530 | [diff] [blame] | 26 | #ifndef CONFIG_ARC_CACHE_VIPT_ALIASING |
Vineet Gupta | d79e678 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 27 | #define tlb_start_vma(tlb, vma) |
Vineet Gupta | 4102b53 | 2013-05-09 21:54:51 +0530 | [diff] [blame] | 28 | #else |
| 29 | #define tlb_start_vma(tlb, vma) \ |
| 30 | do { \ |
| 31 | if (!tlb->fullmm) \ |
| 32 | flush_cache_range(vma, vma->vm_start, vma->vm_end); \ |
| 33 | } while(0) |
| 34 | #endif |
Vineet Gupta | 8d56bec | 2013-04-05 18:38:31 +0530 | [diff] [blame] | 35 | |
| 36 | #define tlb_end_vma(tlb, vma) \ |
| 37 | do { \ |
| 38 | if (!tlb->fullmm) \ |
| 39 | flush_tlb_range(vma, vma->vm_start, vma->vm_end); \ |
| 40 | } while (0) |
Vineet Gupta | d79e678 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 41 | |
| 42 | #define __tlb_remove_tlb_entry(tlb, ptep, address) |
| 43 | |
Vineet Gupta | cc562d2 | 2013-01-18 15:12:19 +0530 | [diff] [blame] | 44 | #include <linux/pagemap.h> |
| 45 | #include <asm-generic/tlb.h> |
| 46 | |
Vineet Gupta | cc562d2 | 2013-01-18 15:12:19 +0530 | [diff] [blame] | 47 | #endif /* _ASM_ARC_TLB_H */ |