summaryrefslogtreecommitdiff
path: root/arch/sh/mm
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 17:03:56 +0900
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 17:03:56 +0900
commit0f08f338083cc1d68788ccbccc44bd0502fc57ae (patch)
tree97c69dbbd63a108a7367644dadedd390a3948f0c /arch/sh/mm
parent9e3043c091819729ecf4fc5063d0a2d0954dfd7f (diff)
sh: More cosmetic cleanups and trivial fixes.
Nothing exciting here, just trivial fixes.. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm')
-rw-r--r--arch/sh/mm/cache-sh7705.c19
-rw-r--r--arch/sh/mm/fault.c13
-rw-r--r--arch/sh/mm/pmb.c4
3 files changed, 14 insertions, 22 deletions
diff --git a/arch/sh/mm/cache-sh7705.c b/arch/sh/mm/cache-sh7705.c
index bf94eedb0a8e..045abdf078f5 100644
--- a/arch/sh/mm/cache-sh7705.c
+++ b/arch/sh/mm/cache-sh7705.c
@@ -9,7 +9,6 @@
* for more details.
*
*/
-
#include <linux/init.h>
#include <linux/mman.h>
#include <linux/mm.h>
@@ -25,14 +24,10 @@
#include <asm/mmu_context.h>
#include <asm/cacheflush.h>
-/* The 32KB cache on the SH7705 suffers from the same synonym problem
- * as SH4 CPUs */
-
-#define __pte_offset(address) \
- ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-#define pte_offset(dir, address) ((pte_t *) pmd_page_vaddr(*(dir)) + \
- __pte_offset(address))
-
+/*
+ * The 32KB cache on the SH7705 suffers from the same synonym problem
+ * as SH4 CPUs
+ */
static inline void cache_wback_all(void)
{
unsigned long ways, waysize, addrstart;
@@ -73,7 +68,6 @@ void flush_icache_range(unsigned long start, unsigned long end)
__flush_wback_region((void *)start, end - start);
}
-
/*
* Writeback&Invalidate the D-cache of the page
*/
@@ -128,7 +122,6 @@ static void __flush_dcache_page(unsigned long phys)
local_irq_restore(flags);
}
-
/*
* Write back & invalidate the D-cache of the page.
* (To avoid "alias" issues)
@@ -186,7 +179,8 @@ void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
*
* ADDRESS: Virtual Address (U0 address)
*/
-void flush_cache_page(struct vm_area_struct *vma, unsigned long address, unsigned long pfn)
+void flush_cache_page(struct vm_area_struct *vma, unsigned long address,
+ unsigned long pfn)
{
__flush_dcache_page(pfn << PAGE_SHIFT);
}
@@ -203,4 +197,3 @@ void flush_icache_page(struct vm_area_struct *vma, struct page *page)
{
__flush_purge_region(page_address(page), PAGE_SIZE);
}
-
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
index dc461d2bc183..c69fd603226a 100644
--- a/arch/sh/mm/fault.c
+++ b/arch/sh/mm/fault.c
@@ -13,6 +13,8 @@
*/
#include <linux/kernel.h>
#include <linux/mm.h>
+#include <linux/hardirq.h>
+#include <linux/kprobes.h>
#include <asm/system.h>
#include <asm/mmu_context.h>
#include <asm/kgdb.h>
@@ -188,15 +190,16 @@ do_sigbus:
/*
* Called with interrupts disabled.
*/
-asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
- unsigned long address)
+asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
+ unsigned long writeaccess,
+ unsigned long address)
{
pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
pte_t *pte;
pte_t entry;
- struct mm_struct *mm;
+ struct mm_struct *mm = current->mm;
spinlock_t *ptl;
int ret = 1;
@@ -214,10 +217,10 @@ asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
pgd = pgd_offset_k(address);
mm = NULL;
} else {
- if (unlikely(address >= TASK_SIZE || !(mm = current->mm)))
+ if (unlikely(address >= TASK_SIZE || !mm))
return 1;
- pgd = pgd_offset(current->mm, address);
+ pgd = pgd_offset(mm, address);
}
pud = pud_offset(pgd, address);
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index 819fd0faf022..92e745341e4d 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -337,10 +337,8 @@ static int __init pmb_init(void)
return 0;
}
-
arch_initcall(pmb_init);
-#ifdef CONFIG_DEBUG_FS
static int pmb_seq_show(struct seq_file *file, void *iter)
{
int i;
@@ -399,6 +397,4 @@ static int __init pmb_debugfs_init(void)
return 0;
}
-
postcore_initcall(pmb_debugfs_init);
-#endif