2009-03-27 20:25:29 +07:00
|
|
|
/*
|
2009-05-26 21:30:18 +07:00
|
|
|
* Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
|
|
|
|
* Copyright (C) 2008-2009 PetaLogix
|
2009-03-27 20:25:29 +07:00
|
|
|
* Copyright (C) 2006 Atmark Techno, Inc.
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ASM_MICROBLAZE_TLBFLUSH_H
|
|
|
|
#define _ASM_MICROBLAZE_TLBFLUSH_H
|
|
|
|
|
2009-05-26 21:30:18 +07:00
|
|
|
#ifdef CONFIG_MMU
|
|
|
|
|
|
|
|
#include <linux/sched.h>
|
|
|
|
#include <linux/threads.h>
|
|
|
|
#include <asm/processor.h> /* For TASK_SIZE */
|
|
|
|
#include <asm/mmu.h>
|
|
|
|
#include <asm/page.h>
|
|
|
|
#include <asm/pgalloc.h>
|
|
|
|
|
|
|
|
extern void _tlbie(unsigned long address);
|
|
|
|
extern void _tlbia(void);
|
|
|
|
|
2010-01-12 15:55:10 +07:00
|
|
|
#define __tlbia() { preempt_disable(); _tlbia(); preempt_enable(); }
|
2010-03-22 20:54:35 +07:00
|
|
|
#define __tlbie(x) { _tlbie(x); }
|
2009-05-26 21:30:18 +07:00
|
|
|
|
|
|
|
static inline void local_flush_tlb_all(void)
|
|
|
|
{ __tlbia(); }
|
|
|
|
static inline void local_flush_tlb_mm(struct mm_struct *mm)
|
|
|
|
{ __tlbia(); }
|
|
|
|
static inline void local_flush_tlb_page(struct vm_area_struct *vma,
|
|
|
|
unsigned long vmaddr)
|
2010-03-22 20:54:35 +07:00
|
|
|
{ __tlbie(vmaddr); }
|
2009-05-26 21:30:18 +07:00
|
|
|
static inline void local_flush_tlb_range(struct vm_area_struct *vma,
|
|
|
|
unsigned long start, unsigned long end)
|
|
|
|
{ __tlbia(); }
|
|
|
|
|
|
|
|
#define flush_tlb_kernel_range(start, end) do { } while (0)
|
|
|
|
|
MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself
On VIVT ARM, when we have multiple shared mappings of the same file
in the same MM, we need to ensure that we have coherency across all
copies. We do this via make_coherent() by making the pages
uncacheable.
This used to work fine, until we allowed highmem with highpte - we
now have a page table which is mapped as required, and is not available
for modification via update_mmu_cache().
Ralf Beache suggested getting rid of the PTE value passed to
update_mmu_cache():
On MIPS update_mmu_cache() calls __update_tlb() which walks pagetables
to construct a pointer to the pte again. Passing a pte_t * is much
more elegant. Maybe we might even replace the pte argument with the
pte_t?
Ben Herrenschmidt would also like the pte pointer for PowerPC:
Passing the ptep in there is exactly what I want. I want that
-instead- of the PTE value, because I have issue on some ppc cases,
for I$/D$ coherency, where set_pte_at() may decide to mask out the
_PAGE_EXEC.
So, pass in the mapped page table pointer into update_mmu_cache(), and
remove the PTE value, updating all implementations and call sites to
suit.
Includes a fix from Stephen Rothwell:
sparc: fix fallout from update_mmu_cache API change
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-18 23:40:18 +07:00
|
|
|
#define update_mmu_cache(vma, addr, ptep) do { } while (0)
|
2009-05-26 21:30:18 +07:00
|
|
|
|
|
|
|
#define flush_tlb_all local_flush_tlb_all
|
|
|
|
#define flush_tlb_mm local_flush_tlb_mm
|
|
|
|
#define flush_tlb_page local_flush_tlb_page
|
|
|
|
#define flush_tlb_range local_flush_tlb_range
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is called in munmap when we have freed up some page-table
|
|
|
|
* pages. We don't need to do anything here, there's nothing special
|
|
|
|
* about our page-table pages. -- paulus
|
|
|
|
*/
|
|
|
|
static inline void flush_tlb_pgtables(struct mm_struct *mm,
|
|
|
|
unsigned long start, unsigned long end) { }
|
|
|
|
|
|
|
|
#else /* CONFIG_MMU */
|
|
|
|
|
2009-03-27 20:25:29 +07:00
|
|
|
#define flush_tlb() BUG()
|
|
|
|
#define flush_tlb_all() BUG()
|
|
|
|
#define flush_tlb_mm(mm) BUG()
|
|
|
|
#define flush_tlb_page(vma, addr) BUG()
|
|
|
|
#define flush_tlb_range(mm, start, end) BUG()
|
|
|
|
#define flush_tlb_pgtables(mm, start, end) BUG()
|
|
|
|
#define flush_tlb_kernel_range(start, end) BUG()
|
|
|
|
|
2009-05-26 21:30:18 +07:00
|
|
|
#endif /* CONFIG_MMU */
|
|
|
|
|
2009-03-27 20:25:29 +07:00
|
|
|
#endif /* _ASM_MICROBLAZE_TLBFLUSH_H */
|