summaryrefslogtreecommitdiffstats
path: root/arch/m32r/mm/page.S
blob: a2e9367dbf79c3eea7bddb450779142875d6bff5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 *  linux/arch/m32r/mm/page.S
 *
 *  Clear/Copy page with CPU
 *
 *  Copyright (C) 2004  The Free Software Initiative of Japan
 *
 *  Written by Niibe Yutaka
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 */
	.text
	.global	copy_page
	/*
	 * copy_page (to, from)
	 *
	 * PAGE_SIZE = 4096-byte
	 * Cache line = 16-byte
	 * 16 * 256
	 */
	.align	4
copy_page:
	ldi	r2, #255
	ld	r3, @r0		/* cache line allocate */
	ld	r4, @r1+
	ld	r5, @r1+
	ld	r6, @r1+
	ld	r7, @r1+
	.fillinsn
0:
	st	r4, @r0
	st	r5, @+r0
	st	r6, @+r0
	st	r7, @+r0
	ld	r4, @r1+
	addi	r0, #4
	ld	r5, @r1+
	ld	r6, @r1+
	ld	r7, @r1+
	ld	r3, @r0		/* cache line allocate */
	addi	r2, #-1
	bnez	r2, 0b

	st	r4, @r0
	st	r5, @+r0
	st	r6, @+r0
	st	r7, @+r0
	jmp	r14

	.text
	.global	clear_page
	/*
	 * clear_page (to)
	 *
	 * PAGE_SIZE = 4096-byte
	 * Cache line = 16-byte
	 * 16 * 256
	 */
	.align	4
clear_page:
	ldi	r2, #255
	ldi	r4, #0
	ld	r3, @r0		/* cache line allocate */
	.fillinsn
0:
	st	r4, @r0
	st	r4, @+r0
	st	r4, @+r0
	st	r4, @+r0
	addi	r0, #4
	ld	r3, @r0		/* cache line allocate */
	addi	r2, #-1
	bnez	r2, 0b

	st	r4, @r0
	st	r4, @+r0
	st	r4, @+r0
	st	r4, @+r0
	jmp	r14