diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-12 13:21:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-12 13:21:22 -0500 |
commit | 45bfe98bd790b5ded00462cd582effcfb42263cc (patch) | |
tree | d4a1f2c5303dda106635b615f8f40ea9104bf25e /arch/powerpc/kernel | |
parent | 9f5974c8734d83d4ab7096ed98136a82f41210d6 (diff) | |
parent | 624cee31bcb14bfd85559fbec5dd7bb833542965 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
Fix up delete/modify conflict of arch/ppc/kernel/process.c by hand (it's
gone, gone, gone).
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/Makefile | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kernel/process.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom.c | 28 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_32.c | 21 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_64.c | 20 |
7 files changed, 59 insertions, 37 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index bbfa1bdceb4d..a94699d8dc52 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -11,7 +11,8 @@ CFLAGS_btext.o += -fPIC | |||
11 | endif | 11 | endif |
12 | 12 | ||
13 | obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ | 13 | obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ |
14 | irq.o align.o signal_32.o pmc.o vdso.o | 14 | irq.o align.o signal_32.o pmc.o vdso.o \ |
15 | init_task.o process.o | ||
15 | obj-y += vdso32/ | 16 | obj-y += vdso32/ |
16 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ | 17 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ |
17 | signal_64.o ptrace32.o systbl.o \ | 18 | signal_64.o ptrace32.o systbl.o \ |
@@ -44,8 +45,7 @@ extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o | |||
44 | extra-$(CONFIG_8xx) := head_8xx.o | 45 | extra-$(CONFIG_8xx) := head_8xx.o |
45 | extra-y += vmlinux.lds | 46 | extra-y += vmlinux.lds |
46 | 47 | ||
47 | obj-y += process.o init_task.o time.o \ | 48 | obj-y += time.o prom.o traps.o setup-common.o udbg.o |
48 | prom.o traps.o setup-common.o udbg.o | ||
49 | obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o | 49 | obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o |
50 | obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o | 50 | obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o |
51 | obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o | 51 | obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 24fe70f40b66..c367520bc1c3 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -53,6 +53,7 @@ EXPORT_SYMBOL(io_page_mask); | |||
53 | #ifdef CONFIG_PPC_MULTIPLATFORM | 53 | #ifdef CONFIG_PPC_MULTIPLATFORM |
54 | static void fixup_resource(struct resource *res, struct pci_dev *dev); | 54 | static void fixup_resource(struct resource *res, struct pci_dev *dev); |
55 | static void do_bus_setup(struct pci_bus *bus); | 55 | static void do_bus_setup(struct pci_bus *bus); |
56 | static void phbs_remap_io(void); | ||
56 | #endif | 57 | #endif |
57 | 58 | ||
58 | /* pci_io_base -- the base address from which io bars are offsets. | 59 | /* pci_io_base -- the base address from which io bars are offsets. |
@@ -251,6 +252,7 @@ void pcibios_free_controller(struct pci_controller *phb) | |||
251 | kfree(phb); | 252 | kfree(phb); |
252 | } | 253 | } |
253 | 254 | ||
255 | #ifndef CONFIG_PPC_ISERIES | ||
254 | void __devinit pcibios_claim_one_bus(struct pci_bus *b) | 256 | void __devinit pcibios_claim_one_bus(struct pci_bus *b) |
255 | { | 257 | { |
256 | struct pci_dev *dev; | 258 | struct pci_dev *dev; |
@@ -275,7 +277,6 @@ void __devinit pcibios_claim_one_bus(struct pci_bus *b) | |||
275 | EXPORT_SYMBOL_GPL(pcibios_claim_one_bus); | 277 | EXPORT_SYMBOL_GPL(pcibios_claim_one_bus); |
276 | #endif | 278 | #endif |
277 | 279 | ||
278 | #ifndef CONFIG_PPC_ISERIES | ||
279 | static void __init pcibios_claim_of_setup(void) | 280 | static void __init pcibios_claim_of_setup(void) |
280 | { | 281 | { |
281 | struct pci_bus *b; | 282 | struct pci_bus *b; |
@@ -1218,7 +1219,7 @@ int remap_bus_range(struct pci_bus *bus) | |||
1218 | } | 1219 | } |
1219 | EXPORT_SYMBOL(remap_bus_range); | 1220 | EXPORT_SYMBOL(remap_bus_range); |
1220 | 1221 | ||
1221 | void phbs_remap_io(void) | 1222 | static void phbs_remap_io(void) |
1222 | { | 1223 | { |
1223 | struct pci_controller *hose, *tmp; | 1224 | struct pci_controller *hose, *tmp; |
1224 | 1225 | ||
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 1f816f0d7740..57703994a063 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -201,13 +201,13 @@ int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs) | |||
201 | } | 201 | } |
202 | #endif /* CONFIG_SPE */ | 202 | #endif /* CONFIG_SPE */ |
203 | 203 | ||
204 | #ifndef CONFIG_SMP | ||
204 | /* | 205 | /* |
205 | * If we are doing lazy switching of CPU state (FP, altivec or SPE), | 206 | * If we are doing lazy switching of CPU state (FP, altivec or SPE), |
206 | * and the current task has some state, discard it. | 207 | * and the current task has some state, discard it. |
207 | */ | 208 | */ |
208 | static inline void discard_lazy_cpu_state(void) | 209 | void discard_lazy_cpu_state(void) |
209 | { | 210 | { |
210 | #ifndef CONFIG_SMP | ||
211 | preempt_disable(); | 211 | preempt_disable(); |
212 | if (last_task_used_math == current) | 212 | if (last_task_used_math == current) |
213 | last_task_used_math = NULL; | 213 | last_task_used_math = NULL; |
@@ -220,9 +220,10 @@ static inline void discard_lazy_cpu_state(void) | |||
220 | last_task_used_spe = NULL; | 220 | last_task_used_spe = NULL; |
221 | #endif | 221 | #endif |
222 | preempt_enable(); | 222 | preempt_enable(); |
223 | #endif /* CONFIG_SMP */ | ||
224 | } | 223 | } |
224 | #endif /* CONFIG_SMP */ | ||
225 | 225 | ||
226 | #ifdef CONFIG_PPC_MERGE /* XXX for now */ | ||
226 | int set_dabr(unsigned long dabr) | 227 | int set_dabr(unsigned long dabr) |
227 | { | 228 | { |
228 | if (ppc_md.set_dabr) | 229 | if (ppc_md.set_dabr) |
@@ -231,6 +232,7 @@ int set_dabr(unsigned long dabr) | |||
231 | mtspr(SPRN_DABR, dabr); | 232 | mtspr(SPRN_DABR, dabr); |
232 | return 0; | 233 | return 0; |
233 | } | 234 | } |
235 | #endif | ||
234 | 236 | ||
235 | #ifdef CONFIG_PPC64 | 237 | #ifdef CONFIG_PPC64 |
236 | DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array); | 238 | DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array); |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 34ab0daec3a7..02e2115323e4 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -1100,17 +1100,37 @@ static int __init early_init_dt_scan_memory(unsigned long node, | |||
1100 | 1100 | ||
1101 | static void __init early_reserve_mem(void) | 1101 | static void __init early_reserve_mem(void) |
1102 | { | 1102 | { |
1103 | unsigned long base, size; | 1103 | u64 base, size; |
1104 | unsigned long *reserve_map; | 1104 | u64 *reserve_map; |
1105 | 1105 | ||
1106 | reserve_map = (unsigned long *)(((unsigned long)initial_boot_params) + | 1106 | reserve_map = (u64 *)(((unsigned long)initial_boot_params) + |
1107 | initial_boot_params->off_mem_rsvmap); | 1107 | initial_boot_params->off_mem_rsvmap); |
1108 | #ifdef CONFIG_PPC32 | ||
1109 | /* | ||
1110 | * Handle the case where we might be booting from an old kexec | ||
1111 | * image that setup the mem_rsvmap as pairs of 32-bit values | ||
1112 | */ | ||
1113 | if (*reserve_map > 0xffffffffull) { | ||
1114 | u32 base_32, size_32; | ||
1115 | u32 *reserve_map_32 = (u32 *)reserve_map; | ||
1116 | |||
1117 | while (1) { | ||
1118 | base_32 = *(reserve_map_32++); | ||
1119 | size_32 = *(reserve_map_32++); | ||
1120 | if (size_32 == 0) | ||
1121 | break; | ||
1122 | DBG("reserving: %lx -> %lx\n", base_32, size_32); | ||
1123 | lmb_reserve(base_32, size_32); | ||
1124 | } | ||
1125 | return; | ||
1126 | } | ||
1127 | #endif | ||
1108 | while (1) { | 1128 | while (1) { |
1109 | base = *(reserve_map++); | 1129 | base = *(reserve_map++); |
1110 | size = *(reserve_map++); | 1130 | size = *(reserve_map++); |
1111 | if (size == 0) | 1131 | if (size == 0) |
1112 | break; | 1132 | break; |
1113 | DBG("reserving: %lx -> %lx\n", base, size); | 1133 | DBG("reserving: %llx -> %llx\n", base, size); |
1114 | lmb_reserve(base, size); | 1134 | lmb_reserve(base, size); |
1115 | } | 1135 | } |
1116 | 1136 | ||
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index e381f2fc121c..d963a12ec640 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -137,8 +137,8 @@ struct prom_t { | |||
137 | }; | 137 | }; |
138 | 138 | ||
139 | struct mem_map_entry { | 139 | struct mem_map_entry { |
140 | unsigned long base; | 140 | u64 base; |
141 | unsigned long size; | 141 | u64 size; |
142 | }; | 142 | }; |
143 | 143 | ||
144 | typedef u32 cell_t; | 144 | typedef u32 cell_t; |
@@ -897,9 +897,9 @@ static unsigned long __init prom_next_cell(int s, cell_t **cellp) | |||
897 | * If problems seem to show up, it would be a good start to track | 897 | * If problems seem to show up, it would be a good start to track |
898 | * them down. | 898 | * them down. |
899 | */ | 899 | */ |
900 | static void reserve_mem(unsigned long base, unsigned long size) | 900 | static void reserve_mem(u64 base, u64 size) |
901 | { | 901 | { |
902 | unsigned long top = base + size; | 902 | u64 top = base + size; |
903 | unsigned long cnt = RELOC(mem_reserve_cnt); | 903 | unsigned long cnt = RELOC(mem_reserve_cnt); |
904 | 904 | ||
905 | if (size == 0) | 905 | if (size == 0) |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index d3f0b6d452fb..177bba78fb0b 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -497,6 +497,15 @@ static long restore_user_regs(struct pt_regs *regs, | |||
497 | if (err) | 497 | if (err) |
498 | return 1; | 498 | return 1; |
499 | 499 | ||
500 | /* | ||
501 | * Do this before updating the thread state in | ||
502 | * current->thread.fpr/vr/evr. That way, if we get preempted | ||
503 | * and another task grabs the FPU/Altivec/SPE, it won't be | ||
504 | * tempted to save the current CPU state into the thread_struct | ||
505 | * and corrupt what we are writing there. | ||
506 | */ | ||
507 | discard_lazy_cpu_state(); | ||
508 | |||
500 | /* force the process to reload the FP registers from | 509 | /* force the process to reload the FP registers from |
501 | current->thread when it next does FP instructions */ | 510 | current->thread when it next does FP instructions */ |
502 | regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1); | 511 | regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1); |
@@ -538,18 +547,6 @@ static long restore_user_regs(struct pt_regs *regs, | |||
538 | return 1; | 547 | return 1; |
539 | #endif /* CONFIG_SPE */ | 548 | #endif /* CONFIG_SPE */ |
540 | 549 | ||
541 | #ifndef CONFIG_SMP | ||
542 | preempt_disable(); | ||
543 | if (last_task_used_math == current) | ||
544 | last_task_used_math = NULL; | ||
545 | if (last_task_used_altivec == current) | ||
546 | last_task_used_altivec = NULL; | ||
547 | #ifdef CONFIG_SPE | ||
548 | if (last_task_used_spe == current) | ||
549 | last_task_used_spe = NULL; | ||
550 | #endif | ||
551 | preempt_enable(); | ||
552 | #endif | ||
553 | return 0; | 550 | return 0; |
554 | } | 551 | } |
555 | 552 | ||
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 5462bef898f6..7b9d999e2115 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -207,10 +207,20 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, | |||
207 | 207 | ||
208 | if (!sig) | 208 | if (!sig) |
209 | regs->gpr[13] = save_r13; | 209 | regs->gpr[13] = save_r13; |
210 | err |= __copy_from_user(¤t->thread.fpr, &sc->fp_regs, FP_REGS_SIZE); | ||
211 | if (set != NULL) | 210 | if (set != NULL) |
212 | err |= __get_user(set->sig[0], &sc->oldmask); | 211 | err |= __get_user(set->sig[0], &sc->oldmask); |
213 | 212 | ||
213 | /* | ||
214 | * Do this before updating the thread state in | ||
215 | * current->thread.fpr/vr. That way, if we get preempted | ||
216 | * and another task grabs the FPU/Altivec, it won't be | ||
217 | * tempted to save the current CPU state into the thread_struct | ||
218 | * and corrupt what we are writing there. | ||
219 | */ | ||
220 | discard_lazy_cpu_state(); | ||
221 | |||
222 | err |= __copy_from_user(¤t->thread.fpr, &sc->fp_regs, FP_REGS_SIZE); | ||
223 | |||
214 | #ifdef CONFIG_ALTIVEC | 224 | #ifdef CONFIG_ALTIVEC |
215 | err |= __get_user(v_regs, &sc->v_regs); | 225 | err |= __get_user(v_regs, &sc->v_regs); |
216 | err |= __get_user(msr, &sc->gp_regs[PT_MSR]); | 226 | err |= __get_user(msr, &sc->gp_regs[PT_MSR]); |
@@ -229,14 +239,6 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, | |||
229 | current->thread.vrsave = 0; | 239 | current->thread.vrsave = 0; |
230 | #endif /* CONFIG_ALTIVEC */ | 240 | #endif /* CONFIG_ALTIVEC */ |
231 | 241 | ||
232 | #ifndef CONFIG_SMP | ||
233 | preempt_disable(); | ||
234 | if (last_task_used_math == current) | ||
235 | last_task_used_math = NULL; | ||
236 | if (last_task_used_altivec == current) | ||
237 | last_task_used_altivec = NULL; | ||
238 | preempt_enable(); | ||
239 | #endif | ||
240 | /* Force reload of FP/VEC */ | 242 | /* Force reload of FP/VEC */ |
241 | regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC); | 243 | regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC); |
242 | 244 | ||