1/*
2 * Copyright (C) 2002 Paul Mackerras, IBM Corp.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#include <asm/processor.h>
10#include <asm/ppc_asm.h>
11
12_GLOBAL(copy_4K_page)
13	std	r31,-8(1)
14	std	r30,-16(1)
15	std	r29,-24(1)
16	std	r28,-32(1)
17	std	r27,-40(1)
18	std	r26,-48(1)
19	std	r25,-56(1)
20	std	r24,-64(1)
21	std	r23,-72(1)
22	std	r22,-80(1)
23	std	r21,-88(1)
24	std	r20,-96(1)
25	li	r5,4096/32 - 1
26	addi	r3,r3,-8
27	li	r12,5
280:	addi	r5,r5,-24
29	mtctr	r12
30	ld	r22,640(4)
31	ld	r21,512(4)
32	ld	r20,384(4)
33	ld	r11,256(4)
34	ld	r9,128(4)
35	ld	r7,0(4)
36	ld	r25,648(4)
37	ld	r24,520(4)
38	ld	r23,392(4)
39	ld	r10,264(4)
40	ld	r8,136(4)
41	ldu	r6,8(4)
42	cmpwi	r5,24
431:	std	r22,648(3)
44	std	r21,520(3)
45	std	r20,392(3)
46	std	r11,264(3)
47	std	r9,136(3)
48	std	r7,8(3)
49	ld	r28,648(4)
50	ld	r27,520(4)
51	ld	r26,392(4)
52	ld	r31,264(4)
53	ld	r30,136(4)
54	ld	r29,8(4)
55	std	r25,656(3)
56	std	r24,528(3)
57	std	r23,400(3)
58	std	r10,272(3)
59	std	r8,144(3)
60	std	r6,16(3)
61	ld	r22,656(4)
62	ld	r21,528(4)
63	ld	r20,400(4)
64	ld	r11,272(4)
65	ld	r9,144(4)
66	ld	r7,16(4)
67	std	r28,664(3)
68	std	r27,536(3)
69	std	r26,408(3)
70	std	r31,280(3)
71	std	r30,152(3)
72	stdu	r29,24(3)
73	ld	r25,664(4)
74	ld	r24,536(4)
75	ld	r23,408(4)
76	ld	r10,280(4)
77	ld	r8,152(4)
78	ldu	r6,24(4)
79	bdnz	1b
80	std	r22,648(3)
81	std	r21,520(3)
82	std	r20,392(3)
83	std	r11,264(3)
84	std	r9,136(3)
85	std	r7,8(3)
86	addi	r4,r4,640
87	addi	r3,r3,648
88	bge	0b
89	mtctr	r5
90	ld	r7,0(4)
91	ld	r8,8(4)
92	ldu	r9,16(4)
933:	ld	r10,8(4)
94	std	r7,8(3)
95	ld	r7,16(4)
96	std	r8,16(3)
97	ld	r8,24(4)
98	std	r9,24(3)
99	ldu	r9,32(4)
100	stdu	r10,32(3)
101	bdnz	3b
1024:	ld	r10,8(4)
103	std	r7,8(3)
104	std	r8,16(3)
105	std	r9,24(3)
106	std	r10,32(3)
1079:	ld	r20,-96(1)
108	ld	r21,-88(1)
109	ld	r22,-80(1)
110	ld	r23,-72(1)
111	ld	r24,-64(1)
112	ld	r25,-56(1)
113	ld	r26,-48(1)
114	ld	r27,-40(1)
115	ld	r28,-32(1)
116	ld	r29,-24(1)
117	ld	r30,-16(1)
118	ld	r31,-8(1)
119	blr
120