aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/head.S
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-11-26 22:06:26 -0500
committerPaul Mundt <lethal@linux-sh.org>2006-12-05 20:45:39 -0500
commit510c72ad2dd4e05e6908755f51ac89482c6eb987 (patch)
treefa2e9e9a674e38dd523d937329627560f0bd6b64 /arch/sh/kernel/head.S
parent1dc41e58a553e612e3d0349bb60eef08f9462bde (diff)
sh: Fixup various PAGE_SIZE == 4096 assumptions.
There were a number of places that made evil PAGE_SIZE == 4k assumptions that ended up breaking when trying to play with 8k and 64k page sizes, this fixes those up. The most significant change is the way we load THREAD_SIZE, previously this was done via: mov #(THREAD_SIZE >> 8), reg shll8 reg to avoid a memory access and allow the immediate load. With a 64k PAGE_SIZE, we're out of range for the immediate load size without resorting to special instructions available in later ISAs (movi20s and so on). The "workaround" for this is to bump up the shift to 10 and insert a shll2, which gives a bit more flexibility while still being much cheaper than a memory access. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/head.S')
-rw-r--r--arch/sh/kernel/head.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/sh/kernel/head.S b/arch/sh/kernel/head.S
index b5ff23264617..6aca4bc6ec5d 100644
--- a/arch/sh/kernel/head.S
+++ b/arch/sh/kernel/head.S
@@ -33,7 +33,7 @@ ENTRY(empty_zero_page)
33 .long 0x00360000 /* INITRD_START */ 33 .long 0x00360000 /* INITRD_START */
34 .long 0x000a0000 /* INITRD_SIZE */ 34 .long 0x000a0000 /* INITRD_SIZE */
35 .long 0 35 .long 0
36 .balign 4096,0,4096 36 .balign PAGE_SIZE,0,PAGE_SIZE
37 37
38 .text 38 .text
39/* 39/*
@@ -70,8 +70,9 @@ ENTRY(_stext)
70 ! 70 !
71 mov.l 2f, r0 71 mov.l 2f, r0
72 mov r0, r15 ! Set initial r15 (stack pointer) 72 mov r0, r15 ! Set initial r15 (stack pointer)
73 mov #(THREAD_SIZE >> 8), r1 73 mov #(THREAD_SIZE >> 10), r1
74 shll8 r1 ! r1 = THREAD_SIZE 74 shll8 r1 ! r1 = THREAD_SIZE
75 shll2 r1
75 sub r1, r0 ! 76 sub r1, r0 !
76#ifdef CONFIG_CPU_HAS_SR_RB 77#ifdef CONFIG_CPU_HAS_SR_RB
77 ldc r0, r7_bank ! ... and initial thread_info 78 ldc r0, r7_bank ! ... and initial thread_info