aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-11-20 02:51:28 -0500
committerPaul Mundt <lethal@linux-sh.org>2008-01-27 23:18:50 -0500
commit379a95d1d2c3e3682e380084c40b6fc01e38fa1f (patch)
tree663a232eaf663abe8e219c475dada42fd81fad4d /arch/sh
parentbcb28e42be8c1cce6cc523c1b656980011464016 (diff)
sh: Tidy up various clear_page()/copy_page() definitions.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/lib64/page_clear.S4
-rw-r--r--arch/sh/lib64/page_copy.S56
-rw-r--r--arch/sh/mm/copy_page.S6
-rw-r--r--arch/sh/mm/init.c15
-rw-r--r--arch/sh/mm/pg-nommu.c4
5 files changed, 34 insertions, 51 deletions
diff --git a/arch/sh/lib64/page_clear.S b/arch/sh/lib64/page_clear.S
index ac0111d669a3..007ab48ecc1c 100644
--- a/arch/sh/lib64/page_clear.S
+++ b/arch/sh/lib64/page_clear.S
@@ -25,8 +25,8 @@
25 .little 25 .little
26 26
27 .balign 8 27 .balign 8
28 .global sh64_page_clear 28 .global clear_page
29sh64_page_clear: 29clear_page:
30 pta/l 1f, tr1 30 pta/l 1f, tr1
31 pta/l 2f, tr2 31 pta/l 2f, tr2
32 ptabs/l r18, tr0 32 ptabs/l r18, tr0
diff --git a/arch/sh/lib64/page_copy.S b/arch/sh/lib64/page_copy.S
index e159c3cd2582..0ec6fca63b56 100644
--- a/arch/sh/lib64/page_copy.S
+++ b/arch/sh/lib64/page_copy.S
@@ -10,8 +10,8 @@
10 of SH5-101 cut2 eval chip with Cayman board DDR memory. 10 of SH5-101 cut2 eval chip with Cayman board DDR memory.
11 11
12 Parameters: 12 Parameters:
13 r2 : source effective address (start of page) 13 r2 : destination effective address (start of page)
14 r3 : destination effective address (start of page) 14 r3 : source effective address (start of page)
15 15
16 Always copies 4096 bytes. 16 Always copies 4096 bytes.
17 17
@@ -27,10 +27,10 @@
27 .little 27 .little
28 28
29 .balign 8 29 .balign 8
30 .global sh64_page_copy 30 .global copy_page
31sh64_page_copy: 31copy_page:
32 32
33 /* Copy 4096 bytes worth of data from r2 to r3. 33 /* Copy 4096 bytes worth of data from r3 to r2.
34 Do prefetches 4 lines ahead. 34 Do prefetches 4 lines ahead.
35 Do alloco 2 lines ahead */ 35 Do alloco 2 lines ahead */
36 36
@@ -41,21 +41,21 @@ sh64_page_copy:
41 41
42#if 0 42#if 0
43 /* TAKum03020 */ 43 /* TAKum03020 */
44 ld.q r2, 0x00, r63 44 ld.q r3, 0x00, r63
45 ld.q r2, 0x20, r63 45 ld.q r3, 0x20, r63
46 ld.q r2, 0x40, r63 46 ld.q r3, 0x40, r63
47 ld.q r2, 0x60, r63 47 ld.q r3, 0x60, r63
48#endif 48#endif
49 alloco r3, 0x00 49 alloco r2, 0x00
50 synco ! TAKum03020 50 synco ! TAKum03020
51 alloco r3, 0x20 51 alloco r2, 0x20
52 synco ! TAKum03020 52 synco ! TAKum03020
53 53
54 movi 3968, r6 54 movi 3968, r6
55 add r3, r6, r6 55 add r2, r6, r6
56 addi r6, 64, r7 56 addi r6, 64, r7
57 addi r7, 64, r8 57 addi r7, 64, r8
58 sub r2, r3, r60 58 sub r3, r2, r60
59 addi r60, 8, r61 59 addi r60, 8, r61
60 addi r61, 8, r62 60 addi r61, 8, r62
61 addi r62, 8, r23 61 addi r62, 8, r23
@@ -67,25 +67,23 @@ sh64_page_copy:
671: 671:
68#if 0 68#if 0
69 /* TAKum03020 */ 69 /* TAKum03020 */
70 bge/u r3, r6, tr2 ! skip prefetch for last 4 lines 70 bge/u r2, r6, tr2 ! skip prefetch for last 4 lines
71 ldx.q r3, r22, r63 ! prefetch 4 lines hence 71 ldx.q r2, r22, r63 ! prefetch 4 lines hence
72#endif 72#endif
732: 732:
74 bge/u r3, r7, tr3 ! skip alloco for last 2 lines 74 bge/u r2, r7, tr3 ! skip alloco for last 2 lines
75 alloco r3, 0x40 ! alloc destination line 2 lines ahead 75 alloco r2, 0x40 ! alloc destination line 2 lines ahead
76 synco ! TAKum03020 76 synco ! TAKum03020
773: 773:
78 ldx.q r3, r60, r36 78 ldx.q r2, r60, r36
79 ldx.q r3, r61, r37 79 ldx.q r2, r61, r37
80 ldx.q r3, r62, r38 80 ldx.q r2, r62, r38
81 ldx.q r3, r23, r39 81 ldx.q r2, r23, r39
82 st.q r3, 0, r36 82 st.q r2, 0, r36
83 st.q r3, 8, r37 83 st.q r2, 8, r37
84 st.q r3, 16, r38 84 st.q r2, 16, r38
85 st.q r3, 24, r39 85 st.q r2, 24, r39
86 addi r3, 32, r3 86 addi r2, 32, r2
87 bgt/l r8, r3, tr1 87 bgt/l r8, r2, tr1
88 88
89 blink tr0, r63 ! return 89 blink tr0, r63 ! return
90
91
diff --git a/arch/sh/mm/copy_page.S b/arch/sh/mm/copy_page.S
index 40685018b952..b879545fa28b 100644
--- a/arch/sh/mm/copy_page.S
+++ b/arch/sh/mm/copy_page.S
@@ -9,11 +9,11 @@
9#include <asm/page.h> 9#include <asm/page.h>
10 10
11/* 11/*
12 * copy_page_slow 12 * copy_page
13 * @to: P1 address 13 * @to: P1 address
14 * @from: P1 address 14 * @from: P1 address
15 * 15 *
16 * void copy_page_slow(void *to, void *from) 16 * void copy_page(void *to, void *from)
17 */ 17 */
18 18
19/* 19/*
@@ -23,7 +23,7 @@
23 * r10 --- to 23 * r10 --- to
24 * r11 --- from 24 * r11 --- from
25 */ 25 */
26ENTRY(copy_page_slow) 26ENTRY(copy_page)
27 mov.l r8,@-r15 27 mov.l r8,@-r15
28 mov.l r10,@-r15 28 mov.l r10,@-r15
29 mov.l r11,@-r15 29 mov.l r11,@-r15
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 5d19c8c7ab53..79c309780f95 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -24,9 +24,6 @@
24DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 24DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
25pgd_t swapper_pg_dir[PTRS_PER_PGD]; 25pgd_t swapper_pg_dir[PTRS_PER_PGD];
26 26
27void (*copy_page)(void *from, void *to);
28void (*clear_page)(void *to);
29
30void show_mem(void) 27void show_mem(void)
31{ 28{
32 int total = 0, reserved = 0, free = 0; 29 int total = 0, reserved = 0, free = 0;
@@ -203,18 +200,6 @@ void __init mem_init(void)
203 memset(empty_zero_page, 0, PAGE_SIZE); 200 memset(empty_zero_page, 0, PAGE_SIZE);
204 __flush_wback_region(empty_zero_page, PAGE_SIZE); 201 __flush_wback_region(empty_zero_page, PAGE_SIZE);
205 202
206 /*
207 * Setup wrappers for copy/clear_page(), these will get overridden
208 * later in the boot process if a better method is available.
209 */
210#ifdef CONFIG_MMU
211 copy_page = copy_page_slow;
212 clear_page = clear_page_slow;
213#else
214 copy_page = copy_page_nommu;
215 clear_page = clear_page_nommu;
216#endif
217
218 after_bootmem = 1; 203 after_bootmem = 1;
219 204
220 codesize = (unsigned long) &_etext - (unsigned long) &_text; 205 codesize = (unsigned long) &_etext - (unsigned long) &_text;
diff --git a/arch/sh/mm/pg-nommu.c b/arch/sh/mm/pg-nommu.c
index d15221beaa16..677dd57f0877 100644
--- a/arch/sh/mm/pg-nommu.c
+++ b/arch/sh/mm/pg-nommu.c
@@ -14,12 +14,12 @@
14#include <linux/string.h> 14#include <linux/string.h>
15#include <asm/page.h> 15#include <asm/page.h>
16 16
17void copy_page_nommu(void *to, void *from) 17void copy_page(void *to, void *from)
18{ 18{
19 memcpy(to, from, PAGE_SIZE); 19 memcpy(to, from, PAGE_SIZE);
20} 20}
21 21
22void clear_page_nommu(void *to) 22void clear_page(void *to)
23{ 23{
24 memset(to, 0, PAGE_SIZE); 24 memset(to, 0, PAGE_SIZE);
25} 25}