aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/Kconfig12
-rw-r--r--arch/powerpc/Kconfig.debug2
-rw-r--r--arch/powerpc/Makefile28
-rw-r--r--arch/powerpc/kernel/Makefile20
-rw-r--r--arch/powerpc/kernel/asm-offsets.c220
-rw-r--r--arch/powerpc/kernel/head.S84
-rw-r--r--arch/powerpc/kernel/head_44x.S14
-rw-r--r--arch/powerpc/kernel/head_4xx.S52
-rw-r--r--arch/powerpc/kernel/head_64.S9
-rw-r--r--arch/powerpc/kernel/head_8xx.S42
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S24
-rw-r--r--arch/powerpc/kernel/idle_power4.S (renamed from arch/ppc64/kernel/idle_power4.S)5
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c16
-rw-r--r--arch/powerpc/kernel/traps.c407
-rw-r--r--arch/powerpc/kernel/vmlinux.lds174
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S190
-rw-r--r--arch/powerpc/platforms/iseries/call_sm.h37
-rw-r--r--arch/powerpc/platforms/iseries/ipl_parms.h70
-rw-r--r--arch/powerpc/platforms/iseries/irq.c3
-rw-r--r--arch/powerpc/platforms/iseries/irq.h8
-rw-r--r--arch/powerpc/platforms/iseries/lpardata.c10
-rw-r--r--arch/powerpc/platforms/iseries/lparmap.c (renamed from arch/ppc64/kernel/lparmap.c)0
-rw-r--r--arch/powerpc/platforms/iseries/lpevents.c2
-rw-r--r--arch/powerpc/platforms/iseries/main_store.h165
-rw-r--r--arch/powerpc/platforms/iseries/pci.c3
-rw-r--r--arch/powerpc/platforms/iseries/proc.c5
-rw-r--r--arch/powerpc/platforms/iseries/processor_vpd.h85
-rw-r--r--arch/powerpc/platforms/iseries/release_data.h63
-rw-r--r--arch/powerpc/platforms/iseries/setup.c10
-rw-r--r--arch/powerpc/platforms/iseries/spcomm_area.h36
-rw-r--r--arch/powerpc/platforms/iseries/vpd_areas.h88
-rw-r--r--arch/ppc/kernel/Makefile2
-rw-r--r--arch/ppc/kernel/fpu.S133
-rw-r--r--arch/ppc/kernel/head.S84
-rw-r--r--arch/ppc/kernel/head_44x.S14
-rw-r--r--arch/ppc/kernel/head_4xx.S52
-rw-r--r--arch/ppc/kernel/head_8xx.S42
-rw-r--r--arch/ppc/kernel/head_booke.h4
-rw-r--r--arch/ppc/kernel/head_fsl_booke.S24
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c16
-rw-r--r--arch/ppc/kernel/traps.c20
-rw-r--r--arch/ppc/kernel/vector.S217
-rw-r--r--arch/ppc/syslib/ibm44x_common.c2
-rw-r--r--arch/ppc/syslib/ppc4xx_setup.c2
-rw-r--r--arch/ppc64/Makefile2
-rw-r--r--arch/ppc64/kernel/Makefile16
-rw-r--r--arch/ppc64/kernel/traps.c568
-rw-r--r--arch/ppc64/kernel/vector.S172
48 files changed, 1477 insertions, 1777 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index edfac467b9e0..34be3247fca4 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -142,8 +142,8 @@ config POWER4
142 def_bool y 142 def_bool y
143 143
144config PPC_FPU 144config PPC_FPU
145 bool 145 depends on PPC32
146 default y if PPC64 146 def_bool y
147 147
148config BOOKE 148config BOOKE
149 bool 149 bool
@@ -317,7 +317,7 @@ config PPC_BPA
317 317
318config PPC_OF 318config PPC_OF
319 bool 319 bool
320 depends on PPC_MULTIPLATFORM # for now 320 depends on PPC_MULTIPLATFORM || PPC_ISERIES
321 default y 321 default y
322 322
323config XICS 323config XICS
@@ -833,6 +833,12 @@ config PIN_TLB
833 depends on ADVANCED_OPTIONS && 8xx 833 depends on ADVANCED_OPTIONS && 8xx
834endmenu 834endmenu
835 835
836if PPC64
837config KERNEL_START
838 hex
839 default "0xc000000000000000"
840endif
841
836source "net/Kconfig" 842source "net/Kconfig"
837 843
838source "drivers/Kconfig" 844source "drivers/Kconfig"
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 61653cb60c4e..19df881bf67b 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -55,7 +55,7 @@ config BDI_SWITCH
55 55
56config BOOTX_TEXT 56config BOOTX_TEXT
57 bool "Support for early boot text console (BootX or OpenFirmware only)" 57 bool "Support for early boot text console (BootX or OpenFirmware only)"
58 depends PPC_OF 58 depends PPC_OF && !PPC_ISERIES
59 help 59 help
60 Say Y here to see progress messages from the boot firmware in text 60 Say Y here to see progress messages from the boot firmware in text
61 mode. Requires either BootX or Open Firmware. 61 mode. Requires either BootX or Open Firmware.
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 92751ca6f8b1..eb1224c24e3e 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -121,16 +121,17 @@ head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o
121 121
122ifeq ($(CONFIG_PPC32),y) 122ifeq ($(CONFIG_PPC32),y)
123head-$(CONFIG_6xx) += arch/powerpc/kernel/idle_6xx.o 123head-$(CONFIG_6xx) += arch/powerpc/kernel/idle_6xx.o
124head-$(CONFIG_POWER4) += arch/powerpc/kernel/idle_power4.o
125head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o 124head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
126endif 125endif
127 126
128core-y += arch/powerpc/kernel/ \ 127core-y += arch/powerpc/kernel/
129 arch/$(OLDARCH)/kernel/ \ 128core-y += arch/$(OLDARCH)/kernel/
130 arch/powerpc/mm/ \ 129core-$(CONFIG_PPC32) += arch/powerpc/mm/
131 arch/powerpc/lib/ \ 130core-$(CONFIG_PPC64) += arch/$(OLDARCH)/mm/
132 arch/powerpc/sysdev/ \ 131core-$(CONFIG_PPC32) += arch/powerpc/lib/
133 arch/powerpc/platforms/ 132libs-$(CONFIG_PPC64) += arch/$(OLDARCH)/lib/
133core-y += arch/powerpc/sysdev/
134core-y += arch/powerpc/platforms/
134core-$(CONFIG_PPC32) += arch/ppc/syslib/ 135core-$(CONFIG_PPC32) += arch/ppc/syslib/
135core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/ 136core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/
136core-$(CONFIG_XMON) += arch/powerpc/xmon/ 137core-$(CONFIG_XMON) += arch/powerpc/xmon/
@@ -141,17 +142,20 @@ drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
141 142
142drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ 143drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
143 144
144BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm 145defaultimage-$(CONFIG_PPC32) := uImage zImage
145 146defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
146.PHONY: $(BOOT_TARGETS) 147KBUILD_IMAGE := $(defaultimage-y)
147 148all: $(KBUILD_IMAGE)
148all: uImage zImage
149 149
150CPPFLAGS_vmlinux.lds := -Upowerpc 150CPPFLAGS_vmlinux.lds := -Upowerpc
151 151
152# All the instructions talk about "make bzImage". 152# All the instructions talk about "make bzImage".
153bzImage: zImage 153bzImage: zImage
154 154
155BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
156
157.PHONY: $(BOOT_TARGETS)
158
155boot := arch/$(OLDARCH)/boot 159boot := arch/$(OLDARCH)/boot
156 160
157$(BOOT_TARGETS): vmlinux 161$(BOOT_TARGETS): vmlinux
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 58c130b10ec8..be3f9d123a6d 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -2,17 +2,31 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5ifeq ($(CONFIG_PPC64),y)
6EXTRA_CFLAGS += -mno-minimal-toc
7endif
8
9ifeq ($(CONFIG_PPC32),y)
5extra-$(CONFIG_PPC_STD_MMU) := head.o 10extra-$(CONFIG_PPC_STD_MMU) := head.o
6extra_$(CONFIG_PPC64) := head_64.o 11endif
12extra-$(CONFIG_PPC64) := head_64.o
7extra-$(CONFIG_40x) := head_4xx.o 13extra-$(CONFIG_40x) := head_4xx.o
8extra-$(CONFIG_44x) := head_44x.o 14extra-$(CONFIG_44x) := head_44x.o
9extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o 15extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
10extra-$(CONFIG_8xx) := head_8xx.o 16extra-$(CONFIG_8xx) := head_8xx.o
11extra-$(CONFIG_6xx) += idle_6xx.o 17extra-$(CONFIG_6xx) += idle_6xx.o
12extra-$(CONFIG_POWER4) += idle_power4.o
13extra-$(CONFIG_PPC_FPU) += fpu.o 18extra-$(CONFIG_PPC_FPU) += fpu.o
14extra-y += vmlinux.lds 19extra-y += vmlinux.lds
15 20
16obj-y := semaphore.o traps.o process.o 21obj-y := traps.o
22obj-$(CONFIG_PPC32) += semaphore.o process.o
23obj-$(CONFIG_PPC64) += idle_power4.o
24ifeq ($(CONFIG_PPC32),y)
17obj-$(CONFIG_MODULES) += ppc_ksyms.o 25obj-$(CONFIG_MODULES) += ppc_ksyms.o
26endif
18obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o 27obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
28
29ifeq ($(CONFIG_PPC_ISERIES),y)
30arch/powerpc/kernel/head_64.o: arch/powerpc/platforms/iseries/lparmap.s
31AFLAGS_head_64.o += -Iarch/powerpc/platforms/iseries
32endif
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 16cf0b7ee2b7..3a247c033e8b 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -20,17 +20,20 @@
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/ptrace.h>
24#include <linux/suspend.h>
25#include <linux/mman.h> 23#include <linux/mman.h>
26#include <linux/mm.h> 24#include <linux/mm.h>
25#ifdef CONFIG_PPC64
27#include <linux/time.h> 26#include <linux/time.h>
28#include <linux/hardirq.h> 27#include <linux/hardirq.h>
28#else
29#include <linux/ptrace.h>
30#include <linux/suspend.h>
31#endif
32
29#include <asm/io.h> 33#include <asm/io.h>
30#include <asm/page.h> 34#include <asm/page.h>
31#include <asm/pgtable.h> 35#include <asm/pgtable.h>
32#include <asm/processor.h> 36#include <asm/processor.h>
33
34#include <asm/cputable.h> 37#include <asm/cputable.h>
35#include <asm/thread_info.h> 38#include <asm/thread_info.h>
36#ifdef CONFIG_PPC64 39#ifdef CONFIG_PPC64
@@ -50,63 +53,117 @@
50 53
51int main(void) 54int main(void)
52{ 55{
53 /* thread struct on stack */ 56 DEFINE(THREAD, offsetof(struct task_struct, thread));
54 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 57 DEFINE(MM, offsetof(struct task_struct, mm));
55 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
56 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
57#ifdef CONFIG_PPC32
58 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
59#endif
60#ifdef CONFIG_PPC64 58#ifdef CONFIG_PPC64
61 DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror));
62 DEFINE(THREAD_SHIFT, THREAD_SHIFT); 59 DEFINE(THREAD_SHIFT, THREAD_SHIFT);
63#endif
64 DEFINE(THREAD_SIZE, THREAD_SIZE); 60 DEFINE(THREAD_SIZE, THREAD_SIZE);
65 61 DEFINE(AUDITCONTEXT, offsetof(struct task_struct, audit_context));
66 /* task_struct->thread */ 62#else
67 DEFINE(THREAD, offsetof(struct task_struct, thread));
68 DEFINE(THREAD_INFO, offsetof(struct task_struct, thread_info)); 63 DEFINE(THREAD_INFO, offsetof(struct task_struct, thread_info));
69 DEFINE(MM, offsetof(struct task_struct, mm));
70 DEFINE(PTRACE, offsetof(struct task_struct, ptrace)); 64 DEFINE(PTRACE, offsetof(struct task_struct, ptrace));
65#endif /* CONFIG_PPC64 */
66
71 DEFINE(KSP, offsetof(struct thread_struct, ksp)); 67 DEFINE(KSP, offsetof(struct thread_struct, ksp));
72 DEFINE(PGDIR, offsetof(struct thread_struct, pgdir));
73 DEFINE(LAST_SYSCALL, offsetof(struct thread_struct, last_syscall));
74 DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); 68 DEFINE(PT_REGS, offsetof(struct thread_struct, regs));
75 DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode)); 69 DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode));
76 DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0])); 70 DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0]));
77 DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr)); 71 DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr));
78#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
79 DEFINE(THREAD_DBCR0, offsetof(struct thread_struct, dbcr0));
80 DEFINE(PT_PTRACED, PT_PTRACED);
81#endif
82#ifdef CONFIG_PPC64
83 DEFINE(KSP_VSID, offsetof(struct thread_struct, ksp_vsid));
84#endif
85
86#ifdef CONFIG_ALTIVEC 72#ifdef CONFIG_ALTIVEC
87 DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0])); 73 DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0]));
88 DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave)); 74 DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave));
89 DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr)); 75 DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr));
90 DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr)); 76 DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr));
91#endif /* CONFIG_ALTIVEC */ 77#endif /* CONFIG_ALTIVEC */
78#ifdef CONFIG_PPC64
79 DEFINE(KSP_VSID, offsetof(struct thread_struct, ksp_vsid));
80#else /* CONFIG_PPC64 */
81 DEFINE(PGDIR, offsetof(struct thread_struct, pgdir));
82 DEFINE(LAST_SYSCALL, offsetof(struct thread_struct, last_syscall));
83#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
84 DEFINE(THREAD_DBCR0, offsetof(struct thread_struct, dbcr0));
85 DEFINE(PT_PTRACED, PT_PTRACED);
86#endif
92#ifdef CONFIG_SPE 87#ifdef CONFIG_SPE
93 DEFINE(THREAD_EVR0, offsetof(struct thread_struct, evr[0])); 88 DEFINE(THREAD_EVR0, offsetof(struct thread_struct, evr[0]));
94 DEFINE(THREAD_ACC, offsetof(struct thread_struct, acc)); 89 DEFINE(THREAD_ACC, offsetof(struct thread_struct, acc));
95 DEFINE(THREAD_SPEFSCR, offsetof(struct thread_struct, spefscr)); 90 DEFINE(THREAD_SPEFSCR, offsetof(struct thread_struct, spefscr));
96 DEFINE(THREAD_USED_SPE, offsetof(struct thread_struct, used_spe)); 91 DEFINE(THREAD_USED_SPE, offsetof(struct thread_struct, used_spe));
97#endif /* CONFIG_SPE */ 92#endif /* CONFIG_SPE */
93#endif /* CONFIG_PPC64 */
94
95 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
96 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
97#ifdef CONFIG_PPC64
98 DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror));
99#else
100 DEFINE(TI_TASK, offsetof(struct thread_info, task));
101 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
102 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
103 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
104#endif /* CONFIG_PPC64 */
105
106#ifdef CONFIG_PPC64
107 DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size));
108 DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_dline_size));
109 DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, dlines_per_page));
110 DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size));
111 DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
112 DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
113 DEFINE(PLATFORM, offsetof(struct systemcfg, platform));
114
115 /* paca */
116 DEFINE(PACA_SIZE, sizeof(struct paca_struct));
117 DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index));
118 DEFINE(PACAPROCSTART, offsetof(struct paca_struct, cpu_start));
119 DEFINE(PACAKSAVE, offsetof(struct paca_struct, kstack));
120 DEFINE(PACACURRENT, offsetof(struct paca_struct, __current));
121 DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, saved_msr));
122 DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real));
123 DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr));
124 DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr));
125 DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1));
126 DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc));
127 DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, proc_enabled));
128 DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
129 DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
130 DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
131#ifdef CONFIG_HUGETLB_PAGE
132 DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas));
133 DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas));
134#endif /* CONFIG_HUGETLB_PAGE */
135 DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr));
136 DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen));
137 DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc));
138 DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb));
139 DEFINE(PACA_EXDSI, offsetof(struct paca_struct, exdsi));
140 DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
141 DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca));
142 DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
143
144 DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0));
145 DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1));
146 DEFINE(LPPACAANYINT, offsetof(struct lppaca, int_dword.any_int));
147 DEFINE(LPPACADECRINT, offsetof(struct lppaca, int_dword.fields.decr_int));
148
149 /* RTAS */
150 DEFINE(RTASBASE, offsetof(struct rtas_t, base));
151 DEFINE(RTASENTRY, offsetof(struct rtas_t, entry));
152#endif /* CONFIG_PPC64 */
153
98 /* Interrupt register frame */ 154 /* Interrupt register frame */
99 DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD); 155 DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD);
100#ifndef CONFIG_PPC64 156#ifndef CONFIG_PPC64
101 DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); 157 DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
102#else 158#else /* CONFIG_PPC64 */
103 DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); 159 DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
104
105 /* 288 = # of volatile regs, int & fp, for leaf routines */ 160 /* 288 = # of volatile regs, int & fp, for leaf routines */
106 /* which do not stack a frame. See the PPC64 ABI. */ 161 /* which do not stack a frame. See the PPC64 ABI. */
107 DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 288); 162 DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 288);
108#endif 163 /* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */
109 /* in fact we only use gpr0 - gpr9 and gpr20 - gpr23 */ 164 DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
165 DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
166#endif /* CONFIG_PPC64 */
110 DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0])); 167 DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0]));
111 DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1])); 168 DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1]));
112 DEFINE(GPR2, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[2])); 169 DEFINE(GPR2, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[2]));
@@ -121,6 +178,7 @@ int main(void)
121 DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11])); 178 DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11]));
122 DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12])); 179 DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12]));
123 DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13])); 180 DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13]));
181#ifndef CONFIG_PPC64
124 DEFINE(GPR14, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[14])); 182 DEFINE(GPR14, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[14]));
125 DEFINE(GPR15, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[15])); 183 DEFINE(GPR15, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[15]));
126 DEFINE(GPR16, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[16])); 184 DEFINE(GPR16, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[16]));
@@ -139,6 +197,7 @@ int main(void)
139 DEFINE(GPR29, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[29])); 197 DEFINE(GPR29, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[29]));
140 DEFINE(GPR30, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[30])); 198 DEFINE(GPR30, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[30]));
141 DEFINE(GPR31, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[31])); 199 DEFINE(GPR31, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[31]));
200#endif /* CONFIG_PPC64 */
142 /* 201 /*
143 * Note: these symbols include _ because they overlap with special 202 * Note: these symbols include _ because they overlap with special
144 * register names 203 * register names
@@ -148,23 +207,37 @@ int main(void)
148 DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr)); 207 DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr));
149 DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link)); 208 DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link));
150 DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr)); 209 DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr));
151 DEFINE(_MQ, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, mq));
152 DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer)); 210 DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer));
153 DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar)); 211 DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar));
154 DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); 212 DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr));
155 /* The PowerPC 400-class & Book-E processors have neither the DAR nor the DSISR 213 DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3));
156 * SPRs. Hence, we overload them to hold the similar DEAR and ESR SPRs 214 DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result));
157 * for such processors. For critical interrupts we use them to 215#ifndef CONFIG_PPC64
158 * hold SRR0 and SRR1. 216 DEFINE(_MQ, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, mq));
217 /*
218 * The PowerPC 400-class & Book-E processors have neither the DAR
219 * nor the DSISR SPRs. Hence, we overload them to hold the similar
220 * DEAR and ESR SPRs for such processors. For critical interrupts
221 * we use them to hold SRR0 and SRR1.
159 */ 222 */
160 DEFINE(_DEAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar)); 223 DEFINE(_DEAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar));
161 DEFINE(_ESR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); 224 DEFINE(_ESR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr));
162 DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3));
163 DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result));
164 DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); 225 DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
226#else /* CONFIG_PPC64 */
227 DEFINE(_TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
228 DEFINE(SOFTE, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, softe));
229
230 /* These _only_ to be used with {PROM,RTAS}_FRAME_SIZE!!! */
231 DEFINE(_SRR0, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs));
232 DEFINE(_SRR1, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)+8);
233#endif /* CONFIG_PPC64 */
234
165 DEFINE(CLONE_VM, CLONE_VM); 235 DEFINE(CLONE_VM, CLONE_VM);
166 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); 236 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
237
238#ifndef CONFIG_PPC64
167 DEFINE(MM_PGD, offsetof(struct mm_struct, pgd)); 239 DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
240#endif /* ! CONFIG_PPC64 */
168 241
169 /* About the CPU features table */ 242 /* About the CPU features table */
170 DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec)); 243 DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec));
@@ -173,66 +246,13 @@ int main(void)
173 DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); 246 DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
174 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); 247 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
175 248
176#ifdef CONFIG_PPC64 249#ifndef CONFIG_PPC64
177 DEFINE(MM, offsetof(struct task_struct, mm)); 250 DEFINE(pbe_address, offsetof(struct pbe, address));
178 DEFINE(AUDITCONTEXT, offsetof(struct task_struct, audit_context)); 251 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
179 252 DEFINE(pbe_next, offsetof(struct pbe, next));
180 DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size));
181 DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_dline_size));
182 DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, dlines_per_page));
183 DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size));
184 DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
185 DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
186 DEFINE(PLATFORM, offsetof(struct systemcfg, platform));
187
188 /* paca */
189 DEFINE(PACA_SIZE, sizeof(struct paca_struct));
190 DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index));
191 DEFINE(PACAPROCSTART, offsetof(struct paca_struct, cpu_start));
192 DEFINE(PACAKSAVE, offsetof(struct paca_struct, kstack));
193 DEFINE(PACACURRENT, offsetof(struct paca_struct, __current));
194 DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, saved_msr));
195 DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real));
196 DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr));
197 DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr));
198 DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1));
199 DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc));
200 DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, proc_enabled));
201 DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
202 DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
203 DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
204#ifdef CONFIG_HUGETLB_PAGE
205 DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas));
206 DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas));
207#endif /* CONFIG_HUGETLB_PAGE */
208 DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr));
209 DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen));
210 DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc));
211 DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb));
212 DEFINE(PACA_EXDSI, offsetof(struct paca_struct, exdsi));
213 DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
214 DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca));
215 DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
216 DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0));
217 DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1));
218 DEFINE(LPPACAANYINT, offsetof(struct lppaca, int_dword.any_int));
219 DEFINE(LPPACADECRINT, offsetof(struct lppaca, int_dword.fields.decr_int));
220
221 /* RTAS */
222 DEFINE(RTASBASE, offsetof(struct rtas_t, base));
223 DEFINE(RTASENTRY, offsetof(struct rtas_t, entry));
224
225 DEFINE(_TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
226 DEFINE(SOFTE, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, softe));
227
228 /* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */
229 DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
230 DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
231
232 /* These _only_ to be used with {PROM,RTAS}_FRAME_SIZE!!! */
233 DEFINE(_SRR0, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs));
234 DEFINE(_SRR1, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)+8);
235 253
254 DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
255#else /* CONFIG_PPC64 */
236 /* systemcfg offsets for use by vdso */ 256 /* systemcfg offsets for use by vdso */
237 DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct systemcfg, tb_orig_stamp)); 257 DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct systemcfg, tb_orig_stamp));
238 DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct systemcfg, tb_ticks_per_sec)); 258 DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct systemcfg, tb_ticks_per_sec));
@@ -251,12 +271,6 @@ int main(void)
251 DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec)); 271 DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec));
252 DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest)); 272 DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest));
253 DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime)); 273 DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime));
254#endif 274#endif /* CONFIG_PPC64 */
255
256 DEFINE(pbe_address, offsetof(struct pbe, address));
257 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
258 DEFINE(pbe_next, offsetof(struct pbe, next));
259
260 DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
261 return 0; 275 return 0;
262} 276}
diff --git a/arch/powerpc/kernel/head.S b/arch/powerpc/kernel/head.S
index 8cdac7385e7f..2c3a1d34e3c7 100644
--- a/arch/powerpc/kernel/head.S
+++ b/arch/powerpc/kernel/head.S
@@ -349,12 +349,12 @@ i##n: \
349 349
350/* System reset */ 350/* System reset */
351/* core99 pmac starts the seconary here by changing the vector, and 351/* core99 pmac starts the seconary here by changing the vector, and
352 putting it back to what it was (UnknownException) when done. */ 352 putting it back to what it was (unknown_exception) when done. */
353#if defined(CONFIG_GEMINI) && defined(CONFIG_SMP) 353#if defined(CONFIG_GEMINI) && defined(CONFIG_SMP)
354 . = 0x100 354 . = 0x100
355 b __secondary_start_gemini 355 b __secondary_start_gemini
356#else 356#else
357 EXCEPTION(0x100, Reset, UnknownException, EXC_XFER_STD) 357 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
358#endif 358#endif
359 359
360/* Machine check */ 360/* Machine check */
@@ -389,7 +389,7 @@ i##n: \
389 cmpwi cr1,r4,0 389 cmpwi cr1,r4,0
390 bne cr1,1f 390 bne cr1,1f
391#endif 391#endif
392 EXC_XFER_STD(0x200, MachineCheckException) 392 EXC_XFER_STD(0x200, machine_check_exception)
393#ifdef CONFIG_PPC_CHRP 393#ifdef CONFIG_PPC_CHRP
3941: b machine_check_in_rtas 3941: b machine_check_in_rtas
395#endif 395#endif
@@ -456,10 +456,10 @@ Alignment:
456 mfspr r5,SPRN_DSISR 456 mfspr r5,SPRN_DSISR
457 stw r5,_DSISR(r11) 457 stw r5,_DSISR(r11)
458 addi r3,r1,STACK_FRAME_OVERHEAD 458 addi r3,r1,STACK_FRAME_OVERHEAD
459 EXC_XFER_EE(0x600, AlignmentException) 459 EXC_XFER_EE(0x600, alignment_exception)
460 460
461/* Program check exception */ 461/* Program check exception */
462 EXCEPTION(0x700, ProgramCheck, ProgramCheckException, EXC_XFER_STD) 462 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
463 463
464/* Floating-point unavailable */ 464/* Floating-point unavailable */
465 . = 0x800 465 . = 0x800
@@ -472,8 +472,8 @@ FPUnavailable:
472/* Decrementer */ 472/* Decrementer */
473 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) 473 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
474 474
475 EXCEPTION(0xa00, Trap_0a, UnknownException, EXC_XFER_EE) 475 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
476 EXCEPTION(0xb00, Trap_0b, UnknownException, EXC_XFER_EE) 476 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
477 477
478/* System call */ 478/* System call */
479 . = 0xc00 479 . = 0xc00
@@ -482,8 +482,8 @@ SystemCall:
482 EXC_XFER_EE_LITE(0xc00, DoSyscall) 482 EXC_XFER_EE_LITE(0xc00, DoSyscall)
483 483
484/* Single step - not used on 601 */ 484/* Single step - not used on 601 */
485 EXCEPTION(0xd00, SingleStep, SingleStepException, EXC_XFER_STD) 485 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
486 EXCEPTION(0xe00, Trap_0e, UnknownException, EXC_XFER_EE) 486 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
487 487
488/* 488/*
489 * The Altivec unavailable trap is at 0x0f20. Foo. 489 * The Altivec unavailable trap is at 0x0f20. Foo.
@@ -502,7 +502,7 @@ SystemCall:
502Trap_0f: 502Trap_0f:
503 EXCEPTION_PROLOG 503 EXCEPTION_PROLOG
504 addi r3,r1,STACK_FRAME_OVERHEAD 504 addi r3,r1,STACK_FRAME_OVERHEAD
505 EXC_XFER_EE(0xf00, UnknownException) 505 EXC_XFER_EE(0xf00, unknown_exception)
506 506
507/* 507/*
508 * Handle TLB miss for instruction on 603/603e. 508 * Handle TLB miss for instruction on 603/603e.
@@ -702,44 +702,44 @@ DataStoreTLBMiss:
702 rfi 702 rfi
703 703
704#ifndef CONFIG_ALTIVEC 704#ifndef CONFIG_ALTIVEC
705#define AltivecAssistException UnknownException 705#define altivec_assist_exception unknown_exception
706#endif 706#endif
707 707
708 EXCEPTION(0x1300, Trap_13, InstructionBreakpoint, EXC_XFER_EE) 708 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE)
709 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE) 709 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE)
710 EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE) 710 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
711#ifdef CONFIG_POWER4 711#ifdef CONFIG_POWER4
712 EXCEPTION(0x1600, Trap_16, UnknownException, EXC_XFER_EE) 712 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
713 EXCEPTION(0x1700, Trap_17, AltivecAssistException, EXC_XFER_EE) 713 EXCEPTION(0x1700, Trap_17, altivec_assist_exception, EXC_XFER_EE)
714 EXCEPTION(0x1800, Trap_18, TAUException, EXC_XFER_STD) 714 EXCEPTION(0x1800, Trap_18, TAUException, EXC_XFER_STD)
715#else /* !CONFIG_POWER4 */ 715#else /* !CONFIG_POWER4 */
716 EXCEPTION(0x1600, Trap_16, AltivecAssistException, EXC_XFER_EE) 716 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE)
717 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD) 717 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD)
718 EXCEPTION(0x1800, Trap_18, UnknownException, EXC_XFER_EE) 718 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
719#endif /* CONFIG_POWER4 */ 719#endif /* CONFIG_POWER4 */
720 EXCEPTION(0x1900, Trap_19, UnknownException, EXC_XFER_EE) 720 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
721 EXCEPTION(0x1a00, Trap_1a, UnknownException, EXC_XFER_EE) 721 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
722 EXCEPTION(0x1b00, Trap_1b, UnknownException, EXC_XFER_EE) 722 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
723 EXCEPTION(0x1c00, Trap_1c, UnknownException, EXC_XFER_EE) 723 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
724 EXCEPTION(0x1d00, Trap_1d, UnknownException, EXC_XFER_EE) 724 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
725 EXCEPTION(0x1e00, Trap_1e, UnknownException, EXC_XFER_EE) 725 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
726 EXCEPTION(0x1f00, Trap_1f, UnknownException, EXC_XFER_EE) 726 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
727 EXCEPTION(0x2000, RunMode, RunModeException, EXC_XFER_EE) 727 EXCEPTION(0x2000, RunMode, RunModeException, EXC_XFER_EE)
728 EXCEPTION(0x2100, Trap_21, UnknownException, EXC_XFER_EE) 728 EXCEPTION(0x2100, Trap_21, unknown_exception, EXC_XFER_EE)
729 EXCEPTION(0x2200, Trap_22, UnknownException, EXC_XFER_EE) 729 EXCEPTION(0x2200, Trap_22, unknown_exception, EXC_XFER_EE)
730 EXCEPTION(0x2300, Trap_23, UnknownException, EXC_XFER_EE) 730 EXCEPTION(0x2300, Trap_23, unknown_exception, EXC_XFER_EE)
731 EXCEPTION(0x2400, Trap_24, UnknownException, EXC_XFER_EE) 731 EXCEPTION(0x2400, Trap_24, unknown_exception, EXC_XFER_EE)
732 EXCEPTION(0x2500, Trap_25, UnknownException, EXC_XFER_EE) 732 EXCEPTION(0x2500, Trap_25, unknown_exception, EXC_XFER_EE)
733 EXCEPTION(0x2600, Trap_26, UnknownException, EXC_XFER_EE) 733 EXCEPTION(0x2600, Trap_26, unknown_exception, EXC_XFER_EE)
734 EXCEPTION(0x2700, Trap_27, UnknownException, EXC_XFER_EE) 734 EXCEPTION(0x2700, Trap_27, unknown_exception, EXC_XFER_EE)
735 EXCEPTION(0x2800, Trap_28, UnknownException, EXC_XFER_EE) 735 EXCEPTION(0x2800, Trap_28, unknown_exception, EXC_XFER_EE)
736 EXCEPTION(0x2900, Trap_29, UnknownException, EXC_XFER_EE) 736 EXCEPTION(0x2900, Trap_29, unknown_exception, EXC_XFER_EE)
737 EXCEPTION(0x2a00, Trap_2a, UnknownException, EXC_XFER_EE) 737 EXCEPTION(0x2a00, Trap_2a, unknown_exception, EXC_XFER_EE)
738 EXCEPTION(0x2b00, Trap_2b, UnknownException, EXC_XFER_EE) 738 EXCEPTION(0x2b00, Trap_2b, unknown_exception, EXC_XFER_EE)
739 EXCEPTION(0x2c00, Trap_2c, UnknownException, EXC_XFER_EE) 739 EXCEPTION(0x2c00, Trap_2c, unknown_exception, EXC_XFER_EE)
740 EXCEPTION(0x2d00, Trap_2d, UnknownException, EXC_XFER_EE) 740 EXCEPTION(0x2d00, Trap_2d, unknown_exception, EXC_XFER_EE)
741 EXCEPTION(0x2e00, Trap_2e, UnknownException, EXC_XFER_EE) 741 EXCEPTION(0x2e00, Trap_2e, unknown_exception, EXC_XFER_EE)
742 EXCEPTION(0x2f00, MOLTrampoline, UnknownException, EXC_XFER_EE_LITE) 742 EXCEPTION(0x2f00, MOLTrampoline, unknown_exception, EXC_XFER_EE_LITE)
743 743
744 .globl mol_trampoline 744 .globl mol_trampoline
745 .set mol_trampoline, i0x2f00 745 .set mol_trampoline, i0x2f00
@@ -751,7 +751,7 @@ AltiVecUnavailable:
751#ifdef CONFIG_ALTIVEC 751#ifdef CONFIG_ALTIVEC
752 bne load_up_altivec /* if from user, just load it up */ 752 bne load_up_altivec /* if from user, just load it up */
753#endif /* CONFIG_ALTIVEC */ 753#endif /* CONFIG_ALTIVEC */
754 EXC_XFER_EE_LITE(0xf20, AltivecUnavailException) 754 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
755 755
756#ifdef CONFIG_PPC64BRIDGE 756#ifdef CONFIG_PPC64BRIDGE
757DataAccess: 757DataAccess:
@@ -767,12 +767,12 @@ DataSegment:
767 addi r3,r1,STACK_FRAME_OVERHEAD 767 addi r3,r1,STACK_FRAME_OVERHEAD
768 mfspr r4,SPRN_DAR 768 mfspr r4,SPRN_DAR
769 stw r4,_DAR(r11) 769 stw r4,_DAR(r11)
770 EXC_XFER_STD(0x380, UnknownException) 770 EXC_XFER_STD(0x380, unknown_exception)
771 771
772InstructionSegment: 772InstructionSegment:
773 EXCEPTION_PROLOG 773 EXCEPTION_PROLOG
774 addi r3,r1,STACK_FRAME_OVERHEAD 774 addi r3,r1,STACK_FRAME_OVERHEAD
775 EXC_XFER_STD(0x480, UnknownException) 775 EXC_XFER_STD(0x480, unknown_exception)
776#endif /* CONFIG_PPC64BRIDGE */ 776#endif /* CONFIG_PPC64BRIDGE */
777 777
778#ifdef CONFIG_ALTIVEC 778#ifdef CONFIG_ALTIVEC
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 599245b0407e..b1b9dc08abca 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -309,13 +309,13 @@ skpinv: addi r4,r4,1 /* Increment */
309 309
310interrupt_base: 310interrupt_base:
311 /* Critical Input Interrupt */ 311 /* Critical Input Interrupt */
312 CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) 312 CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
313 313
314 /* Machine Check Interrupt */ 314 /* Machine Check Interrupt */
315#ifdef CONFIG_440A 315#ifdef CONFIG_440A
316 MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 316 MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
317#else 317#else
318 CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 318 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
319#endif 319#endif
320 320
321 /* Data Storage Interrupt */ 321 /* Data Storage Interrupt */
@@ -442,7 +442,7 @@ interrupt_base:
442#ifdef CONFIG_PPC_FPU 442#ifdef CONFIG_PPC_FPU
443 FP_UNAVAILABLE_EXCEPTION 443 FP_UNAVAILABLE_EXCEPTION
444#else 444#else
445 EXCEPTION(0x2010, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) 445 EXCEPTION(0x2010, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
446#endif 446#endif
447 447
448 /* System Call Interrupt */ 448 /* System Call Interrupt */
@@ -451,21 +451,21 @@ interrupt_base:
451 EXC_XFER_EE_LITE(0x0c00, DoSyscall) 451 EXC_XFER_EE_LITE(0x0c00, DoSyscall)
452 452
453 /* Auxillary Processor Unavailable Interrupt */ 453 /* Auxillary Processor Unavailable Interrupt */
454 EXCEPTION(0x2020, AuxillaryProcessorUnavailable, UnknownException, EXC_XFER_EE) 454 EXCEPTION(0x2020, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
455 455
456 /* Decrementer Interrupt */ 456 /* Decrementer Interrupt */
457 DECREMENTER_EXCEPTION 457 DECREMENTER_EXCEPTION
458 458
459 /* Fixed Internal Timer Interrupt */ 459 /* Fixed Internal Timer Interrupt */
460 /* TODO: Add FIT support */ 460 /* TODO: Add FIT support */
461 EXCEPTION(0x1010, FixedIntervalTimer, UnknownException, EXC_XFER_EE) 461 EXCEPTION(0x1010, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
462 462
463 /* Watchdog Timer Interrupt */ 463 /* Watchdog Timer Interrupt */
464 /* TODO: Add watchdog support */ 464 /* TODO: Add watchdog support */
465#ifdef CONFIG_BOOKE_WDT 465#ifdef CONFIG_BOOKE_WDT
466 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException) 466 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException)
467#else 467#else
468 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, UnknownException) 468 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, unknown_exception)
469#endif 469#endif
470 470
471 /* Data TLB Error Interrupt */ 471 /* Data TLB Error Interrupt */
diff --git a/arch/powerpc/kernel/head_4xx.S b/arch/powerpc/kernel/head_4xx.S
index 8562b807b37c..5772ce97e24e 100644
--- a/arch/powerpc/kernel/head_4xx.S
+++ b/arch/powerpc/kernel/head_4xx.S
@@ -245,12 +245,12 @@ label:
245/* 245/*
246 * 0x0100 - Critical Interrupt Exception 246 * 0x0100 - Critical Interrupt Exception
247 */ 247 */
248 CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, UnknownException) 248 CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, unknown_exception)
249 249
250/* 250/*
251 * 0x0200 - Machine Check Exception 251 * 0x0200 - Machine Check Exception
252 */ 252 */
253 CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 253 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
254 254
255/* 255/*
256 * 0x0300 - Data Storage Exception 256 * 0x0300 - Data Storage Exception
@@ -405,7 +405,7 @@ label:
405 mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */ 405 mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */
406 stw r4,_DEAR(r11) 406 stw r4,_DEAR(r11)
407 addi r3,r1,STACK_FRAME_OVERHEAD 407 addi r3,r1,STACK_FRAME_OVERHEAD
408 EXC_XFER_EE(0x600, AlignmentException) 408 EXC_XFER_EE(0x600, alignment_exception)
409 409
410/* 0x0700 - Program Exception */ 410/* 0x0700 - Program Exception */
411 START_EXCEPTION(0x0700, ProgramCheck) 411 START_EXCEPTION(0x0700, ProgramCheck)
@@ -413,21 +413,21 @@ label:
413 mfspr r4,SPRN_ESR /* Grab the ESR and save it */ 413 mfspr r4,SPRN_ESR /* Grab the ESR and save it */
414 stw r4,_ESR(r11) 414 stw r4,_ESR(r11)
415 addi r3,r1,STACK_FRAME_OVERHEAD 415 addi r3,r1,STACK_FRAME_OVERHEAD
416 EXC_XFER_STD(0x700, ProgramCheckException) 416 EXC_XFER_STD(0x700, program_check_exception)
417 417
418 EXCEPTION(0x0800, Trap_08, UnknownException, EXC_XFER_EE) 418 EXCEPTION(0x0800, Trap_08, unknown_exception, EXC_XFER_EE)
419 EXCEPTION(0x0900, Trap_09, UnknownException, EXC_XFER_EE) 419 EXCEPTION(0x0900, Trap_09, unknown_exception, EXC_XFER_EE)
420 EXCEPTION(0x0A00, Trap_0A, UnknownException, EXC_XFER_EE) 420 EXCEPTION(0x0A00, Trap_0A, unknown_exception, EXC_XFER_EE)
421 EXCEPTION(0x0B00, Trap_0B, UnknownException, EXC_XFER_EE) 421 EXCEPTION(0x0B00, Trap_0B, unknown_exception, EXC_XFER_EE)
422 422
423/* 0x0C00 - System Call Exception */ 423/* 0x0C00 - System Call Exception */
424 START_EXCEPTION(0x0C00, SystemCall) 424 START_EXCEPTION(0x0C00, SystemCall)
425 NORMAL_EXCEPTION_PROLOG 425 NORMAL_EXCEPTION_PROLOG
426 EXC_XFER_EE_LITE(0xc00, DoSyscall) 426 EXC_XFER_EE_LITE(0xc00, DoSyscall)
427 427
428 EXCEPTION(0x0D00, Trap_0D, UnknownException, EXC_XFER_EE) 428 EXCEPTION(0x0D00, Trap_0D, unknown_exception, EXC_XFER_EE)
429 EXCEPTION(0x0E00, Trap_0E, UnknownException, EXC_XFER_EE) 429 EXCEPTION(0x0E00, Trap_0E, unknown_exception, EXC_XFER_EE)
430 EXCEPTION(0x0F00, Trap_0F, UnknownException, EXC_XFER_EE) 430 EXCEPTION(0x0F00, Trap_0F, unknown_exception, EXC_XFER_EE)
431 431
432/* 0x1000 - Programmable Interval Timer (PIT) Exception */ 432/* 0x1000 - Programmable Interval Timer (PIT) Exception */
433 START_EXCEPTION(0x1000, Decrementer) 433 START_EXCEPTION(0x1000, Decrementer)
@@ -444,14 +444,14 @@ label:
444 444
445/* 0x1010 - Fixed Interval Timer (FIT) Exception 445/* 0x1010 - Fixed Interval Timer (FIT) Exception
446*/ 446*/
447 STND_EXCEPTION(0x1010, FITException, UnknownException) 447 STND_EXCEPTION(0x1010, FITException, unknown_exception)
448 448
449/* 0x1020 - Watchdog Timer (WDT) Exception 449/* 0x1020 - Watchdog Timer (WDT) Exception
450*/ 450*/
451#ifdef CONFIG_BOOKE_WDT 451#ifdef CONFIG_BOOKE_WDT
452 CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException) 452 CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException)
453#else 453#else
454 CRITICAL_EXCEPTION(0x1020, WDTException, UnknownException) 454 CRITICAL_EXCEPTION(0x1020, WDTException, unknown_exception)
455#endif 455#endif
456#endif 456#endif
457 457
@@ -656,25 +656,25 @@ label:
656 mfspr r10, SPRN_SPRG0 656 mfspr r10, SPRN_SPRG0
657 b InstructionAccess 657 b InstructionAccess
658 658
659 EXCEPTION(0x1300, Trap_13, UnknownException, EXC_XFER_EE) 659 EXCEPTION(0x1300, Trap_13, unknown_exception, EXC_XFER_EE)
660 EXCEPTION(0x1400, Trap_14, UnknownException, EXC_XFER_EE) 660 EXCEPTION(0x1400, Trap_14, unknown_exception, EXC_XFER_EE)
661 EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE) 661 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
662 EXCEPTION(0x1600, Trap_16, UnknownException, EXC_XFER_EE) 662 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
663#ifdef CONFIG_IBM405_ERR51 663#ifdef CONFIG_IBM405_ERR51
664 /* 405GP errata 51 */ 664 /* 405GP errata 51 */
665 START_EXCEPTION(0x1700, Trap_17) 665 START_EXCEPTION(0x1700, Trap_17)
666 b DTLBMiss 666 b DTLBMiss
667#else 667#else
668 EXCEPTION(0x1700, Trap_17, UnknownException, EXC_XFER_EE) 668 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
669#endif 669#endif
670 EXCEPTION(0x1800, Trap_18, UnknownException, EXC_XFER_EE) 670 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
671 EXCEPTION(0x1900, Trap_19, UnknownException, EXC_XFER_EE) 671 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
672 EXCEPTION(0x1A00, Trap_1A, UnknownException, EXC_XFER_EE) 672 EXCEPTION(0x1A00, Trap_1A, unknown_exception, EXC_XFER_EE)
673 EXCEPTION(0x1B00, Trap_1B, UnknownException, EXC_XFER_EE) 673 EXCEPTION(0x1B00, Trap_1B, unknown_exception, EXC_XFER_EE)
674 EXCEPTION(0x1C00, Trap_1C, UnknownException, EXC_XFER_EE) 674 EXCEPTION(0x1C00, Trap_1C, unknown_exception, EXC_XFER_EE)
675 EXCEPTION(0x1D00, Trap_1D, UnknownException, EXC_XFER_EE) 675 EXCEPTION(0x1D00, Trap_1D, unknown_exception, EXC_XFER_EE)
676 EXCEPTION(0x1E00, Trap_1E, UnknownException, EXC_XFER_EE) 676 EXCEPTION(0x1E00, Trap_1E, unknown_exception, EXC_XFER_EE)
677 EXCEPTION(0x1F00, Trap_1F, UnknownException, EXC_XFER_EE) 677 EXCEPTION(0x1F00, Trap_1F, unknown_exception, EXC_XFER_EE)
678 678
679/* Check for a single step debug exception while in an exception 679/* Check for a single step debug exception while in an exception
680 * handler before state has been saved. This is to catch the case 680 * handler before state has been saved. This is to catch the case
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 22a5ee07e1ea..db0cd3587627 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -1253,7 +1253,7 @@ unrecov_slb:
1253 * 1253 *
1254 * On iSeries, the hypervisor must fill in at least one entry before 1254 * On iSeries, the hypervisor must fill in at least one entry before
1255 * we get control (with relocate on). The address is give to the hv 1255 * we get control (with relocate on). The address is give to the hv
1256 * as a page number (see xLparMap in LparData.c), so this must be at a 1256 * as a page number (see xLparMap in lpardata.c), so this must be at a
1257 * fixed address (the linker can't compute (u64)&initial_stab >> 1257 * fixed address (the linker can't compute (u64)&initial_stab >>
1258 * PAGE_SHIFT). 1258 * PAGE_SHIFT).
1259 */ 1259 */
@@ -1364,6 +1364,7 @@ _STATIC(__start_initialization_iSeries)
1364 addi r2,r2,0x4000 1364 addi r2,r2,0x4000
1365 1365
1366 bl .iSeries_early_setup 1366 bl .iSeries_early_setup
1367 bl .early_setup
1367 1368
1368 /* relocation is on at this point */ 1369 /* relocation is on at this point */
1369 1370
@@ -1970,20 +1971,22 @@ _GLOBAL(hmt_start_secondary)
1970 blr 1971 blr
1971#endif 1972#endif
1972 1973
1973#if defined(CONFIG_KEXEC) || (defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES)) 1974#if defined(CONFIG_KEXEC) || defined(CONFIG_SMP)
1974_GLOBAL(smp_release_cpus) 1975_GLOBAL(smp_release_cpus)
1975 /* All secondary cpus are spinning on a common 1976 /* All secondary cpus are spinning on a common
1976 * spinloop, release them all now so they can start 1977 * spinloop, release them all now so they can start
1977 * to spin on their individual paca spinloops. 1978 * to spin on their individual paca spinloops.
1978 * For non SMP kernels, the secondary cpus never 1979 * For non SMP kernels, the secondary cpus never
1979 * get out of the common spinloop. 1980 * get out of the common spinloop.
1981 * XXX This does nothing useful on iSeries, secondaries are
1982 * already waiting on their paca.
1980 */ 1983 */
1981 li r3,1 1984 li r3,1
1982 LOADADDR(r5,__secondary_hold_spinloop) 1985 LOADADDR(r5,__secondary_hold_spinloop)
1983 std r3,0(r5) 1986 std r3,0(r5)
1984 sync 1987 sync
1985 blr 1988 blr
1986#endif /* CONFIG_SMP && !CONFIG_PPC_ISERIES */ 1989#endif /* CONFIG_SMP */
1987 1990
1988 1991
1989/* 1992/*
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index cb1a3a54a026..de0978742221 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -203,7 +203,7 @@ i##n: \
203 ret_from_except) 203 ret_from_except)
204 204
205/* System reset */ 205/* System reset */
206 EXCEPTION(0x100, Reset, UnknownException, EXC_XFER_STD) 206 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
207 207
208/* Machine check */ 208/* Machine check */
209 . = 0x200 209 . = 0x200
@@ -214,7 +214,7 @@ MachineCheck:
214 mfspr r5,SPRN_DSISR 214 mfspr r5,SPRN_DSISR
215 stw r5,_DSISR(r11) 215 stw r5,_DSISR(r11)
216 addi r3,r1,STACK_FRAME_OVERHEAD 216 addi r3,r1,STACK_FRAME_OVERHEAD
217 EXC_XFER_STD(0x200, MachineCheckException) 217 EXC_XFER_STD(0x200, machine_check_exception)
218 218
219/* Data access exception. 219/* Data access exception.
220 * This is "never generated" by the MPC8xx. We jump to it for other 220 * This is "never generated" by the MPC8xx. We jump to it for other
@@ -252,20 +252,20 @@ Alignment:
252 mfspr r5,SPRN_DSISR 252 mfspr r5,SPRN_DSISR
253 stw r5,_DSISR(r11) 253 stw r5,_DSISR(r11)
254 addi r3,r1,STACK_FRAME_OVERHEAD 254 addi r3,r1,STACK_FRAME_OVERHEAD
255 EXC_XFER_EE(0x600, AlignmentException) 255 EXC_XFER_EE(0x600, alignment_exception)
256 256
257/* Program check exception */ 257/* Program check exception */
258 EXCEPTION(0x700, ProgramCheck, ProgramCheckException, EXC_XFER_STD) 258 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
259 259
260/* No FPU on MPC8xx. This exception is not supposed to happen. 260/* No FPU on MPC8xx. This exception is not supposed to happen.
261*/ 261*/
262 EXCEPTION(0x800, FPUnavailable, UnknownException, EXC_XFER_STD) 262 EXCEPTION(0x800, FPUnavailable, unknown_exception, EXC_XFER_STD)
263 263
264/* Decrementer */ 264/* Decrementer */
265 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) 265 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
266 266
267 EXCEPTION(0xa00, Trap_0a, UnknownException, EXC_XFER_EE) 267 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
268 EXCEPTION(0xb00, Trap_0b, UnknownException, EXC_XFER_EE) 268 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
269 269
270/* System call */ 270/* System call */
271 . = 0xc00 271 . = 0xc00
@@ -274,9 +274,9 @@ SystemCall:
274 EXC_XFER_EE_LITE(0xc00, DoSyscall) 274 EXC_XFER_EE_LITE(0xc00, DoSyscall)
275 275
276/* Single step - not used on 601 */ 276/* Single step - not used on 601 */
277 EXCEPTION(0xd00, SingleStep, SingleStepException, EXC_XFER_STD) 277 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
278 EXCEPTION(0xe00, Trap_0e, UnknownException, EXC_XFER_EE) 278 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
279 EXCEPTION(0xf00, Trap_0f, UnknownException, EXC_XFER_EE) 279 EXCEPTION(0xf00, Trap_0f, unknown_exception, EXC_XFER_EE)
280 280
281/* On the MPC8xx, this is a software emulation interrupt. It occurs 281/* On the MPC8xx, this is a software emulation interrupt. It occurs
282 * for all unimplemented and illegal instructions. 282 * for all unimplemented and illegal instructions.
@@ -540,22 +540,22 @@ DataTLBError:
540#endif 540#endif
541 b DataAccess 541 b DataAccess
542 542
543 EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE) 543 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
544 EXCEPTION(0x1600, Trap_16, UnknownException, EXC_XFER_EE) 544 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
545 EXCEPTION(0x1700, Trap_17, UnknownException, EXC_XFER_EE) 545 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
546 EXCEPTION(0x1800, Trap_18, UnknownException, EXC_XFER_EE) 546 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
547 EXCEPTION(0x1900, Trap_19, UnknownException, EXC_XFER_EE) 547 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
548 EXCEPTION(0x1a00, Trap_1a, UnknownException, EXC_XFER_EE) 548 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
549 EXCEPTION(0x1b00, Trap_1b, UnknownException, EXC_XFER_EE) 549 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
550 550
551/* On the MPC8xx, these next four traps are used for development 551/* On the MPC8xx, these next four traps are used for development
552 * support of breakpoints and such. Someday I will get around to 552 * support of breakpoints and such. Someday I will get around to
553 * using them. 553 * using them.
554 */ 554 */
555 EXCEPTION(0x1c00, Trap_1c, UnknownException, EXC_XFER_EE) 555 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
556 EXCEPTION(0x1d00, Trap_1d, UnknownException, EXC_XFER_EE) 556 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
557 EXCEPTION(0x1e00, Trap_1e, UnknownException, EXC_XFER_EE) 557 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
558 EXCEPTION(0x1f00, Trap_1f, UnknownException, EXC_XFER_EE) 558 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
559 559
560 . = 0x2000 560 . = 0x2000
561 561
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index eba5a5f8ff08..53949811efda 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -426,14 +426,14 @@ skpinv: addi r6,r6,1 /* Increment */
426 426
427interrupt_base: 427interrupt_base:
428 /* Critical Input Interrupt */ 428 /* Critical Input Interrupt */
429 CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) 429 CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
430 430
431 /* Machine Check Interrupt */ 431 /* Machine Check Interrupt */
432#ifdef CONFIG_E200 432#ifdef CONFIG_E200
433 /* no RFMCI, MCSRRs on E200 */ 433 /* no RFMCI, MCSRRs on E200 */
434 CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 434 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
435#else 435#else
436 MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 436 MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
437#endif 437#endif
438 438
439 /* Data Storage Interrupt */ 439 /* Data Storage Interrupt */
@@ -542,9 +542,9 @@ interrupt_base:
542#else 542#else
543#ifdef CONFIG_E200 543#ifdef CONFIG_E200
544 /* E200 treats 'normal' floating point instructions as FP Unavail exception */ 544 /* E200 treats 'normal' floating point instructions as FP Unavail exception */
545 EXCEPTION(0x0800, FloatingPointUnavailable, ProgramCheckException, EXC_XFER_EE) 545 EXCEPTION(0x0800, FloatingPointUnavailable, program_check_exception, EXC_XFER_EE)
546#else 546#else
547 EXCEPTION(0x0800, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) 547 EXCEPTION(0x0800, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
548#endif 548#endif
549#endif 549#endif
550 550
@@ -554,20 +554,20 @@ interrupt_base:
554 EXC_XFER_EE_LITE(0x0c00, DoSyscall) 554 EXC_XFER_EE_LITE(0x0c00, DoSyscall)
555 555
556 /* Auxillary Processor Unavailable Interrupt */ 556 /* Auxillary Processor Unavailable Interrupt */
557 EXCEPTION(0x2900, AuxillaryProcessorUnavailable, UnknownException, EXC_XFER_EE) 557 EXCEPTION(0x2900, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
558 558
559 /* Decrementer Interrupt */ 559 /* Decrementer Interrupt */
560 DECREMENTER_EXCEPTION 560 DECREMENTER_EXCEPTION
561 561
562 /* Fixed Internal Timer Interrupt */ 562 /* Fixed Internal Timer Interrupt */
563 /* TODO: Add FIT support */ 563 /* TODO: Add FIT support */
564 EXCEPTION(0x3100, FixedIntervalTimer, UnknownException, EXC_XFER_EE) 564 EXCEPTION(0x3100, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
565 565
566 /* Watchdog Timer Interrupt */ 566 /* Watchdog Timer Interrupt */
567#ifdef CONFIG_BOOKE_WDT 567#ifdef CONFIG_BOOKE_WDT
568 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, WatchdogException) 568 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, WatchdogException)
569#else 569#else
570 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, UnknownException) 570 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, unknown_exception)
571#endif 571#endif
572 572
573 /* Data TLB Error Interrupt */ 573 /* Data TLB Error Interrupt */
@@ -696,21 +696,21 @@ interrupt_base:
696 addi r3,r1,STACK_FRAME_OVERHEAD 696 addi r3,r1,STACK_FRAME_OVERHEAD
697 EXC_XFER_EE_LITE(0x2010, KernelSPE) 697 EXC_XFER_EE_LITE(0x2010, KernelSPE)
698#else 698#else
699 EXCEPTION(0x2020, SPEUnavailable, UnknownException, EXC_XFER_EE) 699 EXCEPTION(0x2020, SPEUnavailable, unknown_exception, EXC_XFER_EE)
700#endif /* CONFIG_SPE */ 700#endif /* CONFIG_SPE */
701 701
702 /* SPE Floating Point Data */ 702 /* SPE Floating Point Data */
703#ifdef CONFIG_SPE 703#ifdef CONFIG_SPE
704 EXCEPTION(0x2030, SPEFloatingPointData, SPEFloatingPointException, EXC_XFER_EE); 704 EXCEPTION(0x2030, SPEFloatingPointData, SPEFloatingPointException, EXC_XFER_EE);
705#else 705#else
706 EXCEPTION(0x2040, SPEFloatingPointData, UnknownException, EXC_XFER_EE) 706 EXCEPTION(0x2040, SPEFloatingPointData, unknown_exception, EXC_XFER_EE)
707#endif /* CONFIG_SPE */ 707#endif /* CONFIG_SPE */
708 708
709 /* SPE Floating Point Round */ 709 /* SPE Floating Point Round */
710 EXCEPTION(0x2050, SPEFloatingPointRound, UnknownException, EXC_XFER_EE) 710 EXCEPTION(0x2050, SPEFloatingPointRound, unknown_exception, EXC_XFER_EE)
711 711
712 /* Performance Monitor */ 712 /* Performance Monitor */
713 EXCEPTION(0x2060, PerformanceMonitor, PerformanceMonitorException, EXC_XFER_STD) 713 EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD)
714 714
715 715
716 /* Debug Interrupt */ 716 /* Debug Interrupt */
diff --git a/arch/ppc64/kernel/idle_power4.S b/arch/powerpc/kernel/idle_power4.S
index ca02afe2a795..5596fad6c87c 100644
--- a/arch/ppc64/kernel/idle_power4.S
+++ b/arch/powerpc/kernel/idle_power4.S
@@ -63,8 +63,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
63 beq 1f 63 beq 1f
64 mtmsrd r7 /* out of line this ? */ 64 mtmsrd r7 /* out of line this ? */
65 blr 65 blr
661: 661:
67 /* Go to NAP now */ 67 /* Go to NAP now */
68BEGIN_FTR_SECTION 68BEGIN_FTR_SECTION
69 DSSALL 69 DSSALL
70 sync 70 sync
@@ -76,4 +76,3 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
76 isync 76 isync
77 sync 77 sync
78 blr 78 blr
79
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index e73b0699b5f0..33f742cf979b 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -53,10 +53,10 @@
53 53
54extern void transfer_to_handler(void); 54extern void transfer_to_handler(void);
55extern void do_IRQ(struct pt_regs *regs); 55extern void do_IRQ(struct pt_regs *regs);
56extern void MachineCheckException(struct pt_regs *regs); 56extern void machine_check_exception(struct pt_regs *regs);
57extern void AlignmentException(struct pt_regs *regs); 57extern void alignment_exception(struct pt_regs *regs);
58extern void ProgramCheckException(struct pt_regs *regs); 58extern void program_check_exception(struct pt_regs *regs);
59extern void SingleStepException(struct pt_regs *regs); 59extern void single_step_exception(struct pt_regs *regs);
60extern int do_signal(sigset_t *, struct pt_regs *); 60extern int do_signal(sigset_t *, struct pt_regs *);
61extern int pmac_newworld; 61extern int pmac_newworld;
62extern int sys_sigreturn(struct pt_regs *regs); 62extern int sys_sigreturn(struct pt_regs *regs);
@@ -72,10 +72,10 @@ EXPORT_SYMBOL(clear_user_page);
72EXPORT_SYMBOL(do_signal); 72EXPORT_SYMBOL(do_signal);
73EXPORT_SYMBOL(transfer_to_handler); 73EXPORT_SYMBOL(transfer_to_handler);
74EXPORT_SYMBOL(do_IRQ); 74EXPORT_SYMBOL(do_IRQ);
75EXPORT_SYMBOL(MachineCheckException); 75EXPORT_SYMBOL(machine_check_exception);
76EXPORT_SYMBOL(AlignmentException); 76EXPORT_SYMBOL(alignment_exception);
77EXPORT_SYMBOL(ProgramCheckException); 77EXPORT_SYMBOL(program_check_exception);
78EXPORT_SYMBOL(SingleStepException); 78EXPORT_SYMBOL(single_step_exception);
79EXPORT_SYMBOL(sys_sigreturn); 79EXPORT_SYMBOL(sys_sigreturn);
80EXPORT_SYMBOL(ppc_n_lost_interrupts); 80EXPORT_SYMBOL(ppc_n_lost_interrupts);
81EXPORT_SYMBOL(ppc_lost_interrupts); 81EXPORT_SYMBOL(ppc_lost_interrupts);
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index c7afbbba0f36..37b961f1e279 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/powerpc/kernel/traps.c
3 *
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 2 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
5 * 3 *
6 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
@@ -23,29 +21,46 @@
23#include <linux/mm.h> 21#include <linux/mm.h>
24#include <linux/stddef.h> 22#include <linux/stddef.h>
25#include <linux/unistd.h> 23#include <linux/unistd.h>
26#include <linux/ptrace.h>
27#include <linux/slab.h> 24#include <linux/slab.h>
28#include <linux/user.h> 25#include <linux/user.h>
29#include <linux/a.out.h> 26#include <linux/a.out.h>
30#include <linux/interrupt.h> 27#include <linux/interrupt.h>
31#include <linux/config.h>
32#include <linux/init.h> 28#include <linux/init.h>
33#include <linux/module.h> 29#include <linux/module.h>
34#include <linux/prctl.h>
35#include <linux/delay.h> 30#include <linux/delay.h>
36#include <linux/kprobes.h> 31#include <linux/kprobes.h>
37#include <asm/kdebug.h> 32#include <asm/kdebug.h>
33#ifdef CONFIG_PPC32
34#include <linux/ptrace.h>
35#include <linux/prctl.h>
36#endif
38 37
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
40#include <asm/uaccess.h> 39#include <asm/uaccess.h>
41#include <asm/system.h> 40#include <asm/system.h>
42#include <asm/io.h> 41#include <asm/io.h>
42#ifdef CONFIG_PPC32
43#include <asm/reg.h> 43#include <asm/reg.h>
44#include <asm/xmon.h> 44#include <asm/xmon.h>
45#ifdef CONFIG_PMAC_BACKLIGHT 45#ifdef CONFIG_PMAC_BACKLIGHT
46#include <asm/backlight.h> 46#include <asm/backlight.h>
47#endif 47#endif
48#include <asm/perfmon.h> 48#include <asm/perfmon.h>
49#endif
50#ifdef CONFIG_PPC64
51#include <asm/processor.h>
52#include <asm/ppcdebug.h>
53#include <asm/rtas.h>
54#include <asm/systemcfg.h>
55#include <asm/machdep.h>
56#include <asm/pmc.h>
57#endif
58
59#ifdef CONFIG_PPC64
60#define __KPROBES __kprobes
61#else
62#define __KPROBES
63#endif
49 64
50#ifdef CONFIG_DEBUGGER 65#ifdef CONFIG_DEBUGGER
51int (*__debugger)(struct pt_regs *regs); 66int (*__debugger)(struct pt_regs *regs);
@@ -96,7 +111,7 @@ int die(const char *str, struct pt_regs *regs, long err)
96 console_verbose(); 111 console_verbose();
97 spin_lock_irq(&die_lock); 112 spin_lock_irq(&die_lock);
98 bust_spinlocks(1); 113 bust_spinlocks(1);
99#ifdef CONFIG_PMAC_BACKLIGHT 114#if defined(CONFIG_PPC32) && defined(CONFIG_PMAC_BACKLIGHT)
100 if (_machine == _MACH_Pmac) { 115 if (_machine == _MACH_Pmac) {
101 set_backlight_enable(1); 116 set_backlight_enable(1);
102 set_backlight_level(BACKLIGHT_MAX); 117 set_backlight_level(BACKLIGHT_MAX);
@@ -154,9 +169,17 @@ int die(const char *str, struct pt_regs *regs, long err)
154 panic("Fatal exception in interrupt"); 169 panic("Fatal exception in interrupt");
155 170
156 if (panic_on_oops) { 171 if (panic_on_oops) {
172#ifdef CONFIG_PPC64
173 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
174 ssleep(5);
175#endif
157 panic("Fatal exception"); 176 panic("Fatal exception");
158 } 177 }
178#ifdef CONFIG_PPC32
159 do_exit(err); 179 do_exit(err);
180#else
181 do_exit(SIGSEGV);
182#endif
160 183
161 return 0; 184 return 0;
162} 185}
@@ -176,6 +199,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
176 info.si_addr = (void __user *) addr; 199 info.si_addr = (void __user *) addr;
177 force_sig_info(signr, &info, current); 200 force_sig_info(signr, &info, current);
178 201
202#ifdef CONFIG_PPC32
179 /* 203 /*
180 * Init gets no signals that it doesn't have a handler for. 204 * Init gets no signals that it doesn't have a handler for.
181 * That's all very well, but if it has caused a synchronous 205 * That's all very well, but if it has caused a synchronous
@@ -197,6 +221,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
197 do_exit(signr); 221 do_exit(signr);
198 } 222 }
199 } 223 }
224#endif
200} 225}
201 226
202#ifdef CONFIG_PPC64 227#ifdef CONFIG_PPC64
@@ -206,7 +231,7 @@ void system_reset_exception(struct pt_regs *regs)
206 if (ppc_md.system_reset_exception) 231 if (ppc_md.system_reset_exception)
207 ppc_md.system_reset_exception(regs); 232 ppc_md.system_reset_exception(regs);
208 233
209 die("System Reset", regs, SIGABRT); 234 die("System Reset", regs, 0);
210 235
211 /* Must die if the interrupt is not recoverable */ 236 /* Must die if the interrupt is not recoverable */
212 if (!(regs->msr & MSR_RI)) 237 if (!(regs->msr & MSR_RI))
@@ -216,6 +241,7 @@ void system_reset_exception(struct pt_regs *regs)
216} 241}
217#endif 242#endif
218 243
244#ifdef CONFIG_PPC32
219/* 245/*
220 * I/O accesses can cause machine checks on powermacs. 246 * I/O accesses can cause machine checks on powermacs.
221 * Check if the NIP corresponds to the address of a sync 247 * Check if the NIP corresponds to the address of a sync
@@ -264,8 +290,10 @@ static inline int check_io_access(struct pt_regs *regs)
264#endif /* CONFIG_PPC_PMAC */ 290#endif /* CONFIG_PPC_PMAC */
265 return 0; 291 return 0;
266} 292}
293#endif /* CONFIG_PPC32 */
267 294
268#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 295#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
296
269/* On 4xx, the reason for the machine check or program exception 297/* On 4xx, the reason for the machine check or program exception
270 is in the ESR. */ 298 is in the ESR. */
271#define get_reason(regs) ((regs)->dsisr) 299#define get_reason(regs) ((regs)->dsisr)
@@ -284,6 +312,7 @@ static inline int check_io_access(struct pt_regs *regs)
284#define clear_single_step(regs) (current->thread.dbcr0 &= ~DBCR0_IC) 312#define clear_single_step(regs) (current->thread.dbcr0 &= ~DBCR0_IC)
285 313
286#else 314#else
315
287/* On non-4xx, the reason for the machine check or program 316/* On non-4xx, the reason for the machine check or program
288 exception is in the MSR. */ 317 exception is in the MSR. */
289#define get_reason(regs) ((regs)->msr) 318#define get_reason(regs) ((regs)->msr)
@@ -297,6 +326,7 @@ static inline int check_io_access(struct pt_regs *regs)
297#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE) 326#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
298#endif 327#endif
299 328
329#ifdef CONFIG_PPC32
300/* 330/*
301 * This is "fall-back" implementation for configurations 331 * This is "fall-back" implementation for configurations
302 * which don't provide platform-specific machine check info 332 * which don't provide platform-specific machine check info
@@ -305,8 +335,9 @@ void __attribute__ ((weak))
305platform_machine_check(struct pt_regs *regs) 335platform_machine_check(struct pt_regs *regs)
306{ 336{
307} 337}
338#endif
308 339
309void MachineCheckException(struct pt_regs *regs) 340void machine_check_exception(struct pt_regs *regs)
310{ 341{
311#ifdef CONFIG_PPC64 342#ifdef CONFIG_PPC64
312 int recover = 0; 343 int recover = 0;
@@ -462,23 +493,31 @@ void MachineCheckException(struct pt_regs *regs)
462 * additional info, e.g. bus error registers. 493 * additional info, e.g. bus error registers.
463 */ 494 */
464 platform_machine_check(regs); 495 platform_machine_check(regs);
465#endif /* CONFIG_PPC64 */ 496#endif /* CONFIG_PPC32 */
466 497
467 if (debugger_fault_handler(regs)) 498 if (debugger_fault_handler(regs))
468 return; 499 return;
469 die("Machine check", regs, SIGBUS); 500 die("Machine check", regs,
501#ifdef CONFIG_PPC32
502 SIGBUS
503#else
504 0
505#endif
506 );
470 507
471 /* Must die if the interrupt is not recoverable */ 508 /* Must die if the interrupt is not recoverable */
472 if (!(regs->msr & MSR_RI)) 509 if (!(regs->msr & MSR_RI))
473 panic("Unrecoverable Machine check"); 510 panic("Unrecoverable Machine check");
474} 511}
475 512
513#ifdef CONFIG_PPC32
476void SMIException(struct pt_regs *regs) 514void SMIException(struct pt_regs *regs)
477{ 515{
478 die("System Management Interrupt", regs, SIGABRT); 516 die("System Management Interrupt", regs, SIGABRT);
479} 517}
518#endif
480 519
481void UnknownException(struct pt_regs *regs) 520void unknown_exception(struct pt_regs *regs)
482{ 521{
483 printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n", 522 printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n",
484 regs->nip, regs->msr, regs->trap); 523 regs->nip, regs->msr, regs->trap);
@@ -486,7 +525,7 @@ void UnknownException(struct pt_regs *regs)
486 _exception(SIGTRAP, regs, 0, 0); 525 _exception(SIGTRAP, regs, 0, 0);
487} 526}
488 527
489void InstructionBreakpoint(struct pt_regs *regs) 528void instruction_breakpoint_exception(struct pt_regs *regs)
490{ 529{
491 if (notify_die(DIE_IABR_MATCH, "iabr_match", regs, 5, 530 if (notify_die(DIE_IABR_MATCH, "iabr_match", regs, 5,
492 5, SIGTRAP) == NOTIFY_STOP) 531 5, SIGTRAP) == NOTIFY_STOP)
@@ -496,14 +535,20 @@ void InstructionBreakpoint(struct pt_regs *regs)
496 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip); 535 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
497} 536}
498 537
538#ifdef CONFIG_PPC32
499void RunModeException(struct pt_regs *regs) 539void RunModeException(struct pt_regs *regs)
500{ 540{
501 _exception(SIGTRAP, regs, 0, 0); 541 _exception(SIGTRAP, regs, 0, 0);
502} 542}
543#endif
503 544
504void SingleStepException(struct pt_regs *regs) 545void __KPROBES single_step_exception(struct pt_regs *regs)
505{ 546{
547#ifdef CONFIG_PPC32
506 regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */ 548 regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */
549#else
550 regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */
551#endif
507 552
508 if (notify_die(DIE_SSTEP, "single_step", regs, 5, 553 if (notify_die(DIE_SSTEP, "single_step", regs, 5,
509 5, SIGTRAP) == NOTIFY_STOP) 554 5, SIGTRAP) == NOTIFY_STOP)
@@ -520,15 +565,62 @@ void SingleStepException(struct pt_regs *regs)
520 * pretend we got a single-step exception. This was pointed out 565 * pretend we got a single-step exception. This was pointed out
521 * by Kumar Gala. -- paulus 566 * by Kumar Gala. -- paulus
522 */ 567 */
523static void emulate_single_step(struct pt_regs *regs) 568static inline void emulate_single_step(struct pt_regs *regs)
524{ 569{
525 if (single_stepping(regs)) { 570 if (single_stepping(regs)) {
571#ifdef CONFIG_PPC32
526 clear_single_step(regs); 572 clear_single_step(regs);
527 _exception(SIGTRAP, regs, TRAP_TRACE, 0); 573 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
574#else
575 single_step_exception(regs);
576#endif
528 } 577 }
529} 578}
530 579
531/* Illegal instruction emulation support. Originally written to 580static void parse_fpe(struct pt_regs *regs)
581{
582 int code = 0;
583 unsigned long fpscr;
584
585#ifdef CONFIG_PPC32
586 /* We must make sure the FP state is consistent with
587 * our MSR_FP in regs
588 */
589 preempt_disable();
590 if (regs->msr & MSR_FP)
591 giveup_fpu(current);
592 preempt_enable();
593#else
594 flush_fp_to_thread(current);
595#endif
596
597 fpscr = current->thread.fpscr;
598
599 /* Invalid operation */
600 if ((fpscr & FPSCR_VE) && (fpscr & FPSCR_VX))
601 code = FPE_FLTINV;
602
603 /* Overflow */
604 else if ((fpscr & FPSCR_OE) && (fpscr & FPSCR_OX))
605 code = FPE_FLTOVF;
606
607 /* Underflow */
608 else if ((fpscr & FPSCR_UE) && (fpscr & FPSCR_UX))
609 code = FPE_FLTUND;
610
611 /* Divide by zero */
612 else if ((fpscr & FPSCR_ZE) && (fpscr & FPSCR_ZX))
613 code = FPE_FLTDIV;
614
615 /* Inexact result */
616 else if ((fpscr & FPSCR_XE) && (fpscr & FPSCR_XX))
617 code = FPE_FLTRES;
618
619 _exception(SIGFPE, regs, code, regs->nip);
620}
621
622/*
623 * Illegal instruction emulation support. Originally written to
532 * provide the PVR to user applications using the mfspr rd, PVR. 624 * provide the PVR to user applications using the mfspr rd, PVR.
533 * Return non-zero if we can't emulate, or -EFAULT if the associated 625 * Return non-zero if we can't emulate, or -EFAULT if the associated
534 * memory access caused an access fault. Return zero on success. 626 * memory access caused an access fault. Return zero on success.
@@ -536,7 +628,6 @@ static void emulate_single_step(struct pt_regs *regs)
536 * There are a couple of ways to do this, either "decode" the instruction 628 * There are a couple of ways to do this, either "decode" the instruction
537 * or directly match lots of bits. In this case, matching lots of 629 * or directly match lots of bits. In this case, matching lots of
538 * bits is faster and easier. 630 * bits is faster and easier.
539 *
540 */ 631 */
541#define INST_MFSPR_PVR 0x7c1f42a6 632#define INST_MFSPR_PVR 0x7c1f42a6
542#define INST_MFSPR_PVR_MASK 0xfc1fffff 633#define INST_MFSPR_PVR_MASK 0xfc1fffff
@@ -547,6 +638,8 @@ static void emulate_single_step(struct pt_regs *regs)
547#define INST_MCRXR 0x7c000400 638#define INST_MCRXR 0x7c000400
548#define INST_MCRXR_MASK 0x7c0007fe 639#define INST_MCRXR_MASK 0x7c0007fe
549 640
641#ifdef CONFIG_PPC32
642
550#define INST_STRING 0x7c00042a 643#define INST_STRING 0x7c00042a
551#define INST_STRING_MASK 0x7c0007fe 644#define INST_STRING_MASK 0x7c0007fe
552#define INST_STRING_GEN_MASK 0x7c00067e 645#define INST_STRING_GEN_MASK 0x7c00067e
@@ -622,6 +715,7 @@ static int emulate_string_inst(struct pt_regs *regs, u32 instword)
622 715
623 return 0; 716 return 0;
624} 717}
718#endif /* CONFIG_PPC32 */
625 719
626static int emulate_instruction(struct pt_regs *regs) 720static int emulate_instruction(struct pt_regs *regs)
627{ 721{
@@ -643,22 +737,44 @@ static int emulate_instruction(struct pt_regs *regs)
643 } 737 }
644 738
645 /* Emulating the dcba insn is just a no-op. */ 739 /* Emulating the dcba insn is just a no-op. */
646 if ((instword & INST_DCBA_MASK) == INST_DCBA) 740 if ((instword & INST_DCBA_MASK) == INST_DCBA) {
741#ifdef CONFIG_PPC64
742 static int warned;
743
744 if (!warned) {
745 printk(KERN_WARNING
746 "process %d (%s) uses obsolete 'dcba' insn\n",
747 current->pid, current->comm);
748 warned = 1;
749 }
750#endif /* CONFIG_PPC64 */
647 return 0; 751 return 0;
752 }
648 753
649 /* Emulate the mcrxr insn. */ 754 /* Emulate the mcrxr insn. */
650 if ((instword & INST_MCRXR_MASK) == INST_MCRXR) { 755 if ((instword & INST_MCRXR_MASK) == INST_MCRXR) {
651 int shift = (instword >> 21) & 0x1c; 756 unsigned int shift = (instword >> 21) & 0x1c;
652 unsigned long msk = 0xf0000000UL >> shift; 757 unsigned long msk = 0xf0000000UL >> shift;
758#ifdef CONFIG_PPC64
759 static int warned;
653 760
761 if (!warned) {
762 printk(KERN_WARNING
763 "process %d (%s) uses obsolete 'mcrxr' insn\n",
764 current->pid, current->comm);
765 warned = 1;
766 }
767#endif
654 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk); 768 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
655 regs->xer &= ~0xf0000000UL; 769 regs->xer &= ~0xf0000000UL;
656 return 0; 770 return 0;
657 } 771 }
658 772
773#ifdef CONFIG_PPC32
659 /* Emulate load/store string insn. */ 774 /* Emulate load/store string insn. */
660 if ((instword & INST_STRING_GEN_MASK) == INST_STRING) 775 if ((instword & INST_STRING_GEN_MASK) == INST_STRING)
661 return emulate_string_inst(regs, instword); 776 return emulate_string_inst(regs, instword);
777#endif
662 778
663 return -EINVAL; 779 return -EINVAL;
664} 780}
@@ -686,7 +802,7 @@ struct bug_entry *find_bug(unsigned long bugaddr)
686 return module_find_bug(bugaddr); 802 return module_find_bug(bugaddr);
687} 803}
688 804
689int check_bug_trap(struct pt_regs *regs) 805static int check_bug_trap(struct pt_regs *regs)
690{ 806{
691 struct bug_entry *bug; 807 struct bug_entry *bug;
692 unsigned long addr; 808 unsigned long addr;
@@ -701,34 +817,38 @@ int check_bug_trap(struct pt_regs *regs)
701 return 0; 817 return 0;
702 if (bug->line & BUG_WARNING_TRAP) { 818 if (bug->line & BUG_WARNING_TRAP) {
703 /* this is a WARN_ON rather than BUG/BUG_ON */ 819 /* this is a WARN_ON rather than BUG/BUG_ON */
704#ifdef CONFIG_XMON 820#if defined(CONFIG_PPC32) && defined(CONFIG_XMON)
705 xmon_printf(KERN_ERR "Badness in %s at %s:%d\n", 821 xmon_printf(KERN_ERR "Badness in %s at %s:%d\n",
706 bug->function, bug->file, 822 bug->function, bug->file,
707 bug->line & ~BUG_WARNING_TRAP); 823 bug->line & ~BUG_WARNING_TRAP);
708#endif /* CONFIG_XMON */ 824#endif
709 printk(KERN_ERR "Badness in %s at %s:%d\n", 825 printk(KERN_ERR "Badness in %s at %s:%d\n",
710 bug->function, bug->file, 826 bug->function, bug->file,
711 bug->line & ~BUG_WARNING_TRAP); 827 bug->line & ~BUG_WARNING_TRAP);
828#ifdef CONFIG_PPC32
712 dump_stack(); 829 dump_stack();
830#else
831 show_stack(current, (void *)regs->gpr[1]);
832#endif
713 return 1; 833 return 1;
714 } 834 }
715#ifdef CONFIG_XMON 835#if defined(CONFIG_PPC32) && defined(CONFIG_XMON)
716 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n", 836 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
717 bug->function, bug->file, bug->line); 837 bug->function, bug->file, bug->line);
718 xmon(regs); 838 xmon(regs);
719#endif /* CONFIG_XMON */ 839#endif
720 printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n", 840 printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
721 bug->function, bug->file, bug->line); 841 bug->function, bug->file, bug->line);
722 842
723 return 0; 843 return 0;
724} 844}
725 845
726void ProgramCheckException(struct pt_regs *regs) 846void __KPROBES program_check_exception(struct pt_regs *regs)
727{ 847{
728 unsigned int reason = get_reason(regs); 848 unsigned int reason = get_reason(regs);
849#if defined(CONFIG_PPC32) && defined(CONFIG_MATH_EMULATION)
729 extern int do_mathemu(struct pt_regs *regs); 850 extern int do_mathemu(struct pt_regs *regs);
730 851
731#ifdef CONFIG_MATH_EMULATION
732 /* (reason & REASON_ILLEGAL) would be the obvious thing here, 852 /* (reason & REASON_ILLEGAL) would be the obvious thing here,
733 * but there seems to be a hardware bug on the 405GP (RevD) 853 * but there seems to be a hardware bug on the 405GP (RevD)
734 * that means ESR is sometimes set incorrectly - either to 854 * that means ESR is sometimes set incorrectly - either to
@@ -740,69 +860,61 @@ void ProgramCheckException(struct pt_regs *regs)
740 emulate_single_step(regs); 860 emulate_single_step(regs);
741 return; 861 return;
742 } 862 }
743#endif /* CONFIG_MATH_EMULATION */ 863#endif
744
745 if (reason & REASON_FP) {
746 /* IEEE FP exception */
747 int code = 0;
748 u32 fpscr;
749 864
750 /* We must make sure the FP state is consistent with 865#ifdef CONFIG_PPC64
751 * our MSR_FP in regs 866 if (debugger_fault_handler(regs))
752 */
753 preempt_disable();
754 if (regs->msr & MSR_FP)
755 giveup_fpu(current);
756 preempt_enable();
757
758 fpscr = current->thread.fpscr;
759 fpscr &= fpscr << 22; /* mask summary bits with enables */
760 if (fpscr & FPSCR_VX)
761 code = FPE_FLTINV;
762 else if (fpscr & FPSCR_OX)
763 code = FPE_FLTOVF;
764 else if (fpscr & FPSCR_UX)
765 code = FPE_FLTUND;
766 else if (fpscr & FPSCR_ZX)
767 code = FPE_FLTDIV;
768 else if (fpscr & FPSCR_XX)
769 code = FPE_FLTRES;
770 _exception(SIGFPE, regs, code, regs->nip);
771 return; 867 return;
772 } 868#endif
773 869
774 if (reason & REASON_TRAP) { 870 if (reason & REASON_FP) {
871 /* IEEE FP exception */
872 parse_fpe(regs);
873 } else if (reason & REASON_TRAP) {
775 /* trap exception */ 874 /* trap exception */
875#ifdef CONFIG_PPC64
876 if (notify_die(DIE_BPT, "breakpoint", regs, 5, 5, SIGTRAP)
877 == NOTIFY_STOP)
878 return;
879#endif
776 if (debugger_bpt(regs)) 880 if (debugger_bpt(regs))
777 return; 881 return;
778 if (check_bug_trap(regs)) { 882 if (check_bug_trap(regs)) {
779 regs->nip += 4; 883 regs->nip += 4;
780 return; 884 return;
781 } 885 }
782 _exception(SIGTRAP, regs, TRAP_BRKPT, 0); 886 _exception(SIGTRAP, regs, TRAP_BRKPT,
783 return; 887#ifdef CONFIG_PPC32
784 } 888 0
785 889#else
786 /* Try to emulate it if we should. */ 890 regs->nip
787 if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) { 891#endif
892 );
893 } else
894#ifdef CONFIG_PPC32
895 if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED))
896#endif
897 {
898 /* Privileged or illegal instruction; try to emulate it. */
788 switch (emulate_instruction(regs)) { 899 switch (emulate_instruction(regs)) {
789 case 0: 900 case 0:
790 regs->nip += 4; 901 regs->nip += 4;
791 emulate_single_step(regs); 902 emulate_single_step(regs);
792 return; 903 break;
793 case -EFAULT: 904 case -EFAULT:
794 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip); 905 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
795 return; 906 break;
907 default:
908 if (reason & REASON_PRIVILEGED)
909 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
910 else
911 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
912 break;
796 } 913 }
797 } 914 }
798
799 if (reason & REASON_PRIVILEGED)
800 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
801 else
802 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
803} 915}
804 916
805void AlignmentException(struct pt_regs *regs) 917void alignment_exception(struct pt_regs *regs)
806{ 918{
807 int fixed; 919 int fixed;
808 920
@@ -814,18 +926,31 @@ void AlignmentException(struct pt_regs *regs)
814 return; 926 return;
815 } 927 }
816 928
817 /* Operand address was bad */ 929 /* Operand address was bad */
818 if (fixed == -EFAULT) { 930 if (fixed == -EFAULT) {
819 if (user_mode(regs)) 931 if (user_mode(regs))
820 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar); 932 _exception(SIGSEGV, regs,
933#ifdef CONFIG_PPC32
934 SEGV_ACCERR,
935#else
936 SEGV_MAPERR,
937#endif
938 regs->dar);
821 else 939 else
822 /* Search exception table */ 940 /* Search exception table */
823 bad_page_fault(regs, regs->dar, SIGSEGV); 941 bad_page_fault(regs, regs->dar, SIGSEGV);
824 return; 942 return;
825 } 943 }
826 _exception(SIGBUS, regs, BUS_ADRALN, regs->dar); 944 _exception(SIGBUS, regs, BUS_ADRALN,
945#ifdef CONFIG_PPC32
946 regs->dar
947#else
948 regs->nip
949#endif
950 );
827} 951}
828 952
953#ifdef CONFIG_PPC32
829void StackOverflow(struct pt_regs *regs) 954void StackOverflow(struct pt_regs *regs)
830{ 955{
831 printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n", 956 printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n",
@@ -849,8 +974,58 @@ void trace_syscall(struct pt_regs *regs)
849 current, current->pid, regs->nip, regs->link, regs->gpr[0], 974 current, current->pid, regs->nip, regs->link, regs->gpr[0],
850 regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted()); 975 regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
851} 976}
977#endif /* CONFIG_PPC32 */
978
979#ifdef CONFIG_PPC64
980void kernel_fp_unavailable_exception(struct pt_regs *regs)
981{
982 printk(KERN_EMERG "Unrecoverable FP Unavailable Exception "
983 "%lx at %lx\n", regs->trap, regs->nip);
984 die("Unrecoverable FP Unavailable Exception", regs, SIGABRT);
985}
986#endif
987
988void altivec_unavailable_exception(struct pt_regs *regs)
989{
990#if !defined(CONFIG_ALTIVEC) || defined(CONFIG_PPC64)
991 if (user_mode(regs)) {
992 /* A user program has executed an altivec instruction,
993 but this kernel doesn't support altivec. */
994 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
995 return;
996 }
997#endif
998#ifdef CONFIG_PPC32
999 {
1000 static int kernel_altivec_count;
1001
1002 /* The kernel has executed an altivec instruction without
1003 first enabling altivec. Whinge but let it do it. */
1004 if (++kernel_altivec_count < 10)
1005 printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%lx)\n",
1006 current, regs->nip);
1007 regs->msr |= MSR_VEC;
1008 }
1009#else
1010 printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
1011 "%lx at %lx\n", regs->trap, regs->nip);
1012 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
1013#endif
1014}
1015
1016#ifdef CONFIG_PPC64
1017extern perf_irq_t perf_irq;
1018#endif
1019
1020#if defined(CONFIG_PPC64) || defined(CONFIG_E500)
1021void performance_monitor_exception(struct pt_regs *regs)
1022{
1023 perf_irq(regs);
1024}
1025#endif
1026
852 1027
853#ifdef CONFIG_8xx 1028#if defined(CONFIG_PPC32) && defined(CONFIG_8xx)
854void SoftwareEmulation(struct pt_regs *regs) 1029void SoftwareEmulation(struct pt_regs *regs)
855{ 1030{
856 extern int do_mathemu(struct pt_regs *); 1031 extern int do_mathemu(struct pt_regs *);
@@ -879,8 +1054,9 @@ void SoftwareEmulation(struct pt_regs *regs)
879 } else 1054 } else
880 emulate_single_step(regs); 1055 emulate_single_step(regs);
881} 1056}
882#endif /* CONFIG_8xx */ 1057#endif /* defined(CONFIG_PPC32) && defined(CONFIG_8xx) */
883 1058
1059#ifdef CONFIG_PPC32
884#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 1060#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
885 1061
886void DebugException(struct pt_regs *regs, unsigned long debug_status) 1062void DebugException(struct pt_regs *regs, unsigned long debug_status)
@@ -909,42 +1085,36 @@ void TAUException(struct pt_regs *regs)
909 regs->nip, regs->msr, regs->trap, print_tainted()); 1085 regs->nip, regs->msr, regs->trap, print_tainted());
910} 1086}
911#endif /* CONFIG_INT_TAU */ 1087#endif /* CONFIG_INT_TAU */
912 1088#endif /* CONFIG_PPC32*/
913void AltivecUnavailException(struct pt_regs *regs)
914{
915 static int kernel_altivec_count;
916
917#ifndef CONFIG_ALTIVEC
918 if (user_mode(regs)) {
919 /* A user program has executed an altivec instruction,
920 but this kernel doesn't support altivec. */
921 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
922 return;
923 }
924#endif
925 /* The kernel has executed an altivec instruction without
926 first enabling altivec. Whinge but let it do it. */
927 if (++kernel_altivec_count < 10)
928 printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%lx)\n",
929 current, regs->nip);
930 regs->msr |= MSR_VEC;
931}
932 1089
933#ifdef CONFIG_ALTIVEC 1090#ifdef CONFIG_ALTIVEC
934void AltivecAssistException(struct pt_regs *regs) 1091void altivec_assist_exception(struct pt_regs *regs)
935{ 1092{
936 int err; 1093 int err;
1094#ifdef CONFIG_PPC64
1095 siginfo_t info;
1096#endif
937 1097
1098#ifdef CONFIG_PPC32
938 preempt_disable(); 1099 preempt_disable();
939 if (regs->msr & MSR_VEC) 1100 if (regs->msr & MSR_VEC)
940 giveup_altivec(current); 1101 giveup_altivec(current);
941 preempt_enable(); 1102 preempt_enable();
1103#endif
942 if (!user_mode(regs)) { 1104 if (!user_mode(regs)) {
943 printk(KERN_EMERG "VMX/Altivec assist exception in kernel mode" 1105 printk(KERN_EMERG "VMX/Altivec assist exception in kernel mode"
944 " at %lx\n", regs->nip); 1106 " at %lx\n", regs->nip);
945 die("Kernel Altivec assist exception", regs, SIGILL); 1107 die("Kernel "
1108#ifdef CONFIG_PPC64
1109 "VMX/"
1110#endif
1111 "Altivec assist exception", regs, SIGILL);
946 } 1112 }
947 1113
1114#ifdef CONFIG_PPC64
1115 flush_altivec_to_thread(current);
1116#endif /* CONFIG_PPC64 */
1117
948 err = emulate_altivec(regs); 1118 err = emulate_altivec(regs);
949 if (err == 0) { 1119 if (err == 0) {
950 regs->nip += 4; /* skip emulated instruction */ 1120 regs->nip += 4; /* skip emulated instruction */
@@ -954,7 +1124,15 @@ void AltivecAssistException(struct pt_regs *regs)
954 1124
955 if (err == -EFAULT) { 1125 if (err == -EFAULT) {
956 /* got an error reading the instruction */ 1126 /* got an error reading the instruction */
1127#ifdef CONFIG_PPC32
957 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip); 1128 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip);
1129#else
1130 info.si_signo = SIGSEGV;
1131 info.si_errno = 0;
1132 info.si_code = SEGV_MAPERR;
1133 info.si_addr = (void __user *) regs->nip;
1134 force_sig_info(SIGSEGV, &info, current);
1135#endif
958 } else { 1136 } else {
959 /* didn't recognize the instruction */ 1137 /* didn't recognize the instruction */
960 /* XXX quick hack for now: set the non-Java bit in the VSCR */ 1138 /* XXX quick hack for now: set the non-Java bit in the VSCR */
@@ -966,13 +1144,7 @@ void AltivecAssistException(struct pt_regs *regs)
966} 1144}
967#endif /* CONFIG_ALTIVEC */ 1145#endif /* CONFIG_ALTIVEC */
968 1146
969#ifdef CONFIG_E500 1147#ifdef CONFIG_PPC32
970void PerformanceMonitorException(struct pt_regs *regs)
971{
972 perf_irq(regs);
973}
974#endif
975
976#ifdef CONFIG_FSL_BOOKE 1148#ifdef CONFIG_FSL_BOOKE
977void CacheLockingException(struct pt_regs *regs, unsigned long address, 1149void CacheLockingException(struct pt_regs *regs, unsigned long address,
978 unsigned long error_code) 1150 unsigned long error_code)
@@ -1022,7 +1194,24 @@ void SPEFloatingPointException(struct pt_regs *regs)
1022 return; 1194 return;
1023} 1195}
1024#endif 1196#endif
1197#endif /* CONFIG_PPC32 */
1025 1198
1199#ifdef CONFIG_PPC64
1200/*
1201 * We enter here if we get an unrecoverable exception, that is, one
1202 * that happened at a point where the RI (recoverable interrupt) bit
1203 * in the MSR is 0. This indicates that SRR0/1 are live, and that
1204 * we therefore lost state by taking this exception.
1205 */
1206void unrecoverable_exception(struct pt_regs *regs)
1207{
1208 printk(KERN_EMERG "Unrecoverable exception %lx at %lx\n",
1209 regs->trap, regs->nip);
1210 die("Unrecoverable exception", regs, SIGABRT);
1211}
1212#endif /* CONFIG_PPC64 */
1213
1214#ifdef CONFIG_PPC32
1026#ifdef CONFIG_BOOKE_WDT 1215#ifdef CONFIG_BOOKE_WDT
1027/* 1216/*
1028 * Default handler for a Watchdog exception, 1217 * Default handler for a Watchdog exception,
@@ -1041,6 +1230,20 @@ void WatchdogException(struct pt_regs *regs)
1041 WatchdogHandler(regs); 1230 WatchdogHandler(regs);
1042} 1231}
1043#endif 1232#endif
1233#endif /* CONFIG_PPC32 */
1234
1235#ifdef CONFIG_PPC64
1236/*
1237 * We enter here if we discover during exception entry that we are
1238 * running in supervisor mode with a userspace value in the stack pointer.
1239 */
1240void kernel_bad_stack(struct pt_regs *regs)
1241{
1242 printk(KERN_EMERG "Bad kernel stack pointer %lx at %lx\n",
1243 regs->gpr[1], regs->nip);
1244 die("Bad kernel stack pointer", regs, SIGABRT);
1245}
1246#endif
1044 1247
1045void __init trap_init(void) 1248void __init trap_init(void)
1046{ 1249{
diff --git a/arch/powerpc/kernel/vmlinux.lds b/arch/powerpc/kernel/vmlinux.lds
deleted file mode 100644
index d62c288a81d0..000000000000
--- a/arch/powerpc/kernel/vmlinux.lds
+++ /dev/null
@@ -1,174 +0,0 @@
1/* Align . to a 8 byte boundary equals to maximum function alignment. */
2/* sched.text is aling to function alignment to secure we have same
3 * address even at second ld pass when generating System.map */
4/* spinlock.text is aling to function alignment to secure we have same
5 * address even at second ld pass when generating System.map */
6 /* DWARF debug sections.
7 Symbols in the DWARF debugging sections are relative to
8 the beginning of the section so we begin them at 0. */
9 /* Stabs debugging sections. */
10OUTPUT_ARCH(powerpc:common)
11jiffies = jiffies_64 + 4;
12SECTIONS
13{
14 /* Read-only sections, merged into text segment: */
15 . = + SIZEOF_HEADERS;
16 .interp : { *(.interp) }
17 .hash : { *(.hash) }
18 .dynsym : { *(.dynsym) }
19 .dynstr : { *(.dynstr) }
20 .rel.text : { *(.rel.text) }
21 .rela.text : { *(.rela.text) }
22 .rel.data : { *(.rel.data) }
23 .rela.data : { *(.rela.data) }
24 .rel.rodata : { *(.rel.rodata) }
25 .rela.rodata : { *(.rela.rodata) }
26 .rel.got : { *(.rel.got) }
27 .rela.got : { *(.rela.got) }
28 .rel.ctors : { *(.rel.ctors) }
29 .rela.ctors : { *(.rela.ctors) }
30 .rel.dtors : { *(.rel.dtors) }
31 .rela.dtors : { *(.rela.dtors) }
32 .rel.bss : { *(.rel.bss) }
33 .rela.bss : { *(.rela.bss) }
34 .rel.plt : { *(.rel.plt) }
35 .rela.plt : { *(.rela.plt) }
36/* .init : { *(.init) } =0*/
37 .plt : { *(.plt) }
38 .text :
39 {
40 *(.text)
41 . = ALIGN(8); __sched_text_start = .; *(.sched.text) __sched_text_end = .;
42 . = ALIGN(8); __lock_text_start = .; *(.spinlock.text) __lock_text_end = .;
43 *(.fixup)
44 *(.got1)
45 __got2_start = .;
46 *(.got2)
47 __got2_end = .;
48 }
49 _etext = .;
50 PROVIDE (etext = .);
51 .rodata : AT(ADDR(.rodata) - 0) { *(.rodata) *(.rodata.*) *(__vermagic) } .rodata1 : AT(ADDR(.rodata1) - 0) { *(.rodata1) } .pci_fixup : AT(ADDR(.pci_fixup) - 0) { __start_pci_fixups_early = .; *(.pci_fixup_early) __end_pci_fixups_early = .; __start_pci_fixups_header = .; *(.pci_fixup_header) __end_pci_fixups_header = .; __start_pci_fixups_final = .; *(.pci_fixup_final) __end_pci_fixups_final = .; __start_pci_fixups_enable = .; *(.pci_fixup_enable) __end_pci_fixups_enable = .; } __ksymtab : AT(ADDR(__ksymtab) - 0) { __start___ksymtab = .; *(__ksymtab) __stop___ksymtab = .; } __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - 0) { __start___ksymtab_gpl = .; *(__ksymtab_gpl) __stop___ksymtab_gpl = .; } __kcrctab : AT(ADDR(__kcrctab) - 0) { __start___kcrctab = .; *(__kcrctab) __stop___kcrctab = .; } __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - 0) { __start___kcrctab_gpl = .; *(__kcrctab_gpl) __stop___kcrctab_gpl = .; } __ksymtab_strings : AT(ADDR(__ksymtab_strings) - 0) { *(__ksymtab_strings) } __param : AT(ADDR(__param) - 0) { __start___param = .; *(__param) __stop___param = .; }
52 .fini : { *(.fini) } =0
53 .ctors : { *(.ctors) }
54 .dtors : { *(.dtors) }
55 .fixup : { *(.fixup) }
56 __ex_table : {
57 __start___ex_table = .;
58 *(__ex_table)
59 __stop___ex_table = .;
60 }
61 __bug_table : {
62 __start___bug_table = .;
63 *(__bug_table)
64 __stop___bug_table = .;
65 }
66 /* Read-write section, merged into data segment: */
67 . = ALIGN(4096);
68 .data :
69 {
70 *(.data)
71 *(.data1)
72 *(.sdata)
73 *(.sdata2)
74 *(.got.plt) *(.got)
75 *(.dynamic)
76 CONSTRUCTORS
77 }
78
79 . = ALIGN(4096);
80 __nosave_begin = .;
81 .data_nosave : { *(.data.nosave) }
82 . = ALIGN(4096);
83 __nosave_end = .;
84
85 . = ALIGN(32);
86 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
87
88 _edata = .;
89 PROVIDE (edata = .);
90
91 . = ALIGN(8192);
92 .data.init_task : { *(.data.init_task) }
93
94 . = ALIGN(4096);
95 __init_begin = .;
96 .init.text : {
97 _sinittext = .;
98 *(.init.text)
99 _einittext = .;
100 }
101 /* .exit.text is discarded at runtime, not link time,
102 to deal with references from __bug_table */
103 .exit.text : { *(.exit.text) }
104 .init.data : {
105 *(.init.data);
106 __vtop_table_begin = .;
107 *(.vtop_fixup);
108 __vtop_table_end = .;
109 __ptov_table_begin = .;
110 *(.ptov_fixup);
111 __ptov_table_end = .;
112 }
113 . = ALIGN(16);
114 __setup_start = .;
115 .init.setup : { *(.init.setup) }
116 __setup_end = .;
117 __initcall_start = .;
118 .initcall.init : {
119 *(.initcall1.init)
120 *(.initcall2.init)
121 *(.initcall3.init)
122 *(.initcall4.init)
123 *(.initcall5.init)
124 *(.initcall6.init)
125 *(.initcall7.init)
126 }
127 __initcall_end = .;
128
129 __con_initcall_start = .;
130 .con_initcall.init : { *(.con_initcall.init) }
131 __con_initcall_end = .;
132
133 .security_initcall.init : AT(ADDR(.security_initcall.init) - 0) { __security_initcall_start = .; *(.security_initcall.init) __security_initcall_end = .; }
134
135 __start___ftr_fixup = .;
136 __ftr_fixup : { *(__ftr_fixup) }
137 __stop___ftr_fixup = .;
138
139 . = ALIGN(32);
140 __per_cpu_start = .;
141 .data.percpu : { *(.data.percpu) }
142 __per_cpu_end = .;
143
144 . = ALIGN(4096);
145 __initramfs_start = .;
146 .init.ramfs : { *(.init.ramfs) }
147 __initramfs_end = .;
148
149 . = ALIGN(4096);
150 __init_end = .;
151
152 . = ALIGN(4096);
153 _sextratext = .;
154 _eextratext = .;
155
156 __bss_start = .;
157 .bss :
158 {
159 *(.sbss) *(.scommon)
160 *(.dynbss)
161 *(.bss)
162 *(COMMON)
163 }
164 __bss_stop = .;
165
166 _end = . ;
167 PROVIDE (end = .);
168
169 /* Sections to be discarded. */
170 /DISCARD/ : {
171 *(.exitcall.exit)
172 *(.exit.data)
173 }
174}
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 09c6525cfa61..0587d9c4609d 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -1,10 +1,29 @@
1#include <linux/config.h>
2#ifdef CONFIG_PPC64
3#include <asm/page.h>
4#endif
1#include <asm-generic/vmlinux.lds.h> 5#include <asm-generic/vmlinux.lds.h>
2 6
7#ifdef CONFIG_PPC64
8OUTPUT_ARCH(powerpc:common64)
9jiffies = jiffies_64;
10#else
3OUTPUT_ARCH(powerpc:common) 11OUTPUT_ARCH(powerpc:common)
4jiffies = jiffies_64 + 4; 12jiffies = jiffies_64 + 4;
13#endif
5SECTIONS 14SECTIONS
6{ 15{
16 /* Sections to be discarded. */
17 /DISCARD/ : {
18 *(.exitcall.exit)
19#ifdef CONFIG_PPC32
20 *(.exit.data)
21#endif
22 }
23
24
7 /* Read-only sections, merged into text segment: */ 25 /* Read-only sections, merged into text segment: */
26#ifdef CONFIG_PPC32
8 . = + SIZEOF_HEADERS; 27 . = + SIZEOF_HEADERS;
9 .interp : { *(.interp) } 28 .interp : { *(.interp) }
10 .hash : { *(.hash) } 29 .hash : { *(.hash) }
@@ -28,17 +47,30 @@ SECTIONS
28 .rela.plt : { *(.rela.plt) } 47 .rela.plt : { *(.rela.plt) }
29/* .init : { *(.init) } =0*/ 48/* .init : { *(.init) } =0*/
30 .plt : { *(.plt) } 49 .plt : { *(.plt) }
31 .text : 50#endif
32 { 51 .text : {
52#ifdef CONFIG_PPC64
53 *(.text .text.*)
54#else
33 *(.text) 55 *(.text)
56#endif
34 SCHED_TEXT 57 SCHED_TEXT
35 LOCK_TEXT 58 LOCK_TEXT
59#ifdef CONFIG_PPC64
60 KPROBES_TEXT
61#endif
36 *(.fixup) 62 *(.fixup)
63#ifdef CONFIG_PPC32
37 *(.got1) 64 *(.got1)
38 __got2_start = .; 65 __got2_start = .;
39 *(.got2) 66 *(.got2)
40 __got2_end = .; 67 __got2_end = .;
68#else
69 . = ALIGN(PAGE_SIZE);
70 _etext = .;
71#endif
41 } 72 }
73#ifdef CONFIG_PPC32
42 _etext = .; 74 _etext = .;
43 PROVIDE (etext = .); 75 PROVIDE (etext = .);
44 76
@@ -48,6 +80,7 @@ SECTIONS
48 .dtors : { *(.dtors) } 80 .dtors : { *(.dtors) }
49 81
50 .fixup : { *(.fixup) } 82 .fixup : { *(.fixup) }
83#endif
51 84
52 __ex_table : { 85 __ex_table : {
53 __start___ex_table = .; 86 __start___ex_table = .;
@@ -61,6 +94,17 @@ SECTIONS
61 __stop___bug_table = .; 94 __stop___bug_table = .;
62 } 95 }
63 96
97#ifdef CONFIG_PPC64
98 __ftr_fixup : {
99 __start___ftr_fixup = .;
100 *(__ftr_fixup)
101 __stop___ftr_fixup = .;
102 }
103
104 RODATA
105#endif
106
107#ifdef CONFIG_PPC32
64 /* Read-write section, merged into data segment: */ 108 /* Read-write section, merged into data segment: */
65 . = ALIGN(4096); 109 . = ALIGN(4096);
66 .data : 110 .data :
@@ -90,16 +134,25 @@ SECTIONS
90 .data.init_task : { *(.data.init_task) } 134 .data.init_task : { *(.data.init_task) }
91 135
92 . = ALIGN(4096); 136 . = ALIGN(4096);
137#else
138 /* will be freed after init */
139 . = ALIGN(PAGE_SIZE);
140#endif
93 __init_begin = .; 141 __init_begin = .;
94 .init.text : { 142 .init.text : {
95 _sinittext = .; 143 _sinittext = .;
96 *(.init.text) 144 *(.init.text)
97 _einittext = .; 145 _einittext = .;
98 } 146 }
147#ifdef CONFIG_PPC32
99 /* .exit.text is discarded at runtime, not link time, 148 /* .exit.text is discarded at runtime, not link time,
100 to deal with references from __bug_table */ 149 to deal with references from __bug_table */
101 .exit.text : { *(.exit.text) } 150 .exit.text : { *(.exit.text) }
151#endif
102 .init.data : { 152 .init.data : {
153#ifdef CONFIG_PPC64
154 *(.init.data)
155#else
103 *(.init.data); 156 *(.init.data);
104 __vtop_table_begin = .; 157 __vtop_table_begin = .;
105 *(.vtop_fixup); 158 *(.vtop_fixup);
@@ -107,13 +160,31 @@ SECTIONS
107 __ptov_table_begin = .; 160 __ptov_table_begin = .;
108 *(.ptov_fixup); 161 *(.ptov_fixup);
109 __ptov_table_end = .; 162 __ptov_table_end = .;
163#endif
110 } 164 }
165
111 . = ALIGN(16); 166 . = ALIGN(16);
167#ifdef CONFIG_PPC32
112 __setup_start = .; 168 __setup_start = .;
113 .init.setup : { *(.init.setup) } 169#endif
170 .init.setup : {
171#ifdef CONFIG_PPC64
172 __setup_start = .;
173#endif
174 *(.init.setup)
175#ifdef CONFIG_PPC64
176 __setup_end = .;
177#endif
178 }
179#ifdef CONFIG_PPC32
114 __setup_end = .; 180 __setup_end = .;
181
115 __initcall_start = .; 182 __initcall_start = .;
183#endif
116 .initcall.init : { 184 .initcall.init : {
185#ifdef CONFIG_PPC64
186 __initcall_start = .;
187#endif
117 *(.initcall1.init) 188 *(.initcall1.init)
118 *(.initcall2.init) 189 *(.initcall2.init)
119 *(.initcall3.init) 190 *(.initcall3.init)
@@ -121,27 +192,109 @@ SECTIONS
121 *(.initcall5.init) 192 *(.initcall5.init)
122 *(.initcall6.init) 193 *(.initcall6.init)
123 *(.initcall7.init) 194 *(.initcall7.init)
195#ifdef CONFIG_PPC64
196 __initcall_end = .;
197#endif
124 } 198 }
199#ifdef CONFIG_PPC32
125 __initcall_end = .; 200 __initcall_end = .;
126 201
127 __con_initcall_start = .; 202 __con_initcall_start = .;
128 .con_initcall.init : { *(.con_initcall.init) } 203#endif
204 .con_initcall.init : {
205#ifdef CONFIG_PPC64
206 __con_initcall_start = .;
207#endif
208 *(.con_initcall.init)
209#ifdef CONFIG_PPC64
210 __con_initcall_end = .;
211#endif
212 }
213#ifdef CONFIG_PPC32
129 __con_initcall_end = .; 214 __con_initcall_end = .;
215#endif
130 216
131 SECURITY_INIT 217 SECURITY_INIT
132 218
219#ifdef CONFIG_PPC32
133 __start___ftr_fixup = .; 220 __start___ftr_fixup = .;
134 __ftr_fixup : { *(__ftr_fixup) } 221 __ftr_fixup : { *(__ftr_fixup) }
135 __stop___ftr_fixup = .; 222 __stop___ftr_fixup = .;
223#else
224 . = ALIGN(PAGE_SIZE);
225 .init.ramfs : {
226 __initramfs_start = .;
227 *(.init.ramfs)
228 __initramfs_end = .;
229 }
230#endif
136 231
232#ifdef CONFIG_PPC32
137 . = ALIGN(32); 233 . = ALIGN(32);
138 __per_cpu_start = .; 234 __per_cpu_start = .;
139 .data.percpu : { *(.data.percpu) } 235#endif
236 .data.percpu : {
237#ifdef CONFIG_PPC64
238 __per_cpu_start = .;
239#endif
240 *(.data.percpu)
241#ifdef CONFIG_PPC64
242 __per_cpu_end = .;
243#endif
244 }
245#ifdef CONFIG_PPC32
140 __per_cpu_end = .; 246 __per_cpu_end = .;
247#endif
141 248
249#ifdef CONFIG_PPC64
250 . = ALIGN(PAGE_SIZE);
251 . = ALIGN(16384);
252 __init_end = .;
253 /* freed after init ends here */
254
255
256 /* Read/write sections */
257 . = ALIGN(PAGE_SIZE);
258 . = ALIGN(16384);
259 /* The initial task and kernel stack */
260 .data.init_task : {
261 *(.data.init_task)
262 }
263
264 . = ALIGN(PAGE_SIZE);
265 .data.page_aligned : {
266 *(.data.page_aligned)
267 }
268
269 .data.cacheline_aligned : {
270 *(.data.cacheline_aligned)
271 }
272
273 .data : {
274 *(.data .data.rel* .toc1)
275 *(.branch_lt)
276 }
277
278 .opd : {
279 *(.opd)
280 }
281
282 .got : {
283 __toc_start = .;
284 *(.got)
285 *(.toc)
286 . = ALIGN(PAGE_SIZE);
287 _edata = .;
288 }
289
290
291 . = ALIGN(PAGE_SIZE);
292#else
142 . = ALIGN(4096); 293 . = ALIGN(4096);
143 __initramfs_start = .; 294 __initramfs_start = .;
144 .init.ramfs : { *(.init.ramfs) } 295 .init.ramfs : {
296 *(.init.ramfs)
297 }
145 __initramfs_end = .; 298 __initramfs_end = .;
146 299
147 . = ALIGN(4096); 300 . = ALIGN(4096);
@@ -152,21 +305,30 @@ SECTIONS
152 _eextratext = .; 305 _eextratext = .;
153 306
154 __bss_start = .; 307 __bss_start = .;
155 .bss : 308#endif
156 { 309 .bss : {
310#ifdef CONFIG_PPC64
311 __bss_start = .;
312#else
157 *(.sbss) *(.scommon) 313 *(.sbss) *(.scommon)
158 *(.dynbss) 314 *(.dynbss)
315#endif
159 *(.bss) 316 *(.bss)
317#ifdef CONFIG_PPC32
160 *(COMMON) 318 *(COMMON)
319#else
320 __bss_stop = .;
321#endif
161 } 322 }
323#ifdef CONFIG_PPC32
162 __bss_stop = .; 324 __bss_stop = .;
325#endif
163 326
327#ifdef CONFIG_PPC64
328 . = ALIGN(PAGE_SIZE);
329#endif
164 _end = . ; 330 _end = . ;
331#ifdef CONFIG_PPC32
165 PROVIDE (end = .); 332 PROVIDE (end = .);
166 333#endif
167 /* Sections to be discarded. */
168 /DISCARD/ : {
169 *(.exitcall.exit)
170 *(.exit.data)
171 }
172} 334}
diff --git a/arch/powerpc/platforms/iseries/call_sm.h b/arch/powerpc/platforms/iseries/call_sm.h
new file mode 100644
index 000000000000..ef223166cf22
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/call_sm.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _ISERIES_CALL_SM_H
19#define _ISERIES_CALL_SM_H
20
21/*
22 * This file contains the "hypervisor call" interface which is used to
23 * drive the hypervisor from the OS.
24 */
25
26#include <asm/iSeries/HvCallSc.h>
27#include <asm/iSeries/HvTypes.h>
28
29#define HvCallSmGet64BitsOfAccessMap HvCallSm + 11
30
31static inline u64 HvCallSm_get64BitsOfAccessMap(HvLpIndex lpIndex,
32 u64 indexIntoBitMap)
33{
34 return HvCall2(HvCallSmGet64BitsOfAccessMap, lpIndex, indexIntoBitMap);
35}
36
37#endif /* _ISERIES_CALL_SM_H */
diff --git a/arch/powerpc/platforms/iseries/ipl_parms.h b/arch/powerpc/platforms/iseries/ipl_parms.h
new file mode 100644
index 000000000000..77c135ddbf1b
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/ipl_parms.h
@@ -0,0 +1,70 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _ISERIES_IPL_PARMS_H
19#define _ISERIES_IPL_PARMS_H
20
21/*
22 * This struct maps the IPL Parameters DMA'd from the SP.
23 *
24 * Warning:
25 * This data must map in exactly 64 bytes and match the architecture for
26 * the IPL parms
27 */
28
29#include <asm/types.h>
30
31struct ItIplParmsReal {
32 u8 xFormat; // Defines format of IplParms x00-x00
33 u8 xRsvd01:6; // Reserved x01-x01
34 u8 xAlternateSearch:1; // Alternate search indicator ...
35 u8 xUaSupplied:1; // UA Supplied on programmed IPL...
36 u8 xLsUaFormat; // Format byte for UA x02-x02
37 u8 xRsvd02; // Reserved x03-x03
38 u32 xLsUa; // LS UA x04-x07
39 u32 xUnusedLsLid; // First OS LID to load x08-x0B
40 u16 xLsBusNumber; // LS Bus Number x0C-x0D
41 u8 xLsCardAdr; // LS Card Address x0E-x0E
42 u8 xLsBoardAdr; // LS Board Address x0F-x0F
43 u32 xRsvd03; // Reserved x10-x13
44 u8 xSpcnPresent:1; // SPCN present x14-x14
45 u8 xCpmPresent:1; // CPM present ...
46 u8 xRsvd04:6; // Reserved ...
47 u8 xRsvd05:4; // Reserved x15-x15
48 u8 xKeyLock:4; // Keylock setting ...
49 u8 xRsvd06:6; // Reserved x16-x16
50 u8 xIplMode:2; // Ipl mode (A|B|C|D) ...
51 u8 xHwIplType; // Fast v slow v slow EC HW IPL x17-x17
52 u16 xCpmEnabledIpl:1; // CPM in effect when IPL initiatedx18-x19
53 u16 xPowerOnResetIpl:1; // Indicate POR condition ...
54 u16 xMainStorePreserved:1; // Main Storage is preserved ...
55 u16 xRsvd07:13; // Reserved ...
56 u16 xIplSource:16; // Ipl source x1A-x1B
57 u8 xIplReason:8; // Reason for this IPL x1C-x1C
58 u8 xRsvd08; // Reserved x1D-x1D
59 u16 xRsvd09; // Reserved x1E-x1F
60 u16 xSysBoxType; // System Box Type x20-x21
61 u16 xSysProcType; // System Processor Type x22-x23
62 u32 xRsvd10; // Reserved x24-x27
63 u64 xRsvd11; // Reserved x28-x2F
64 u64 xRsvd12; // Reserved x30-x37
65 u64 xRsvd13; // Reserved x38-x3F
66};
67
68extern struct ItIplParmsReal xItIplParmsReal;
69
70#endif /* _ISERIES_IPL_PARMS_H */
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 5a8a0056b31f..31fb5fa67fa3 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -40,7 +40,8 @@
40#include <asm/iSeries/HvLpEvent.h> 40#include <asm/iSeries/HvLpEvent.h>
41#include <asm/iSeries/HvCallPci.h> 41#include <asm/iSeries/HvCallPci.h>
42#include <asm/iSeries/HvCallXm.h> 42#include <asm/iSeries/HvCallXm.h>
43#include <asm/iSeries/iSeries_irq.h> 43
44#include "irq.h"
44 45
45/* This maps virtual irq numbers to real irqs */ 46/* This maps virtual irq numbers to real irqs */
46unsigned int virt_irq_to_real_map[NR_IRQS]; 47unsigned int virt_irq_to_real_map[NR_IRQS];
diff --git a/arch/powerpc/platforms/iseries/irq.h b/arch/powerpc/platforms/iseries/irq.h
new file mode 100644
index 000000000000..5f643f16ecc0
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/irq.h
@@ -0,0 +1,8 @@
1#ifndef _ISERIES_IRQ_H
2#define _ISERIES_IRQ_H
3
4extern void iSeries_init_IRQ(void);
5extern int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, HvAgentId);
6extern void iSeries_activate_IRQs(void);
7
8#endif /* _ISERIES_IRQ_H */
diff --git a/arch/powerpc/platforms/iseries/lpardata.c b/arch/powerpc/platforms/iseries/lpardata.c
index 87b7ad8ca465..ed2ffee6f731 100644
--- a/arch/powerpc/platforms/iseries/lpardata.c
+++ b/arch/powerpc/platforms/iseries/lpardata.c
@@ -19,15 +19,15 @@
19#include <asm/lppaca.h> 19#include <asm/lppaca.h>
20#include <asm/iSeries/ItLpRegSave.h> 20#include <asm/iSeries/ItLpRegSave.h>
21#include <asm/paca.h> 21#include <asm/paca.h>
22#include <asm/iSeries/HvReleaseData.h>
23#include <asm/iSeries/LparMap.h> 22#include <asm/iSeries/LparMap.h>
24#include <asm/iSeries/ItVpdAreas.h>
25#include <asm/iSeries/ItIplParmsReal.h>
26#include <asm/iSeries/ItExtVpdPanel.h> 23#include <asm/iSeries/ItExtVpdPanel.h>
27#include <asm/iSeries/ItLpQueue.h> 24#include <asm/iSeries/ItLpQueue.h>
28#include <asm/iSeries/IoHriProcessorVpd.h>
29#include <asm/iSeries/ItSpCommArea.h>
30 25
26#include "vpd_areas.h"
27#include "spcomm_area.h"
28#include "ipl_parms.h"
29#include "processor_vpd.h"
30#include "release_data.h"
31 31
32/* The HvReleaseData is the root of the information shared between 32/* The HvReleaseData is the root of the information shared between
33 * the hypervisor and Linux. 33 * the hypervisor and Linux.
diff --git a/arch/ppc64/kernel/lparmap.c b/arch/powerpc/platforms/iseries/lparmap.c
index b81de286df5e..b81de286df5e 100644
--- a/arch/ppc64/kernel/lparmap.c
+++ b/arch/powerpc/platforms/iseries/lparmap.c
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c
index 883603027ccf..f8b4155b0481 100644
--- a/arch/powerpc/platforms/iseries/lpevents.c
+++ b/arch/powerpc/platforms/iseries/lpevents.c
@@ -13,6 +13,8 @@
13#include <linux/bootmem.h> 13#include <linux/bootmem.h>
14#include <linux/seq_file.h> 14#include <linux/seq_file.h>
15#include <linux/proc_fs.h> 15#include <linux/proc_fs.h>
16#include <linux/module.h>
17
16#include <asm/system.h> 18#include <asm/system.h>
17#include <asm/paca.h> 19#include <asm/paca.h>
18#include <asm/iSeries/ItLpQueue.h> 20#include <asm/iSeries/ItLpQueue.h>
diff --git a/arch/powerpc/platforms/iseries/main_store.h b/arch/powerpc/platforms/iseries/main_store.h
new file mode 100644
index 000000000000..74f6889f834f
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/main_store.h
@@ -0,0 +1,165 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef _ISERIES_MAIN_STORE_H
20#define _ISERIES_MAIN_STORE_H
21
22/* Main Store Vpd for Condor,iStar,sStar */
23struct IoHriMainStoreSegment4 {
24 u8 msArea0Exists:1;
25 u8 msArea1Exists:1;
26 u8 msArea2Exists:1;
27 u8 msArea3Exists:1;
28 u8 reserved1:4;
29 u8 reserved2;
30
31 u8 msArea0Functional:1;
32 u8 msArea1Functional:1;
33 u8 msArea2Functional:1;
34 u8 msArea3Functional:1;
35 u8 reserved3:4;
36 u8 reserved4;
37
38 u32 totalMainStore;
39
40 u64 msArea0Ptr;
41 u64 msArea1Ptr;
42 u64 msArea2Ptr;
43 u64 msArea3Ptr;
44
45 u32 cardProductionLevel;
46
47 u32 msAdrHole;
48
49 u8 msArea0HasRiserVpd:1;
50 u8 msArea1HasRiserVpd:1;
51 u8 msArea2HasRiserVpd:1;
52 u8 msArea3HasRiserVpd:1;
53 u8 reserved5:4;
54 u8 reserved6;
55 u16 reserved7;
56
57 u8 reserved8[28];
58
59 u64 nonInterleavedBlocksStartAdr;
60 u64 nonInterleavedBlocksEndAdr;
61};
62
63/* Main Store VPD for Power4 */
64struct IoHriMainStoreChipInfo1 {
65 u32 chipMfgID __attribute((packed));
66 char chipECLevel[4] __attribute((packed));
67};
68
69struct IoHriMainStoreVpdIdData {
70 char typeNumber[4];
71 char modelNumber[4];
72 char partNumber[12];
73 char serialNumber[12];
74};
75
76struct IoHriMainStoreVpdFruData {
77 char fruLabel[8] __attribute((packed));
78 u8 numberOfSlots __attribute((packed));
79 u8 pluggingType __attribute((packed));
80 u16 slotMapIndex __attribute((packed));
81};
82
83struct IoHriMainStoreAdrRangeBlock {
84 void *blockStart __attribute((packed));
85 void *blockEnd __attribute((packed));
86 u32 blockProcChipId __attribute((packed));
87};
88
89#define MaxAreaAdrRangeBlocks 4
90
91struct IoHriMainStoreArea4 {
92 u32 msVpdFormat __attribute((packed));
93 u8 containedVpdType __attribute((packed));
94 u8 reserved1 __attribute((packed));
95 u16 reserved2 __attribute((packed));
96
97 u64 msExists __attribute((packed));
98 u64 msFunctional __attribute((packed));
99
100 u32 memorySize __attribute((packed));
101 u32 procNodeId __attribute((packed));
102
103 u32 numAdrRangeBlocks __attribute((packed));
104 struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks] __attribute((packed));
105
106 struct IoHriMainStoreChipInfo1 chipInfo0 __attribute((packed));
107 struct IoHriMainStoreChipInfo1 chipInfo1 __attribute((packed));
108 struct IoHriMainStoreChipInfo1 chipInfo2 __attribute((packed));
109 struct IoHriMainStoreChipInfo1 chipInfo3 __attribute((packed));
110 struct IoHriMainStoreChipInfo1 chipInfo4 __attribute((packed));
111 struct IoHriMainStoreChipInfo1 chipInfo5 __attribute((packed));
112 struct IoHriMainStoreChipInfo1 chipInfo6 __attribute((packed));
113 struct IoHriMainStoreChipInfo1 chipInfo7 __attribute((packed));
114
115 void *msRamAreaArray __attribute((packed));
116 u32 msRamAreaArrayNumEntries __attribute((packed));
117 u32 msRamAreaArrayEntrySize __attribute((packed));
118
119 u32 numaDimmExists __attribute((packed));
120 u32 numaDimmFunctional __attribute((packed));
121 void *numaDimmArray __attribute((packed));
122 u32 numaDimmArrayNumEntries __attribute((packed));
123 u32 numaDimmArrayEntrySize __attribute((packed));
124
125 struct IoHriMainStoreVpdIdData idData __attribute((packed));
126
127 u64 powerData __attribute((packed));
128 u64 cardAssemblyPartNum __attribute((packed));
129 u64 chipSerialNum __attribute((packed));
130
131 u64 reserved3 __attribute((packed));
132 char reserved4[16] __attribute((packed));
133
134 struct IoHriMainStoreVpdFruData fruData __attribute((packed));
135
136 u8 vpdPortNum __attribute((packed));
137 u8 reserved5 __attribute((packed));
138 u8 frameId __attribute((packed));
139 u8 rackUnit __attribute((packed));
140 char asciiKeywordVpd[256] __attribute((packed));
141 u32 reserved6 __attribute((packed));
142};
143
144
145struct IoHriMainStoreSegment5 {
146 u16 reserved1;
147 u8 reserved2;
148 u8 msVpdFormat;
149
150 u32 totalMainStore;
151 u64 maxConfiguredMsAdr;
152
153 struct IoHriMainStoreArea4 *msAreaArray;
154 u32 msAreaArrayNumEntries;
155 u32 msAreaArrayEntrySize;
156
157 u32 msAreaExists;
158 u32 msAreaFunctional;
159
160 u64 reserved3;
161};
162
163extern u64 xMsVpd[];
164
165#endif /* _ISERIES_MAIN_STORE_H */
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 501b1dcbfac5..70185dec940b 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -37,12 +37,13 @@
37 37
38#include <asm/iSeries/HvCallPci.h> 38#include <asm/iSeries/HvCallPci.h>
39#include <asm/iSeries/HvCallXm.h> 39#include <asm/iSeries/HvCallXm.h>
40#include <asm/iSeries/iSeries_irq.h>
41#include <asm/iSeries/iSeries_pci.h> 40#include <asm/iSeries/iSeries_pci.h>
42#include <asm/iSeries/mf.h> 41#include <asm/iSeries/mf.h>
43 42
44#include <asm/ppc-pci.h> 43#include <asm/ppc-pci.h>
45 44
45#include "irq.h"
46
46extern unsigned long io_page_mask; 47extern unsigned long io_page_mask;
47 48
48/* 49/*
diff --git a/arch/powerpc/platforms/iseries/proc.c b/arch/powerpc/platforms/iseries/proc.c
index d46b473ce4dd..6f1929cac66b 100644
--- a/arch/powerpc/platforms/iseries/proc.c
+++ b/arch/powerpc/platforms/iseries/proc.c
@@ -26,8 +26,9 @@
26#include <asm/lppaca.h> 26#include <asm/lppaca.h>
27#include <asm/iSeries/ItLpQueue.h> 27#include <asm/iSeries/ItLpQueue.h>
28#include <asm/iSeries/HvCallXm.h> 28#include <asm/iSeries/HvCallXm.h>
29#include <asm/iSeries/IoHriMainStore.h> 29
30#include <asm/iSeries/IoHriProcessorVpd.h> 30#include "processor_vpd.h"
31#include "main_store.h"
31 32
32static int __init iseries_proc_create(void) 33static int __init iseries_proc_create(void)
33{ 34{
diff --git a/arch/powerpc/platforms/iseries/processor_vpd.h b/arch/powerpc/platforms/iseries/processor_vpd.h
new file mode 100644
index 000000000000..7ac5d0d0dbfa
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/processor_vpd.h
@@ -0,0 +1,85 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _ISERIES_PROCESSOR_VPD_H
19#define _ISERIES_PROCESSOR_VPD_H
20
21#include <asm/types.h>
22
23/*
24 * This struct maps Processor Vpd that is DMAd to SLIC by CSP
25 */
26struct IoHriProcessorVpd {
27 u8 xFormat; // VPD format indicator x00-x00
28 u8 xProcStatus:8; // Processor State x01-x01
29 u8 xSecondaryThreadCount; // Secondary thread cnt x02-x02
30 u8 xSrcType:1; // Src Type x03-x03
31 u8 xSrcSoft:1; // Src stay soft ...
32 u8 xSrcParable:1; // Src parable ...
33 u8 xRsvd1:5; // Reserved ...
34 u16 xHvPhysicalProcIndex; // Hypervisor physical proc index04-x05
35 u16 xRsvd2; // Reserved x06-x07
36 u32 xHwNodeId; // Hardware node id x08-x0B
37 u32 xHwProcId; // Hardware processor id x0C-x0F
38
39 u32 xTypeNum; // Card Type/CCIN number x10-x13
40 u32 xModelNum; // Model/Feature number x14-x17
41 u64 xSerialNum; // Serial number x18-x1F
42 char xPartNum[12]; // Book Part or FPU number x20-x2B
43 char xMfgID[4]; // Manufacturing ID x2C-x2F
44
45 u32 xProcFreq; // Processor Frequency x30-x33
46 u32 xTimeBaseFreq; // Time Base Frequency x34-x37
47
48 u32 xChipEcLevel; // Chip EC Levels x38-x3B
49 u32 xProcIdReg; // PIR SPR value x3C-x3F
50 u32 xPVR; // PVR value x40-x43
51 u8 xRsvd3[12]; // Reserved x44-x4F
52
53 u32 xInstCacheSize; // Instruction cache size in KB x50-x53
54 u32 xInstBlockSize; // Instruction cache block size x54-x57
55 u32 xDataCacheOperandSize; // Data cache operand size x58-x5B
56 u32 xInstCacheOperandSize; // Inst cache operand size x5C-x5F
57
58 u32 xDataL1CacheSizeKB; // L1 data cache size in KB x60-x63
59 u32 xDataL1CacheLineSize; // L1 data cache block size x64-x67
60 u64 xRsvd4; // Reserved x68-x6F
61
62 u32 xDataL2CacheSizeKB; // L2 data cache size in KB x70-x73
63 u32 xDataL2CacheLineSize; // L2 data cache block size x74-x77
64 u64 xRsvd5; // Reserved x78-x7F
65
66 u32 xDataL3CacheSizeKB; // L3 data cache size in KB x80-x83
67 u32 xDataL3CacheLineSize; // L3 data cache block size x84-x87
68 u64 xRsvd6; // Reserved x88-x8F
69
70 u64 xFruLabel; // Card Location Label x90-x97
71 u8 xSlotsOnCard; // Slots on card (0=no slots) x98-x98
72 u8 xPartLocFlag; // Location flag (0-pluggable 1-imbedded) x99-x99
73 u16 xSlotMapIndex; // Index in slot map table x9A-x9B
74 u8 xSmartCardPortNo; // Smart card port number x9C-x9C
75 u8 xRsvd7; // Reserved x9D-x9D
76 u16 xFrameIdAndRackUnit; // Frame ID and rack unit adr x9E-x9F
77
78 u8 xRsvd8[24]; // Reserved xA0-xB7
79
80 char xProcSrc[72]; // CSP format SRC xB8-xFF
81};
82
83extern struct IoHriProcessorVpd xIoHriProcessorVpd[];
84
85#endif /* _ISERIES_PROCESSOR_VPD_H */
diff --git a/arch/powerpc/platforms/iseries/release_data.h b/arch/powerpc/platforms/iseries/release_data.h
new file mode 100644
index 000000000000..c68b9c3e5caf
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/release_data.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _ISERIES_RELEASE_DATA_H
19#define _ISERIES_RELEASE_DATA_H
20
21/*
22 * This control block contains the critical information about the
23 * release so that it can be changed in the future (ie, the virtual
24 * address of the OS's NACA).
25 */
26#include <asm/types.h>
27#include <asm/naca.h>
28
29/*
30 * When we IPL a secondary partition, we will check if if the
31 * secondary xMinPlicVrmIndex > the primary xVrmIndex.
32 * If it is then this tells PLIC that this secondary is not
33 * supported running on this "old" of a level of PLIC.
34 *
35 * Likewise, we will compare the primary xMinSlicVrmIndex to
36 * the secondary xVrmIndex.
37 * If the primary xMinSlicVrmDelta > secondary xVrmDelta then we
38 * know that this PLIC does not support running an OS "that old".
39 */
40
41#define HVREL_TAGSINACTIVE 0x8000
42#define HVREL_32BIT 0x4000
43#define HVREL_NOSHAREDPROCS 0x2000
44#define HVREL_NOHMT 0x1000
45
46struct HvReleaseData {
47 u32 xDesc; /* Descriptor "HvRD" ebcdic x00-x03 */
48 u16 xSize; /* Size of this control block x04-x05 */
49 u16 xVpdAreasPtrOffset; /* Offset in NACA of ItVpdAreas x06-x07 */
50 struct naca_struct *xSlicNacaAddr; /* Virt addr of SLIC NACA x08-x0F */
51 u32 xMsNucDataOffset; /* Offset of Linux Mapping Data x10-x13 */
52 u32 xRsvd1; /* Reserved x14-x17 */
53 u16 xFlags;
54 u16 xVrmIndex; /* VRM Index of OS image x1A-x1B */
55 u16 xMinSupportedPlicVrmIndex; /* Min PLIC level (soft) x1C-x1D */
56 u16 xMinCompatablePlicVrmIndex; /* Min PLIC levelP (hard) x1E-x1F */
57 char xVrmName[12]; /* Displayable name x20-x2B */
58 char xRsvd3[20]; /* Reserved x2C-x3F */
59};
60
61extern struct HvReleaseData hvReleaseData;
62
63#endif /* _ISERIES_RELEASE_DATA_H */
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index ad78c8581a5a..c3e532b766ef 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -48,18 +48,18 @@
48#include <asm/iSeries/HvCallHpt.h> 48#include <asm/iSeries/HvCallHpt.h>
49#include <asm/iSeries/HvLpConfig.h> 49#include <asm/iSeries/HvLpConfig.h>
50#include <asm/iSeries/HvCallEvent.h> 50#include <asm/iSeries/HvCallEvent.h>
51#include <asm/iSeries/HvCallSm.h>
52#include <asm/iSeries/HvCallXm.h> 51#include <asm/iSeries/HvCallXm.h>
53#include <asm/iSeries/ItLpQueue.h> 52#include <asm/iSeries/ItLpQueue.h>
54#include <asm/iSeries/IoHriMainStore.h>
55#include <asm/iSeries/mf.h> 53#include <asm/iSeries/mf.h>
56#include <asm/iSeries/HvLpEvent.h> 54#include <asm/iSeries/HvLpEvent.h>
57#include <asm/iSeries/iSeries_irq.h>
58#include <asm/iSeries/IoHriProcessorVpd.h>
59#include <asm/iSeries/ItVpdAreas.h>
60#include <asm/iSeries/LparMap.h> 55#include <asm/iSeries/LparMap.h>
61 56
62#include "setup.h" 57#include "setup.h"
58#include "irq.h"
59#include "vpd_areas.h"
60#include "processor_vpd.h"
61#include "main_store.h"
62#include "call_sm.h"
63 63
64extern void hvlog(char *fmt, ...); 64extern void hvlog(char *fmt, ...);
65 65
diff --git a/arch/powerpc/platforms/iseries/spcomm_area.h b/arch/powerpc/platforms/iseries/spcomm_area.h
new file mode 100644
index 000000000000..6e3b685115c9
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/spcomm_area.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef _ISERIES_SPCOMM_AREA_H
20#define _ISERIES_SPCOMM_AREA_H
21
22
23struct SpCommArea {
24 u32 xDesc; // Descriptor (only in new formats) 000-003
25 u8 xFormat; // Format (only in new formats) 004-004
26 u8 xRsvd1[11]; // Reserved 005-00F
27 u64 xRawTbAtIplStart; // Raw HW TB value when IPL is started 010-017
28 u64 xRawTodAtIplStart; // Raw HW TOD value when IPL is started 018-01F
29 u64 xBcdTimeAtIplStart; // BCD time when IPL is started 020-027
30 u64 xBcdTimeAtOsStart; // BCD time when OS passed control 028-02F
31 u8 xRsvd2[80]; // Reserved 030-07F
32};
33
34extern struct SpCommArea xSpCommArea;
35
36#endif /* _ISERIES_SPCOMM_AREA_H */
diff --git a/arch/powerpc/platforms/iseries/vpd_areas.h b/arch/powerpc/platforms/iseries/vpd_areas.h
new file mode 100644
index 000000000000..601e6dd860ed
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/vpd_areas.h
@@ -0,0 +1,88 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _ISERIES_VPD_AREAS_H
19#define _ISERIES_VPD_AREAS_H
20
21/*
22 * This file defines the address and length of all of the VPD area passed to
23 * the OS from PLIC (most of which start from the SP).
24 */
25
26#include <asm/types.h>
27
28/* VPD Entry index is carved in stone - cannot be changed (easily). */
29#define ItVpdCecVpd 0
30#define ItVpdDynamicSpace 1
31#define ItVpdExtVpd 2
32#define ItVpdExtVpdOnPanel 3
33#define ItVpdFirstPaca 4
34#define ItVpdIoVpd 5
35#define ItVpdIplParms 6
36#define ItVpdMsVpd 7
37#define ItVpdPanelVpd 8
38#define ItVpdLpNaca 9
39#define ItVpdBackplaneAndMaybeClockCardVpd 10
40#define ItVpdRecoveryLogBuffer 11
41#define ItVpdSpCommArea 12
42#define ItVpdSpLogBuffer 13
43#define ItVpdSpLogBufferSave 14
44#define ItVpdSpCardVpd 15
45#define ItVpdFirstProcVpd 16
46#define ItVpdApModelVpd 17
47#define ItVpdClockCardVpd 18
48#define ItVpdBusExtCardVpd 19
49#define ItVpdProcCapacityVpd 20
50#define ItVpdInteractiveCapacityVpd 21
51#define ItVpdFirstSlotLabel 22
52#define ItVpdFirstLpQueue 23
53#define ItVpdFirstL3CacheVpd 24
54#define ItVpdFirstProcFruVpd 25
55
56#define ItVpdMaxEntries 26
57
58#define ItDmaMaxEntries 10
59
60#define ItVpdAreasMaxSlotLabels 192
61
62
63struct ItVpdAreas {
64 u32 xSlicDesc; // Descriptor 000-003
65 u16 xSlicSize; // Size of this control block 004-005
66 u16 xPlicAdjustVpdLens:1; // Flag to indicate new interface006-007
67 u16 xRsvd1:15; // Reserved bits ...
68 u16 xSlicVpdEntries; // Number of VPD entries 008-009
69 u16 xSlicDmaEntries; // Number of DMA entries 00A-00B
70 u16 xSlicMaxLogicalProcs; // Maximum logical processors 00C-00D
71 u16 xSlicMaxPhysicalProcs; // Maximum physical processors 00E-00F
72 u16 xSlicDmaToksOffset; // Offset into this of array 010-011
73 u16 xSlicVpdAdrsOffset; // Offset into this of array 012-013
74 u16 xSlicDmaLensOffset; // Offset into this of array 014-015
75 u16 xSlicVpdLensOffset; // Offset into this of array 016-017
76 u16 xSlicMaxSlotLabels; // Maximum number of slot labels018-019
77 u16 xSlicMaxLpQueues; // Maximum number of LP Queues 01A-01B
78 u8 xRsvd2[4]; // Reserved 01C-01F
79 u64 xRsvd3[12]; // Reserved 020-07F
80 u32 xPlicDmaLens[ItDmaMaxEntries];// Array of DMA lengths 080-0A7
81 u32 xPlicDmaToks[ItDmaMaxEntries];// Array of DMA tokens 0A8-0CF
82 u32 xSlicVpdLens[ItVpdMaxEntries];// Array of VPD lengths 0D0-12F
83 void *xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers 130-1EF
84};
85
86extern struct ItVpdAreas itVpdAreas;
87
88#endif /* _ISERIES_VPD_AREAS_H */
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
index 467f96480355..da2dc08c4c1b 100644
--- a/arch/ppc/kernel/Makefile
+++ b/arch/ppc/kernel/Makefile
@@ -38,6 +38,8 @@ endif
38 38
39# These are here while we do the architecture merge 39# These are here while we do the architecture merge
40vecemu-y += ../../powerpc/kernel/vecemu.o 40vecemu-y += ../../powerpc/kernel/vecemu.o
41vector-y += ../../powerpc/kernel/vector.o
42fpu-y += ../../powerpc/kernel/fpu.o
41 43
42else 44else
43obj-y := entry.o irq.o idle.o time.o misc.o \ 45obj-y := entry.o irq.o idle.o time.o misc.o \
diff --git a/arch/ppc/kernel/fpu.S b/arch/ppc/kernel/fpu.S
deleted file mode 100644
index 665d7d34304c..000000000000
--- a/arch/ppc/kernel/fpu.S
+++ /dev/null
@@ -1,133 +0,0 @@
1/*
2 * FPU support code, moved here from head.S so that it can be used
3 * by chips which use other head-whatever.S files.
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 */
11
12#include <linux/config.h>
13#include <asm/processor.h>
14#include <asm/page.h>
15#include <asm/mmu.h>
16#include <asm/pgtable.h>
17#include <asm/cputable.h>
18#include <asm/cache.h>
19#include <asm/thread_info.h>
20#include <asm/ppc_asm.h>
21#include <asm/asm-offsets.h>
22
23/*
24 * This task wants to use the FPU now.
25 * On UP, disable FP for the task which had the FPU previously,
26 * and save its floating-point registers in its thread_struct.
27 * Load up this task's FP registers from its thread_struct,
28 * enable the FPU for the current task and return to the task.
29 */
30 .globl load_up_fpu
31load_up_fpu:
32 mfmsr r5
33 ori r5,r5,MSR_FP
34#ifdef CONFIG_PPC64BRIDGE
35 clrldi r5,r5,1 /* turn off 64-bit mode */
36#endif /* CONFIG_PPC64BRIDGE */
37 SYNC
38 MTMSRD(r5) /* enable use of fpu now */
39 isync
40/*
41 * For SMP, we don't do lazy FPU switching because it just gets too
42 * horrendously complex, especially when a task switches from one CPU
43 * to another. Instead we call giveup_fpu in switch_to.
44 */
45#ifndef CONFIG_SMP
46 tophys(r6,0) /* get __pa constant */
47 addis r3,r6,last_task_used_math@ha
48 lwz r4,last_task_used_math@l(r3)
49 cmpwi 0,r4,0
50 beq 1f
51 add r4,r4,r6
52 addi r4,r4,THREAD /* want last_task_used_math->thread */
53 SAVE_32FPRS(0, r4)
54 mffs fr0
55 stfd fr0,THREAD_FPSCR-4(r4)
56 lwz r5,PT_REGS(r4)
57 add r5,r5,r6
58 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
59 li r10,MSR_FP|MSR_FE0|MSR_FE1
60 andc r4,r4,r10 /* disable FP for previous task */
61 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
621:
63#endif /* CONFIG_SMP */
64 /* enable use of FP after return */
65 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */
66 lwz r4,THREAD_FPEXC_MODE(r5)
67 ori r9,r9,MSR_FP /* enable FP for current */
68 or r9,r9,r4
69 lfd fr0,THREAD_FPSCR-4(r5)
70 mtfsf 0xff,fr0
71 REST_32FPRS(0, r5)
72#ifndef CONFIG_SMP
73 subi r4,r5,THREAD
74 sub r4,r4,r6
75 stw r4,last_task_used_math@l(r3)
76#endif /* CONFIG_SMP */
77 /* restore registers and return */
78 /* we haven't used ctr or xer or lr */
79 b fast_exception_return
80
81/*
82 * FP unavailable trap from kernel - print a message, but let
83 * the task use FP in the kernel until it returns to user mode.
84 */
85 .globl KernelFP
86KernelFP:
87 lwz r3,_MSR(r1)
88 ori r3,r3,MSR_FP
89 stw r3,_MSR(r1) /* enable use of FP after return */
90 lis r3,86f@h
91 ori r3,r3,86f@l
92 mr r4,r2 /* current */
93 lwz r5,_NIP(r1)
94 bl printk
95 b ret_from_except
9686: .string "floating point used in kernel (task=%p, pc=%x)\n"
97 .align 4,0
98
99/*
100 * giveup_fpu(tsk)
101 * Disable FP for the task given as the argument,
102 * and save the floating-point registers in its thread_struct.
103 * Enables the FPU for use in the kernel on return.
104 */
105 .globl giveup_fpu
106giveup_fpu:
107 mfmsr r5
108 ori r5,r5,MSR_FP
109 SYNC_601
110 ISYNC_601
111 MTMSRD(r5) /* enable use of fpu now */
112 SYNC_601
113 isync
114 cmpwi 0,r3,0
115 beqlr- /* if no previous owner, done */
116 addi r3,r3,THREAD /* want THREAD of task */
117 lwz r5,PT_REGS(r3)
118 cmpwi 0,r5,0
119 SAVE_32FPRS(0, r3)
120 mffs fr0
121 stfd fr0,THREAD_FPSCR-4(r3)
122 beq 1f
123 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
124 li r3,MSR_FP|MSR_FE0|MSR_FE1
125 andc r4,r4,r3 /* disable FP for previous task */
126 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
1271:
128#ifndef CONFIG_SMP
129 li r5,0
130 lis r4,last_task_used_math@ha
131 stw r5,last_task_used_math@l(r4)
132#endif /* CONFIG_SMP */
133 blr
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index 8cdac7385e7f..2c3a1d34e3c7 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -349,12 +349,12 @@ i##n: \
349 349
350/* System reset */ 350/* System reset */
351/* core99 pmac starts the seconary here by changing the vector, and 351/* core99 pmac starts the seconary here by changing the vector, and
352 putting it back to what it was (UnknownException) when done. */ 352 putting it back to what it was (unknown_exception) when done. */
353#if defined(CONFIG_GEMINI) && defined(CONFIG_SMP) 353#if defined(CONFIG_GEMINI) && defined(CONFIG_SMP)
354 . = 0x100 354 . = 0x100
355 b __secondary_start_gemini 355 b __secondary_start_gemini
356#else 356#else
357 EXCEPTION(0x100, Reset, UnknownException, EXC_XFER_STD) 357 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
358#endif 358#endif
359 359
360/* Machine check */ 360/* Machine check */
@@ -389,7 +389,7 @@ i##n: \
389 cmpwi cr1,r4,0 389 cmpwi cr1,r4,0
390 bne cr1,1f 390 bne cr1,1f
391#endif 391#endif
392 EXC_XFER_STD(0x200, MachineCheckException) 392 EXC_XFER_STD(0x200, machine_check_exception)
393#ifdef CONFIG_PPC_CHRP 393#ifdef CONFIG_PPC_CHRP
3941: b machine_check_in_rtas 3941: b machine_check_in_rtas
395#endif 395#endif
@@ -456,10 +456,10 @@ Alignment:
456 mfspr r5,SPRN_DSISR 456 mfspr r5,SPRN_DSISR
457 stw r5,_DSISR(r11) 457 stw r5,_DSISR(r11)
458 addi r3,r1,STACK_FRAME_OVERHEAD 458 addi r3,r1,STACK_FRAME_OVERHEAD
459 EXC_XFER_EE(0x600, AlignmentException) 459 EXC_XFER_EE(0x600, alignment_exception)
460 460
461/* Program check exception */ 461/* Program check exception */
462 EXCEPTION(0x700, ProgramCheck, ProgramCheckException, EXC_XFER_STD) 462 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
463 463
464/* Floating-point unavailable */ 464/* Floating-point unavailable */
465 . = 0x800 465 . = 0x800
@@ -472,8 +472,8 @@ FPUnavailable:
472/* Decrementer */ 472/* Decrementer */
473 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) 473 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
474 474
475 EXCEPTION(0xa00, Trap_0a, UnknownException, EXC_XFER_EE) 475 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
476 EXCEPTION(0xb00, Trap_0b, UnknownException, EXC_XFER_EE) 476 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
477 477
478/* System call */ 478/* System call */
479 . = 0xc00 479 . = 0xc00
@@ -482,8 +482,8 @@ SystemCall:
482 EXC_XFER_EE_LITE(0xc00, DoSyscall) 482 EXC_XFER_EE_LITE(0xc00, DoSyscall)
483 483
484/* Single step - not used on 601 */ 484/* Single step - not used on 601 */
485 EXCEPTION(0xd00, SingleStep, SingleStepException, EXC_XFER_STD) 485 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
486 EXCEPTION(0xe00, Trap_0e, UnknownException, EXC_XFER_EE) 486 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
487 487
488/* 488/*
489 * The Altivec unavailable trap is at 0x0f20. Foo. 489 * The Altivec unavailable trap is at 0x0f20. Foo.
@@ -502,7 +502,7 @@ SystemCall:
502Trap_0f: 502Trap_0f:
503 EXCEPTION_PROLOG 503 EXCEPTION_PROLOG
504 addi r3,r1,STACK_FRAME_OVERHEAD 504 addi r3,r1,STACK_FRAME_OVERHEAD
505 EXC_XFER_EE(0xf00, UnknownException) 505 EXC_XFER_EE(0xf00, unknown_exception)
506 506
507/* 507/*
508 * Handle TLB miss for instruction on 603/603e. 508 * Handle TLB miss for instruction on 603/603e.
@@ -702,44 +702,44 @@ DataStoreTLBMiss:
702 rfi 702 rfi
703 703
704#ifndef CONFIG_ALTIVEC 704#ifndef CONFIG_ALTIVEC
705#define AltivecAssistException UnknownException 705#define altivec_assist_exception unknown_exception
706#endif 706#endif
707 707
708 EXCEPTION(0x1300, Trap_13, InstructionBreakpoint, EXC_XFER_EE) 708 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE)
709 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE) 709 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE)
710 EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE) 710 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
711#ifdef CONFIG_POWER4 711#ifdef CONFIG_POWER4
712 EXCEPTION(0x1600, Trap_16, UnknownException, EXC_XFER_EE) 712 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
713 EXCEPTION(0x1700, Trap_17, AltivecAssistException, EXC_XFER_EE) 713 EXCEPTION(0x1700, Trap_17, altivec_assist_exception, EXC_XFER_EE)
714 EXCEPTION(0x1800, Trap_18, TAUException, EXC_XFER_STD) 714 EXCEPTION(0x1800, Trap_18, TAUException, EXC_XFER_STD)
715#else /* !CONFIG_POWER4 */ 715#else /* !CONFIG_POWER4 */
716 EXCEPTION(0x1600, Trap_16, AltivecAssistException, EXC_XFER_EE) 716 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE)
717 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD) 717 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD)
718 EXCEPTION(0x1800, Trap_18, UnknownException, EXC_XFER_EE) 718 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
719#endif /* CONFIG_POWER4 */ 719#endif /* CONFIG_POWER4 */
720 EXCEPTION(0x1900, Trap_19, UnknownException, EXC_XFER_EE) 720 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
721 EXCEPTION(0x1a00, Trap_1a, UnknownException, EXC_XFER_EE) 721 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
722 EXCEPTION(0x1b00, Trap_1b, UnknownException, EXC_XFER_EE) 722 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
723 EXCEPTION(0x1c00, Trap_1c, UnknownException, EXC_XFER_EE) 723 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
724 EXCEPTION(0x1d00, Trap_1d, UnknownException, EXC_XFER_EE) 724 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
725 EXCEPTION(0x1e00, Trap_1e, UnknownException, EXC_XFER_EE) 725 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
726 EXCEPTION(0x1f00, Trap_1f, UnknownException, EXC_XFER_EE) 726 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
727 EXCEPTION(0x2000, RunMode, RunModeException, EXC_XFER_EE) 727 EXCEPTION(0x2000, RunMode, RunModeException, EXC_XFER_EE)
728 EXCEPTION(0x2100, Trap_21, UnknownException, EXC_XFER_EE) 728 EXCEPTION(0x2100, Trap_21, unknown_exception, EXC_XFER_EE)
729 EXCEPTION(0x2200, Trap_22, UnknownException, EXC_XFER_EE) 729 EXCEPTION(0x2200, Trap_22, unknown_exception, EXC_XFER_EE)
730 EXCEPTION(0x2300, Trap_23, UnknownException, EXC_XFER_EE) 730 EXCEPTION(0x2300, Trap_23, unknown_exception, EXC_XFER_EE)
731 EXCEPTION(0x2400, Trap_24, UnknownException, EXC_XFER_EE) 731 EXCEPTION(0x2400, Trap_24, unknown_exception, EXC_XFER_EE)
732 EXCEPTION(0x2500, Trap_25, UnknownException, EXC_XFER_EE) 732 EXCEPTION(0x2500, Trap_25, unknown_exception, EXC_XFER_EE)
733 EXCEPTION(0x2600, Trap_26, UnknownException, EXC_XFER_EE) 733 EXCEPTION(0x2600, Trap_26, unknown_exception, EXC_XFER_EE)
734 EXCEPTION(0x2700, Trap_27, UnknownException, EXC_XFER_EE) 734 EXCEPTION(0x2700, Trap_27, unknown_exception, EXC_XFER_EE)
735 EXCEPTION(0x2800, Trap_28, UnknownException, EXC_XFER_EE) 735 EXCEPTION(0x2800, Trap_28, unknown_exception, EXC_XFER_EE)
736 EXCEPTION(0x2900, Trap_29, UnknownException, EXC_XFER_EE) 736 EXCEPTION(0x2900, Trap_29, unknown_exception, EXC_XFER_EE)
737 EXCEPTION(0x2a00, Trap_2a, UnknownException, EXC_XFER_EE) 737 EXCEPTION(0x2a00, Trap_2a, unknown_exception, EXC_XFER_EE)
738 EXCEPTION(0x2b00, Trap_2b, UnknownException, EXC_XFER_EE) 738 EXCEPTION(0x2b00, Trap_2b, unknown_exception, EXC_XFER_EE)
739 EXCEPTION(0x2c00, Trap_2c, UnknownException, EXC_XFER_EE) 739 EXCEPTION(0x2c00, Trap_2c, unknown_exception, EXC_XFER_EE)
740 EXCEPTION(0x2d00, Trap_2d, UnknownException, EXC_XFER_EE) 740 EXCEPTION(0x2d00, Trap_2d, unknown_exception, EXC_XFER_EE)
741 EXCEPTION(0x2e00, Trap_2e, UnknownException, EXC_XFER_EE) 741 EXCEPTION(0x2e00, Trap_2e, unknown_exception, EXC_XFER_EE)
742 EXCEPTION(0x2f00, MOLTrampoline, UnknownException, EXC_XFER_EE_LITE) 742 EXCEPTION(0x2f00, MOLTrampoline, unknown_exception, EXC_XFER_EE_LITE)
743 743
744 .globl mol_trampoline 744 .globl mol_trampoline
745 .set mol_trampoline, i0x2f00 745 .set mol_trampoline, i0x2f00
@@ -751,7 +751,7 @@ AltiVecUnavailable:
751#ifdef CONFIG_ALTIVEC 751#ifdef CONFIG_ALTIVEC
752 bne load_up_altivec /* if from user, just load it up */ 752 bne load_up_altivec /* if from user, just load it up */
753#endif /* CONFIG_ALTIVEC */ 753#endif /* CONFIG_ALTIVEC */
754 EXC_XFER_EE_LITE(0xf20, AltivecUnavailException) 754 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
755 755
756#ifdef CONFIG_PPC64BRIDGE 756#ifdef CONFIG_PPC64BRIDGE
757DataAccess: 757DataAccess:
@@ -767,12 +767,12 @@ DataSegment:
767 addi r3,r1,STACK_FRAME_OVERHEAD 767 addi r3,r1,STACK_FRAME_OVERHEAD
768 mfspr r4,SPRN_DAR 768 mfspr r4,SPRN_DAR
769 stw r4,_DAR(r11) 769 stw r4,_DAR(r11)
770 EXC_XFER_STD(0x380, UnknownException) 770 EXC_XFER_STD(0x380, unknown_exception)
771 771
772InstructionSegment: 772InstructionSegment:
773 EXCEPTION_PROLOG 773 EXCEPTION_PROLOG
774 addi r3,r1,STACK_FRAME_OVERHEAD 774 addi r3,r1,STACK_FRAME_OVERHEAD
775 EXC_XFER_STD(0x480, UnknownException) 775 EXC_XFER_STD(0x480, unknown_exception)
776#endif /* CONFIG_PPC64BRIDGE */ 776#endif /* CONFIG_PPC64BRIDGE */
777 777
778#ifdef CONFIG_ALTIVEC 778#ifdef CONFIG_ALTIVEC
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
index 599245b0407e..b1b9dc08abca 100644
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -309,13 +309,13 @@ skpinv: addi r4,r4,1 /* Increment */
309 309
310interrupt_base: 310interrupt_base:
311 /* Critical Input Interrupt */ 311 /* Critical Input Interrupt */
312 CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) 312 CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
313 313
314 /* Machine Check Interrupt */ 314 /* Machine Check Interrupt */
315#ifdef CONFIG_440A 315#ifdef CONFIG_440A
316 MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 316 MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
317#else 317#else
318 CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 318 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
319#endif 319#endif
320 320
321 /* Data Storage Interrupt */ 321 /* Data Storage Interrupt */
@@ -442,7 +442,7 @@ interrupt_base:
442#ifdef CONFIG_PPC_FPU 442#ifdef CONFIG_PPC_FPU
443 FP_UNAVAILABLE_EXCEPTION 443 FP_UNAVAILABLE_EXCEPTION
444#else 444#else
445 EXCEPTION(0x2010, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) 445 EXCEPTION(0x2010, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
446#endif 446#endif
447 447
448 /* System Call Interrupt */ 448 /* System Call Interrupt */
@@ -451,21 +451,21 @@ interrupt_base:
451 EXC_XFER_EE_LITE(0x0c00, DoSyscall) 451 EXC_XFER_EE_LITE(0x0c00, DoSyscall)
452 452
453 /* Auxillary Processor Unavailable Interrupt */ 453 /* Auxillary Processor Unavailable Interrupt */
454 EXCEPTION(0x2020, AuxillaryProcessorUnavailable, UnknownException, EXC_XFER_EE) 454 EXCEPTION(0x2020, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
455 455
456 /* Decrementer Interrupt */ 456 /* Decrementer Interrupt */
457 DECREMENTER_EXCEPTION 457 DECREMENTER_EXCEPTION
458 458
459 /* Fixed Internal Timer Interrupt */ 459 /* Fixed Internal Timer Interrupt */
460 /* TODO: Add FIT support */ 460 /* TODO: Add FIT support */
461 EXCEPTION(0x1010, FixedIntervalTimer, UnknownException, EXC_XFER_EE) 461 EXCEPTION(0x1010, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
462 462
463 /* Watchdog Timer Interrupt */ 463 /* Watchdog Timer Interrupt */
464 /* TODO: Add watchdog support */ 464 /* TODO: Add watchdog support */
465#ifdef CONFIG_BOOKE_WDT 465#ifdef CONFIG_BOOKE_WDT
466 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException) 466 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException)
467#else 467#else
468 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, UnknownException) 468 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, unknown_exception)
469#endif 469#endif
470 470
471 /* Data TLB Error Interrupt */ 471 /* Data TLB Error Interrupt */
diff --git a/arch/ppc/kernel/head_4xx.S b/arch/ppc/kernel/head_4xx.S
index 8562b807b37c..5772ce97e24e 100644
--- a/arch/ppc/kernel/head_4xx.S
+++ b/arch/ppc/kernel/head_4xx.S
@@ -245,12 +245,12 @@ label:
245/* 245/*
246 * 0x0100 - Critical Interrupt Exception 246 * 0x0100 - Critical Interrupt Exception
247 */ 247 */
248 CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, UnknownException) 248 CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, unknown_exception)
249 249
250/* 250/*
251 * 0x0200 - Machine Check Exception 251 * 0x0200 - Machine Check Exception
252 */ 252 */
253 CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 253 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
254 254
255/* 255/*
256 * 0x0300 - Data Storage Exception 256 * 0x0300 - Data Storage Exception
@@ -405,7 +405,7 @@ label:
405 mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */ 405 mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */
406 stw r4,_DEAR(r11) 406 stw r4,_DEAR(r11)
407 addi r3,r1,STACK_FRAME_OVERHEAD 407 addi r3,r1,STACK_FRAME_OVERHEAD
408 EXC_XFER_EE(0x600, AlignmentException) 408 EXC_XFER_EE(0x600, alignment_exception)
409 409
410/* 0x0700 - Program Exception */ 410/* 0x0700 - Program Exception */
411 START_EXCEPTION(0x0700, ProgramCheck) 411 START_EXCEPTION(0x0700, ProgramCheck)
@@ -413,21 +413,21 @@ label:
413 mfspr r4,SPRN_ESR /* Grab the ESR and save it */ 413 mfspr r4,SPRN_ESR /* Grab the ESR and save it */
414 stw r4,_ESR(r11) 414 stw r4,_ESR(r11)
415 addi r3,r1,STACK_FRAME_OVERHEAD 415 addi r3,r1,STACK_FRAME_OVERHEAD
416 EXC_XFER_STD(0x700, ProgramCheckException) 416 EXC_XFER_STD(0x700, program_check_exception)
417 417
418 EXCEPTION(0x0800, Trap_08, UnknownException, EXC_XFER_EE) 418 EXCEPTION(0x0800, Trap_08, unknown_exception, EXC_XFER_EE)
419 EXCEPTION(0x0900, Trap_09, UnknownException, EXC_XFER_EE) 419 EXCEPTION(0x0900, Trap_09, unknown_exception, EXC_XFER_EE)
420 EXCEPTION(0x0A00, Trap_0A, UnknownException, EXC_XFER_EE) 420 EXCEPTION(0x0A00, Trap_0A, unknown_exception, EXC_XFER_EE)
421 EXCEPTION(0x0B00, Trap_0B, UnknownException, EXC_XFER_EE) 421 EXCEPTION(0x0B00, Trap_0B, unknown_exception, EXC_XFER_EE)
422 422
423/* 0x0C00 - System Call Exception */ 423/* 0x0C00 - System Call Exception */
424 START_EXCEPTION(0x0C00, SystemCall) 424 START_EXCEPTION(0x0C00, SystemCall)
425 NORMAL_EXCEPTION_PROLOG 425 NORMAL_EXCEPTION_PROLOG
426 EXC_XFER_EE_LITE(0xc00, DoSyscall) 426 EXC_XFER_EE_LITE(0xc00, DoSyscall)
427 427
428 EXCEPTION(0x0D00, Trap_0D, UnknownException, EXC_XFER_EE) 428 EXCEPTION(0x0D00, Trap_0D, unknown_exception, EXC_XFER_EE)
429 EXCEPTION(0x0E00, Trap_0E, UnknownException, EXC_XFER_EE) 429 EXCEPTION(0x0E00, Trap_0E, unknown_exception, EXC_XFER_EE)
430 EXCEPTION(0x0F00, Trap_0F, UnknownException, EXC_XFER_EE) 430 EXCEPTION(0x0F00, Trap_0F, unknown_exception, EXC_XFER_EE)
431 431
432/* 0x1000 - Programmable Interval Timer (PIT) Exception */ 432/* 0x1000 - Programmable Interval Timer (PIT) Exception */
433 START_EXCEPTION(0x1000, Decrementer) 433 START_EXCEPTION(0x1000, Decrementer)
@@ -444,14 +444,14 @@ label:
444 444
445/* 0x1010 - Fixed Interval Timer (FIT) Exception 445/* 0x1010 - Fixed Interval Timer (FIT) Exception
446*/ 446*/
447 STND_EXCEPTION(0x1010, FITException, UnknownException) 447 STND_EXCEPTION(0x1010, FITException, unknown_exception)
448 448
449/* 0x1020 - Watchdog Timer (WDT) Exception 449/* 0x1020 - Watchdog Timer (WDT) Exception
450*/ 450*/
451#ifdef CONFIG_BOOKE_WDT 451#ifdef CONFIG_BOOKE_WDT
452 CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException) 452 CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException)
453#else 453#else
454 CRITICAL_EXCEPTION(0x1020, WDTException, UnknownException) 454 CRITICAL_EXCEPTION(0x1020, WDTException, unknown_exception)
455#endif 455#endif
456#endif 456#endif
457 457
@@ -656,25 +656,25 @@ label:
656 mfspr r10, SPRN_SPRG0 656 mfspr r10, SPRN_SPRG0
657 b InstructionAccess 657 b InstructionAccess
658 658
659 EXCEPTION(0x1300, Trap_13, UnknownException, EXC_XFER_EE) 659 EXCEPTION(0x1300, Trap_13, unknown_exception, EXC_XFER_EE)
660 EXCEPTION(0x1400, Trap_14, UnknownException, EXC_XFER_EE) 660 EXCEPTION(0x1400, Trap_14, unknown_exception, EXC_XFER_EE)
661 EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE) 661 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
662 EXCEPTION(0x1600, Trap_16, UnknownException, EXC_XFER_EE) 662 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
663#ifdef CONFIG_IBM405_ERR51 663#ifdef CONFIG_IBM405_ERR51
664 /* 405GP errata 51 */ 664 /* 405GP errata 51 */
665 START_EXCEPTION(0x1700, Trap_17) 665 START_EXCEPTION(0x1700, Trap_17)
666 b DTLBMiss 666 b DTLBMiss
667#else 667#else
668 EXCEPTION(0x1700, Trap_17, UnknownException, EXC_XFER_EE) 668 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
669#endif 669#endif
670 EXCEPTION(0x1800, Trap_18, UnknownException, EXC_XFER_EE) 670 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
671 EXCEPTION(0x1900, Trap_19, UnknownException, EXC_XFER_EE) 671 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
672 EXCEPTION(0x1A00, Trap_1A, UnknownException, EXC_XFER_EE) 672 EXCEPTION(0x1A00, Trap_1A, unknown_exception, EXC_XFER_EE)
673 EXCEPTION(0x1B00, Trap_1B, UnknownException, EXC_XFER_EE) 673 EXCEPTION(0x1B00, Trap_1B, unknown_exception, EXC_XFER_EE)
674 EXCEPTION(0x1C00, Trap_1C, UnknownException, EXC_XFER_EE) 674 EXCEPTION(0x1C00, Trap_1C, unknown_exception, EXC_XFER_EE)
675 EXCEPTION(0x1D00, Trap_1D, UnknownException, EXC_XFER_EE) 675 EXCEPTION(0x1D00, Trap_1D, unknown_exception, EXC_XFER_EE)
676 EXCEPTION(0x1E00, Trap_1E, UnknownException, EXC_XFER_EE) 676 EXCEPTION(0x1E00, Trap_1E, unknown_exception, EXC_XFER_EE)
677 EXCEPTION(0x1F00, Trap_1F, UnknownException, EXC_XFER_EE) 677 EXCEPTION(0x1F00, Trap_1F, unknown_exception, EXC_XFER_EE)
678 678
679/* Check for a single step debug exception while in an exception 679/* Check for a single step debug exception while in an exception
680 * handler before state has been saved. This is to catch the case 680 * handler before state has been saved. This is to catch the case
diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
index cb1a3a54a026..de0978742221 100644
--- a/arch/ppc/kernel/head_8xx.S
+++ b/arch/ppc/kernel/head_8xx.S
@@ -203,7 +203,7 @@ i##n: \
203 ret_from_except) 203 ret_from_except)
204 204
205/* System reset */ 205/* System reset */
206 EXCEPTION(0x100, Reset, UnknownException, EXC_XFER_STD) 206 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
207 207
208/* Machine check */ 208/* Machine check */
209 . = 0x200 209 . = 0x200
@@ -214,7 +214,7 @@ MachineCheck:
214 mfspr r5,SPRN_DSISR 214 mfspr r5,SPRN_DSISR
215 stw r5,_DSISR(r11) 215 stw r5,_DSISR(r11)
216 addi r3,r1,STACK_FRAME_OVERHEAD 216 addi r3,r1,STACK_FRAME_OVERHEAD
217 EXC_XFER_STD(0x200, MachineCheckException) 217 EXC_XFER_STD(0x200, machine_check_exception)
218 218
219/* Data access exception. 219/* Data access exception.
220 * This is "never generated" by the MPC8xx. We jump to it for other 220 * This is "never generated" by the MPC8xx. We jump to it for other
@@ -252,20 +252,20 @@ Alignment:
252 mfspr r5,SPRN_DSISR 252 mfspr r5,SPRN_DSISR
253 stw r5,_DSISR(r11) 253 stw r5,_DSISR(r11)
254 addi r3,r1,STACK_FRAME_OVERHEAD 254 addi r3,r1,STACK_FRAME_OVERHEAD
255 EXC_XFER_EE(0x600, AlignmentException) 255 EXC_XFER_EE(0x600, alignment_exception)
256 256
257/* Program check exception */ 257/* Program check exception */
258 EXCEPTION(0x700, ProgramCheck, ProgramCheckException, EXC_XFER_STD) 258 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
259 259
260/* No FPU on MPC8xx. This exception is not supposed to happen. 260/* No FPU on MPC8xx. This exception is not supposed to happen.
261*/ 261*/
262 EXCEPTION(0x800, FPUnavailable, UnknownException, EXC_XFER_STD) 262 EXCEPTION(0x800, FPUnavailable, unknown_exception, EXC_XFER_STD)
263 263
264/* Decrementer */ 264/* Decrementer */
265 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) 265 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
266 266
267 EXCEPTION(0xa00, Trap_0a, UnknownException, EXC_XFER_EE) 267 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
268 EXCEPTION(0xb00, Trap_0b, UnknownException, EXC_XFER_EE) 268 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
269 269
270/* System call */ 270/* System call */
271 . = 0xc00 271 . = 0xc00
@@ -274,9 +274,9 @@ SystemCall:
274 EXC_XFER_EE_LITE(0xc00, DoSyscall) 274 EXC_XFER_EE_LITE(0xc00, DoSyscall)
275 275
276/* Single step - not used on 601 */ 276/* Single step - not used on 601 */
277 EXCEPTION(0xd00, SingleStep, SingleStepException, EXC_XFER_STD) 277 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
278 EXCEPTION(0xe00, Trap_0e, UnknownException, EXC_XFER_EE) 278 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
279 EXCEPTION(0xf00, Trap_0f, UnknownException, EXC_XFER_EE) 279 EXCEPTION(0xf00, Trap_0f, unknown_exception, EXC_XFER_EE)
280 280
281/* On the MPC8xx, this is a software emulation interrupt. It occurs 281/* On the MPC8xx, this is a software emulation interrupt. It occurs
282 * for all unimplemented and illegal instructions. 282 * for all unimplemented and illegal instructions.
@@ -540,22 +540,22 @@ DataTLBError:
540#endif 540#endif
541 b DataAccess 541 b DataAccess
542 542
543 EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE) 543 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
544 EXCEPTION(0x1600, Trap_16, UnknownException, EXC_XFER_EE) 544 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
545 EXCEPTION(0x1700, Trap_17, UnknownException, EXC_XFER_EE) 545 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
546 EXCEPTION(0x1800, Trap_18, UnknownException, EXC_XFER_EE) 546 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
547 EXCEPTION(0x1900, Trap_19, UnknownException, EXC_XFER_EE) 547 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
548 EXCEPTION(0x1a00, Trap_1a, UnknownException, EXC_XFER_EE) 548 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
549 EXCEPTION(0x1b00, Trap_1b, UnknownException, EXC_XFER_EE) 549 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
550 550
551/* On the MPC8xx, these next four traps are used for development 551/* On the MPC8xx, these next four traps are used for development
552 * support of breakpoints and such. Someday I will get around to 552 * support of breakpoints and such. Someday I will get around to
553 * using them. 553 * using them.
554 */ 554 */
555 EXCEPTION(0x1c00, Trap_1c, UnknownException, EXC_XFER_EE) 555 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
556 EXCEPTION(0x1d00, Trap_1d, UnknownException, EXC_XFER_EE) 556 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
557 EXCEPTION(0x1e00, Trap_1e, UnknownException, EXC_XFER_EE) 557 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
558 EXCEPTION(0x1f00, Trap_1f, UnknownException, EXC_XFER_EE) 558 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
559 559
560 . = 0x2000 560 . = 0x2000
561 561
diff --git a/arch/ppc/kernel/head_booke.h b/arch/ppc/kernel/head_booke.h
index 9342acf12e72..aeb349b47af3 100644
--- a/arch/ppc/kernel/head_booke.h
+++ b/arch/ppc/kernel/head_booke.h
@@ -335,7 +335,7 @@ label:
335 mfspr r4,SPRN_DEAR; /* Grab the DEAR and save it */ \ 335 mfspr r4,SPRN_DEAR; /* Grab the DEAR and save it */ \
336 stw r4,_DEAR(r11); \ 336 stw r4,_DEAR(r11); \
337 addi r3,r1,STACK_FRAME_OVERHEAD; \ 337 addi r3,r1,STACK_FRAME_OVERHEAD; \
338 EXC_XFER_EE(0x0600, AlignmentException) 338 EXC_XFER_EE(0x0600, alignment_exception)
339 339
340#define PROGRAM_EXCEPTION \ 340#define PROGRAM_EXCEPTION \
341 START_EXCEPTION(Program) \ 341 START_EXCEPTION(Program) \
@@ -343,7 +343,7 @@ label:
343 mfspr r4,SPRN_ESR; /* Grab the ESR and save it */ \ 343 mfspr r4,SPRN_ESR; /* Grab the ESR and save it */ \
344 stw r4,_ESR(r11); \ 344 stw r4,_ESR(r11); \
345 addi r3,r1,STACK_FRAME_OVERHEAD; \ 345 addi r3,r1,STACK_FRAME_OVERHEAD; \
346 EXC_XFER_STD(0x0700, ProgramCheckException) 346 EXC_XFER_STD(0x0700, program_check_exception)
347 347
348#define DECREMENTER_EXCEPTION \ 348#define DECREMENTER_EXCEPTION \
349 START_EXCEPTION(Decrementer) \ 349 START_EXCEPTION(Decrementer) \
diff --git a/arch/ppc/kernel/head_fsl_booke.S b/arch/ppc/kernel/head_fsl_booke.S
index eba5a5f8ff08..53949811efda 100644
--- a/arch/ppc/kernel/head_fsl_booke.S
+++ b/arch/ppc/kernel/head_fsl_booke.S
@@ -426,14 +426,14 @@ skpinv: addi r6,r6,1 /* Increment */
426 426
427interrupt_base: 427interrupt_base:
428 /* Critical Input Interrupt */ 428 /* Critical Input Interrupt */
429 CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) 429 CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
430 430
431 /* Machine Check Interrupt */ 431 /* Machine Check Interrupt */
432#ifdef CONFIG_E200 432#ifdef CONFIG_E200
433 /* no RFMCI, MCSRRs on E200 */ 433 /* no RFMCI, MCSRRs on E200 */
434 CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 434 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
435#else 435#else
436 MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 436 MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
437#endif 437#endif
438 438
439 /* Data Storage Interrupt */ 439 /* Data Storage Interrupt */
@@ -542,9 +542,9 @@ interrupt_base:
542#else 542#else
543#ifdef CONFIG_E200 543#ifdef CONFIG_E200
544 /* E200 treats 'normal' floating point instructions as FP Unavail exception */ 544 /* E200 treats 'normal' floating point instructions as FP Unavail exception */
545 EXCEPTION(0x0800, FloatingPointUnavailable, ProgramCheckException, EXC_XFER_EE) 545 EXCEPTION(0x0800, FloatingPointUnavailable, program_check_exception, EXC_XFER_EE)
546#else 546#else
547 EXCEPTION(0x0800, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) 547 EXCEPTION(0x0800, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
548#endif 548#endif
549#endif 549#endif
550 550
@@ -554,20 +554,20 @@ interrupt_base:
554 EXC_XFER_EE_LITE(0x0c00, DoSyscall) 554 EXC_XFER_EE_LITE(0x0c00, DoSyscall)
555 555
556 /* Auxillary Processor Unavailable Interrupt */ 556 /* Auxillary Processor Unavailable Interrupt */
557 EXCEPTION(0x2900, AuxillaryProcessorUnavailable, UnknownException, EXC_XFER_EE) 557 EXCEPTION(0x2900, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
558 558
559 /* Decrementer Interrupt */ 559 /* Decrementer Interrupt */
560 DECREMENTER_EXCEPTION 560 DECREMENTER_EXCEPTION
561 561
562 /* Fixed Internal Timer Interrupt */ 562 /* Fixed Internal Timer Interrupt */
563 /* TODO: Add FIT support */ 563 /* TODO: Add FIT support */
564 EXCEPTION(0x3100, FixedIntervalTimer, UnknownException, EXC_XFER_EE) 564 EXCEPTION(0x3100, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
565 565
566 /* Watchdog Timer Interrupt */ 566 /* Watchdog Timer Interrupt */
567#ifdef CONFIG_BOOKE_WDT 567#ifdef CONFIG_BOOKE_WDT
568 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, WatchdogException) 568 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, WatchdogException)
569#else 569#else
570 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, UnknownException) 570 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, unknown_exception)
571#endif 571#endif
572 572
573 /* Data TLB Error Interrupt */ 573 /* Data TLB Error Interrupt */
@@ -696,21 +696,21 @@ interrupt_base:
696 addi r3,r1,STACK_FRAME_OVERHEAD 696 addi r3,r1,STACK_FRAME_OVERHEAD
697 EXC_XFER_EE_LITE(0x2010, KernelSPE) 697 EXC_XFER_EE_LITE(0x2010, KernelSPE)
698#else 698#else
699 EXCEPTION(0x2020, SPEUnavailable, UnknownException, EXC_XFER_EE) 699 EXCEPTION(0x2020, SPEUnavailable, unknown_exception, EXC_XFER_EE)
700#endif /* CONFIG_SPE */ 700#endif /* CONFIG_SPE */
701 701
702 /* SPE Floating Point Data */ 702 /* SPE Floating Point Data */
703#ifdef CONFIG_SPE 703#ifdef CONFIG_SPE
704 EXCEPTION(0x2030, SPEFloatingPointData, SPEFloatingPointException, EXC_XFER_EE); 704 EXCEPTION(0x2030, SPEFloatingPointData, SPEFloatingPointException, EXC_XFER_EE);
705#else 705#else
706 EXCEPTION(0x2040, SPEFloatingPointData, UnknownException, EXC_XFER_EE) 706 EXCEPTION(0x2040, SPEFloatingPointData, unknown_exception, EXC_XFER_EE)
707#endif /* CONFIG_SPE */ 707#endif /* CONFIG_SPE */
708 708
709 /* SPE Floating Point Round */ 709 /* SPE Floating Point Round */
710 EXCEPTION(0x2050, SPEFloatingPointRound, UnknownException, EXC_XFER_EE) 710 EXCEPTION(0x2050, SPEFloatingPointRound, unknown_exception, EXC_XFER_EE)
711 711
712 /* Performance Monitor */ 712 /* Performance Monitor */
713 EXCEPTION(0x2060, PerformanceMonitor, PerformanceMonitorException, EXC_XFER_STD) 713 EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD)
714 714
715 715
716 /* Debug Interrupt */ 716 /* Debug Interrupt */
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 1545621d44d2..7872c6c45732 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -53,10 +53,10 @@
53 53
54extern void transfer_to_handler(void); 54extern void transfer_to_handler(void);
55extern void do_IRQ(struct pt_regs *regs); 55extern void do_IRQ(struct pt_regs *regs);
56extern void MachineCheckException(struct pt_regs *regs); 56extern void machine_check_exception(struct pt_regs *regs);
57extern void AlignmentException(struct pt_regs *regs); 57extern void alignment_exception(struct pt_regs *regs);
58extern void ProgramCheckException(struct pt_regs *regs); 58extern void program_check_exception(struct pt_regs *regs);
59extern void SingleStepException(struct pt_regs *regs); 59extern void single_step_exception(struct pt_regs *regs);
60extern int do_signal(sigset_t *, struct pt_regs *); 60extern int do_signal(sigset_t *, struct pt_regs *);
61extern int pmac_newworld; 61extern int pmac_newworld;
62extern int sys_sigreturn(struct pt_regs *regs); 62extern int sys_sigreturn(struct pt_regs *regs);
@@ -72,10 +72,10 @@ EXPORT_SYMBOL(clear_user_page);
72EXPORT_SYMBOL(do_signal); 72EXPORT_SYMBOL(do_signal);
73EXPORT_SYMBOL(transfer_to_handler); 73EXPORT_SYMBOL(transfer_to_handler);
74EXPORT_SYMBOL(do_IRQ); 74EXPORT_SYMBOL(do_IRQ);
75EXPORT_SYMBOL(MachineCheckException); 75EXPORT_SYMBOL(machine_check_exception);
76EXPORT_SYMBOL(AlignmentException); 76EXPORT_SYMBOL(alignment_exception);
77EXPORT_SYMBOL(ProgramCheckException); 77EXPORT_SYMBOL(program_check_exception);
78EXPORT_SYMBOL(SingleStepException); 78EXPORT_SYMBOL(single_step_exception);
79EXPORT_SYMBOL(sys_sigreturn); 79EXPORT_SYMBOL(sys_sigreturn);
80EXPORT_SYMBOL(ppc_n_lost_interrupts); 80EXPORT_SYMBOL(ppc_n_lost_interrupts);
81EXPORT_SYMBOL(ppc_lost_interrupts); 81EXPORT_SYMBOL(ppc_lost_interrupts);
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index 82e4d70e6dbb..26606aa33de6 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -74,7 +74,7 @@ void (*debugger_fault_handler)(struct pt_regs *regs);
74 74
75DEFINE_SPINLOCK(die_lock); 75DEFINE_SPINLOCK(die_lock);
76 76
77void die(const char * str, struct pt_regs * fp, long err) 77int die(const char * str, struct pt_regs * fp, long err)
78{ 78{
79 static int die_counter; 79 static int die_counter;
80 int nl = 0; 80 int nl = 0;
@@ -232,7 +232,7 @@ platform_machine_check(struct pt_regs *regs)
232{ 232{
233} 233}
234 234
235void MachineCheckException(struct pt_regs *regs) 235void machine_check_exception(struct pt_regs *regs)
236{ 236{
237 unsigned long reason = get_mc_reason(regs); 237 unsigned long reason = get_mc_reason(regs);
238 238
@@ -393,14 +393,14 @@ void SMIException(struct pt_regs *regs)
393#endif 393#endif
394} 394}
395 395
396void UnknownException(struct pt_regs *regs) 396void unknown_exception(struct pt_regs *regs)
397{ 397{
398 printk("Bad trap at PC: %lx, MSR: %lx, vector=%lx %s\n", 398 printk("Bad trap at PC: %lx, MSR: %lx, vector=%lx %s\n",
399 regs->nip, regs->msr, regs->trap, print_tainted()); 399 regs->nip, regs->msr, regs->trap, print_tainted());
400 _exception(SIGTRAP, regs, 0, 0); 400 _exception(SIGTRAP, regs, 0, 0);
401} 401}
402 402
403void InstructionBreakpoint(struct pt_regs *regs) 403void instruction_breakpoint_exception(struct pt_regs *regs)
404{ 404{
405 if (debugger_iabr_match(regs)) 405 if (debugger_iabr_match(regs))
406 return; 406 return;
@@ -622,7 +622,7 @@ int check_bug_trap(struct pt_regs *regs)
622 return 0; 622 return 0;
623} 623}
624 624
625void ProgramCheckException(struct pt_regs *regs) 625void program_check_exception(struct pt_regs *regs)
626{ 626{
627 unsigned int reason = get_reason(regs); 627 unsigned int reason = get_reason(regs);
628 extern int do_mathemu(struct pt_regs *regs); 628 extern int do_mathemu(struct pt_regs *regs);
@@ -701,7 +701,7 @@ void ProgramCheckException(struct pt_regs *regs)
701 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); 701 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
702} 702}
703 703
704void SingleStepException(struct pt_regs *regs) 704void single_step_exception(struct pt_regs *regs)
705{ 705{
706 regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */ 706 regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */
707 if (debugger_sstep(regs)) 707 if (debugger_sstep(regs))
@@ -709,7 +709,7 @@ void SingleStepException(struct pt_regs *regs)
709 _exception(SIGTRAP, regs, TRAP_TRACE, 0); 709 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
710} 710}
711 711
712void AlignmentException(struct pt_regs *regs) 712void alignment_exception(struct pt_regs *regs)
713{ 713{
714 int fixed; 714 int fixed;
715 715
@@ -814,7 +814,7 @@ void TAUException(struct pt_regs *regs)
814} 814}
815#endif /* CONFIG_INT_TAU */ 815#endif /* CONFIG_INT_TAU */
816 816
817void AltivecUnavailException(struct pt_regs *regs) 817void altivec_unavailable_exception(struct pt_regs *regs)
818{ 818{
819 static int kernel_altivec_count; 819 static int kernel_altivec_count;
820 820
@@ -835,7 +835,7 @@ void AltivecUnavailException(struct pt_regs *regs)
835} 835}
836 836
837#ifdef CONFIG_ALTIVEC 837#ifdef CONFIG_ALTIVEC
838void AltivecAssistException(struct pt_regs *regs) 838void altivec_assist_exception(struct pt_regs *regs)
839{ 839{
840 int err; 840 int err;
841 841
@@ -872,7 +872,7 @@ void AltivecAssistException(struct pt_regs *regs)
872#endif /* CONFIG_ALTIVEC */ 872#endif /* CONFIG_ALTIVEC */
873 873
874#ifdef CONFIG_E500 874#ifdef CONFIG_E500
875void PerformanceMonitorException(struct pt_regs *regs) 875void performance_monitor_exception(struct pt_regs *regs)
876{ 876{
877 perf_irq(regs); 877 perf_irq(regs);
878} 878}
diff --git a/arch/ppc/kernel/vector.S b/arch/ppc/kernel/vector.S
deleted file mode 100644
index 82a21346bf80..000000000000
--- a/arch/ppc/kernel/vector.S
+++ /dev/null
@@ -1,217 +0,0 @@
1#include <asm/ppc_asm.h>
2#include <asm/processor.h>
3
4/*
5 * The routines below are in assembler so we can closely control the
6 * usage of floating-point registers. These routines must be called
7 * with preempt disabled.
8 */
9 .data
10fpzero:
11 .long 0
12fpone:
13 .long 0x3f800000 /* 1.0 in single-precision FP */
14fphalf:
15 .long 0x3f000000 /* 0.5 in single-precision FP */
16
17 .text
18/*
19 * Internal routine to enable floating point and set FPSCR to 0.
20 * Don't call it from C; it doesn't use the normal calling convention.
21 */
22fpenable:
23 mfmsr r10
24 ori r11,r10,MSR_FP
25 mtmsr r11
26 isync
27 stfd fr0,24(r1)
28 stfd fr1,16(r1)
29 stfd fr31,8(r1)
30 lis r11,fpzero@ha
31 mffs fr31
32 lfs fr1,fpzero@l(r11)
33 mtfsf 0xff,fr1
34 blr
35
36fpdisable:
37 mtfsf 0xff,fr31
38 lfd fr31,8(r1)
39 lfd fr1,16(r1)
40 lfd fr0,24(r1)
41 mtmsr r10
42 isync
43 blr
44
45/*
46 * Vector add, floating point.
47 */
48 .globl vaddfp
49vaddfp:
50 stwu r1,-32(r1)
51 mflr r0
52 stw r0,36(r1)
53 bl fpenable
54 li r0,4
55 mtctr r0
56 li r6,0
571: lfsx fr0,r4,r6
58 lfsx fr1,r5,r6
59 fadds fr0,fr0,fr1
60 stfsx fr0,r3,r6
61 addi r6,r6,4
62 bdnz 1b
63 bl fpdisable
64 lwz r0,36(r1)
65 mtlr r0
66 addi r1,r1,32
67 blr
68
69/*
70 * Vector subtract, floating point.
71 */
72 .globl vsubfp
73vsubfp:
74 stwu r1,-32(r1)
75 mflr r0
76 stw r0,36(r1)
77 bl fpenable
78 li r0,4
79 mtctr r0
80 li r6,0
811: lfsx fr0,r4,r6
82 lfsx fr1,r5,r6
83 fsubs fr0,fr0,fr1
84 stfsx fr0,r3,r6
85 addi r6,r6,4
86 bdnz 1b
87 bl fpdisable
88 lwz r0,36(r1)
89 mtlr r0
90 addi r1,r1,32
91 blr
92
93/*
94 * Vector multiply and add, floating point.
95 */
96 .globl vmaddfp
97vmaddfp:
98 stwu r1,-48(r1)
99 mflr r0
100 stw r0,52(r1)
101 bl fpenable
102 stfd fr2,32(r1)
103 li r0,4
104 mtctr r0
105 li r7,0
1061: lfsx fr0,r4,r7
107 lfsx fr1,r5,r7
108 lfsx fr2,r6,r7
109 fmadds fr0,fr0,fr2,fr1
110 stfsx fr0,r3,r7
111 addi r7,r7,4
112 bdnz 1b
113 lfd fr2,32(r1)
114 bl fpdisable
115 lwz r0,52(r1)
116 mtlr r0
117 addi r1,r1,48
118 blr
119
120/*
121 * Vector negative multiply and subtract, floating point.
122 */
123 .globl vnmsubfp
124vnmsubfp:
125 stwu r1,-48(r1)
126 mflr r0
127 stw r0,52(r1)
128 bl fpenable
129 stfd fr2,32(r1)
130 li r0,4
131 mtctr r0
132 li r7,0
1331: lfsx fr0,r4,r7
134 lfsx fr1,r5,r7
135 lfsx fr2,r6,r7
136 fnmsubs fr0,fr0,fr2,fr1
137 stfsx fr0,r3,r7
138 addi r7,r7,4
139 bdnz 1b
140 lfd fr2,32(r1)
141 bl fpdisable
142 lwz r0,52(r1)
143 mtlr r0
144 addi r1,r1,48
145 blr
146
147/*
148 * Vector reciprocal estimate. We just compute 1.0/x.
149 * r3 -> destination, r4 -> source.
150 */
151 .globl vrefp
152vrefp:
153 stwu r1,-32(r1)
154 mflr r0
155 stw r0,36(r1)
156 bl fpenable
157 lis r9,fpone@ha
158 li r0,4
159 lfs fr1,fpone@l(r9)
160 mtctr r0
161 li r6,0
1621: lfsx fr0,r4,r6
163 fdivs fr0,fr1,fr0
164 stfsx fr0,r3,r6
165 addi r6,r6,4
166 bdnz 1b
167 bl fpdisable
168 lwz r0,36(r1)
169 mtlr r0
170 addi r1,r1,32
171 blr
172
173/*
174 * Vector reciprocal square-root estimate, floating point.
175 * We use the frsqrte instruction for the initial estimate followed
176 * by 2 iterations of Newton-Raphson to get sufficient accuracy.
177 * r3 -> destination, r4 -> source.
178 */
179 .globl vrsqrtefp
180vrsqrtefp:
181 stwu r1,-48(r1)
182 mflr r0
183 stw r0,52(r1)
184 bl fpenable
185 stfd fr2,32(r1)
186 stfd fr3,40(r1)
187 stfd fr4,48(r1)
188 stfd fr5,56(r1)
189 lis r9,fpone@ha
190 lis r8,fphalf@ha
191 li r0,4
192 lfs fr4,fpone@l(r9)
193 lfs fr5,fphalf@l(r8)
194 mtctr r0
195 li r6,0
1961: lfsx fr0,r4,r6
197 frsqrte fr1,fr0 /* r = frsqrte(s) */
198 fmuls fr3,fr1,fr0 /* r * s */
199 fmuls fr2,fr1,fr5 /* r * 0.5 */
200 fnmsubs fr3,fr1,fr3,fr4 /* 1 - s * r * r */
201 fmadds fr1,fr2,fr3,fr1 /* r = r + 0.5 * r * (1 - s * r * r) */
202 fmuls fr3,fr1,fr0 /* r * s */
203 fmuls fr2,fr1,fr5 /* r * 0.5 */
204 fnmsubs fr3,fr1,fr3,fr4 /* 1 - s * r * r */
205 fmadds fr1,fr2,fr3,fr1 /* r = r + 0.5 * r * (1 - s * r * r) */
206 stfsx fr1,r3,r6
207 addi r6,r6,4
208 bdnz 1b
209 lfd fr5,56(r1)
210 lfd fr4,48(r1)
211 lfd fr3,40(r1)
212 lfd fr2,32(r1)
213 bl fpdisable
214 lwz r0,36(r1)
215 mtlr r0
216 addi r1,r1,32
217 blr
diff --git a/arch/ppc/syslib/ibm44x_common.c b/arch/ppc/syslib/ibm44x_common.c
index 7612e0623f99..95e11f93c15d 100644
--- a/arch/ppc/syslib/ibm44x_common.c
+++ b/arch/ppc/syslib/ibm44x_common.c
@@ -178,7 +178,7 @@ void __init ibm44x_platform_init(void)
178#endif 178#endif
179} 179}
180 180
181/* Called from MachineCheckException */ 181/* Called from machine_check_exception */
182void platform_machine_check(struct pt_regs *regs) 182void platform_machine_check(struct pt_regs *regs)
183{ 183{
184 printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x\n", 184 printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x\n",
diff --git a/arch/ppc/syslib/ppc4xx_setup.c b/arch/ppc/syslib/ppc4xx_setup.c
index b843c4fef25e..def724b6e1c9 100644
--- a/arch/ppc/syslib/ppc4xx_setup.c
+++ b/arch/ppc/syslib/ppc4xx_setup.c
@@ -279,7 +279,7 @@ ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5,
279#endif /* defined(CONFIG_PCI) && defined(CONFIG_IDE) */ 279#endif /* defined(CONFIG_PCI) && defined(CONFIG_IDE) */
280} 280}
281 281
282/* Called from MachineCheckException */ 282/* Called from machine_check_exception */
283void platform_machine_check(struct pt_regs *regs) 283void platform_machine_check(struct pt_regs *regs)
284{ 284{
285#if defined(DCRN_PLB0_BEAR) 285#if defined(DCRN_PLB0_BEAR)
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
index d4eb55f82f03..fa889204d6ae 100644
--- a/arch/ppc64/Makefile
+++ b/arch/ppc64/Makefile
@@ -82,7 +82,7 @@ CFLAGS += $(call cc-option,-funit-at-a-time)
82head-y := arch/ppc64/kernel/head.o 82head-y := arch/ppc64/kernel/head.o
83 83
84libs-y += arch/ppc64/lib/ 84libs-y += arch/ppc64/lib/
85core-y += arch/ppc64/kernel/ 85core-y += arch/ppc64/kernel/ arch/powerpc/kernel/
86core-y += arch/ppc64/mm/ 86core-y += arch/ppc64/mm/
87core-y += arch/powerpc/platforms/ 87core-y += arch/powerpc/platforms/
88core-$(CONFIG_XMON) += arch/ppc64/xmon/ 88core-$(CONFIG_XMON) += arch/ppc64/xmon/
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile
index bb5946b88b8b..2fdcc4b63d40 100644
--- a/arch/ppc64/kernel/Makefile
+++ b/arch/ppc64/kernel/Makefile
@@ -3,14 +3,16 @@
3# 3#
4 4
5EXTRA_CFLAGS += -mno-minimal-toc 5EXTRA_CFLAGS += -mno-minimal-toc
6ifneq ($(CONFIG_PPC_MERGE),y)
6extra-y := head.o vmlinux.lds 7extra-y := head.o vmlinux.lds
8endif
7 9
8obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \ 10obj-y := setup.o entry.o irq.o idle.o dma.o \
9 time.o process.o signal.o syscalls.o misc.o ptrace.o \ 11 time.o process.o signal.o syscalls.o misc.o ptrace.o \
10 align.o semaphore.o bitops.o pacaData.o \ 12 align.o semaphore.o bitops.o pacaData.o \
11 udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \ 13 udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \
12 ptrace32.o signal32.o rtc.o init_task.o \ 14 ptrace32.o signal32.o rtc.o init_task.o \
13 lmb.o cputable.o cpu_setup_power4.o idle_power4.o \ 15 lmb.o cputable.o cpu_setup_power4.o \
14 iommu.o sysfs.o vdso.o pmc.o firmware.o prom.o 16 iommu.o sysfs.o vdso.o pmc.o firmware.o prom.o
15obj-y += vdso32/ vdso64/ 17obj-y += vdso32/ vdso64/
16 18
@@ -64,15 +66,13 @@ obj-$(CONFIG_PPC_BPA) += pSeries_smp.o
64obj-$(CONFIG_PPC_MAPLE) += smp-tbsync.o 66obj-$(CONFIG_PPC_MAPLE) += smp-tbsync.o
65endif 67endif
66 68
67obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
68obj-$(CONFIG_KPROBES) += kprobes.o 69obj-$(CONFIG_KPROBES) += kprobes.o
69 70
70CFLAGS_ioctl32.o += -Ifs/ 71CFLAGS_ioctl32.o += -Ifs/
71 72
73ifneq ($(CONFIG_PPC_MERGE),y)
72ifeq ($(CONFIG_PPC_ISERIES),y) 74ifeq ($(CONFIG_PPC_ISERIES),y)
73arch/ppc64/kernel/head.o: arch/ppc64/kernel/lparmap.s 75arch/ppc64/kernel/head.o: arch/powerpc/platforms/iseries/lparmap.s
74AFLAGS_head.o += -Iarch/ppc64/kernel 76AFLAGS_head.o += -Iarch/powerpc/platforms/iseries
77endif
75endif 78endif
76
77# These are here while we do the architecture merge
78vecemu-y += ../../powerpc/kernel/vecemu.o
diff --git a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c
deleted file mode 100644
index a728c9f0b53f..000000000000
--- a/arch/ppc64/kernel/traps.c
+++ /dev/null
@@ -1,568 +0,0 @@
1/*
2 * linux/arch/ppc64/kernel/traps.c
3 *
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 * Modified by Cort Dougan (cort@cs.nmt.edu)
12 * and Paul Mackerras (paulus@cs.anu.edu.au)
13 */
14
15/*
16 * This file handles the architecture-dependent parts of hardware exceptions
17 */
18
19#include <linux/config.h>
20#include <linux/errno.h>
21#include <linux/sched.h>
22#include <linux/kernel.h>
23#include <linux/mm.h>
24#include <linux/stddef.h>
25#include <linux/unistd.h>
26#include <linux/slab.h>
27#include <linux/user.h>
28#include <linux/a.out.h>
29#include <linux/interrupt.h>
30#include <linux/init.h>
31#include <linux/module.h>
32#include <linux/delay.h>
33#include <linux/kprobes.h>
34#include <asm/kdebug.h>
35
36#include <asm/pgtable.h>
37#include <asm/uaccess.h>
38#include <asm/system.h>
39#include <asm/io.h>
40#include <asm/processor.h>
41#include <asm/ppcdebug.h>
42#include <asm/rtas.h>
43#include <asm/systemcfg.h>
44#include <asm/machdep.h>
45#include <asm/pmc.h>
46
47#ifdef CONFIG_DEBUGGER
48int (*__debugger)(struct pt_regs *regs);
49int (*__debugger_ipi)(struct pt_regs *regs);
50int (*__debugger_bpt)(struct pt_regs *regs);
51int (*__debugger_sstep)(struct pt_regs *regs);
52int (*__debugger_iabr_match)(struct pt_regs *regs);
53int (*__debugger_dabr_match)(struct pt_regs *regs);
54int (*__debugger_fault_handler)(struct pt_regs *regs);
55
56EXPORT_SYMBOL(__debugger);
57EXPORT_SYMBOL(__debugger_ipi);
58EXPORT_SYMBOL(__debugger_bpt);
59EXPORT_SYMBOL(__debugger_sstep);
60EXPORT_SYMBOL(__debugger_iabr_match);
61EXPORT_SYMBOL(__debugger_dabr_match);
62EXPORT_SYMBOL(__debugger_fault_handler);
63#endif
64
65struct notifier_block *powerpc_die_chain;
66static DEFINE_SPINLOCK(die_notifier_lock);
67
68int register_die_notifier(struct notifier_block *nb)
69{
70 int err = 0;
71 unsigned long flags;
72
73 spin_lock_irqsave(&die_notifier_lock, flags);
74 err = notifier_chain_register(&powerpc_die_chain, nb);
75 spin_unlock_irqrestore(&die_notifier_lock, flags);
76 return err;
77}
78
79/*
80 * Trap & Exception support
81 */
82
83static DEFINE_SPINLOCK(die_lock);
84
85int die(const char *str, struct pt_regs *regs, long err)
86{
87 static int die_counter;
88 int nl = 0;
89
90 if (debugger(regs))
91 return 1;
92
93 console_verbose();
94 spin_lock_irq(&die_lock);
95 bust_spinlocks(1);
96 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
97#ifdef CONFIG_PREEMPT
98 printk("PREEMPT ");
99 nl = 1;
100#endif
101#ifdef CONFIG_SMP
102 printk("SMP NR_CPUS=%d ", NR_CPUS);
103 nl = 1;
104#endif
105#ifdef CONFIG_DEBUG_PAGEALLOC
106 printk("DEBUG_PAGEALLOC ");
107 nl = 1;
108#endif
109#ifdef CONFIG_NUMA
110 printk("NUMA ");
111 nl = 1;
112#endif
113 switch(systemcfg->platform) {
114 case PLATFORM_PSERIES:
115 printk("PSERIES ");
116 nl = 1;
117 break;
118 case PLATFORM_PSERIES_LPAR:
119 printk("PSERIES LPAR ");
120 nl = 1;
121 break;
122 case PLATFORM_ISERIES_LPAR:
123 printk("ISERIES LPAR ");
124 nl = 1;
125 break;
126 case PLATFORM_POWERMAC:
127 printk("POWERMAC ");
128 nl = 1;
129 break;
130 case PLATFORM_BPA:
131 printk("BPA ");
132 nl = 1;
133 break;
134 }
135 if (nl)
136 printk("\n");
137 print_modules();
138 show_regs(regs);
139 bust_spinlocks(0);
140 spin_unlock_irq(&die_lock);
141
142 if (in_interrupt())
143 panic("Fatal exception in interrupt");
144
145 if (panic_on_oops) {
146 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
147 ssleep(5);
148 panic("Fatal exception");
149 }
150 do_exit(SIGSEGV);
151
152 return 0;
153}
154
155void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
156{
157 siginfo_t info;
158
159 if (!user_mode(regs)) {
160 if (die("Exception in kernel mode", regs, signr))
161 return;
162 }
163
164 memset(&info, 0, sizeof(info));
165 info.si_signo = signr;
166 info.si_code = code;
167 info.si_addr = (void __user *) addr;
168 force_sig_info(signr, &info, current);
169}
170
171void system_reset_exception(struct pt_regs *regs)
172{
173 /* See if any machine dependent calls */
174 if (ppc_md.system_reset_exception)
175 ppc_md.system_reset_exception(regs);
176
177 die("System Reset", regs, 0);
178
179 /* Must die if the interrupt is not recoverable */
180 if (!(regs->msr & MSR_RI))
181 panic("Unrecoverable System Reset");
182
183 /* What should we do here? We could issue a shutdown or hard reset. */
184}
185
186void machine_check_exception(struct pt_regs *regs)
187{
188 int recover = 0;
189
190 /* See if any machine dependent calls */
191 if (ppc_md.machine_check_exception)
192 recover = ppc_md.machine_check_exception(regs);
193
194 if (recover)
195 return;
196
197 if (debugger_fault_handler(regs))
198 return;
199 die("Machine check", regs, 0);
200
201 /* Must die if the interrupt is not recoverable */
202 if (!(regs->msr & MSR_RI))
203 panic("Unrecoverable Machine check");
204}
205
206void unknown_exception(struct pt_regs *regs)
207{
208 printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n",
209 regs->nip, regs->msr, regs->trap);
210
211 _exception(SIGTRAP, regs, 0, 0);
212}
213
214void instruction_breakpoint_exception(struct pt_regs *regs)
215{
216 if (notify_die(DIE_IABR_MATCH, "iabr_match", regs, 5,
217 5, SIGTRAP) == NOTIFY_STOP)
218 return;
219 if (debugger_iabr_match(regs))
220 return;
221 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
222}
223
224void __kprobes single_step_exception(struct pt_regs *regs)
225{
226 regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */
227
228 if (notify_die(DIE_SSTEP, "single_step", regs, 5,
229 5, SIGTRAP) == NOTIFY_STOP)
230 return;
231 if (debugger_sstep(regs))
232 return;
233
234 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
235}
236
237/*
238 * After we have successfully emulated an instruction, we have to
239 * check if the instruction was being single-stepped, and if so,
240 * pretend we got a single-step exception. This was pointed out
241 * by Kumar Gala. -- paulus
242 */
243static inline void emulate_single_step(struct pt_regs *regs)
244{
245 if (regs->msr & MSR_SE)
246 single_step_exception(regs);
247}
248
249static void parse_fpe(struct pt_regs *regs)
250{
251 int code = 0;
252 unsigned long fpscr;
253
254 flush_fp_to_thread(current);
255
256 fpscr = current->thread.fpscr;
257
258 /* Invalid operation */
259 if ((fpscr & FPSCR_VE) && (fpscr & FPSCR_VX))
260 code = FPE_FLTINV;
261
262 /* Overflow */
263 else if ((fpscr & FPSCR_OE) && (fpscr & FPSCR_OX))
264 code = FPE_FLTOVF;
265
266 /* Underflow */
267 else if ((fpscr & FPSCR_UE) && (fpscr & FPSCR_UX))
268 code = FPE_FLTUND;
269
270 /* Divide by zero */
271 else if ((fpscr & FPSCR_ZE) && (fpscr & FPSCR_ZX))
272 code = FPE_FLTDIV;
273
274 /* Inexact result */
275 else if ((fpscr & FPSCR_XE) && (fpscr & FPSCR_XX))
276 code = FPE_FLTRES;
277
278 _exception(SIGFPE, regs, code, regs->nip);
279}
280
281/*
282 * Illegal instruction emulation support. Return non-zero if we can't
283 * emulate, or -EFAULT if the associated memory access caused an access
284 * fault. Return zero on success.
285 */
286
287#define INST_MFSPR_PVR 0x7c1f42a6
288#define INST_MFSPR_PVR_MASK 0xfc1fffff
289
290#define INST_DCBA 0x7c0005ec
291#define INST_DCBA_MASK 0x7c0007fe
292
293#define INST_MCRXR 0x7c000400
294#define INST_MCRXR_MASK 0x7c0007fe
295
296static int emulate_instruction(struct pt_regs *regs)
297{
298 unsigned int instword;
299
300 if (!user_mode(regs))
301 return -EINVAL;
302
303 CHECK_FULL_REGS(regs);
304
305 if (get_user(instword, (unsigned int __user *)(regs->nip)))
306 return -EFAULT;
307
308 /* Emulate the mfspr rD, PVR. */
309 if ((instword & INST_MFSPR_PVR_MASK) == INST_MFSPR_PVR) {
310 unsigned int rd;
311
312 rd = (instword >> 21) & 0x1f;
313 regs->gpr[rd] = mfspr(SPRN_PVR);
314 return 0;
315 }
316
317 /* Emulating the dcba insn is just a no-op. */
318 if ((instword & INST_DCBA_MASK) == INST_DCBA) {
319 static int warned;
320
321 if (!warned) {
322 printk(KERN_WARNING
323 "process %d (%s) uses obsolete 'dcba' insn\n",
324 current->pid, current->comm);
325 warned = 1;
326 }
327 return 0;
328 }
329
330 /* Emulate the mcrxr insn. */
331 if ((instword & INST_MCRXR_MASK) == INST_MCRXR) {
332 static int warned;
333 unsigned int shift;
334
335 if (!warned) {
336 printk(KERN_WARNING
337 "process %d (%s) uses obsolete 'mcrxr' insn\n",
338 current->pid, current->comm);
339 warned = 1;
340 }
341
342 shift = (instword >> 21) & 0x1c;
343 regs->ccr &= ~(0xf0000000 >> shift);
344 regs->ccr |= (regs->xer & 0xf0000000) >> shift;
345 regs->xer &= ~0xf0000000;
346 return 0;
347 }
348
349 return -EINVAL;
350}
351
352/*
353 * Look through the list of trap instructions that are used for BUG(),
354 * BUG_ON() and WARN_ON() and see if we hit one. At this point we know
355 * that the exception was caused by a trap instruction of some kind.
356 * Returns 1 if we should continue (i.e. it was a WARN_ON) or 0
357 * otherwise.
358 */
359extern struct bug_entry __start___bug_table[], __stop___bug_table[];
360
361#ifndef CONFIG_MODULES
362#define module_find_bug(x) NULL
363#endif
364
365struct bug_entry *find_bug(unsigned long bugaddr)
366{
367 struct bug_entry *bug;
368
369 for (bug = __start___bug_table; bug < __stop___bug_table; ++bug)
370 if (bugaddr == bug->bug_addr)
371 return bug;
372 return module_find_bug(bugaddr);
373}
374
375static int
376check_bug_trap(struct pt_regs *regs)
377{
378 struct bug_entry *bug;
379 unsigned long addr;
380
381 if (regs->msr & MSR_PR)
382 return 0; /* not in kernel */
383 addr = regs->nip; /* address of trap instruction */
384 if (addr < PAGE_OFFSET)
385 return 0;
386 bug = find_bug(regs->nip);
387 if (bug == NULL)
388 return 0;
389 if (bug->line & BUG_WARNING_TRAP) {
390 /* this is a WARN_ON rather than BUG/BUG_ON */
391 printk(KERN_ERR "Badness in %s at %s:%d\n",
392 bug->function, bug->file,
393 bug->line & ~BUG_WARNING_TRAP);
394 show_stack(current, (void *)regs->gpr[1]);
395 return 1;
396 }
397 printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
398 bug->function, bug->file, bug->line);
399 return 0;
400}
401
402void __kprobes program_check_exception(struct pt_regs *regs)
403{
404 if (debugger_fault_handler(regs))
405 return;
406
407 if (regs->msr & 0x100000) {
408 /* IEEE FP exception */
409 parse_fpe(regs);
410 } else if (regs->msr & 0x20000) {
411 /* trap exception */
412
413 if (notify_die(DIE_BPT, "breakpoint", regs, 5,
414 5, SIGTRAP) == NOTIFY_STOP)
415 return;
416 if (debugger_bpt(regs))
417 return;
418
419 if (check_bug_trap(regs)) {
420 regs->nip += 4;
421 return;
422 }
423 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
424
425 } else {
426 /* Privileged or illegal instruction; try to emulate it. */
427 switch (emulate_instruction(regs)) {
428 case 0:
429 regs->nip += 4;
430 emulate_single_step(regs);
431 break;
432
433 case -EFAULT:
434 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
435 break;
436
437 default:
438 if (regs->msr & 0x40000)
439 /* priveleged */
440 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
441 else
442 /* illegal */
443 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
444 break;
445 }
446 }
447}
448
449void kernel_fp_unavailable_exception(struct pt_regs *regs)
450{
451 printk(KERN_EMERG "Unrecoverable FP Unavailable Exception "
452 "%lx at %lx\n", regs->trap, regs->nip);
453 die("Unrecoverable FP Unavailable Exception", regs, SIGABRT);
454}
455
456void altivec_unavailable_exception(struct pt_regs *regs)
457{
458 if (user_mode(regs)) {
459 /* A user program has executed an altivec instruction,
460 but this kernel doesn't support altivec. */
461 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
462 return;
463 }
464 printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
465 "%lx at %lx\n", regs->trap, regs->nip);
466 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
467}
468
469extern perf_irq_t perf_irq;
470
471void performance_monitor_exception(struct pt_regs *regs)
472{
473 perf_irq(regs);
474}
475
476void alignment_exception(struct pt_regs *regs)
477{
478 int fixed;
479
480 fixed = fix_alignment(regs);
481
482 if (fixed == 1) {
483 regs->nip += 4; /* skip over emulated instruction */
484 emulate_single_step(regs);
485 return;
486 }
487
488 /* Operand address was bad */
489 if (fixed == -EFAULT) {
490 if (user_mode(regs)) {
491 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->dar);
492 } else {
493 /* Search exception table */
494 bad_page_fault(regs, regs->dar, SIGSEGV);
495 }
496
497 return;
498 }
499
500 _exception(SIGBUS, regs, BUS_ADRALN, regs->nip);
501}
502
503#ifdef CONFIG_ALTIVEC
504void altivec_assist_exception(struct pt_regs *regs)
505{
506 int err;
507 siginfo_t info;
508
509 if (!user_mode(regs)) {
510 printk(KERN_EMERG "VMX/Altivec assist exception in kernel mode"
511 " at %lx\n", regs->nip);
512 die("Kernel VMX/Altivec assist exception", regs, SIGILL);
513 }
514
515 flush_altivec_to_thread(current);
516
517 err = emulate_altivec(regs);
518 if (err == 0) {
519 regs->nip += 4; /* skip emulated instruction */
520 emulate_single_step(regs);
521 return;
522 }
523
524 if (err == -EFAULT) {
525 /* got an error reading the instruction */
526 info.si_signo = SIGSEGV;
527 info.si_errno = 0;
528 info.si_code = SEGV_MAPERR;
529 info.si_addr = (void __user *) regs->nip;
530 force_sig_info(SIGSEGV, &info, current);
531 } else {
532 /* didn't recognize the instruction */
533 /* XXX quick hack for now: set the non-Java bit in the VSCR */
534 if (printk_ratelimit())
535 printk(KERN_ERR "Unrecognized altivec instruction "
536 "in %s at %lx\n", current->comm, regs->nip);
537 current->thread.vscr.u[3] |= 0x10000;
538 }
539}
540#endif /* CONFIG_ALTIVEC */
541
542/*
543 * We enter here if we get an unrecoverable exception, that is, one
544 * that happened at a point where the RI (recoverable interrupt) bit
545 * in the MSR is 0. This indicates that SRR0/1 are live, and that
546 * we therefore lost state by taking this exception.
547 */
548void unrecoverable_exception(struct pt_regs *regs)
549{
550 printk(KERN_EMERG "Unrecoverable exception %lx at %lx\n",
551 regs->trap, regs->nip);
552 die("Unrecoverable exception", regs, SIGABRT);
553}
554
555/*
556 * We enter here if we discover during exception entry that we are
557 * running in supervisor mode with a userspace value in the stack pointer.
558 */
559void kernel_bad_stack(struct pt_regs *regs)
560{
561 printk(KERN_EMERG "Bad kernel stack pointer %lx at %lx\n",
562 regs->gpr[1], regs->nip);
563 die("Bad kernel stack pointer", regs, SIGABRT);
564}
565
566void __init trap_init(void)
567{
568}
diff --git a/arch/ppc64/kernel/vector.S b/arch/ppc64/kernel/vector.S
deleted file mode 100644
index b79d33e4001e..000000000000
--- a/arch/ppc64/kernel/vector.S
+++ /dev/null
@@ -1,172 +0,0 @@
1#include <asm/ppc_asm.h>
2#include <asm/processor.h>
3
4/*
5 * The routines below are in assembler so we can closely control the
6 * usage of floating-point registers. These routines must be called
7 * with preempt disabled.
8 */
9 .section ".toc","aw"
10fpzero:
11 .tc FD_0_0[TC],0
12fpone:
13 .tc FD_3ff00000_0[TC],0x3ff0000000000000 /* 1.0 */
14fphalf:
15 .tc FD_3fe00000_0[TC],0x3fe0000000000000 /* 0.5 */
16
17 .text
18/*
19 * Internal routine to enable floating point and set FPSCR to 0.
20 * Don't call it from C; it doesn't use the normal calling convention.
21 */
22fpenable:
23 mfmsr r10
24 ori r11,r10,MSR_FP
25 mtmsr r11
26 isync
27 stfd fr31,-8(r1)
28 stfd fr0,-16(r1)
29 stfd fr1,-24(r1)
30 mffs fr31
31 lfd fr1,fpzero@toc(r2)
32 mtfsf 0xff,fr1
33 blr
34
35fpdisable:
36 mtlr r12
37 mtfsf 0xff,fr31
38 lfd fr1,-24(r1)
39 lfd fr0,-16(r1)
40 lfd fr31,-8(r1)
41 mtmsr r10
42 isync
43 blr
44
45/*
46 * Vector add, floating point.
47 */
48_GLOBAL(vaddfp)
49 mflr r12
50 bl fpenable
51 li r0,4
52 mtctr r0
53 li r6,0
541: lfsx fr0,r4,r6
55 lfsx fr1,r5,r6
56 fadds fr0,fr0,fr1
57 stfsx fr0,r3,r6
58 addi r6,r6,4
59 bdnz 1b
60 b fpdisable
61
62/*
63 * Vector subtract, floating point.
64 */
65_GLOBAL(vsubfp)
66 mflr r12
67 bl fpenable
68 li r0,4
69 mtctr r0
70 li r6,0
711: lfsx fr0,r4,r6
72 lfsx fr1,r5,r6
73 fsubs fr0,fr0,fr1
74 stfsx fr0,r3,r6
75 addi r6,r6,4
76 bdnz 1b
77 b fpdisable
78
79/*
80 * Vector multiply and add, floating point.
81 */
82_GLOBAL(vmaddfp)
83 mflr r12
84 bl fpenable
85 stfd fr2,-32(r1)
86 li r0,4
87 mtctr r0
88 li r7,0
891: lfsx fr0,r4,r7
90 lfsx fr1,r5,r7
91 lfsx fr2,r6,r7
92 fmadds fr0,fr0,fr2,fr1
93 stfsx fr0,r3,r7
94 addi r7,r7,4
95 bdnz 1b
96 lfd fr2,-32(r1)
97 b fpdisable
98
99/*
100 * Vector negative multiply and subtract, floating point.
101 */
102_GLOBAL(vnmsubfp)
103 mflr r12
104 bl fpenable
105 stfd fr2,-32(r1)
106 li r0,4
107 mtctr r0
108 li r7,0
1091: lfsx fr0,r4,r7
110 lfsx fr1,r5,r7
111 lfsx fr2,r6,r7
112 fnmsubs fr0,fr0,fr2,fr1
113 stfsx fr0,r3,r7
114 addi r7,r7,4
115 bdnz 1b
116 lfd fr2,-32(r1)
117 b fpdisable
118
119/*
120 * Vector reciprocal estimate. We just compute 1.0/x.
121 * r3 -> destination, r4 -> source.
122 */
123_GLOBAL(vrefp)
124 mflr r12
125 bl fpenable
126 li r0,4
127 lfd fr1,fpone@toc(r2)
128 mtctr r0
129 li r6,0
1301: lfsx fr0,r4,r6
131 fdivs fr0,fr1,fr0
132 stfsx fr0,r3,r6
133 addi r6,r6,4
134 bdnz 1b
135 b fpdisable
136
137/*
138 * Vector reciprocal square-root estimate, floating point.
139 * We use the frsqrte instruction for the initial estimate followed
140 * by 2 iterations of Newton-Raphson to get sufficient accuracy.
141 * r3 -> destination, r4 -> source.
142 */
143_GLOBAL(vrsqrtefp)
144 mflr r12
145 bl fpenable
146 stfd fr2,-32(r1)
147 stfd fr3,-40(r1)
148 stfd fr4,-48(r1)
149 stfd fr5,-56(r1)
150 li r0,4
151 lfd fr4,fpone@toc(r2)
152 lfd fr5,fphalf@toc(r2)
153 mtctr r0
154 li r6,0
1551: lfsx fr0,r4,r6
156 frsqrte fr1,fr0 /* r = frsqrte(s) */
157 fmuls fr3,fr1,fr0 /* r * s */
158 fmuls fr2,fr1,fr5 /* r * 0.5 */
159 fnmsubs fr3,fr1,fr3,fr4 /* 1 - s * r * r */
160 fmadds fr1,fr2,fr3,fr1 /* r = r + 0.5 * r * (1 - s * r * r) */
161 fmuls fr3,fr1,fr0 /* r * s */
162 fmuls fr2,fr1,fr5 /* r * 0.5 */
163 fnmsubs fr3,fr1,fr3,fr4 /* 1 - s * r * r */
164 fmadds fr1,fr2,fr3,fr1 /* r = r + 0.5 * r * (1 - s * r * r) */
165 stfsx fr1,r3,r6
166 addi r6,r6,4
167 bdnz 1b
168 lfd fr5,-56(r1)
169 lfd fr4,-48(r1)
170 lfd fr3,-40(r1)
171 lfd fr2,-32(r1)
172 b fpdisable