diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 02:00:04 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 02:00:04 -0400 |
commit | b7e108ee63624176af85b97d4d80bef6fe099395 (patch) | |
tree | 747d9a2e760c6aa955dd4f228caaf433228ce5a0 /arch/sh/kernel | |
parent | 298476220d1f793ca0ac6c9e5dc817e1ad3e9851 (diff) |
sh: BSS init bugfix and barrier in entry point.
A synco is needed before we jump to start_kernel().
While we're at it, also move the sh_cpu_init() jump until after
we've zeroed BSS, as this has caused some undesirable results
in sh_cpu_init().
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/head.S | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/arch/sh/kernel/head.S b/arch/sh/kernel/head.S index 00cd4708ef46..c5e363872b91 100644 --- a/arch/sh/kernel/head.S +++ b/arch/sh/kernel/head.S | |||
@@ -12,6 +12,17 @@ | |||
12 | */ | 12 | */ |
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | 14 | ||
15 | #ifdef CONFIG_CPU_SH4A | ||
16 | #define SYNCO() synco | ||
17 | |||
18 | #define PREFI(label, reg) \ | ||
19 | mov.l label, reg; \ | ||
20 | prefi @reg | ||
21 | #else | ||
22 | #define SYNCO() | ||
23 | #define PREFI(label, reg) | ||
24 | #endif | ||
25 | |||
15 | .section .empty_zero_page, "aw" | 26 | .section .empty_zero_page, "aw" |
16 | ENTRY(empty_zero_page) | 27 | ENTRY(empty_zero_page) |
17 | .long 1 /* MOUNT_ROOT_RDONLY */ | 28 | .long 1 /* MOUNT_ROOT_RDONLY */ |
@@ -42,6 +53,17 @@ ENTRY(_stext) | |||
42 | ! Initialize global interrupt mask | 53 | ! Initialize global interrupt mask |
43 | mov #0, r0 | 54 | mov #0, r0 |
44 | ldc r0, r6_bank | 55 | ldc r0, r6_bank |
56 | |||
57 | /* | ||
58 | * Prefetch if possible to reduce cache miss penalty. | ||
59 | * | ||
60 | * We do this early on for SH-4A as a micro-optimization, | ||
61 | * as later on we will have speculative execution enabled | ||
62 | * and this will become less of an issue. | ||
63 | */ | ||
64 | PREFI(5f, r0) | ||
65 | PREFI(6f, r0) | ||
66 | |||
45 | ! | 67 | ! |
46 | mov.l 2f, r0 | 68 | mov.l 2f, r0 |
47 | mov r0, r15 ! Set initial r15 (stack pointer) | 69 | mov r0, r15 ! Set initial r15 (stack pointer) |
@@ -49,11 +71,7 @@ ENTRY(_stext) | |||
49 | shll8 r1 ! r1 = 8192 | 71 | shll8 r1 ! r1 = 8192 |
50 | sub r1, r0 ! | 72 | sub r1, r0 ! |
51 | ldc r0, r7_bank ! ... and initial thread_info | 73 | ldc r0, r7_bank ! ... and initial thread_info |
52 | ! | 74 | |
53 | ! Additional CPU initialization | ||
54 | mov.l 6f, r0 | ||
55 | jsr @r0 | ||
56 | nop | ||
57 | ! Clear BSS area | 75 | ! Clear BSS area |
58 | mov.l 3f, r1 | 76 | mov.l 3f, r1 |
59 | add #4, r1 | 77 | add #4, r1 |
@@ -62,6 +80,14 @@ ENTRY(_stext) | |||
62 | 9: cmp/hs r2, r1 | 80 | 9: cmp/hs r2, r1 |
63 | bf/s 9b ! while (r1 < r2) | 81 | bf/s 9b ! while (r1 < r2) |
64 | mov.l r0,@-r2 | 82 | mov.l r0,@-r2 |
83 | |||
84 | ! Additional CPU initialization | ||
85 | mov.l 6f, r0 | ||
86 | jsr @r0 | ||
87 | nop | ||
88 | |||
89 | SYNCO() ! Wait for pending instructions.. | ||
90 | |||
65 | ! Start kernel | 91 | ! Start kernel |
66 | mov.l 5f, r0 | 92 | mov.l 5f, r0 |
67 | jmp @r0 | 93 | jmp @r0 |