1 /* $Id: clear_page.S,v 1.13 2003/08/25 17:03:10 lethal Exp $
3 * __clear_user_page, __clear_user, clear_page implementation of SuperH
5 * Copyright (C) 2001 Kaz Kojima
6 * Copyright (C) 2001, 2002 Niibe Yutaka
9 #include <linux/config.h>
10 #include <linux/linkage.h>
16 * void clear_page_slow(void *to)
24 ENTRY(clear_page_slow)
31 #if defined(CONFIG_CPU_SH3)
33 #elif defined(CONFIG_CPU_SH4)
45 #if defined(CONFIG_CPU_SH4)
54 .Llimit: .word (4096-28)
59 mov #0xe0, r1 ! 0xffffffe0
61 ! r4..(r4+31)&~32 -------- not aligned [ Area 0 ]
62 ! (r4+31)&~32..(r4+r5)&~32 -------- aligned [ Area 1 ]
63 ! (r4+r5)&~32..r4+r5 -------- not aligned [ Area 2 ]
68 tst r1, r5 ! length < 32
69 bt .Larea2 ! skip to remainder
95 #if defined(CONFIG_CPU_SH4)
132 mov #0, r0 ! return 0 as normal return
134 ! return the number of bytes remained
141 .section __ex_table,"a"
143 .long 0b, .Lbad_clear_user
144 .long 1b, .Lbad_clear_user
145 .long 2b, .Lbad_clear_user
146 .long 3b, .Lbad_clear_user
147 .long 4b, .Lbad_clear_user
148 .long 5b, .Lbad_clear_user
149 .long 6b, .Lbad_clear_user
150 .long 7b, .Lbad_clear_user
151 .long 8b, .Lbad_clear_user
152 .long 9b, .Lbad_clear_user
155 #if defined(CONFIG_CPU_SH4)
158 * @to: P3 address (with same color)
159 * @orig_to: P1 address
161 * void __clear_user_page(void *to, void *orig_to)
170 ENTRY(__clear_user_page)
197 ENTRY(__flush_cache_4096)
227 ENTRY(__flush_dcache_all)
230 and r0,r4 ! r4 = (unsigned long)&empty_zero_page[0] & ~0xffffc000
237 ldc r2,sr ! set BL bit
249 ldc r1,sr ! restore SR
258 3: .long empty_zero_page
259 4: .long 0x10000000 ! BL bit
261 /* __flush_cache_4096_all(unsigned long addr) */
262 ENTRY(__flush_cache_4096_all)
266 or r2,r4 ! r4 = addr | (unsigned long)&empty_zero_page[0] & ~0x3fff
272 ldc r2,sr ! set BL bit
284 ldc r1,sr ! restore SR
293 3: .long empty_zero_page
294 4: .long 0x10000000 ! BL bit