tlbflush.h 2.0 KB
Newer Older
1
/*
2 3
 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
 * Copyright (C) 2008-2009 PetaLogix
4 5 6 7 8 9 10 11 12 13
 * 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

14 15 16 17 18 19 20 21 22 23 24 25
#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);

26
#define __tlbia()	{ preempt_disable(); _tlbia(); preempt_enable(); }
M
Michal Simek 已提交
27
#define __tlbie(x)	{ _tlbie(x); }
28 29 30 31 32 33 34

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)
M
Michal Simek 已提交
35
	{ __tlbie(vmaddr); }
36 37 38 39 40 41
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)

42
#define update_mmu_cache(vma, addr, ptep)	do { } while (0)
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58

#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 */

59 60 61 62 63 64 65 66
#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()

67 68
#endif /* CONFIG_MMU */

69
#endif /* _ASM_MICROBLAZE_TLBFLUSH_H */