xref: /openbmc/linux/arch/sparc/lib/NG4copy_page.S (revision b2441318)
1b2441318SGreg Kroah-Hartman/* SPDX-License-Identifier: GPL-2.0 */
2ae2c6ca6SDavid S. Miller/* NG4copy_page.S: Niagara-4 optimized copy page.
3ae2c6ca6SDavid S. Miller *
4ae2c6ca6SDavid S. Miller * Copyright (C) 2012 (davem@davemloft.net)
5ae2c6ca6SDavid S. Miller */
6ae2c6ca6SDavid S. Miller
7ae2c6ca6SDavid S. Miller#include <asm/asi.h>
8ae2c6ca6SDavid S. Miller#include <asm/page.h>
9ae2c6ca6SDavid S. Miller
10ae2c6ca6SDavid S. Miller	.text
11ae2c6ca6SDavid S. Miller	.align		32
12ae2c6ca6SDavid S. Miller
13ae2c6ca6SDavid S. Miller	.register	%g2, #scratch
14ae2c6ca6SDavid S. Miller	.register	%g3, #scratch
15ae2c6ca6SDavid S. Miller
16ae2c6ca6SDavid S. Miller	.globl		NG4copy_user_page
17ae2c6ca6SDavid S. MillerNG4copy_user_page:	/* %o0=dest, %o1=src, %o2=vaddr */
18ae2c6ca6SDavid S. Miller	prefetch	[%o1 + 0x000], #n_reads_strong
19ae2c6ca6SDavid S. Miller	prefetch	[%o1 + 0x040], #n_reads_strong
20ae2c6ca6SDavid S. Miller	prefetch	[%o1 + 0x080], #n_reads_strong
21ae2c6ca6SDavid S. Miller	prefetch	[%o1 + 0x0c0], #n_reads_strong
22ae2c6ca6SDavid S. Miller	set		PAGE_SIZE, %g7
23ae2c6ca6SDavid S. Miller	prefetch	[%o1 + 0x100], #n_reads_strong
24ae2c6ca6SDavid S. Miller	prefetch	[%o1 + 0x140], #n_reads_strong
25ae2c6ca6SDavid S. Miller	prefetch	[%o1 + 0x180], #n_reads_strong
26ae2c6ca6SDavid S. Miller	prefetch	[%o1 + 0x1c0], #n_reads_strong
27ae2c6ca6SDavid S. Miller1:
28ae2c6ca6SDavid S. Miller	ldx		[%o1 + 0x00], %o2
29ae2c6ca6SDavid S. Miller	subcc		%g7, 0x40, %g7
30ae2c6ca6SDavid S. Miller	ldx		[%o1 + 0x08], %o3
31ae2c6ca6SDavid S. Miller	ldx		[%o1 + 0x10], %o4
32ae2c6ca6SDavid S. Miller	ldx		[%o1 + 0x18], %o5
33ae2c6ca6SDavid S. Miller	ldx		[%o1 + 0x20], %g1
349f825962SDavid S. Miller	stxa		%o2, [%o0] ASI_ST_BLKINIT_MRU_P
35ae2c6ca6SDavid S. Miller	add		%o0, 0x08, %o0
36ae2c6ca6SDavid S. Miller	ldx		[%o1 + 0x28], %g2
379f825962SDavid S. Miller	stxa		%o3, [%o0] ASI_ST_BLKINIT_MRU_P
38ae2c6ca6SDavid S. Miller	add		%o0, 0x08, %o0
39ae2c6ca6SDavid S. Miller	ldx		[%o1 + 0x30], %g3
409f825962SDavid S. Miller	stxa		%o4, [%o0] ASI_ST_BLKINIT_MRU_P
41ae2c6ca6SDavid S. Miller	add		%o0, 0x08, %o0
42ae2c6ca6SDavid S. Miller	ldx		[%o1 + 0x38], %o2
43ae2c6ca6SDavid S. Miller	add		%o1, 0x40, %o1
449f825962SDavid S. Miller	stxa		%o5, [%o0] ASI_ST_BLKINIT_MRU_P
45ae2c6ca6SDavid S. Miller	add		%o0, 0x08, %o0
469f825962SDavid S. Miller	stxa		%g1, [%o0] ASI_ST_BLKINIT_MRU_P
47ae2c6ca6SDavid S. Miller	add		%o0, 0x08, %o0
489f825962SDavid S. Miller	stxa		%g2, [%o0] ASI_ST_BLKINIT_MRU_P
49ae2c6ca6SDavid S. Miller	add		%o0, 0x08, %o0
509f825962SDavid S. Miller	stxa		%g3, [%o0] ASI_ST_BLKINIT_MRU_P
51ae2c6ca6SDavid S. Miller	add		%o0, 0x08, %o0
529f825962SDavid S. Miller	stxa		%o2, [%o0] ASI_ST_BLKINIT_MRU_P
53ae2c6ca6SDavid S. Miller	add		%o0, 0x08, %o0
54ae2c6ca6SDavid S. Miller	bne,pt		%icc, 1b
55ae2c6ca6SDavid S. Miller	 prefetch	[%o1 + 0x200], #n_reads_strong
56ae2c6ca6SDavid S. Miller	retl
57ae2c6ca6SDavid S. Miller	 membar		#StoreLoad | #StoreStore
58ae2c6ca6SDavid S. Miller	.size		NG4copy_user_page,.-NG4copy_user_page
59