aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu
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/cpu
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/cpu')
-rw-r--r--arch/sh/kernel/cpu/sh3/entry.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S
index 5de99b498738..7ba3dcbe7504 100644
--- a/arch/sh/kernel/cpu/sh3/entry.S
+++ b/arch/sh/kernel/cpu/sh3/entry.S
@@ -335,7 +335,7 @@ general_exception:
335/* This code makes some assumptions to improve performance. 335/* This code makes some assumptions to improve performance.
336 * Make sure they are stil true. */ 336 * Make sure they are stil true. */
337#if PTRS_PER_PGD != PTRS_PER_PTE 337#if PTRS_PER_PGD != PTRS_PER_PTE
338#error PDG and PTE sizes don't match 338#error PGD and PTE sizes don't match
339#endif 339#endif
340 340
341/* gas doesn't flag impossible values for mov #immediate as an error */ 341/* gas doesn't flag impossible values for mov #immediate as an error */
@@ -547,8 +547,9 @@ ENTRY(handle_exception)
547 bt/s 1f ! It's a kernel to kernel transition. 547 bt/s 1f ! It's a kernel to kernel transition.
548 mov r15, k0 ! save original stack to k0 548 mov r15, k0 ! save original stack to k0
549 /* User space to kernel */ 549 /* User space to kernel */
550 mov #(THREAD_SIZE >> 8), k1 550 mov #(THREAD_SIZE >> 10), k1
551 shll8 k1 ! k1 := THREAD_SIZE 551 shll8 k1 ! k1 := THREAD_SIZE
552 shll2 k1
552 add current, k1 553 add current, k1
553 mov k1, r15 ! change to kernel stack 554 mov k1, r15 ! change to kernel stack
554 ! 555 !