summaryrefslogtreecommitdiff
path: root/arch/m68k/include/asm/mmu_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/include/asm/mmu_context.h')
-rw-r--r--arch/m68k/include/asm/mmu_context.h48
1 files changed, 16 insertions, 32 deletions
diff --git a/arch/m68k/include/asm/mmu_context.h b/arch/m68k/include/asm/mmu_context.h
index cac9f289d1f6..141bbdfad960 100644
--- a/arch/m68k/include/asm/mmu_context.h
+++ b/arch/m68k/include/asm/mmu_context.h
@@ -5,10 +5,6 @@
#include <asm-generic/mm_hooks.h>
#include <linux/mm_types.h>
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-{
-}
-
#ifdef CONFIG_MMU
#if defined(CONFIG_COLDFIRE)
@@ -35,7 +31,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
if (mm->context != NO_CONTEXT)
return;
- while (atomic_dec_and_test_lt(&nr_free_contexts)) {
+ while (arch_atomic_dec_and_test_lt(&nr_free_contexts)) {
atomic_inc(&nr_free_contexts);
steal_context();
}
@@ -58,6 +54,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
/*
* We're finished using the context for an address space.
*/
+#define destroy_context destroy_context
static inline void destroy_context(struct mm_struct *mm)
{
if (mm->context != NO_CONTEXT) {
@@ -83,6 +80,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
* After we have set current->mm to a new value, this activates
* the context for the new mm so we see the new mappings.
*/
+#define activate_mm activate_mm
static inline void activate_mm(struct mm_struct *active_mm,
struct mm_struct *mm)
{
@@ -90,8 +88,6 @@ static inline void activate_mm(struct mm_struct *active_mm,
set_context(mm->context, mm->pgd);
}
-#define deactivate_mm(tsk, mm) do { } while (0)
-
#define prepare_arch_switch(next) load_ksp_mmu(next)
static inline void load_ksp_mmu(struct task_struct *task)
@@ -103,7 +99,7 @@ static inline void load_ksp_mmu(struct task_struct *task)
p4d_t *p4d;
pud_t *pud;
pmd_t *pmd;
- pte_t *pte;
+ pte_t *pte = NULL;
unsigned long mmuar;
local_irq_save(flags);
@@ -143,7 +139,7 @@ static inline void load_ksp_mmu(struct task_struct *task)
pte = (mmuar >= PAGE_OFFSET) ? pte_offset_kernel(pmd, mmuar)
: pte_offset_map(pmd, mmuar);
- if (pte_none(*pte) || !pte_present(*pte))
+ if (!pte || pte_none(*pte) || !pte_present(*pte))
goto bug;
set_pte(pte, pte_mkyoung(*pte));
@@ -165,6 +161,8 @@ static inline void load_ksp_mmu(struct task_struct *task)
bug:
pr_info("ksp load failed: mm=0x%p ksp=0x08%lx\n", mm, mmuar);
end:
+ if (pte && mmuar < PAGE_OFFSET)
+ pte_unmap(pte);
local_irq_restore(flags);
}
@@ -176,6 +174,7 @@ extern unsigned long get_free_context(struct mm_struct *mm);
extern void clear_context(unsigned long context);
/* set the context for a new task to unmapped */
+#define init_new_context init_new_context
static inline int init_new_context(struct task_struct *tsk,
struct mm_struct *mm)
{
@@ -192,6 +191,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
}
/* flush context if allocated... */
+#define destroy_context destroy_context
static inline void destroy_context(struct mm_struct *mm)
{
if (mm->context != SUN3_INVALID_CONTEXT)
@@ -210,8 +210,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
activate_context(tsk->mm);
}
-#define deactivate_mm(tsk, mm) do { } while (0)
-
+#define activate_mm activate_mm
static inline void activate_mm(struct mm_struct *prev_mm,
struct mm_struct *next_mm)
{
@@ -222,8 +221,9 @@ static inline void activate_mm(struct mm_struct *prev_mm,
#include <asm/setup.h>
#include <asm/page.h>
-#include <asm/pgalloc.h>
+#include <asm/cacheflush.h>
+#define init_new_context init_new_context
static inline int init_new_context(struct task_struct *tsk,
struct mm_struct *mm)
{
@@ -231,8 +231,6 @@ static inline int init_new_context(struct task_struct *tsk,
return 0;
}
-#define destroy_context(mm) do { } while(0)
-
static inline void switch_mm_0230(struct mm_struct *mm)
{
unsigned long crp[2] = {
@@ -300,8 +298,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, str
}
}
-#define deactivate_mm(tsk,mm) do { } while (0)
-
+#define activate_mm activate_mm
static inline void activate_mm(struct mm_struct *prev_mm,
struct mm_struct *next_mm)
{
@@ -315,24 +312,11 @@ static inline void activate_mm(struct mm_struct *prev_mm,
#endif
-#else /* !CONFIG_MMU */
-
-static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
-{
- return 0;
-}
-
-
-static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
-{
-}
+#include <asm-generic/mmu_context.h>
-#define destroy_context(mm) do { } while (0)
-#define deactivate_mm(tsk,mm) do { } while (0)
+#else /* !CONFIG_MMU */
-static inline void activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
-{
-}
+#include <asm-generic/nommu_context.h>
#endif /* CONFIG_MMU */
#endif /* __M68K_MMU_CONTEXT_H */