diff options
Diffstat (limited to 'arch/parisc/kernel')
-rw-r--r-- | arch/parisc/kernel/drivers.c | 40 | ||||
-rw-r--r-- | arch/parisc/kernel/hpmc.S | 8 | ||||
-rw-r--r-- | arch/parisc/kernel/irq.c | 11 | ||||
-rw-r--r-- | arch/parisc/kernel/pdc_cons.c | 2 | ||||
-rw-r--r-- | arch/parisc/kernel/perf.c | 4 | ||||
-rw-r--r-- | arch/parisc/kernel/processor.c | 68 | ||||
-rw-r--r-- | arch/parisc/kernel/setup.c | 11 | ||||
-rw-r--r-- | arch/parisc/kernel/smp.c | 32 | ||||
-rw-r--r-- | arch/parisc/kernel/time.c | 4 | ||||
-rw-r--r-- | arch/parisc/kernel/topology.c | 4 | ||||
-rw-r--r-- | arch/parisc/kernel/traps.c | 9 | ||||
-rw-r--r-- | arch/parisc/kernel/unwind.c | 2 |
12 files changed, 114 insertions, 81 deletions
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index 884b7ce16a3b..994bcd980909 100644 --- a/arch/parisc/kernel/drivers.c +++ b/arch/parisc/kernel/drivers.c | |||
@@ -549,6 +549,38 @@ static int parisc_generic_match(struct device *dev, struct device_driver *drv) | |||
549 | return match_device(to_parisc_driver(drv), to_parisc_device(dev)); | 549 | return match_device(to_parisc_driver(drv), to_parisc_device(dev)); |
550 | } | 550 | } |
551 | 551 | ||
552 | static ssize_t make_modalias(struct device *dev, char *buf) | ||
553 | { | ||
554 | const struct parisc_device *padev = to_parisc_device(dev); | ||
555 | const struct parisc_device_id *id = &padev->id; | ||
556 | |||
557 | return sprintf(buf, "parisc:t%02Xhv%04Xrev%02Xsv%08X\n", | ||
558 | (u8)id->hw_type, (u16)id->hversion, (u8)id->hversion_rev, | ||
559 | (u32)id->sversion); | ||
560 | } | ||
561 | |||
562 | static int parisc_uevent(struct device *dev, struct kobj_uevent_env *env) | ||
563 | { | ||
564 | const struct parisc_device *padev; | ||
565 | char modalias[40]; | ||
566 | |||
567 | if (!dev) | ||
568 | return -ENODEV; | ||
569 | |||
570 | padev = to_parisc_device(dev); | ||
571 | if (!padev) | ||
572 | return -ENODEV; | ||
573 | |||
574 | if (add_uevent_var(env, "PARISC_NAME=%s", padev->name)) | ||
575 | return -ENOMEM; | ||
576 | |||
577 | make_modalias(dev, modalias); | ||
578 | if (add_uevent_var(env, "MODALIAS=%s", modalias)) | ||
579 | return -ENOMEM; | ||
580 | |||
581 | return 0; | ||
582 | } | ||
583 | |||
552 | #define pa_dev_attr(name, field, format_string) \ | 584 | #define pa_dev_attr(name, field, format_string) \ |
553 | static ssize_t name##_show(struct device *dev, struct device_attribute *attr, char *buf) \ | 585 | static ssize_t name##_show(struct device *dev, struct device_attribute *attr, char *buf) \ |
554 | { \ | 586 | { \ |
@@ -566,12 +598,7 @@ pa_dev_attr_id(sversion, "0x%05x\n"); | |||
566 | 598 | ||
567 | static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) | 599 | static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) |
568 | { | 600 | { |
569 | struct parisc_device *padev = to_parisc_device(dev); | 601 | return make_modalias(dev, buf); |
570 | struct parisc_device_id *id = &padev->id; | ||
571 | |||
572 | return sprintf(buf, "parisc:t%02Xhv%04Xrev%02Xsv%08X\n", | ||
573 | (u8)id->hw_type, (u16)id->hversion, (u8)id->hversion_rev, | ||
574 | (u32)id->sversion); | ||
575 | } | 602 | } |
576 | 603 | ||
577 | static struct device_attribute parisc_device_attrs[] = { | 604 | static struct device_attribute parisc_device_attrs[] = { |
@@ -587,6 +614,7 @@ static struct device_attribute parisc_device_attrs[] = { | |||
587 | struct bus_type parisc_bus_type = { | 614 | struct bus_type parisc_bus_type = { |
588 | .name = "parisc", | 615 | .name = "parisc", |
589 | .match = parisc_generic_match, | 616 | .match = parisc_generic_match, |
617 | .uevent = parisc_uevent, | ||
590 | .dev_attrs = parisc_device_attrs, | 618 | .dev_attrs = parisc_device_attrs, |
591 | .probe = parisc_driver_probe, | 619 | .probe = parisc_driver_probe, |
592 | .remove = parisc_driver_remove, | 620 | .remove = parisc_driver_remove, |
diff --git a/arch/parisc/kernel/hpmc.S b/arch/parisc/kernel/hpmc.S index 2cbf13b3ef11..5595a2f31181 100644 --- a/arch/parisc/kernel/hpmc.S +++ b/arch/parisc/kernel/hpmc.S | |||
@@ -80,6 +80,7 @@ END(hpmc_pim_data) | |||
80 | 80 | ||
81 | .import intr_save, code | 81 | .import intr_save, code |
82 | ENTRY(os_hpmc) | 82 | ENTRY(os_hpmc) |
83 | .os_hpmc: | ||
83 | 84 | ||
84 | /* | 85 | /* |
85 | * registers modified: | 86 | * registers modified: |
@@ -295,5 +296,10 @@ os_hpmc_6: | |||
295 | b . | 296 | b . |
296 | nop | 297 | nop |
297 | ENDPROC(os_hpmc) | 298 | ENDPROC(os_hpmc) |
298 | ENTRY(os_hpmc_end) /* this label used to compute os_hpmc checksum */ | 299 | .os_hpmc_end: |
299 | nop | 300 | nop |
301 | .data | ||
302 | .align 4 | ||
303 | .export os_hpmc_size | ||
304 | os_hpmc_size: | ||
305 | .word .os_hpmc_end-.os_hpmc | ||
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index 4cea935e2f99..ac2c822928c7 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c | |||
@@ -298,7 +298,7 @@ unsigned long txn_affinity_addr(unsigned int irq, int cpu) | |||
298 | irq_desc[irq].affinity = cpumask_of_cpu(cpu); | 298 | irq_desc[irq].affinity = cpumask_of_cpu(cpu); |
299 | #endif | 299 | #endif |
300 | 300 | ||
301 | return cpu_data[cpu].txn_addr; | 301 | return per_cpu(cpu_data, cpu).txn_addr; |
302 | } | 302 | } |
303 | 303 | ||
304 | 304 | ||
@@ -309,8 +309,9 @@ unsigned long txn_alloc_addr(unsigned int virt_irq) | |||
309 | next_cpu++; /* assign to "next" CPU we want this bugger on */ | 309 | next_cpu++; /* assign to "next" CPU we want this bugger on */ |
310 | 310 | ||
311 | /* validate entry */ | 311 | /* validate entry */ |
312 | while ((next_cpu < NR_CPUS) && (!cpu_data[next_cpu].txn_addr || | 312 | while ((next_cpu < NR_CPUS) && |
313 | !cpu_online(next_cpu))) | 313 | (!per_cpu(cpu_data, next_cpu).txn_addr || |
314 | !cpu_online(next_cpu))) | ||
314 | next_cpu++; | 315 | next_cpu++; |
315 | 316 | ||
316 | if (next_cpu >= NR_CPUS) | 317 | if (next_cpu >= NR_CPUS) |
@@ -359,7 +360,7 @@ void do_cpu_irq_mask(struct pt_regs *regs) | |||
359 | printk(KERN_DEBUG "redirecting irq %d from CPU %d to %d\n", | 360 | printk(KERN_DEBUG "redirecting irq %d from CPU %d to %d\n", |
360 | irq, smp_processor_id(), cpu); | 361 | irq, smp_processor_id(), cpu); |
361 | gsc_writel(irq + CPU_IRQ_BASE, | 362 | gsc_writel(irq + CPU_IRQ_BASE, |
362 | cpu_data[cpu].hpa); | 363 | per_cpu(cpu_data, cpu).hpa); |
363 | goto set_out; | 364 | goto set_out; |
364 | } | 365 | } |
365 | #endif | 366 | #endif |
@@ -421,5 +422,5 @@ void __init init_IRQ(void) | |||
421 | 422 | ||
422 | void ack_bad_irq(unsigned int irq) | 423 | void ack_bad_irq(unsigned int irq) |
423 | { | 424 | { |
424 | printk("unexpected IRQ %d\n", irq); | 425 | printk(KERN_WARNING "unexpected IRQ %d\n", irq); |
425 | } | 426 | } |
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c index ccb68090781e..1ff366cb9685 100644 --- a/arch/parisc/kernel/pdc_cons.c +++ b/arch/parisc/kernel/pdc_cons.c | |||
@@ -52,7 +52,7 @@ | |||
52 | #include <linux/tty.h> | 52 | #include <linux/tty.h> |
53 | #include <asm/pdc.h> /* for iodc_call() proto and friends */ | 53 | #include <asm/pdc.h> /* for iodc_call() proto and friends */ |
54 | 54 | ||
55 | static spinlock_t pdc_console_lock = SPIN_LOCK_UNLOCKED; | 55 | static DEFINE_SPINLOCK(pdc_console_lock); |
56 | 56 | ||
57 | static void pdc_console_write(struct console *co, const char *s, unsigned count) | 57 | static void pdc_console_write(struct console *co, const char *s, unsigned count) |
58 | { | 58 | { |
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index f696f57faa15..75099efb3bf3 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c | |||
@@ -541,9 +541,9 @@ static int __init perf_init(void) | |||
541 | spin_lock_init(&perf_lock); | 541 | spin_lock_init(&perf_lock); |
542 | 542 | ||
543 | /* TODO: this only lets us access the first cpu.. what to do for SMP? */ | 543 | /* TODO: this only lets us access the first cpu.. what to do for SMP? */ |
544 | cpu_device = cpu_data[0].dev; | 544 | cpu_device = per_cpu(cpu_data, 0).dev; |
545 | printk("Performance monitoring counters enabled for %s\n", | 545 | printk("Performance monitoring counters enabled for %s\n", |
546 | cpu_data[0].dev->name); | 546 | per_cpu(cpu_data, 0).dev->name); |
547 | 547 | ||
548 | return 0; | 548 | return 0; |
549 | } | 549 | } |
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index 370086fb8333..ecb609342feb 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * Initial setup-routines for HP 9000 based hardware. | 3 | * Initial setup-routines for HP 9000 based hardware. |
4 | * | 4 | * |
5 | * Copyright (C) 1991, 1992, 1995 Linus Torvalds | 5 | * Copyright (C) 1991, 1992, 1995 Linus Torvalds |
6 | * Modifications for PA-RISC (C) 1999 Helge Deller <deller@gmx.de> | 6 | * Modifications for PA-RISC (C) 1999-2008 Helge Deller <deller@gmx.de> |
7 | * Modifications copyright 1999 SuSE GmbH (Philipp Rumpf) | 7 | * Modifications copyright 1999 SuSE GmbH (Philipp Rumpf) |
8 | * Modifications copyright 2000 Martin K. Petersen <mkp@mkp.net> | 8 | * Modifications copyright 2000 Martin K. Petersen <mkp@mkp.net> |
9 | * Modifications copyright 2000 Philipp Rumpf <prumpf@tux.org> | 9 | * Modifications copyright 2000 Philipp Rumpf <prumpf@tux.org> |
@@ -46,7 +46,7 @@ | |||
46 | struct system_cpuinfo_parisc boot_cpu_data __read_mostly; | 46 | struct system_cpuinfo_parisc boot_cpu_data __read_mostly; |
47 | EXPORT_SYMBOL(boot_cpu_data); | 47 | EXPORT_SYMBOL(boot_cpu_data); |
48 | 48 | ||
49 | struct cpuinfo_parisc cpu_data[NR_CPUS] __read_mostly; | 49 | DEFINE_PER_CPU(struct cpuinfo_parisc, cpu_data); |
50 | 50 | ||
51 | extern int update_cr16_clocksource(void); /* from time.c */ | 51 | extern int update_cr16_clocksource(void); /* from time.c */ |
52 | 52 | ||
@@ -69,6 +69,23 @@ extern int update_cr16_clocksource(void); /* from time.c */ | |||
69 | */ | 69 | */ |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * init_cpu_profiler - enable/setup per cpu profiling hooks. | ||
73 | * @cpunum: The processor instance. | ||
74 | * | ||
75 | * FIXME: doesn't do much yet... | ||
76 | */ | ||
77 | static void __cpuinit | ||
78 | init_percpu_prof(unsigned long cpunum) | ||
79 | { | ||
80 | struct cpuinfo_parisc *p; | ||
81 | |||
82 | p = &per_cpu(cpu_data, cpunum); | ||
83 | p->prof_counter = 1; | ||
84 | p->prof_multiplier = 1; | ||
85 | } | ||
86 | |||
87 | |||
88 | /** | ||
72 | * processor_probe - Determine if processor driver should claim this device. | 89 | * processor_probe - Determine if processor driver should claim this device. |
73 | * @dev: The device which has been found. | 90 | * @dev: The device which has been found. |
74 | * | 91 | * |
@@ -147,7 +164,7 @@ static int __cpuinit processor_probe(struct parisc_device *dev) | |||
147 | } | 164 | } |
148 | #endif | 165 | #endif |
149 | 166 | ||
150 | p = &cpu_data[cpuid]; | 167 | p = &per_cpu(cpu_data, cpuid); |
151 | boot_cpu_data.cpu_count++; | 168 | boot_cpu_data.cpu_count++; |
152 | 169 | ||
153 | /* initialize counters - CPU 0 gets it_value set in time_init() */ | 170 | /* initialize counters - CPU 0 gets it_value set in time_init() */ |
@@ -162,12 +179,9 @@ static int __cpuinit processor_probe(struct parisc_device *dev) | |||
162 | #ifdef CONFIG_SMP | 179 | #ifdef CONFIG_SMP |
163 | /* | 180 | /* |
164 | ** FIXME: review if any other initialization is clobbered | 181 | ** FIXME: review if any other initialization is clobbered |
165 | ** for boot_cpu by the above memset(). | 182 | ** for boot_cpu by the above memset(). |
166 | */ | 183 | */ |
167 | 184 | init_percpu_prof(cpuid); | |
168 | /* stolen from init_percpu_prof() */ | ||
169 | cpu_data[cpuid].prof_counter = 1; | ||
170 | cpu_data[cpuid].prof_multiplier = 1; | ||
171 | #endif | 185 | #endif |
172 | 186 | ||
173 | /* | 187 | /* |
@@ -261,19 +275,6 @@ void __init collect_boot_cpu_data(void) | |||
261 | } | 275 | } |
262 | 276 | ||
263 | 277 | ||
264 | /** | ||
265 | * init_cpu_profiler - enable/setup per cpu profiling hooks. | ||
266 | * @cpunum: The processor instance. | ||
267 | * | ||
268 | * FIXME: doesn't do much yet... | ||
269 | */ | ||
270 | static inline void __init | ||
271 | init_percpu_prof(int cpunum) | ||
272 | { | ||
273 | cpu_data[cpunum].prof_counter = 1; | ||
274 | cpu_data[cpunum].prof_multiplier = 1; | ||
275 | } | ||
276 | |||
277 | 278 | ||
278 | /** | 279 | /** |
279 | * init_per_cpu - Handle individual processor initializations. | 280 | * init_per_cpu - Handle individual processor initializations. |
@@ -293,7 +294,7 @@ init_percpu_prof(int cpunum) | |||
293 | * | 294 | * |
294 | * o Enable CPU profiling hooks. | 295 | * o Enable CPU profiling hooks. |
295 | */ | 296 | */ |
296 | int __init init_per_cpu(int cpunum) | 297 | int __cpuinit init_per_cpu(int cpunum) |
297 | { | 298 | { |
298 | int ret; | 299 | int ret; |
299 | struct pdc_coproc_cfg coproc_cfg; | 300 | struct pdc_coproc_cfg coproc_cfg; |
@@ -307,8 +308,8 @@ int __init init_per_cpu(int cpunum) | |||
307 | /* FWIW, FP rev/model is a more accurate way to determine | 308 | /* FWIW, FP rev/model is a more accurate way to determine |
308 | ** CPU type. CPU rev/model has some ambiguous cases. | 309 | ** CPU type. CPU rev/model has some ambiguous cases. |
309 | */ | 310 | */ |
310 | cpu_data[cpunum].fp_rev = coproc_cfg.revision; | 311 | per_cpu(cpu_data, cpunum).fp_rev = coproc_cfg.revision; |
311 | cpu_data[cpunum].fp_model = coproc_cfg.model; | 312 | per_cpu(cpu_data, cpunum).fp_model = coproc_cfg.model; |
312 | 313 | ||
313 | printk(KERN_INFO "FP[%d] enabled: Rev %ld Model %ld\n", | 314 | printk(KERN_INFO "FP[%d] enabled: Rev %ld Model %ld\n", |
314 | cpunum, coproc_cfg.revision, coproc_cfg.model); | 315 | cpunum, coproc_cfg.revision, coproc_cfg.model); |
@@ -344,16 +345,17 @@ int __init init_per_cpu(int cpunum) | |||
344 | int | 345 | int |
345 | show_cpuinfo (struct seq_file *m, void *v) | 346 | show_cpuinfo (struct seq_file *m, void *v) |
346 | { | 347 | { |
347 | int n; | 348 | unsigned long cpu; |
348 | 349 | ||
349 | for(n=0; n<boot_cpu_data.cpu_count; n++) { | 350 | for_each_online_cpu(cpu) { |
351 | const struct cpuinfo_parisc *cpuinfo = &per_cpu(cpu_data, cpu); | ||
350 | #ifdef CONFIG_SMP | 352 | #ifdef CONFIG_SMP |
351 | if (0 == cpu_data[n].hpa) | 353 | if (0 == cpuinfo->hpa) |
352 | continue; | 354 | continue; |
353 | #endif | 355 | #endif |
354 | seq_printf(m, "processor\t: %d\n" | 356 | seq_printf(m, "processor\t: %lu\n" |
355 | "cpu family\t: PA-RISC %s\n", | 357 | "cpu family\t: PA-RISC %s\n", |
356 | n, boot_cpu_data.family_name); | 358 | cpu, boot_cpu_data.family_name); |
357 | 359 | ||
358 | seq_printf(m, "cpu\t\t: %s\n", boot_cpu_data.cpu_name ); | 360 | seq_printf(m, "cpu\t\t: %s\n", boot_cpu_data.cpu_name ); |
359 | 361 | ||
@@ -365,8 +367,8 @@ show_cpuinfo (struct seq_file *m, void *v) | |||
365 | seq_printf(m, "model\t\t: %s\n" | 367 | seq_printf(m, "model\t\t: %s\n" |
366 | "model name\t: %s\n", | 368 | "model name\t: %s\n", |
367 | boot_cpu_data.pdc.sys_model_name, | 369 | boot_cpu_data.pdc.sys_model_name, |
368 | cpu_data[n].dev ? | 370 | cpuinfo->dev ? |
369 | cpu_data[n].dev->name : "Unknown" ); | 371 | cpuinfo->dev->name : "Unknown"); |
370 | 372 | ||
371 | seq_printf(m, "hversion\t: 0x%08x\n" | 373 | seq_printf(m, "hversion\t: 0x%08x\n" |
372 | "sversion\t: 0x%08x\n", | 374 | "sversion\t: 0x%08x\n", |
@@ -377,8 +379,8 @@ show_cpuinfo (struct seq_file *m, void *v) | |||
377 | show_cache_info(m); | 379 | show_cache_info(m); |
378 | 380 | ||
379 | seq_printf(m, "bogomips\t: %lu.%02lu\n", | 381 | seq_printf(m, "bogomips\t: %lu.%02lu\n", |
380 | cpu_data[n].loops_per_jiffy / (500000 / HZ), | 382 | cpuinfo->loops_per_jiffy / (500000 / HZ), |
381 | (cpu_data[n].loops_per_jiffy / (5000 / HZ)) % 100); | 383 | (cpuinfo->loops_per_jiffy / (5000 / HZ)) % 100); |
382 | 384 | ||
383 | seq_printf(m, "software id\t: %ld\n\n", | 385 | seq_printf(m, "software id\t: %ld\n\n", |
384 | boot_cpu_data.pdc.model.sw_id); | 386 | boot_cpu_data.pdc.model.sw_id); |
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index 7d27853ff8c8..82131ca8e05c 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c | |||
@@ -58,11 +58,6 @@ int parisc_bus_is_phys __read_mostly = 1; /* Assume no IOMMU is present */ | |||
58 | EXPORT_SYMBOL(parisc_bus_is_phys); | 58 | EXPORT_SYMBOL(parisc_bus_is_phys); |
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | /* This sets the vmerge boundary and size, it's here because it has to | ||
62 | * be available on all platforms (zero means no-virtual merging) */ | ||
63 | unsigned long parisc_vmerge_boundary = 0; | ||
64 | unsigned long parisc_vmerge_max_size = 0; | ||
65 | |||
66 | void __init setup_cmdline(char **cmdline_p) | 61 | void __init setup_cmdline(char **cmdline_p) |
67 | { | 62 | { |
68 | extern unsigned int boot_args[]; | 63 | extern unsigned int boot_args[]; |
@@ -321,7 +316,7 @@ static int __init parisc_init(void) | |||
321 | 316 | ||
322 | processor_init(); | 317 | processor_init(); |
323 | printk(KERN_INFO "CPU(s): %d x %s at %d.%06d MHz\n", | 318 | printk(KERN_INFO "CPU(s): %d x %s at %d.%06d MHz\n", |
324 | boot_cpu_data.cpu_count, | 319 | num_present_cpus(), |
325 | boot_cpu_data.cpu_name, | 320 | boot_cpu_data.cpu_name, |
326 | boot_cpu_data.cpu_hz / 1000000, | 321 | boot_cpu_data.cpu_hz / 1000000, |
327 | boot_cpu_data.cpu_hz % 1000000 ); | 322 | boot_cpu_data.cpu_hz % 1000000 ); |
@@ -387,8 +382,8 @@ void start_parisc(void) | |||
387 | if (ret >= 0 && coproc_cfg.ccr_functional) { | 382 | if (ret >= 0 && coproc_cfg.ccr_functional) { |
388 | mtctl(coproc_cfg.ccr_functional, 10); | 383 | mtctl(coproc_cfg.ccr_functional, 10); |
389 | 384 | ||
390 | cpu_data[cpunum].fp_rev = coproc_cfg.revision; | 385 | per_cpu(cpu_data, cpunum).fp_rev = coproc_cfg.revision; |
391 | cpu_data[cpunum].fp_model = coproc_cfg.model; | 386 | per_cpu(cpu_data, cpunum).fp_model = coproc_cfg.model; |
392 | 387 | ||
393 | asm volatile ("fstd %fr0,8(%sp)"); | 388 | asm volatile ("fstd %fr0,8(%sp)"); |
394 | } else { | 389 | } else { |
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 80bc000523fa..9995d7ed5819 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c | |||
@@ -56,16 +56,17 @@ static int smp_debug_lvl = 0; | |||
56 | if (lvl >= smp_debug_lvl) \ | 56 | if (lvl >= smp_debug_lvl) \ |
57 | printk(printargs); | 57 | printk(printargs); |
58 | #else | 58 | #else |
59 | #define smp_debug(lvl, ...) | 59 | #define smp_debug(lvl, ...) do { } while(0) |
60 | #endif /* DEBUG_SMP */ | 60 | #endif /* DEBUG_SMP */ |
61 | 61 | ||
62 | DEFINE_SPINLOCK(smp_lock); | 62 | DEFINE_SPINLOCK(smp_lock); |
63 | 63 | ||
64 | volatile struct task_struct *smp_init_current_idle_task; | 64 | volatile struct task_struct *smp_init_current_idle_task; |
65 | 65 | ||
66 | static volatile int cpu_now_booting __read_mostly = 0; /* track which CPU is booting */ | 66 | /* track which CPU is booting */ |
67 | static volatile int cpu_now_booting __cpuinitdata; | ||
67 | 68 | ||
68 | static int parisc_max_cpus __read_mostly = 1; | 69 | static int parisc_max_cpus __cpuinitdata = 1; |
69 | 70 | ||
70 | DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED; | 71 | DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED; |
71 | 72 | ||
@@ -123,7 +124,7 @@ irqreturn_t | |||
123 | ipi_interrupt(int irq, void *dev_id) | 124 | ipi_interrupt(int irq, void *dev_id) |
124 | { | 125 | { |
125 | int this_cpu = smp_processor_id(); | 126 | int this_cpu = smp_processor_id(); |
126 | struct cpuinfo_parisc *p = &cpu_data[this_cpu]; | 127 | struct cpuinfo_parisc *p = &per_cpu(cpu_data, this_cpu); |
127 | unsigned long ops; | 128 | unsigned long ops; |
128 | unsigned long flags; | 129 | unsigned long flags; |
129 | 130 | ||
@@ -202,13 +203,13 @@ ipi_interrupt(int irq, void *dev_id) | |||
202 | static inline void | 203 | static inline void |
203 | ipi_send(int cpu, enum ipi_message_type op) | 204 | ipi_send(int cpu, enum ipi_message_type op) |
204 | { | 205 | { |
205 | struct cpuinfo_parisc *p = &cpu_data[cpu]; | 206 | struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpu); |
206 | spinlock_t *lock = &per_cpu(ipi_lock, cpu); | 207 | spinlock_t *lock = &per_cpu(ipi_lock, cpu); |
207 | unsigned long flags; | 208 | unsigned long flags; |
208 | 209 | ||
209 | spin_lock_irqsave(lock, flags); | 210 | spin_lock_irqsave(lock, flags); |
210 | p->pending_ipi |= 1 << op; | 211 | p->pending_ipi |= 1 << op; |
211 | gsc_writel(IPI_IRQ - CPU_IRQ_BASE, cpu_data[cpu].hpa); | 212 | gsc_writel(IPI_IRQ - CPU_IRQ_BASE, p->hpa); |
212 | spin_unlock_irqrestore(lock, flags); | 213 | spin_unlock_irqrestore(lock, flags); |
213 | } | 214 | } |
214 | 215 | ||
@@ -224,10 +225,7 @@ send_IPI_mask(cpumask_t mask, enum ipi_message_type op) | |||
224 | static inline void | 225 | static inline void |
225 | send_IPI_single(int dest_cpu, enum ipi_message_type op) | 226 | send_IPI_single(int dest_cpu, enum ipi_message_type op) |
226 | { | 227 | { |
227 | if (dest_cpu == NO_PROC_ID) { | 228 | BUG_ON(dest_cpu == NO_PROC_ID); |
228 | BUG(); | ||
229 | return; | ||
230 | } | ||
231 | 229 | ||
232 | ipi_send(dest_cpu, op); | 230 | ipi_send(dest_cpu, op); |
233 | } | 231 | } |
@@ -309,8 +307,7 @@ smp_cpu_init(int cpunum) | |||
309 | /* Initialise the idle task for this CPU */ | 307 | /* Initialise the idle task for this CPU */ |
310 | atomic_inc(&init_mm.mm_count); | 308 | atomic_inc(&init_mm.mm_count); |
311 | current->active_mm = &init_mm; | 309 | current->active_mm = &init_mm; |
312 | if(current->mm) | 310 | BUG_ON(current->mm); |
313 | BUG(); | ||
314 | enter_lazy_tlb(&init_mm, current); | 311 | enter_lazy_tlb(&init_mm, current); |
315 | 312 | ||
316 | init_IRQ(); /* make sure no IRQs are enabled or pending */ | 313 | init_IRQ(); /* make sure no IRQs are enabled or pending */ |
@@ -345,6 +342,7 @@ void __init smp_callin(void) | |||
345 | */ | 342 | */ |
346 | int __cpuinit smp_boot_one_cpu(int cpuid) | 343 | int __cpuinit smp_boot_one_cpu(int cpuid) |
347 | { | 344 | { |
345 | const struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpuid); | ||
348 | struct task_struct *idle; | 346 | struct task_struct *idle; |
349 | long timeout; | 347 | long timeout; |
350 | 348 | ||
@@ -376,7 +374,7 @@ int __cpuinit smp_boot_one_cpu(int cpuid) | |||
376 | smp_init_current_idle_task = idle ; | 374 | smp_init_current_idle_task = idle ; |
377 | mb(); | 375 | mb(); |
378 | 376 | ||
379 | printk("Releasing cpu %d now, hpa=%lx\n", cpuid, cpu_data[cpuid].hpa); | 377 | printk(KERN_INFO "Releasing cpu %d now, hpa=%lx\n", cpuid, p->hpa); |
380 | 378 | ||
381 | /* | 379 | /* |
382 | ** This gets PDC to release the CPU from a very tight loop. | 380 | ** This gets PDC to release the CPU from a very tight loop. |
@@ -387,7 +385,7 @@ int __cpuinit smp_boot_one_cpu(int cpuid) | |||
387 | ** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the | 385 | ** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the |
388 | ** contents of memory are valid." | 386 | ** contents of memory are valid." |
389 | */ | 387 | */ |
390 | gsc_writel(TIMER_IRQ - CPU_IRQ_BASE, cpu_data[cpuid].hpa); | 388 | gsc_writel(TIMER_IRQ - CPU_IRQ_BASE, p->hpa); |
391 | mb(); | 389 | mb(); |
392 | 390 | ||
393 | /* | 391 | /* |
@@ -419,12 +417,12 @@ alive: | |||
419 | return 0; | 417 | return 0; |
420 | } | 418 | } |
421 | 419 | ||
422 | void __devinit smp_prepare_boot_cpu(void) | 420 | void __init smp_prepare_boot_cpu(void) |
423 | { | 421 | { |
424 | int bootstrap_processor=cpu_data[0].cpuid; /* CPU ID of BSP */ | 422 | int bootstrap_processor = per_cpu(cpu_data, 0).cpuid; |
425 | 423 | ||
426 | /* Setup BSP mappings */ | 424 | /* Setup BSP mappings */ |
427 | printk("SMP: bootstrap CPU ID is %d\n",bootstrap_processor); | 425 | printk(KERN_INFO "SMP: bootstrap CPU ID is %d\n", bootstrap_processor); |
428 | 426 | ||
429 | cpu_set(bootstrap_processor, cpu_online_map); | 427 | cpu_set(bootstrap_processor, cpu_online_map); |
430 | cpu_set(bootstrap_processor, cpu_present_map); | 428 | cpu_set(bootstrap_processor, cpu_present_map); |
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 4d09203bc693..9d46c43a4152 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c | |||
@@ -60,7 +60,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id) | |||
60 | unsigned long cycles_elapsed, ticks_elapsed; | 60 | unsigned long cycles_elapsed, ticks_elapsed; |
61 | unsigned long cycles_remainder; | 61 | unsigned long cycles_remainder; |
62 | unsigned int cpu = smp_processor_id(); | 62 | unsigned int cpu = smp_processor_id(); |
63 | struct cpuinfo_parisc *cpuinfo = &cpu_data[cpu]; | 63 | struct cpuinfo_parisc *cpuinfo = &per_cpu(cpu_data, cpu); |
64 | 64 | ||
65 | /* gcc can optimize for "read-only" case with a local clocktick */ | 65 | /* gcc can optimize for "read-only" case with a local clocktick */ |
66 | unsigned long cpt = clocktick; | 66 | unsigned long cpt = clocktick; |
@@ -213,7 +213,7 @@ void __init start_cpu_itimer(void) | |||
213 | 213 | ||
214 | mtctl(next_tick, 16); /* kick off Interval Timer (CR16) */ | 214 | mtctl(next_tick, 16); /* kick off Interval Timer (CR16) */ |
215 | 215 | ||
216 | cpu_data[cpu].it_value = next_tick; | 216 | per_cpu(cpu_data, cpu).it_value = next_tick; |
217 | } | 217 | } |
218 | 218 | ||
219 | struct platform_device rtc_parisc_dev = { | 219 | struct platform_device rtc_parisc_dev = { |
diff --git a/arch/parisc/kernel/topology.c b/arch/parisc/kernel/topology.c index d71cb018a21e..f5159381fdd6 100644 --- a/arch/parisc/kernel/topology.c +++ b/arch/parisc/kernel/topology.c | |||
@@ -22,14 +22,14 @@ | |||
22 | #include <linux/cpu.h> | 22 | #include <linux/cpu.h> |
23 | #include <linux/cache.h> | 23 | #include <linux/cache.h> |
24 | 24 | ||
25 | static struct cpu cpu_devices[NR_CPUS] __read_mostly; | 25 | static DEFINE_PER_CPU(struct cpu, cpu_devices); |
26 | 26 | ||
27 | static int __init topology_init(void) | 27 | static int __init topology_init(void) |
28 | { | 28 | { |
29 | int num; | 29 | int num; |
30 | 30 | ||
31 | for_each_present_cpu(num) { | 31 | for_each_present_cpu(num) { |
32 | register_cpu(&cpu_devices[num], num); | 32 | register_cpu(&per_cpu(cpu_devices, num), num); |
33 | } | 33 | } |
34 | return 0; | 34 | return 0; |
35 | } | 35 | } |
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 4c771cd580ec..ba658d2086f7 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c | |||
@@ -745,6 +745,10 @@ void handle_interruption(int code, struct pt_regs *regs) | |||
745 | /* Fall Through */ | 745 | /* Fall Through */ |
746 | case 27: | 746 | case 27: |
747 | /* Data memory protection ID trap */ | 747 | /* Data memory protection ID trap */ |
748 | if (code == 27 && !user_mode(regs) && | ||
749 | fixup_exception(regs)) | ||
750 | return; | ||
751 | |||
748 | die_if_kernel("Protection id trap", regs, code); | 752 | die_if_kernel("Protection id trap", regs, code); |
749 | si.si_code = SEGV_MAPERR; | 753 | si.si_code = SEGV_MAPERR; |
750 | si.si_signo = SIGSEGV; | 754 | si.si_signo = SIGSEGV; |
@@ -821,8 +825,8 @@ void handle_interruption(int code, struct pt_regs *regs) | |||
821 | 825 | ||
822 | int __init check_ivt(void *iva) | 826 | int __init check_ivt(void *iva) |
823 | { | 827 | { |
828 | extern u32 os_hpmc_size; | ||
824 | extern const u32 os_hpmc[]; | 829 | extern const u32 os_hpmc[]; |
825 | extern const u32 os_hpmc_end[]; | ||
826 | 830 | ||
827 | int i; | 831 | int i; |
828 | u32 check = 0; | 832 | u32 check = 0; |
@@ -839,8 +843,7 @@ int __init check_ivt(void *iva) | |||
839 | *ivap++ = 0; | 843 | *ivap++ = 0; |
840 | 844 | ||
841 | /* Compute Checksum for HPMC handler */ | 845 | /* Compute Checksum for HPMC handler */ |
842 | 846 | length = os_hpmc_size; | |
843 | length = os_hpmc_end - os_hpmc; | ||
844 | ivap[7] = length; | 847 | ivap[7] = length; |
845 | 848 | ||
846 | hpmcp = (u32 *)os_hpmc; | 849 | hpmcp = (u32 *)os_hpmc; |
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index 6773c582e457..69dad5a850a8 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c | |||
@@ -372,7 +372,7 @@ void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct | |||
372 | struct pt_regs *r = &t->thread.regs; | 372 | struct pt_regs *r = &t->thread.regs; |
373 | struct pt_regs *r2; | 373 | struct pt_regs *r2; |
374 | 374 | ||
375 | r2 = kmalloc(sizeof(struct pt_regs), GFP_KERNEL); | 375 | r2 = kmalloc(sizeof(struct pt_regs), GFP_ATOMIC); |
376 | if (!r2) | 376 | if (!r2) |
377 | return; | 377 | return; |
378 | *r2 = *r; | 378 | *r2 = *r; |