summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2002-07-27 19:15:06 +1000
committerPaul Mackerras <paulus@samba.org>2002-07-27 19:15:06 +1000
commitc479ed684fc26a5852f79079c0e06cad81c96279 (patch)
treebcff8171e9ec4cb5ad20702fd2cde95e0273f84a /include
parent354f4492d650aa5bf12a02381d79ae09c54745f4 (diff)
PPC32: Simple mmu_gather implementation for now.
This could be made more efficient by batching the hashtable flushes but that can be done later.
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc/tlb.h59
-rw-r--r--include/asm-ppc/tlbflush.h5
2 files changed, 58 insertions, 6 deletions
diff --git a/include/asm-ppc/tlb.h b/include/asm-ppc/tlb.h
index ba4ea097a73e..fd7cd0b460cc 100644
--- a/include/asm-ppc/tlb.h
+++ b/include/asm-ppc/tlb.h
@@ -1,4 +1,61 @@
/*
- * BK Id: SCCS/s.tlb.h 1.5 05/17/01 18:14:26 cort
+ * TLB shootdown specifics for PPC
+ *
+ * Copyright (C) 2002 Paul Mackerras, IBM Corp.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*/
+#ifndef _PPC_TLB_H
+#define _PPC_TLB_H
+
+#include <linux/config.h>
+#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
+#include <asm/tlbflush.h>
+#include <asm/page.h>
+#include <asm/mmu.h>
+
+#ifdef CONFIG_PPC_STD_MMU
+/* Classic PPC with hash-table based MMU... */
+
+struct free_pte_ctx;
+extern void tlb_flush(struct free_pte_ctx *tlb);
+
+/* Get the generic bits... */
#include <asm-generic/tlb.h>
+
+/* Nothing needed here in fact... */
+#define tlb_start_vma(tlb, vma) do { } while (0)
+#define tlb_end_vma(tlb, vma) do { } while (0)
+
+extern void flush_hash_entry(struct mm_struct *mm, pte_t *ptep,
+ unsigned long address);
+
+static inline void tlb_remove_tlb_entry(mmu_gather_t *tlb, pte_t *ptep,
+ unsigned long address)
+{
+ if (pte_val(*ptep) & _PAGE_HASHPTE)
+ flush_hash_entry(tlb->mm, ptep, address);
+}
+
+#else
+/* Embedded PPC with software-loaded TLB, very simple... */
+
+struct flush_tlb_arch { };
+
+#define tlb_init_arch(tlb, full_flush) do { } while (0)
+#define tlb_finish_arch(tlb) do { } while (0)
+#define tlb_start_vma(tlb, vma) do { } while (0)
+#define tlb_end_vma(tlb, vma) do { } while (0)
+#define tlb_remove_tlb_entry(tlb, pte, address) do { } while (0)
+#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
+
+/* Get the generic bits... */
+#include <asm-generic/tlb.h>
+
+#endif /* CONFIG_PPC_STD_MMU */
+
+#endif /* __PPC_TLB_H */
diff --git a/include/asm-ppc/tlbflush.h b/include/asm-ppc/tlbflush.h
index af4295e46861..9c06b88c45d9 100644
--- a/include/asm-ppc/tlbflush.h
+++ b/include/asm-ppc/tlbflush.h
@@ -22,8 +22,6 @@ extern void _tlbia(void);
#if defined(CONFIG_4xx)
-static inline void flush_tlb_all(void)
- { _tlbia(); }
static inline void flush_tlb_mm(struct mm_struct *mm)
{ _tlbia(); }
static inline void flush_tlb_page(struct vm_area_struct *vma,
@@ -40,8 +38,6 @@ static inline void flush_tlb_kernel_range(unsigned long start,
#elif defined(CONFIG_8xx)
#define __tlbia() asm volatile ("tlbia; sync" : : : "memory")
-static inline void flush_tlb_all(void)
- { __tlbia(); }
static inline void flush_tlb_mm(struct mm_struct *mm)
{ __tlbia(); }
static inline void flush_tlb_page(struct vm_area_struct *vma,
@@ -58,7 +54,6 @@ static inline void flush_tlb_kernel_range(unsigned long start,
#else /* 6xx, 7xx, 7xxx cpus */
struct mm_struct;
struct vm_area_struct;
-extern void flush_tlb_all(void);
extern void flush_tlb_mm(struct mm_struct *mm);
extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,