diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-15 12:51:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-15 12:51:09 -0400 |
commit | 723e9db7a46e328527cc3da2b478b831184fe828 (patch) | |
tree | cdeda255633057dcb4c84097bed27b2bbf76970f /arch/powerpc/kernel/head_booke.h | |
parent | ada3fa15057205b7d3f727bba5cd26b5912e350f (diff) | |
parent | d331d8305cba713605854aab63a000fb892353a7 (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (134 commits)
powerpc/nvram: Enable use Generic NVRAM driver for different size chips
powerpc/iseries: Fix oops reading from /proc/iSeries/mf/*/cmdline
powerpc/ps3: Workaround for flash memory I/O error
powerpc/booke: Don't set DABR on 64-bit BookE, use DAC1 instead
powerpc/perf_counters: Reduce stack usage of power_check_constraints
powerpc: Fix bug where perf_counters breaks oprofile
powerpc/85xx: Fix SMP compile error and allow NULL for smp_ops
powerpc/irq: Improve nanodoc
powerpc: Fix some late PowerMac G5 with PCIe ATI graphics
powerpc/fsl-booke: Use HW PTE format if CONFIG_PTE_64BIT
powerpc/book3e: Add missing page sizes
powerpc/pseries: Fix to handle slb resize across migration
powerpc/powermac: Thermal control turns system off too eagerly
powerpc/pci: Merge ppc32 and ppc64 versions of phb_scan()
powerpc/405ex: support cuImage via included dtb
powerpc/405ex: provide necessary fixup function to support cuImage
powerpc/40x: Add support for the ESTeem 195E (PPC405EP) SBC
powerpc/44x: Add Eiger AMCC (AppliedMicro) PPC460SX evaluation board support.
powerpc/44x: Update Arches defconfig
powerpc/44x: Update Arches dts
...
Fix up conflicts in drivers/char/agp/uninorth-agp.c
Diffstat (limited to 'arch/powerpc/kernel/head_booke.h')
-rw-r--r-- | arch/powerpc/kernel/head_booke.h | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h index 5f9febc8d143..50504ae39cb7 100644 --- a/arch/powerpc/kernel/head_booke.h +++ b/arch/powerpc/kernel/head_booke.h | |||
@@ -20,14 +20,14 @@ | |||
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #define NORMAL_EXCEPTION_PROLOG \ | 22 | #define NORMAL_EXCEPTION_PROLOG \ |
23 | mtspr SPRN_SPRG0,r10; /* save two registers to work with */\ | 23 | mtspr SPRN_SPRG_WSCRATCH0,r10;/* save two registers to work with */\ |
24 | mtspr SPRN_SPRG1,r11; \ | 24 | mtspr SPRN_SPRG_WSCRATCH1,r11; \ |
25 | mtspr SPRN_SPRG4W,r1; \ | 25 | mtspr SPRN_SPRG_WSCRATCH2,r1; \ |
26 | mfcr r10; /* save CR in r10 for now */\ | 26 | mfcr r10; /* save CR in r10 for now */\ |
27 | mfspr r11,SPRN_SRR1; /* check whether user or kernel */\ | 27 | mfspr r11,SPRN_SRR1; /* check whether user or kernel */\ |
28 | andi. r11,r11,MSR_PR; \ | 28 | andi. r11,r11,MSR_PR; \ |
29 | beq 1f; \ | 29 | beq 1f; \ |
30 | mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\ | 30 | mfspr r1,SPRN_SPRG_THREAD; /* if from user, start at top of */\ |
31 | lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\ | 31 | lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\ |
32 | ALLOC_STACK_FRAME(r1, THREAD_SIZE); \ | 32 | ALLOC_STACK_FRAME(r1, THREAD_SIZE); \ |
33 | 1: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\ | 33 | 1: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\ |
@@ -35,13 +35,13 @@ | |||
35 | stw r10,_CCR(r11); /* save various registers */\ | 35 | stw r10,_CCR(r11); /* save various registers */\ |
36 | stw r12,GPR12(r11); \ | 36 | stw r12,GPR12(r11); \ |
37 | stw r9,GPR9(r11); \ | 37 | stw r9,GPR9(r11); \ |
38 | mfspr r10,SPRN_SPRG0; \ | 38 | mfspr r10,SPRN_SPRG_RSCRATCH0; \ |
39 | stw r10,GPR10(r11); \ | 39 | stw r10,GPR10(r11); \ |
40 | mfspr r12,SPRN_SPRG1; \ | 40 | mfspr r12,SPRN_SPRG_RSCRATCH1; \ |
41 | stw r12,GPR11(r11); \ | 41 | stw r12,GPR11(r11); \ |
42 | mflr r10; \ | 42 | mflr r10; \ |
43 | stw r10,_LINK(r11); \ | 43 | stw r10,_LINK(r11); \ |
44 | mfspr r10,SPRN_SPRG4R; \ | 44 | mfspr r10,SPRN_SPRG_RSCRATCH2; \ |
45 | mfspr r12,SPRN_SRR0; \ | 45 | mfspr r12,SPRN_SRR0; \ |
46 | stw r10,GPR1(r11); \ | 46 | stw r10,GPR1(r11); \ |
47 | mfspr r9,SPRN_SRR1; \ | 47 | mfspr r9,SPRN_SRR1; \ |
@@ -69,21 +69,11 @@ | |||
69 | * providing configurations that micro-optimize space usage. | 69 | * providing configurations that micro-optimize space usage. |
70 | */ | 70 | */ |
71 | 71 | ||
72 | /* CRIT_SPRG only used in critical exception handling */ | 72 | #define MC_STACK_BASE mcheckirq_ctx |
73 | #define CRIT_SPRG SPRN_SPRG2 | ||
74 | /* MCHECK_SPRG only used in machine check exception handling */ | ||
75 | #define MCHECK_SPRG SPRN_SPRG6W | ||
76 | |||
77 | #define MCHECK_STACK_BASE mcheckirq_ctx | ||
78 | #define CRIT_STACK_BASE critirq_ctx | 73 | #define CRIT_STACK_BASE critirq_ctx |
79 | 74 | ||
80 | /* only on e500mc/e200 */ | 75 | /* only on e500mc/e200 */ |
81 | #define DEBUG_STACK_BASE dbgirq_ctx | 76 | #define DBG_STACK_BASE dbgirq_ctx |
82 | #ifdef CONFIG_E200 | ||
83 | #define DEBUG_SPRG SPRN_SPRG6W | ||
84 | #else | ||
85 | #define DEBUG_SPRG SPRN_SPRG9 | ||
86 | #endif | ||
87 | 77 | ||
88 | #define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE) | 78 | #define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE) |
89 | 79 | ||
@@ -110,7 +100,7 @@ | |||
110 | * critical/machine check exception stack at low physical addresses. | 100 | * critical/machine check exception stack at low physical addresses. |
111 | */ | 101 | */ |
112 | #define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, exc_level_srr0, exc_level_srr1) \ | 102 | #define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, exc_level_srr0, exc_level_srr1) \ |
113 | mtspr exc_level##_SPRG,r8; \ | 103 | mtspr SPRN_SPRG_WSCRATCH_##exc_level,r8; \ |
114 | BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);/* r8 points to the exc_level stack*/ \ | 104 | BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);/* r8 points to the exc_level stack*/ \ |
115 | stw r9,GPR9(r8); /* save various registers */\ | 105 | stw r9,GPR9(r8); /* save various registers */\ |
116 | mfcr r9; /* save CR in r9 for now */\ | 106 | mfcr r9; /* save CR in r9 for now */\ |
@@ -119,7 +109,7 @@ | |||
119 | stw r9,_CCR(r8); /* save CR on stack */\ | 109 | stw r9,_CCR(r8); /* save CR on stack */\ |
120 | mfspr r10,exc_level_srr1; /* check whether user or kernel */\ | 110 | mfspr r10,exc_level_srr1; /* check whether user or kernel */\ |
121 | andi. r10,r10,MSR_PR; \ | 111 | andi. r10,r10,MSR_PR; \ |
122 | mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\ | 112 | mfspr r11,SPRN_SPRG_THREAD; /* if from user, start at top of */\ |
123 | lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\ | 113 | lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\ |
124 | addi r11,r11,EXC_LVL_FRAME_OVERHEAD; /* allocate stack frame */\ | 114 | addi r11,r11,EXC_LVL_FRAME_OVERHEAD; /* allocate stack frame */\ |
125 | beq 1f; \ | 115 | beq 1f; \ |
@@ -140,7 +130,7 @@ | |||
140 | lwz r9,TI_TASK-EXC_LVL_FRAME_OVERHEAD(r11); \ | 130 | lwz r9,TI_TASK-EXC_LVL_FRAME_OVERHEAD(r11); \ |
141 | stw r9,TI_TASK-EXC_LVL_FRAME_OVERHEAD(r8); \ | 131 | stw r9,TI_TASK-EXC_LVL_FRAME_OVERHEAD(r8); \ |
142 | mr r11,r8; \ | 132 | mr r11,r8; \ |
143 | 2: mfspr r8,exc_level##_SPRG; \ | 133 | 2: mfspr r8,SPRN_SPRG_RSCRATCH_##exc_level; \ |
144 | stw r12,GPR12(r11); /* save various registers */\ | 134 | stw r12,GPR12(r11); /* save various registers */\ |
145 | mflr r10; \ | 135 | mflr r10; \ |
146 | stw r10,_LINK(r11); \ | 136 | stw r10,_LINK(r11); \ |
@@ -161,9 +151,9 @@ | |||
161 | #define CRITICAL_EXCEPTION_PROLOG \ | 151 | #define CRITICAL_EXCEPTION_PROLOG \ |
162 | EXC_LEVEL_EXCEPTION_PROLOG(CRIT, SPRN_CSRR0, SPRN_CSRR1) | 152 | EXC_LEVEL_EXCEPTION_PROLOG(CRIT, SPRN_CSRR0, SPRN_CSRR1) |
163 | #define DEBUG_EXCEPTION_PROLOG \ | 153 | #define DEBUG_EXCEPTION_PROLOG \ |
164 | EXC_LEVEL_EXCEPTION_PROLOG(DEBUG, SPRN_DSRR0, SPRN_DSRR1) | 154 | EXC_LEVEL_EXCEPTION_PROLOG(DBG, SPRN_DSRR0, SPRN_DSRR1) |
165 | #define MCHECK_EXCEPTION_PROLOG \ | 155 | #define MCHECK_EXCEPTION_PROLOG \ |
166 | EXC_LEVEL_EXCEPTION_PROLOG(MCHECK, SPRN_MCSRR0, SPRN_MCSRR1) | 156 | EXC_LEVEL_EXCEPTION_PROLOG(MC, SPRN_MCSRR0, SPRN_MCSRR1) |
167 | 157 | ||
168 | /* | 158 | /* |
169 | * Exception vectors. | 159 | * Exception vectors. |
@@ -282,13 +272,13 @@ label: | |||
282 | mtspr SPRN_DSRR1,r9; \ | 272 | mtspr SPRN_DSRR1,r9; \ |
283 | lwz r9,GPR9(r11); \ | 273 | lwz r9,GPR9(r11); \ |
284 | lwz r12,GPR12(r11); \ | 274 | lwz r12,GPR12(r11); \ |
285 | mtspr DEBUG_SPRG,r8; \ | 275 | mtspr SPRN_SPRG_WSCRATCH_DBG,r8; \ |
286 | BOOKE_LOAD_EXC_LEVEL_STACK(DEBUG); /* r8 points to the debug stack */ \ | 276 | BOOKE_LOAD_EXC_LEVEL_STACK(DBG); /* r8 points to the debug stack */ \ |
287 | lwz r10,GPR10(r8); \ | 277 | lwz r10,GPR10(r8); \ |
288 | lwz r11,GPR11(r8); \ | 278 | lwz r11,GPR11(r8); \ |
289 | mfspr r8,DEBUG_SPRG; \ | 279 | mfspr r8,SPRN_SPRG_RSCRATCH_DBG; \ |
290 | \ | 280 | \ |
291 | PPC_RFDI; \ | 281 | PPC_RFDI; \ |
292 | b .; \ | 282 | b .; \ |
293 | \ | 283 | \ |
294 | /* continue normal handling for a debug exception... */ \ | 284 | /* continue normal handling for a debug exception... */ \ |
@@ -335,11 +325,11 @@ label: | |||
335 | mtspr SPRN_CSRR1,r9; \ | 325 | mtspr SPRN_CSRR1,r9; \ |
336 | lwz r9,GPR9(r11); \ | 326 | lwz r9,GPR9(r11); \ |
337 | lwz r12,GPR12(r11); \ | 327 | lwz r12,GPR12(r11); \ |
338 | mtspr CRIT_SPRG,r8; \ | 328 | mtspr SPRN_SPRG_WSCRATCH_CRIT,r8; \ |
339 | BOOKE_LOAD_EXC_LEVEL_STACK(CRIT); /* r8 points to the debug stack */ \ | 329 | BOOKE_LOAD_EXC_LEVEL_STACK(CRIT); /* r8 points to the debug stack */ \ |
340 | lwz r10,GPR10(r8); \ | 330 | lwz r10,GPR10(r8); \ |
341 | lwz r11,GPR11(r8); \ | 331 | lwz r11,GPR11(r8); \ |
342 | mfspr r8,CRIT_SPRG; \ | 332 | mfspr r8,SPRN_SPRG_RSCRATCH_CRIT; \ |
343 | \ | 333 | \ |
344 | rfci; \ | 334 | rfci; \ |
345 | b .; \ | 335 | b .; \ |