aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/Makefile9
-rw-r--r--arch/powerpc/kernel/asm-offsets.c11
-rw-r--r--arch/powerpc/kernel/cpu_setup_44x.S1
-rw-r--r--arch/powerpc/kernel/cpu_setup_6xx.S8
-rw-r--r--arch/powerpc/kernel/cputable.c4
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S11
-rw-r--r--arch/powerpc/kernel/misc_32.S6
-rw-r--r--arch/powerpc/kernel/misc_64.S20
-rw-r--r--arch/powerpc/kernel/of_platform.c2
-rw-r--r--arch/powerpc/kernel/paca.c87
-rw-r--r--arch/powerpc/kernel/ppc32.h2
-rw-r--r--arch/powerpc/kernel/process.c31
-rw-r--r--arch/powerpc/kernel/prom.c4
-rw-r--r--arch/powerpc/kernel/prom_init_check.sh58
-rw-r--r--arch/powerpc/kernel/ptrace32.c27
-rw-r--r--arch/powerpc/kernel/setup_64.c5
-rw-r--r--arch/powerpc/kernel/stacktrace.c1
-rw-r--r--arch/powerpc/kernel/udbg.c4
18 files changed, 163 insertions, 128 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index ce1e8d24e747..9177b21b1a95 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -106,4 +106,13 @@ PHONY += systbl_chk
106systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i 106systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
107 $(call cmd,systbl_chk) 107 $(call cmd,systbl_chk)
108 108
109$(obj)/built-in.o: prom_init_check
110
111quiet_cmd_prom_init_check = CALL $<
112 cmd_prom_init_check = $(CONFIG_SHELL) $< "$(NM)" "$(obj)/prom_init.o"
113
114PHONY += prom_init_check
115prom_init_check: $(src)/prom_init_check.sh $(obj)/prom_init.o
116 $(call cmd,prom_init_check)
117
109clean-files := vmlinux.lds 118clean-files := vmlinux.lds
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 292c6d8db0e1..adf1d09d726f 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -93,10 +93,7 @@ int main(void)
93 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags)); 93 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
94 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 94 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
95 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 95 DEFINE(TI_TASK, offsetof(struct thread_info, task));
96#ifdef CONFIG_PPC32
97 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
98 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 96 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
99#endif /* CONFIG_PPC32 */
100 97
101#ifdef CONFIG_PPC64 98#ifdef CONFIG_PPC64
102 DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size)); 99 DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size));
@@ -165,13 +162,9 @@ int main(void)
165 162
166 /* Interrupt register frame */ 163 /* Interrupt register frame */
167 DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD); 164 DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD);
168#ifndef CONFIG_PPC64 165 DEFINE(INT_FRAME_SIZE, STACK_INT_FRAME_SIZE);
169 DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); 166#ifdef CONFIG_PPC64
170#else /* CONFIG_PPC64 */
171 DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); 167 DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
172 /* 288 = # of volatile regs, int & fp, for leaf routines */
173 /* which do not stack a frame. See the PPC64 ABI. */
174 DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 288);
175 /* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */ 168 /* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */
176 DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); 169 DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
177 DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); 170 DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
diff --git a/arch/powerpc/kernel/cpu_setup_44x.S b/arch/powerpc/kernel/cpu_setup_44x.S
index 5465e8de0e61..e3623e3e3451 100644
--- a/arch/powerpc/kernel/cpu_setup_44x.S
+++ b/arch/powerpc/kernel/cpu_setup_44x.S
@@ -33,7 +33,6 @@ _GLOBAL(__setup_cpu_440grx)
33 mtlr r4 33 mtlr r4
34 blr 34 blr
35_GLOBAL(__setup_cpu_460ex) 35_GLOBAL(__setup_cpu_460ex)
36_GLOBAL(__setup_cpu_460gt)
37 b __init_fpu_44x 36 b __init_fpu_44x
38_GLOBAL(__setup_cpu_440gx) 37_GLOBAL(__setup_cpu_440gx)
39_GLOBAL(__setup_cpu_440spe) 38_GLOBAL(__setup_cpu_440spe)
diff --git a/arch/powerpc/kernel/cpu_setup_6xx.S b/arch/powerpc/kernel/cpu_setup_6xx.S
index f1ee0b3f78f2..72d1d7395254 100644
--- a/arch/powerpc/kernel/cpu_setup_6xx.S
+++ b/arch/powerpc/kernel/cpu_setup_6xx.S
@@ -17,7 +17,13 @@
17#include <asm/cache.h> 17#include <asm/cache.h>
18 18
19_GLOBAL(__setup_cpu_603) 19_GLOBAL(__setup_cpu_603)
20 b setup_common_caches 20 mflr r4
21BEGIN_FTR_SECTION
22 bl __init_fpu_registers
23END_FTR_SECTION_IFCLR(CPU_FTR_FPU_UNAVAILABLE)
24 bl setup_common_caches
25 mtlr r4
26 blr
21_GLOBAL(__setup_cpu_604) 27_GLOBAL(__setup_cpu_604)
22 mflr r4 28 mflr r4
23 bl setup_common_caches 29 bl setup_common_caches
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 26ffb44e2701..36080d4d1922 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -37,7 +37,6 @@ extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
37extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec); 37extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
38extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec); 38extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
39extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec); 39extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec);
40extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec);
41extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec); 40extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
42extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec); 41extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
43extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec); 42extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
@@ -1416,10 +1415,9 @@ static struct cpu_spec __initdata cpu_specs[] = {
1416 .pvr_value = 0x13020000, 1415 .pvr_value = 0x13020000,
1417 .cpu_name = "460GT", 1416 .cpu_name = "460GT",
1418 .cpu_features = CPU_FTRS_44X, 1417 .cpu_features = CPU_FTRS_44X,
1419 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, 1418 .cpu_user_features = COMMON_USER_BOOKE,
1420 .icache_bsize = 32, 1419 .icache_bsize = 32,
1421 .dcache_bsize = 32, 1420 .dcache_bsize = 32,
1422 .cpu_setup = __setup_cpu_460gt,
1423 .machine_check = machine_check_440A, 1421 .machine_check = machine_check_440A,
1424 .platform = "ppc440", 1422 .platform = "ppc440",
1425 }, 1423 },
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 4ff744143566..e581524d85bc 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -371,6 +371,17 @@ skpinv: addi r6,r6,1 /* Increment */
371 371
372 bl early_init 372 bl early_init
373 373
374#ifdef CONFIG_RELOCATABLE
375 lis r3,kernstart_addr@ha
376 la r3,kernstart_addr@l(r3)
377#ifdef CONFIG_PHYS_64BIT
378 stw r23,0(r3)
379 stw r25,4(r3)
380#else
381 stw r25,0(r3)
382#endif
383#endif
384
374 mfspr r3,SPRN_TLB1CFG 385 mfspr r3,SPRN_TLB1CFG
375 andi. r3,r3,0xfff 386 andi. r3,r3,0xfff
376 lis r4,num_tlbcam_entries@ha 387 lis r4,num_tlbcam_entries@ha
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 9d2c56621f1e..92ccc6fcc5b0 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -152,7 +152,7 @@ _GLOBAL(low_choose_750fx_pll)
152 mtspr SPRN_HID1,r4 152 mtspr SPRN_HID1,r4
153 153
154 /* Store new HID1 image */ 154 /* Store new HID1 image */
155 rlwinm r6,r1,0,0,18 155 rlwinm r6,r1,0,0,(31-THREAD_SHIFT)
156 lwz r6,TI_CPU(r6) 156 lwz r6,TI_CPU(r6)
157 slwi r6,r6,2 157 slwi r6,r6,2
158 addis r6,r6,nap_save_hid1@ha 158 addis r6,r6,nap_save_hid1@ha
@@ -281,7 +281,7 @@ _GLOBAL(_tlbia)
281#endif /* CONFIG_SMP */ 281#endif /* CONFIG_SMP */
282#else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */ 282#else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */
283#if defined(CONFIG_SMP) 283#if defined(CONFIG_SMP)
284 rlwinm r8,r1,0,0,18 284 rlwinm r8,r1,0,0,(31-THREAD_SHIFT)
285 lwz r8,TI_CPU(r8) 285 lwz r8,TI_CPU(r8)
286 oris r8,r8,10 286 oris r8,r8,10
287 mfmsr r10 287 mfmsr r10
@@ -377,7 +377,7 @@ _GLOBAL(_tlbie)
377#endif /* CONFIG_SMP */ 377#endif /* CONFIG_SMP */
378#else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */ 378#else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */
379#if defined(CONFIG_SMP) 379#if defined(CONFIG_SMP)
380 rlwinm r8,r1,0,0,18 380 rlwinm r8,r1,0,0,(31-THREAD_SHIFT)
381 lwz r8,TI_CPU(r8) 381 lwz r8,TI_CPU(r8)
382 oris r8,r8,11 382 oris r8,r8,11
383 mfmsr r10 383 mfmsr r10
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index a3c491e88a72..942951e76586 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -27,23 +27,11 @@
27 27
28 .text 28 .text
29 29
30_GLOBAL(get_msr)
31 mfmsr r3
32 blr
33
34_GLOBAL(get_srr0)
35 mfsrr0 r3
36 blr
37
38_GLOBAL(get_srr1)
39 mfsrr1 r3
40 blr
41
42#ifdef CONFIG_IRQSTACKS 30#ifdef CONFIG_IRQSTACKS
43_GLOBAL(call_do_softirq) 31_GLOBAL(call_do_softirq)
44 mflr r0 32 mflr r0
45 std r0,16(r1) 33 std r0,16(r1)
46 stdu r1,THREAD_SIZE-112(r3) 34 stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3)
47 mr r1,r3 35 mr r1,r3
48 bl .__do_softirq 36 bl .__do_softirq
49 ld r1,0(r1) 37 ld r1,0(r1)
@@ -56,7 +44,7 @@ _GLOBAL(call_handle_irq)
56 mflr r0 44 mflr r0
57 std r0,16(r1) 45 std r0,16(r1)
58 mtctr r8 46 mtctr r8
59 stdu r1,THREAD_SIZE-112(r5) 47 stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r5)
60 mr r1,r5 48 mr r1,r5
61 bctrl 49 bctrl
62 ld r1,0(r1) 50 ld r1,0(r1)
@@ -599,7 +587,7 @@ _GLOBAL(kexec_sequence)
599 std r0,16(r1) 587 std r0,16(r1)
600 588
601 /* switch stacks to newstack -- &kexec_stack.stack */ 589 /* switch stacks to newstack -- &kexec_stack.stack */
602 stdu r1,THREAD_SIZE-112(r3) 590 stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3)
603 mr r1,r3 591 mr r1,r3
604 592
605 li r0,0 593 li r0,0
@@ -616,7 +604,7 @@ _GLOBAL(kexec_sequence)
616 std r26,-48(r1) 604 std r26,-48(r1)
617 std r25,-56(r1) 605 std r25,-56(r1)
618 606
619 stdu r1,-112-64(r1) 607 stdu r1,-STACK_FRAME_OVERHEAD-64(r1)
620 608
621 /* save args into preserved regs */ 609 /* save args into preserved regs */
622 mr r31,r3 /* newstack (both) */ 610 mr r31,r3 /* newstack (both) */
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index fb698d47082d..e79ad8afda07 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -275,6 +275,8 @@ static int __devinit of_pci_phb_probe(struct of_device *dev,
275 275
276 /* Scan the bus */ 276 /* Scan the bus */
277 scan_phb(phb); 277 scan_phb(phb);
278 if (phb->bus == NULL)
279 return -ENXIO;
278 280
279 /* Claim resources. This might need some rework as well depending 281 /* Claim resources. This might need some rework as well depending
280 * wether we are doing probe-only or not, like assigning unassigned 282 * wether we are doing probe-only or not, like assigning unassigned
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index ac163bd46cfd..c9bf17eec31b 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -7,17 +7,11 @@
7 * 2 of the License, or (at your option) any later version. 7 * 2 of the License, or (at your option) any later version.
8 */ 8 */
9 9
10#include <linux/types.h>
11#include <linux/threads.h> 10#include <linux/threads.h>
12#include <linux/module.h> 11#include <linux/module.h>
13 12
14#include <asm/processor.h>
15#include <asm/ptrace.h>
16#include <asm/page.h>
17#include <asm/lppaca.h> 13#include <asm/lppaca.h>
18#include <asm/paca.h> 14#include <asm/paca.h>
19#include <asm/mmu.h>
20
21 15
22/* This symbol is provided by the linker - let it fill in the paca 16/* This symbol is provided by the linker - let it fill in the paca
23 * field correctly */ 17 * field correctly */
@@ -65,60 +59,29 @@ struct slb_shadow slb_shadow[] __cacheline_aligned = {
65 * processors. The processor VPD array needs one entry per physical 59 * processors. The processor VPD array needs one entry per physical
66 * processor (not thread). 60 * processor (not thread).
67 */ 61 */
68#define PACA_INIT(number) \ 62struct paca_struct paca[NR_CPUS];
69{ \
70 .lppaca_ptr = &lppaca[number], \
71 .lock_token = 0x8000, \
72 .paca_index = (number), /* Paca Index */ \
73 .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \
74 .hw_cpu_id = 0xffff, \
75 .slb_shadow_ptr = &slb_shadow[number], \
76 .__current = &init_task, \
77}
78
79struct paca_struct paca[] = {
80 PACA_INIT(0),
81#if NR_CPUS > 1
82 PACA_INIT( 1), PACA_INIT( 2), PACA_INIT( 3),
83#if NR_CPUS > 4
84 PACA_INIT( 4), PACA_INIT( 5), PACA_INIT( 6), PACA_INIT( 7),
85#if NR_CPUS > 8
86 PACA_INIT( 8), PACA_INIT( 9), PACA_INIT( 10), PACA_INIT( 11),
87 PACA_INIT( 12), PACA_INIT( 13), PACA_INIT( 14), PACA_INIT( 15),
88 PACA_INIT( 16), PACA_INIT( 17), PACA_INIT( 18), PACA_INIT( 19),
89 PACA_INIT( 20), PACA_INIT( 21), PACA_INIT( 22), PACA_INIT( 23),
90 PACA_INIT( 24), PACA_INIT( 25), PACA_INIT( 26), PACA_INIT( 27),
91 PACA_INIT( 28), PACA_INIT( 29), PACA_INIT( 30), PACA_INIT( 31),
92#if NR_CPUS > 32
93 PACA_INIT( 32), PACA_INIT( 33), PACA_INIT( 34), PACA_INIT( 35),
94 PACA_INIT( 36), PACA_INIT( 37), PACA_INIT( 38), PACA_INIT( 39),
95 PACA_INIT( 40), PACA_INIT( 41), PACA_INIT( 42), PACA_INIT( 43),
96 PACA_INIT( 44), PACA_INIT( 45), PACA_INIT( 46), PACA_INIT( 47),
97 PACA_INIT( 48), PACA_INIT( 49), PACA_INIT( 50), PACA_INIT( 51),
98 PACA_INIT( 52), PACA_INIT( 53), PACA_INIT( 54), PACA_INIT( 55),
99 PACA_INIT( 56), PACA_INIT( 57), PACA_INIT( 58), PACA_INIT( 59),
100 PACA_INIT( 60), PACA_INIT( 61), PACA_INIT( 62), PACA_INIT( 63),
101#if NR_CPUS > 64
102 PACA_INIT( 64), PACA_INIT( 65), PACA_INIT( 66), PACA_INIT( 67),
103 PACA_INIT( 68), PACA_INIT( 69), PACA_INIT( 70), PACA_INIT( 71),
104 PACA_INIT( 72), PACA_INIT( 73), PACA_INIT( 74), PACA_INIT( 75),
105 PACA_INIT( 76), PACA_INIT( 77), PACA_INIT( 78), PACA_INIT( 79),
106 PACA_INIT( 80), PACA_INIT( 81), PACA_INIT( 82), PACA_INIT( 83),
107 PACA_INIT( 84), PACA_INIT( 85), PACA_INIT( 86), PACA_INIT( 87),
108 PACA_INIT( 88), PACA_INIT( 89), PACA_INIT( 90), PACA_INIT( 91),
109 PACA_INIT( 92), PACA_INIT( 93), PACA_INIT( 94), PACA_INIT( 95),
110 PACA_INIT( 96), PACA_INIT( 97), PACA_INIT( 98), PACA_INIT( 99),
111 PACA_INIT(100), PACA_INIT(101), PACA_INIT(102), PACA_INIT(103),
112 PACA_INIT(104), PACA_INIT(105), PACA_INIT(106), PACA_INIT(107),
113 PACA_INIT(108), PACA_INIT(109), PACA_INIT(110), PACA_INIT(111),
114 PACA_INIT(112), PACA_INIT(113), PACA_INIT(114), PACA_INIT(115),
115 PACA_INIT(116), PACA_INIT(117), PACA_INIT(118), PACA_INIT(119),
116 PACA_INIT(120), PACA_INIT(121), PACA_INIT(122), PACA_INIT(123),
117 PACA_INIT(124), PACA_INIT(125), PACA_INIT(126), PACA_INIT(127),
118#endif
119#endif
120#endif
121#endif
122#endif
123};
124EXPORT_SYMBOL(paca); 63EXPORT_SYMBOL(paca);
64
65void __init initialise_pacas(void)
66{
67 int cpu;
68
69 /* The TOC register (GPR2) points 32kB into the TOC, so that 64kB
70 * of the TOC can be addressed using a single machine instruction.
71 */
72 unsigned long kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL;
73
74 /* Can't use for_each_*_cpu, as they aren't functional yet */
75 for (cpu = 0; cpu < NR_CPUS; cpu++) {
76 struct paca_struct *new_paca = &paca[cpu];
77
78 new_paca->lppaca_ptr = &lppaca[cpu];
79 new_paca->lock_token = 0x8000;
80 new_paca->paca_index = cpu;
81 new_paca->kernel_toc = kernel_toc;
82 new_paca->hw_cpu_id = 0xffff;
83 new_paca->slb_shadow_ptr = &slb_shadow[cpu];
84 new_paca->__current = &init_task;
85
86 }
87}
diff --git a/arch/powerpc/kernel/ppc32.h b/arch/powerpc/kernel/ppc32.h
index fda05e2211d6..90e562771791 100644
--- a/arch/powerpc/kernel/ppc32.h
+++ b/arch/powerpc/kernel/ppc32.h
@@ -135,6 +135,4 @@ struct ucontext32 {
135 struct mcontext32 uc_mcontext; 135 struct mcontext32 uc_mcontext;
136}; 136};
137 137
138extern int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s);
139
140#endif /* _PPC64_PPC32_H */ 138#endif /* _PPC64_PPC32_H */
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 703100d5e458..6caad17ea72e 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1033,3 +1033,34 @@ void ppc64_runlatch_off(void)
1033 } 1033 }
1034} 1034}
1035#endif 1035#endif
1036
1037#if THREAD_SHIFT < PAGE_SHIFT
1038
1039static struct kmem_cache *thread_info_cache;
1040
1041struct thread_info *alloc_thread_info(struct task_struct *tsk)
1042{
1043 struct thread_info *ti;
1044
1045 ti = kmem_cache_alloc(thread_info_cache, GFP_KERNEL);
1046 if (unlikely(ti == NULL))
1047 return NULL;
1048#ifdef CONFIG_DEBUG_STACK_USAGE
1049 memset(ti, 0, THREAD_SIZE);
1050#endif
1051 return ti;
1052}
1053
1054void free_thread_info(struct thread_info *ti)
1055{
1056 kmem_cache_free(thread_info_cache, ti);
1057}
1058
1059void thread_info_cache_init(void)
1060{
1061 thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
1062 THREAD_SIZE, 0, NULL);
1063 BUG_ON(thread_info_cache == NULL);
1064}
1065
1066#endif /* THREAD_SHIFT < PAGE_SHIFT */
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 3bfe7837e820..2aefe2a4129a 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -53,6 +53,7 @@
53#include <asm/pci-bridge.h> 53#include <asm/pci-bridge.h>
54#include <asm/phyp_dump.h> 54#include <asm/phyp_dump.h>
55#include <asm/kexec.h> 55#include <asm/kexec.h>
56#include <mm/mmu_decl.h>
56 57
57#ifdef DEBUG 58#ifdef DEBUG
58#define DBG(fmt...) printk(KERN_ERR fmt) 59#define DBG(fmt...) printk(KERN_ERR fmt)
@@ -978,7 +979,10 @@ static int __init early_init_dt_scan_memory(unsigned long node,
978 } 979 }
979#endif 980#endif
980 lmb_add(base, size); 981 lmb_add(base, size);
982
983 memstart_addr = min((u64)memstart_addr, base);
981 } 984 }
985
982 return 0; 986 return 0;
983} 987}
984 988
diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
new file mode 100644
index 000000000000..8e24fc1821e8
--- /dev/null
+++ b/arch/powerpc/kernel/prom_init_check.sh
@@ -0,0 +1,58 @@
1#!/bin/sh
2#
3# Copyright © 2008 IBM Corporation
4#
5# This program is free software; you can redistribute it and/or
6# modify it under the terms of the GNU General Public License
7# as published by the Free Software Foundation; either version
8# 2 of the License, or (at your option) any later version.
9
10# This script checks prom_init.o to see what external symbols it
11# is using, if it finds symbols not in the whitelist it returns
12# an error. The point of this is to discourage people from
13# intentionally or accidentally adding new code to prom_init.c
14# which has side effects on other parts of the kernel.
15
16# If you really need to reference something from prom_init.o add
17# it to the list below:
18
19WHITELIST="add_reloc_offset __bss_start __bss_stop copy_and_flush
20_end enter_prom memcpy memset reloc_offset __secondary_hold
21__secondary_hold_acknowledge __secondary_hold_spinloop __start
22strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224
23reloc_got2"
24
25NM="$1"
26OBJ="$2"
27
28ERROR=0
29
30for UNDEF in $($NM -u $OBJ | awk '{print $2}')
31do
32 # On 64-bit nm gives us the function descriptors, which have
33 # a leading . on the name, so strip it off here.
34 UNDEF="${UNDEF#.}"
35
36 if [ $KBUILD_VERBOSE ]; then
37 if [ $KBUILD_VERBOSE -ne 0 ]; then
38 echo "Checking prom_init.o symbol '$UNDEF'"
39 fi
40 fi
41
42 OK=0
43 for WHITE in $WHITELIST
44 do
45 if [ "$UNDEF" = "$WHITE" ]; then
46 OK=1
47 break
48 fi
49 done
50
51 if [ $OK -eq 0 ]; then
52 ERROR=1
53 echo "Error: External symbol '$UNDEF' referenced" \
54 "from prom_init.c" >&2
55 fi
56done
57
58exit $ERROR
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
index 9d30e10970ac..4c1de6af4c09 100644
--- a/arch/powerpc/kernel/ptrace32.c
+++ b/arch/powerpc/kernel/ptrace32.c
@@ -29,15 +29,12 @@
29#include <linux/security.h> 29#include <linux/security.h>
30#include <linux/signal.h> 30#include <linux/signal.h>
31#include <linux/compat.h> 31#include <linux/compat.h>
32#include <linux/elf.h>
33 32
34#include <asm/uaccess.h> 33#include <asm/uaccess.h>
35#include <asm/page.h> 34#include <asm/page.h>
36#include <asm/pgtable.h> 35#include <asm/pgtable.h>
37#include <asm/system.h> 36#include <asm/system.h>
38 37
39#include "ppc32.h"
40
41/* 38/*
42 * does not yet catch signals sent when the child dies. 39 * does not yet catch signals sent when the child dies.
43 * in exit.c or in signal.c. 40 * in exit.c or in signal.c.
@@ -67,27 +64,6 @@ static long compat_ptrace_old(struct task_struct *child, long request,
67 return -EPERM; 64 return -EPERM;
68} 65}
69 66
70static int compat_ptrace_getsiginfo(struct task_struct *child, compat_siginfo_t __user *data)
71{
72 siginfo_t lastinfo;
73 int error = -ESRCH;
74
75 read_lock(&tasklist_lock);
76 if (likely(child->sighand != NULL)) {
77 error = -EINVAL;
78 spin_lock_irq(&child->sighand->siglock);
79 if (likely(child->last_siginfo != NULL)) {
80 lastinfo = *child->last_siginfo;
81 error = 0;
82 }
83 spin_unlock_irq(&child->sighand->siglock);
84 }
85 read_unlock(&tasklist_lock);
86 if (!error)
87 return copy_siginfo_to_user32(data, &lastinfo);
88 return error;
89}
90
91long compat_arch_ptrace(struct task_struct *child, compat_long_t request, 67long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
92 compat_ulong_t caddr, compat_ulong_t cdata) 68 compat_ulong_t caddr, compat_ulong_t cdata)
93{ 69{
@@ -306,9 +282,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
306 0, PT_REGS_COUNT * sizeof(compat_long_t), 282 0, PT_REGS_COUNT * sizeof(compat_long_t),
307 compat_ptr(data)); 283 compat_ptr(data));
308 284
309 case PTRACE_GETSIGINFO:
310 return compat_ptrace_getsiginfo(child, compat_ptr(data));
311
312 case PTRACE_GETFPREGS: 285 case PTRACE_GETFPREGS:
313 case PTRACE_SETFPREGS: 286 case PTRACE_SETFPREGS:
314 case PTRACE_GETVRREGS: 287 case PTRACE_GETVRREGS:
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 31ada9fdfc5c..dff6308d1b5e 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -170,6 +170,9 @@ void __init setup_paca(int cpu)
170 170
171void __init early_setup(unsigned long dt_ptr) 171void __init early_setup(unsigned long dt_ptr)
172{ 172{
173 /* Fill in any unititialised pacas */
174 initialise_pacas();
175
173 /* Identify CPU type */ 176 /* Identify CPU type */
174 identify_cpu(0, mfspr(SPRN_PVR)); 177 identify_cpu(0, mfspr(SPRN_PVR));
175 178
@@ -435,7 +438,7 @@ void __init setup_system(void)
435 printk("htab_address = 0x%p\n", htab_address); 438 printk("htab_address = 0x%p\n", htab_address);
436 printk("htab_hash_mask = 0x%lx\n", htab_hash_mask); 439 printk("htab_hash_mask = 0x%lx\n", htab_hash_mask);
437#if PHYSICAL_START > 0 440#if PHYSICAL_START > 0
438 printk("physical_start = 0x%x\n", PHYSICAL_START); 441 printk("physical_start = 0x%lx\n", PHYSICAL_START);
439#endif 442#endif
440 printk("-----------------------------------------------------\n"); 443 printk("-----------------------------------------------------\n");
441 444
diff --git a/arch/powerpc/kernel/stacktrace.c b/arch/powerpc/kernel/stacktrace.c
index e3638eeaaae7..962944038430 100644
--- a/arch/powerpc/kernel/stacktrace.c
+++ b/arch/powerpc/kernel/stacktrace.c
@@ -13,7 +13,6 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/stacktrace.h> 14#include <linux/stacktrace.h>
15#include <asm/ptrace.h> 15#include <asm/ptrace.h>
16#include <asm/asm-offsets.h>
17 16
18/* 17/*
19 * Save stack-backtrace addresses into a stack_trace buffer. 18 * Save stack-backtrace addresses into a stack_trace buffer.
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index 7aad6203e411..7d6c9bb8c77f 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -154,8 +154,8 @@ static void udbg_console_write(struct console *con, const char *s,
154static struct console udbg_console = { 154static struct console udbg_console = {
155 .name = "udbg", 155 .name = "udbg",
156 .write = udbg_console_write, 156 .write = udbg_console_write,
157 .flags = CON_PRINTBUFFER | CON_ENABLED | CON_BOOT, 157 .flags = CON_PRINTBUFFER | CON_ENABLED | CON_BOOT | CON_ANYTIME,
158 .index = -1, 158 .index = 0,
159}; 159};
160 160
161static int early_console_initialized; 161static int early_console_initialized;