aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-12-01 04:56:43 -0500
committerDavid Woodhouse <dwmw2@infradead.org>2006-12-01 04:56:43 -0500
commitbd3c97a7c718bfb9f1e4f31c16c383a5c6f815eb (patch)
tree3f56594e813c6f35cbacbdb3e137ba5bfd0b3069 /arch/ppc
parent6c33cafc794d07c9254c160789120a0e98c088c9 (diff)
parent0215ffb08ce99e2bb59eca114a99499a4d06e704 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/boot/simple/relocate.S6
-rw-r--r--arch/ppc/kernel/misc.S74
-rw-r--r--arch/ppc/kernel/setup.c10
-rw-r--r--arch/ppc/kernel/traps.c18
-rw-r--r--arch/ppc/kernel/vmlinux.lds.S8
5 files changed, 20 insertions, 96 deletions
diff --git a/arch/ppc/boot/simple/relocate.S b/arch/ppc/boot/simple/relocate.S
index 0c021556d78e..1bbbcd2f2bcb 100644
--- a/arch/ppc/boot/simple/relocate.S
+++ b/arch/ppc/boot/simple/relocate.S
@@ -154,8 +154,8 @@ do_relocate_out:
154 154
155start_ldr: 155start_ldr:
156/* Clear all of BSS and set up stack for C calls */ 156/* Clear all of BSS and set up stack for C calls */
157 lis r3,edata@h 157 lis r3,__bss_start@h
158 ori r3,r3,edata@l 158 ori r3,r3,__bss_start@l
159 lis r4,end@h 159 lis r4,end@h
160 ori r4,r4,end@l 160 ori r4,r4,end@l
161 subi r3,r3,4 161 subi r3,r3,4
@@ -163,7 +163,7 @@ start_ldr:
163 li r0,0 163 li r0,0
16450: stwu r0,4(r3) 16450: stwu r0,4(r3)
165 cmpw cr0,r3,r4 165 cmpw cr0,r3,r4
166 bne 50b 166 blt 50b
16790: mr r9,r1 /* Save old stack pointer (in case it matters) */ 16790: mr r9,r1 /* Save old stack pointer (in case it matters) */
168 lis r1,.stack@h 168 lis r1,.stack@h
169 ori r1,r1,.stack@l 169 ori r1,r1,.stack@l
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 5f6684012ded..d319f9ba2379 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -110,80 +110,6 @@ _GLOBAL(reloc_got2)
110 blr 110 blr
111 111
112/* 112/*
113 * identify_cpu,
114 * called with r3 = data offset and r4 = CPU number
115 * doesn't change r3
116 */
117_GLOBAL(identify_cpu)
118 addis r8,r3,cpu_specs@ha
119 addi r8,r8,cpu_specs@l
120 mfpvr r7
1211:
122 lwz r5,CPU_SPEC_PVR_MASK(r8)
123 and r5,r5,r7
124 lwz r6,CPU_SPEC_PVR_VALUE(r8)
125 cmplw 0,r6,r5
126 beq 1f
127 addi r8,r8,CPU_SPEC_ENTRY_SIZE
128 b 1b
1291:
130 addis r6,r3,cur_cpu_spec@ha
131 addi r6,r6,cur_cpu_spec@l
132 sub r8,r8,r3
133 stw r8,0(r6)
134 blr
135
136/*
137 * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
138 * and writes nop's over sections of code that don't apply for this cpu.
139 * r3 = data offset (not changed)
140 */
141_GLOBAL(do_cpu_ftr_fixups)
142 /* Get CPU 0 features */
143 addis r6,r3,cur_cpu_spec@ha
144 addi r6,r6,cur_cpu_spec@l
145 lwz r4,0(r6)
146 add r4,r4,r3
147 lwz r4,CPU_SPEC_FEATURES(r4)
148
149 /* Get the fixup table */
150 addis r6,r3,__start___ftr_fixup@ha
151 addi r6,r6,__start___ftr_fixup@l
152 addis r7,r3,__stop___ftr_fixup@ha
153 addi r7,r7,__stop___ftr_fixup@l
154
155 /* Do the fixup */
1561: cmplw 0,r6,r7
157 bgelr
158 addi r6,r6,16
159 lwz r8,-16(r6) /* mask */
160 and r8,r8,r4
161 lwz r9,-12(r6) /* value */
162 cmplw 0,r8,r9
163 beq 1b
164 lwz r8,-8(r6) /* section begin */
165 lwz r9,-4(r6) /* section end */
166 subf. r9,r8,r9
167 beq 1b
168 /* write nops over the section of code */
169 /* todo: if large section, add a branch at the start of it */
170 srwi r9,r9,2
171 mtctr r9
172 add r8,r8,r3
173 lis r0,0x60000000@h /* nop */
1743: stw r0,0(r8)
175 andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
176 beq 2f
177 dcbst 0,r8 /* suboptimal, but simpler */
178 sync
179 icbi 0,r8
1802: addi r8,r8,4
181 bdnz 3b
182 sync /* additional sync needed on g4 */
183 isync
184 b 1b
185
186/*
187 * call_setup_cpu - call the setup_cpu function for this cpu 113 * call_setup_cpu - call the setup_cpu function for this cpu
188 * r3 = data offset, r24 = cpu number 114 * r3 = data offset, r24 = cpu number
189 * 115 *
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 75fe13815be2..27faeca2c7a2 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -38,6 +38,7 @@
38#include <asm/nvram.h> 38#include <asm/nvram.h>
39#include <asm/xmon.h> 39#include <asm/xmon.h>
40#include <asm/ocp.h> 40#include <asm/ocp.h>
41#include <asm/prom.h>
41 42
42#define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \ 43#define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \
43 defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \ 44 defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \
@@ -53,8 +54,6 @@
53 54
54extern void platform_init(unsigned long r3, unsigned long r4, 55extern void platform_init(unsigned long r3, unsigned long r4,
55 unsigned long r5, unsigned long r6, unsigned long r7); 56 unsigned long r5, unsigned long r6, unsigned long r7);
56extern void identify_cpu(unsigned long offset, unsigned long cpu);
57extern void do_cpu_ftr_fixups(unsigned long offset);
58extern void reloc_got2(unsigned long offset); 57extern void reloc_got2(unsigned long offset);
59 58
60extern void ppc6xx_idle(void); 59extern void ppc6xx_idle(void);
@@ -301,6 +300,7 @@ early_init(int r3, int r4, int r5)
301{ 300{
302 unsigned long phys; 301 unsigned long phys;
303 unsigned long offset = reloc_offset(); 302 unsigned long offset = reloc_offset();
303 struct cpu_spec *spec;
304 304
305 /* Default */ 305 /* Default */
306 phys = offset + KERNELBASE; 306 phys = offset + KERNELBASE;
@@ -313,8 +313,10 @@ early_init(int r3, int r4, int r5)
313 * Identify the CPU type and fix up code sections 313 * Identify the CPU type and fix up code sections
314 * that depend on which cpu we have. 314 * that depend on which cpu we have.
315 */ 315 */
316 identify_cpu(offset, 0); 316 spec = identify_cpu(offset);
317 do_cpu_ftr_fixups(offset); 317 do_feature_fixups(spec->cpu_features,
318 PTRRELOC(&__start___ftr_fixup),
319 PTRRELOC(&__stop___ftr_fixup));
318 320
319 return phys; 321 return phys;
320} 322}
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index aafc8e8893d1..9661a91183b3 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -708,7 +708,7 @@ void single_step_exception(struct pt_regs *regs)
708 708
709void alignment_exception(struct pt_regs *regs) 709void alignment_exception(struct pt_regs *regs)
710{ 710{
711 int fixed; 711 int sig, code, fixed = 0;
712 712
713 fixed = fix_alignment(regs); 713 fixed = fix_alignment(regs);
714 if (fixed == 1) { 714 if (fixed == 1) {
@@ -717,14 +717,16 @@ void alignment_exception(struct pt_regs *regs)
717 return; 717 return;
718 } 718 }
719 if (fixed == -EFAULT) { 719 if (fixed == -EFAULT) {
720 /* fixed == -EFAULT means the operand address was bad */ 720 sig = SIGSEGV;
721 if (user_mode(regs)) 721 code = SEGV_ACCERR;
722 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar); 722 } else {
723 else 723 sig = SIGBUS;
724 bad_page_fault(regs, regs->dar, SIGSEGV); 724 code = BUS_ADRALN;
725 return;
726 } 725 }
727 _exception(SIGBUS, regs, BUS_ADRALN, regs->dar); 726 if (user_mode(regs))
727 _exception(sig, regs, code, regs->dar);
728 else
729 bad_page_fault(regs, regs->dar, sig);
728} 730}
729 731
730void StackOverflow(struct pt_regs *regs) 732void StackOverflow(struct pt_regs *regs)
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index 095fd3323323..16e8661e1fec 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -115,13 +115,7 @@ SECTIONS
115 __setup_end = .; 115 __setup_end = .;
116 __initcall_start = .; 116 __initcall_start = .;
117 .initcall.init : { 117 .initcall.init : {
118 *(.initcall1.init) 118 INITCALLS
119 *(.initcall2.init)
120 *(.initcall3.init)
121 *(.initcall4.init)
122 *(.initcall5.init)
123 *(.initcall6.init)
124 *(.initcall7.init)
125 } 119 }
126 __initcall_end = .; 120 __initcall_end = .;
127 121