Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfff0fa6 authored by Paul Mundt's avatar Paul Mundt
Browse files

sh: wire up clear_user_highpage() for sh4, convert sh7705.



This wires up clear_user_highpage() on SH-4 and subsequently converts the
SH7705 32kB cache mode over to using it. Now that the SH-4 implementation
handles all of the dcache purging directly in the aliasing case, there is
no need to do this in the default clear_page() implementation.

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 2277ab4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ static inline void flush_kernel_dcache_page(struct page *page)
	flush_dcache_page(page);
}

#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_CACHE_OFF)
#if (defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB)) && !defined(CONFIG_CACHE_OFF)
extern void copy_to_user_page(struct vm_area_struct *vma,
	struct page *page, unsigned long vaddr, void *dst, const void *src,
	unsigned long len);
+8 −4
Original line number Diff line number Diff line
@@ -56,21 +56,25 @@ pages_do_alias(unsigned long addr1, unsigned long addr2)
	return (addr1 ^ addr2) & shm_align_mask;
}

extern void clear_page(void *to);

#define clear_page(page)	memset((void *)(page), 0, PAGE_SIZE)
extern void copy_page(void *to, void *from);

struct page;
struct vm_area_struct;

#if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \
	(defined(CONFIG_CPU_SH5) || defined(CONFIG_CPU_SH4) || \
	 defined(CONFIG_SH7705_CACHE_32KB))
struct page;
struct vm_area_struct;
extern void clear_user_page(void *to, unsigned long address, struct page *page);
extern void copy_user_page(void *to, void *from, unsigned long address,
			   struct page *page);
#if defined(CONFIG_CPU_SH4)
#if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB)
extern void copy_user_highpage(struct page *to, struct page *from,
			       unsigned long vaddr, struct vm_area_struct *vma);
#define __HAVE_ARCH_COPY_USER_HIGHPAGE
extern void clear_user_highpage(struct page *page, unsigned long vaddr);
#define clear_user_highpage	clear_user_highpage
#endif
#else
#define clear_user_page(page, vaddr, pg)	clear_page(page)
+2 −1
Original line number Diff line number Diff line
@@ -141,7 +141,8 @@ extern void paging_init(void);
extern void page_table_range_init(unsigned long start, unsigned long end,
				  pgd_t *pgd);

#if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_CPU_SH4) && defined(CONFIG_MMU)
#if !defined(CONFIG_CACHE_OFF) && (defined(CONFIG_CPU_SH4) || \
    defined(CONFIG_SH7705_CACHE_32KB)) && defined(CONFIG_MMU)
extern void kmap_coherent_init(void);
#else
#define kmap_coherent_init()	do { } while (0)
+0 −6
Original line number Diff line number Diff line
@@ -101,11 +101,6 @@ EXPORT_SYMBOL(flush_cache_range);
EXPORT_SYMBOL(flush_dcache_page);
#endif

#if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \
	(defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB))
EXPORT_SYMBOL(clear_user_page);
#endif

#ifdef CONFIG_MCOUNT
DECLARE_EXPORT(mcount);
#endif
@@ -114,7 +109,6 @@ EXPORT_SYMBOL(csum_partial_copy_generic);
#ifdef CONFIG_IPV6
EXPORT_SYMBOL(csum_ipv6_magic);
#endif
EXPORT_SYMBOL(clear_page);
EXPORT_SYMBOL(copy_page);
EXPORT_SYMBOL(__clear_user);
EXPORT_SYMBOL(_ebss);
+0 −46
Original line number Diff line number Diff line
@@ -8,52 +8,6 @@
#include <linux/linkage.h>
#include <asm/page.h>

/*
 * clear_page
 * @to: P1 address
 *
 * void clear_page(void *to)
 */

/*
 * r0 --- scratch
 * r4 --- to
 * r5 --- to + PAGE_SIZE
 */
ENTRY(clear_page)
	mov	r4,r5
	mov.l	.Llimit,r0
	add	r0,r5
	mov	#0,r0
	!
1:
#if defined(CONFIG_CPU_SH4)
	movca.l	r0,@r4
	mov	r4,r1
#else
	mov.l	r0,@r4
#endif
	add	#32,r4
	mov.l	r0,@-r4
	mov.l	r0,@-r4
	mov.l	r0,@-r4
	mov.l	r0,@-r4
	mov.l	r0,@-r4
	mov.l	r0,@-r4
	mov.l	r0,@-r4
#if defined(CONFIG_CPU_SH4)
	ocbwb	@r1
#endif
	cmp/eq	r5,r4
	bf/s	1b
	 add	#28,r4
	!
	rts
	 nop

	.balign 4
.Llimit:	.long	(PAGE_SIZE-28)

ENTRY(__clear_user)
	!
	mov	#0, r0
Loading