xref: /openbmc/linux/arch/sparc/lib/NG4clear_page.S (revision 61daf52c)
1b2441318SGreg Kroah-Hartman/* SPDX-License-Identifier: GPL-2.0 */
29f825962SDavid S. Miller/* NG4copy_page.S: Niagara-4 optimized clear page.
39f825962SDavid S. Miller *
49f825962SDavid S. Miller * Copyright (C) 2012 (davem@davemloft.net)
59f825962SDavid S. Miller */
69f825962SDavid S. Miller
79f825962SDavid S. Miller#include <asm/asi.h>
89f825962SDavid S. Miller#include <asm/page.h>
99f825962SDavid S. Miller
109f825962SDavid S. Miller	.text
119f825962SDavid S. Miller
129f825962SDavid S. Miller	.register	%g3, #scratch
139f825962SDavid S. Miller
149f825962SDavid S. Miller	.align		32
159f825962SDavid S. Miller	.globl		NG4clear_page
169f825962SDavid S. Miller	.globl		NG4clear_user_page
179f825962SDavid S. MillerNG4clear_page:		/* %o0=dest */
189f825962SDavid S. MillerNG4clear_user_page:	/* %o0=dest, %o1=vaddr */
199f825962SDavid S. Miller	set		PAGE_SIZE, %g7
209f825962SDavid S. Miller	mov		0x20, %g3
219f825962SDavid S. Miller1:	stxa		%g0, [%o0 + %g0] ASI_ST_BLKINIT_MRU_P
229f825962SDavid S. Miller	subcc		%g7, 0x40, %g7
239f825962SDavid S. Miller	stxa		%g0, [%o0 + %g3] ASI_ST_BLKINIT_MRU_P
249f825962SDavid S. Miller	bne,pt		%xcc, 1b
259f825962SDavid S. Miller	 add		%o0, 0x40, %o0
269f825962SDavid S. Miller	membar		#StoreLoad|#StoreStore
279f825962SDavid S. Miller	retl
289f825962SDavid S. Miller	 nop
299f825962SDavid S. Miller	.size		NG4clear_page,.-NG4clear_page
309f825962SDavid S. Miller	.size		NG4clear_user_page,.-NG4clear_user_page
31